code logs -> 2014 -> Wed, 17 Sep 2014< code.20140916.log - code.20140918.log >
--- Log opened Wed Sep 17 00:00:11 2014
00:03
<@gnolam>
Oh hey, a 32-bit float seems to make it through float(str()) unscathed. That simplifies things.
00:03
<&McMartin>
If it's super-important that it do so you may be able to get it to dump in binary/hex floating point format
00:11 froztbyte [froztbyte@Nightstar-frrora.za.net] has quit [Operation timed out]
00:11 froztbyte [froztbyte@Nightstar-frrora.za.net] has joined #code
00:11 mode/#code [+o froztbyte] by ChanServ
00:23
<&ToxicFrog>
Reiv: "mostly the same" is honestly worse than "totally different"
00:32
<@Reiv>
ToxicFrog: I agree on that
00:32
<@RchrdB>
gnolam, have you tested that for all 4-billion-ish possible values? :)
00:32
<@Reiv>
Though it does at least make translation more straightforward (mostly)
00:42
<@gnolam>
Nope.
00:43
<@TheWatcher>
It just means you think you've got it right, only you haven't in subtle and horrible ways
00:43
<@TheWatcher>
Generally involving spiders.
00:44
<@gnolam>
But it seems to be true for enough tested values that any deviation will be well within the error introduced by the subsequent calculations done on said values.
00:46
<@gnolam>
(And the errors introduced when the calculated values meet the real world and the imperfect machines they control)
00:46
<@Reiv>
oh hush
00:46
<@Reiv>
I spent my first three months at this job converting TSQL to PLSQL
00:47
<@gnolam>
I may well write a unit test just for my peace of mind, but. It'll be good enough.
00:47
<@Reiv>
And aside from unfortunate bits involving date functions or temporary tables, the conversion process was straightforward enough
00:47
<@Reiv>
Indeed, large swathes of it could well have been done automatically, as the dialects are close enough
00:48
<@RchrdB>
gnolam, I'm semi-serious about that though; one of the nice things about 32-bit floats is that there are "only" about 4 billion of them, so you can with modern CPU speeds around 2-3GHz *exhaustively* test 1-input float functions at roughly 1 second-ish per (cycle per call). :)
00:48
<@TheWatcher>
I now invite you to write a system that works with mysql, postgres, and oracle
00:49
<@TheWatcher>
You basically end up having to write a database abstraction layer to avoid the horrible crawling madness
00:50
<@Reiv>
TheWatcher: On that point I do agree
00:50 RchrdB [0x2ba22e11@Nightstar-qe9.aug.187.81.IP] has quit [[NS] Quit: Leaving]
00:50
<@Reiv>
But, uh, we have a BI system
00:50
<@Reiv>
For that exact reason
00:51
<@Reiv>
The funiest bit of the whole damn thing was the day that our analysts discovered that after all the effort of SQL-ising their queries, they could just upload bloody excel files as a data source.
00:51
<@Reiv>
We, uh, have to watch that like a dragon on his hoard~
01:02 Checkmate [Z@Nightstar-484uip.cust.comxnet.dk] has quit [Ping timeout: 121 seconds]
01:17
<@Azash>
I'm usually torn
01:17
<@Azash>
I work with Rails, so I use ActiveRecord
01:17
<@Azash>
Which is really nice and pleasant
01:17
<@Azash>
And then you have the console up and you see it handle a request and suddenly there's like four empty transactions
01:17
<@Azash>
Just BEGIN COMMIT BEGIN COMMIT BEGIN COMMIT BEGIN COMMIT
01:31 * iospace commits Azash to the asylum
01:31
<@iospace>
:P
01:37 * Reiv begins to commit Azash to the asylum; get it right~
01:59
<~Vornicus>
RchrdB: I found myself in need of testing trios of floats a couple weeks back
02:00
<@gnolam>
He's gone.
02:00
<~Vornicus>
bah
02:05
<@gnolam>
FOREIGN KEY (sample) REFERENCES Xen(portal) ON RESONANCE CASCADE
02:11
<&McMartin>
The right query in the wrong place can make *all the difference in the world*
02:16 * Vornicus spent his afternoon crafting queries
02:18
<~Vornicus>
I'm still dissatisfied with my result for the "use a single query, get counts of children from two different tables"
02:20 VirusJTG [VirusJTG@Nightstar-6i5vf7.sta.comporium.net] has quit [[NS] Quit: Program Shutting down]
02:41
<@Reiv>
Why are children in two different tables
02:42
<~Vornicus>
because they're two different types of children
02:42
<@Reiv>
I take it we are not talking 'boys' and 'girls' then
02:42
<~Vornicus>
I described the situation earlier - posts, comments, votes
02:43
<@Reiv>
oh right
02:43
<@Reiv>
Yes that's fair
02:43
<@Reiv>
Why the dissatisaction? Wrong number?
02:43
<~Vornicus>
Number of rows generated en route to the final result
02:45
<~Vornicus>
If a post has 3 votes and 5 comments, my double-left-join thing gets (as far as I can tell, unless my system understands this situation and optimizes accordingly) 15 rows for that one post, as opposed to 3 (if I just counted votes) or 5 (if I just counted comments)
02:48
<~Vornicus>
-- it goes basically select post_id, count(distinct comment_id), count(distinct vote_id) from posts left join comments left join votes
02:49
<@Reiv>
And you'd want it to get 8, correct?
02:49
<~Vornicus>
yeah, or something
02:50
<@Reiv>
Yeah, you've got a misjoin, that's always fun
02:50
<@Reiv>
Er, crossjoin
02:50 * Reiv muses
02:50
<~Vornicus>
especially as this gets quadratically worse the more popular a single post (or whatever) gets
02:50
<~Vornicus>
(there are of course conditions on the two joins but they're cross to each other)
02:52
<@Reiv>
I've solved this one before
02:52
<@Reiv>
what language you typing in?
02:53
<~Vornicus>
It's MySQL running behind PHP/CodeIgniter; this and similar monsters are in views.
02:53
<@Reiv>
hm
02:53
<@Reiv>
Do you have the UNION command available?
02:53
<~Vornicus>
Yepperoni.
02:54
<~Vornicus>
Oh, I see where you're going. Subquery and then do counts.
02:54
<@Reiv>
Because my default solution would be SELECT (counts and shit) FROM (vote_id_query UNION comment_id_query)
02:54
<@Reiv>
So long as those two queries return the same column names, you're golden
02:54
<@Reiv>
And maintainable, to boot
02:54
<~Vornicus>
Indeed, that looks very sensible.
02:55
<@Reiv>
Table-specific rules go in their individual subqueries, generic rules go in the wrapper query
02:55 * Reiv crackles with power!
02:55
<@Reiv>
It's also totally doable with joins, but then you're rocking a crossjoin and null-rules, and meh
02:55
<@Reiv>
Save the WHERE foo_id IS NULL for where you need it~
02:56 macdjord [macdjord@Nightstar-7rac1r.mc.videotron.ca] has quit [Ping timeout: 121 seconds]
02:57
<@Reiv>
Do make a point of poking me if you have other SQL logic you need a hand with, eh?
02:57
<~Vornicus>
Of course. Though usually I'm fighting with this before you get up in the morning, I think~
02:57
<@Reiv>
I don't check the channel all that much.
02:57
<@Reiv>
haha
02:58
<~Vornicus>
I will give you a ping when I need it, though, thank you
02:58
<@Reiv>
no worries
02:58
<@Reiv>
You've helped me often enough~
02:58
<@Reiv>
agh
02:58
<@Reiv>
You've helped me often enough, it's nice to be able to return the favor~
03:00 * Reiv muses
03:00
<@Reiv>
I am generally hear, uh, five hours ago
03:00
<@Reiv>
*here
03:00
<@Reiv>
What time is that local for you these days, you moved
03:00
<~Vornicus>
yeah that's when I get out of work. 5PM
03:01
<@Reiv>
ha, so
03:01
<@Reiv>
If you've got anything left bugging you when you leave work, I can probably help~
03:01
<@Reiv>
That's kind of amusingly fitting.
03:02
<@Reiv>
Yeah, crossjoins are a pain in the butt
03:04
<@Reiv>
tsk, though you lack analytic functions, oh well
03:04
<@Reiv>
Not the end of the world but they are my Sharp Knife in oh so many sqlcancers~
03:05 macdjord [macdjord@Nightstar-7rac1r.mc.videotron.ca] has joined #code
03:05 mode/#code [+o macdjord] by ChanServ
03:22 gnolam [lenin@Nightstar-sanfmp.cust.bredbandsbolaget.se] has quit [Ping timeout: 121 seconds]
03:48 gnolam [lenin@Nightstar-sanfmp.cust.bredbandsbolaget.se] has joined #code
03:48 mode/#code [+o gnolam] by ChanServ
04:09
<@Alek>
http://imgur.com/gallery/viQOQgO
04:48 Kindamoody[zZz] is now known as Kindamoody
04:52 Vornicus [vorn@ServerAdministrator.Nightstar.Net] has quit [[NS] Quit: Leaving]
05:08 Harlow [harlow@Nightstar-pq0497.il.comcast.net] has joined #code
05:38 Turaiel is now known as Turaiel[Offline]
06:19 Harlow [harlow@Nightstar-pq0497.il.comcast.net] has quit [[NS] Quit: BED]
06:46 celticminstrel [celticminst@Nightstar-ak6p6n.dsl.bell.ca] has quit [[NS] Quit: And lo! The computer falls into a deep sleep, to awake again some other day!]
08:19 Kindamoody is now known as Kindamoody|out
08:47 [R] [rstamer@genoce.org] has quit [Ping timeout: 121 seconds]
09:35 [R] [rstamer@Nightstar-d7h8ki.org] has joined #code
10:17 RchrdB [0x2ba22e11@Nightstar-952.jvr.168.194.IP] has joined #code
10:17 mode/#code [+o RchrdB] by ChanServ
10:39 RchrdB [0x2ba22e11@Nightstar-952.jvr.168.194.IP] has quit [Operation timed out]
10:44 RchrdB [0x2ba22e11@Nightstar-952.jvr.168.194.IP] has joined #code
10:44 mode/#code [+o RchrdB] by ChanServ
11:00 * Tarinaky head-desks at her own stupidity.
11:03 Checkmate [Z@Nightstar-484uip.cust.comxnet.dk] has joined #code
11:03 mode/#code [+o Checkmate] by ChanServ
11:14 VirusJTG [VirusJTG@Nightstar-6i5vf7.sta.comporium.net] has joined #code
12:11
<@Tarinaky>
I am an even bigger idiot.
12:12
<@Tamber>
How badly has it caught fire?
12:16
<@Tarinaky>
I was freeing something on the stack, stupidly...
12:17
<@Tarinaky>
SO I got rid of the free statement, pushed it back through valgrind and went to get food.
12:17
<@RchrdB>
forgot to recompile?
12:17
<@Tarinaky>
Then on the way there I realised that I was freeing something on the stack because I shoul;d have been /copying/ the damn thing onto the heap.
12:17
<@Tarinaky>
So I've just been filling up a bunch of structs with identical values!
12:24
<@Tarinaky>
Invalid read of size 1
12:24
<@Tarinaky>
==4266== at 0x4836484: strlen (mc_replace_strmem.c:390)
12:24
<@Tarinaky>
I have no idea what this means :/
12:26
<@TheWatcher>
you're trying to access memory you don't have access to.
12:27
<@TheWatcher>
either via a pointer to a junk location, or to memory you've freed already
12:27
<@Tarinaky>
Google says the issue is that I need to calloc one more element than strlen ( source )
12:28
<@TheWatcher>
This is true
12:28
<@Tarinaky>
(Yes, I suck at pure-C. I'm a C++ coder. Go figure)
12:28
<@Tarinaky>
Inb4 C++ coder == terrible coder
12:29
<@TheWatcher>
printf("%d\n", strlen("foo")); will print out '3', but the string is actually 4 characters long because it needs to have the '\0' on the end.
12:29
<@Tarinaky>
Yes, I'd forgotten this.
12:30
<@Tarinaky>
I was expecting strlen to include the \0
12:30
<@TheWatcher>
That would make too much sense!
12:33
<@Tarinaky>
Well, that's a good sign. Valgrind doesn't immediately shout at me.
12:34
<@TheWatcher>
always good, that.
12:36
<@Tarinaky>
SHit, no. Infiniloop :/
12:37 * Tarinaky facepalms.
12:50 * TheWatcher eyes this
12:50
<@TheWatcher>
Oh gods, I'm going to have to generate a fucking dot file for this
12:59
<@RchrdB>
as in graphviz? graphviz is pretty civilised
13:00
<@Tarinaky>
I think he means /home/foo/.program
13:04
< Syka>
psst
13:04
< Syka>
http://labs.twistedmatrix.com/2014/09/twisted-1401-released.html
13:06
<@Tarinaky>
Are source and destination allowed to overlap for strcpy?
13:06
<@Tarinaky>
If I want to implement a byte-shift left.
13:06
<@Tarinaky>
The source is 'ahead' of the destination by a character.
13:06
<@Tarinaky>
Or is this still a shooting offence?
13:07
<@TheWatcher>
RchrdB: yes, graphviz
13:08
<@TheWatcher>
for a graph that is currently looking like having about 8000 nodes
13:10
<@TheWatcher>
Tarinaky: generally no
13:10
<@Tarinaky>
What about in this specific case?
13:10
<@RchrdB>
TheWatcher, ehhhhhh~
13:11
<@RchrdB>
Like I say, dot is a pretty civilised text format.
13:11
<@TheWatcher>
strcpy() is often implmented either with memcpy (which explicitly states areas should not overlap) or with a loop that copies bytes sequentially
13:11
<@RchrdB>
IME, the hard part is repeatedly changing the code that generates your dotfiles until you find a rule for computing a subset of the graph's nodes and edges that makes the whole thing comprehensible to look at when rendered.
13:12
<@TheWatcher>
so you'd obliterate your \0, and run off into bufferoverlowland
13:13
<@RchrdB>
Tarinaky, memmove() is the function to use if you want src and dest areas that may overlap.
13:13
<@RchrdB>
strcpy()'s linux man page says that the strings passed to strcpy may not overlap.
13:14
<@RchrdB>
also strcpy() is a slightly-evil function, strncpy() slightly less so.
13:14
<@TheWatcher>
(although beware strncpy()'s hilarious gotcha with not nul-terminating
13:14
<@TheWatcher>
)
13:15
<@RchrdB>
TheWatcher, e.g. last time I was using graphviz in anger, I was drawing graphs of "referrer â URL" in order to work out why a piece of routing logic had given a user a link to a bad page, and I had to make a couple of runs at things like pruning the CSS files off the graph, since they were referred to by EVERY other node and made it unreadable. :)
13:17
<@TheWatcher>
I'm trying to visuals a system that has an N-way tree of 'metadata' nodes, each of those nodes can have zero or more entities associated with it that use the metadata to determine roles, and zero or more role/user associations
13:18 * Tarinaky comes up with a more robust way of doing what she wanted using strtok
13:22
<@Tarinaky>
Wait. What.
13:25
<@Tarinaky>
Oh.
13:26
<@Tarinaky>
Not to self. strtok "\"foo\"" -> [ "foo" ] /not/ [ "", "foo", "" ]
13:26
<@Tarinaky>
Err, with "\"" as the seperator
13:44
<&ToxicFrog>
strtok :gonk:
13:47
<@Tarinaky>
?
13:58
<&ToxicFrog>
":gonk:" is an expression of horror and dismay.
13:59
<@Tarinaky>
Why?
14:08
<@Tarinaky>
I mean, why're you horrified?
14:08
<@Tarinaky>
(I'm using a CSV file format specifically so I can parse it without extra includes)
14:14
<@Tarinaky>
The take home lesson from this is that I suck at writing pure C and should never do this for a living; I think~
14:17 Turaiel[Offline] is now known as Turaiel
14:17
<&ToxicFrog>
It destructively modifies its argument in place and is not thread- or even interleave-safe.
14:21
<@Tarinaky>
Well, yes.
14:22
<@Tarinaky>
I thought you were :gonk: ing at me for using it.
14:22
<@Tarinaky>
Not for it being slightly... dated?
14:23
<&ToxicFrog>
Well, yes, I was, because it is the gets() of string processing
14:34 Alek [omegaboot@Nightstar-c8t.a00.36.73.IP] has quit [Ping timeout: 121 seconds]
14:35 Checkmate [Z@Nightstar-484uip.cust.comxnet.dk] has quit [[NS] Quit: If I had a world of my own, everything would be nonsense. Nothing would be what it is because everything would be what it isn't. And contrary-wise; what it is it wouldn't be, and what it wouldn't be, it would. You see?]
14:37 Alek [omegaboot@Nightstar-c8t.a00.36.73.IP] has joined #code
14:37 mode/#code [+o Alek] by ChanServ
14:37 Turaiel is now known as Turaiel[Offline]
15:42
<@Tarinaky>
ToxicFrog: It's also the easiest way to parse a CSV file in pure-C
16:01 Attilla [uid13723@Nightstar-ed0oqj.irccloud.com] has joined #code
16:18 celticminstrel [celticminst@Nightstar-ak6p6n.dsl.bell.ca] has joined #code
16:18 mode/#code [+o celticminstrel] by ChanServ
16:30 * Tarinaky grumbles, unable to find the dilbert she's looking for.
16:30
<@Tarinaky>
It's onw where Asok is saying that they've completed everything
16:34
<@Tarinaky>
Ahah!
17:16
<@RchrdB>
Tarinaky, would you like a BSD-licensed CSV parser? I can probably write a finite state machine for it. :P
17:17
<@RchrdB>
What output format would you like?
17:32 celticminstrel [celticminst@Nightstar-ak6p6n.dsl.bell.ca] has quit [Connection closed]
17:32 celticminstrel [celticminst@Nightstar-ak6p6n.dsl.bell.ca] has joined #code
17:32 mode/#code [+o celticminstrel] by ChanServ
17:34 thalass [thalass@Nightstar-up51sl.bigpond.net.au] has quit [Ping timeout: 121 seconds]
17:41
<@Tarinaky>
RchrdB: "No thanks."
17:41
<@Tarinaky>
My program is done
17:41
<@Tarinaky>
And while it counts as premature optimisation: but binary size matters in context.
17:43
<@RchrdB>
I'd be willing to bet I could write a function that breaks an in-memory CSV function into lines in a few kB. :P
17:44
<@Tarinaky>
That's require effort on my part.
17:46 thalass [thalass@Nightstar-up51sl.bigpond.net.au] has joined #code
17:46 mode/#code [+o thalass] by ChanServ
17:57 Turaiel[Offline] is now known as Turaiel
18:46 Turaiel is now known as Turaiel[Offline]
18:48 RchrdB [0x2ba22e11@Nightstar-952.jvr.168.194.IP] has quit [Operation timed out]
19:38 Kindamoody|out is now known as Kindamoody
19:56
<@froztbyte>
https://github.com/froztbyte/pushloop if anyone ever needs that kind of terrible
19:56
<@froztbyte>
"I got tired of running this command myself" is the design motivation
19:57
<@froztbyte>
(and the screen bit for being visible)
19:57
<@Tamber>
:)
19:57
<@froztbyte>
mostly for when you're doing supercheap stuff in a shared screen session or somesuch
20:15 Kindamoody is now known as Kindamoody[zZz]
20:51 gnolam_ [lenin@Nightstar-sanfmp.cust.bredbandsbolaget.se] has joined #code
20:55 gnolam [lenin@Nightstar-sanfmp.cust.bredbandsbolaget.se] has quit [Ping timeout: 121 seconds]
21:02 gnolam_ is now known as gnolam
21:02 mode/#code [+o gnolam] by ChanServ
21:02 thalass [thalass@Nightstar-up51sl.bigpond.net.au] has quit [Ping timeout: 121 seconds]
21:15 thalass [thalass@Nightstar-l4g186.bigpond.net.au] has joined #code
21:15 mode/#code [+o thalass] by ChanServ
21:22 thalass [thalass@Nightstar-l4g186.bigpond.net.au] has quit [Ping timeout: 121 seconds]
21:35 thalass [thalass@Nightstar-nad7or.bigpond.net.au] has joined #code
21:35 mode/#code [+o thalass] by ChanServ
21:54 thalass [thalass@Nightstar-nad7or.bigpond.net.au] has quit [Ping timeout: 121 seconds]
22:07 thalass [thalass@Nightstar-7cct2u.bigpond.net.au] has joined #code
22:07 mode/#code [+o thalass] by ChanServ
22:15 * TheWatcher sighs at code design
22:30
<&McMartin>
;_;
22:30 * McMartin is worried about that right now too
22:31
<@TheWatcher>
Thankfully this isn't something I need to so much /worry/ about, as just get kinda irritated if I get it wrong.
22:34
<@TheWatcher>
I think I'm going to have to muck around with template specialisation, joy.
22:35
<&McMartin>
Oh man.
22:35
<&McMartin>
Good luck. -_-
22:35
<&McMartin>
... Oh wait, I can have one minor actually useful piece of advice
22:35 thalass [thalass@Nightstar-7cct2u.bigpond.net.au] has quit [Ping timeout: 121 seconds]
22:36
<@TheWatcher>
Oh?
22:36
<&McMartin>
Try to snag access to a machine with clang on it; clang's template errors are often (not a slam dunk, but often) more human-useful than g++'s.
22:37 Checkmate [Z@Nightstar-484uip.cust.comxnet.dk] has joined #code
22:37 mode/#code [+o Checkmate] by ChanServ
22:40
<@TheWatcher>
Thanks, I should be able to arrange that easily enough; I can probably stick it on morpheus
22:48 thalass [thalass@Nightstar-gf3dmq.bigpond.net.au] has joined #code
22:48 mode/#code [+o thalass] by ChanServ
--- Log closed Thu Sep 18 00:00:27 2014
code logs -> 2014 -> Wed, 17 Sep 2014< code.20140916.log - code.20140918.log >

[ Latest log file ]