#dev | Logs for 2016-05-20
« return
[01:18:49] Bytram|away is now known as Bytram
[04:27:34] Bytram is now known as Bytram|away
[07:53:28] -!- Tachyon has quit [Quit: De omnibus dubitandum est.]
[07:53:37] -!- Tachyon [Tachyon!Tachyon@hollhb.kolej.mff.cuni.cz] has joined #dev
[07:54:35] -!- Tachyon has quit [Client Quit]
[07:54:46] -!- Tachyon [Tachyon!Tachyon@hollhb.kolej.mff.cuni.cz] has joined #dev
[11:47:30] Bytram|away is now known as Bytram
[14:27:50] <TheMightyBuzzard> select s.stoid, date_add(max(time), interval 93+floor(rand()*14) minute) as next from stories as s left outer join (select stoid, value as neverdisplay from story_param where name = 'neverdisplay') as p on s.stoid = p.stoid where neverdisplay is null;
[14:29:06] <Bytram> hmmm, I just realized that I know how to get to the prod db... what box is on dev, and do I use the same cmd to access that DB as I do on prod?
[14:29:22] <TheMightyBuzzard> dev is dev
[14:29:25] <TheMightyBuzzard> ssh dev
[14:29:31] <Bytram> orly?
[14:29:40] <TheMightyBuzzard> aka lithium but dev is quicker to type
[14:29:46] <Bytram> ahhh. k
[14:30:04] <TheMightyBuzzard> basically the same layout as prod but the db name is soylentdev not soylentnews
[14:30:14] <Bytram> nod nod
[14:30:35] <Bytram> I used it a long while back but it's been a LONG time
[14:31:35] <TheMightyBuzzard> well if yer gonna try code on it hit me up before ya do. some traditions needing to be upheld while yer working on it.
[14:32:02] <Bytram> nah, not gonna do any coding on it... just making sure I know how to get there atm
[14:32:50] <Bytram> btw, get scary msg when try to ssh to dev -- The authenticity oh host 'dev' .... can't be established.
[14:32:50] <TheMightyBuzzard> like ~/src/rehash is where the soylentnews/rehash repo gets cloned and our individual branches get named ~/src/rehash-tmb or ~/src/rehash-somethingimworkingon
[14:33:15] <TheMightyBuzzard> thas just cause it's the first time that user ssh'd to that box.
[14:33:29] <TheMightyBuzzard> happens every time you ssh to a box for the first time
[14:33:39] <Bytram> nod nod
[14:33:44] <Bytram> just retried as you suggested.
[14:33:47] <Bytram> iz happy now. thanks!
[14:34:29] <TheMightyBuzzard> if yer gonna thoroughly break dev, make sure n do a db backup first. it's a pain to clean a copy of prod's
[14:38:02] <Bytram> yeah, anything I'd do on dev would be just queries for quite a while.
[14:40:55] <TheMightyBuzzard> oh hey, in your version put a set of ()s around the $VAR*2 part otherwise you'll end up doing (rand()*$VAR) * 2 instead of rand()*($VAR*2)
[14:41:29] <TheMightyBuzzard> and you'll always end up with even numbered results
[14:43:26] <Bytram> nod nod; excellent point!
[14:43:28] <Bytram> teamwork++
[14:43:28] <Bender> karma - teamwork: 4
[14:45:18] <Bytram> hrmmmm
[14:46:26] <TheMightyBuzzard> .topic Sic Semper Insectus
[14:46:26] SkyNet changed topic of #dev to: Sic Semper Insectus
[14:53:24] <Bytram> subquery to *exclude*: SELECT sp.stoid FROM story_param AS sp WHERE sp.name = 'neverdisplay' AND sp.value = '1';
[14:54:02] <Bytram> SELECT blah from stories AS s WHERE s.stoid NOT IN ( ^^ subquery )
[14:57:24] <Bytram> hmmm, I think this gets the gist of it and seems more straightforward (for my brain, at least):
[14:58:03] <Bytram> SELECT s.stoid, date_add(max(time), interval 93+floor(rand()*14) minute) AS next FROM stories AS s WHERE s.stoid NOT IN ( SELECT sp.stoid FROM story_param AS sp WHERE sp.name = 'neverdisplay' AND sp.value = '1' );
[15:00:08] <Bytram> this looks better:
[15:00:10] <Bytram> SELECT s.stoid, date_add(max(time), interval 93+floor(rand()*14) minute) AS next
[15:00:12] <Bytram> FROM stories AS s
[15:00:12] <Bytram> WHERE s.stoid NOT IN (
[15:00:12] <Bytram> SELECT sp.stoid
[15:00:12] <Bytram> FROM story_param AS sp
[15:00:12] <Bytram> WHERE sp.name = 'neverdisplay'
[15:00:13] <Bytram> AND sp.value = '1'
[15:00:15] <Bytram> )
[15:00:17] <Bytram> )
[15:00:51] <Bytram> TheMightyBuzzard: ^^
[15:04:07] Bytram is now known as Bytram|away
[15:07:30] <TheMightyBuzzard> if it works and gives you the same result, more power to yas.
[23:22:28] Bytram|away is now known as Bytram