code logs -> 2014 -> Tue, 16 Sep 2014< code.20140915.log - code.20140917.log >
--- Log opened Tue Sep 16 00:00:55 2014
00:49 Derakon[AFK] is now known as Derakon
03:17 Xon [Xon@Nightstar-j72.ku7.252.119.IP] has quit [Client exited]
03:21 Xon [Xon@Nightstar-j72.ku7.252.119.IP] has joined #code
03:35 Attilla [uid13723@Nightstar-ed0oqj.irccloud.com] has quit [[NS] Quit: Connection closed for inactivity]
03:52 Checkmate [Z@Nightstar-484uip.cust.comxnet.dk] has quit [Ping timeout: 121 seconds]
04:02 VirusJTG [VirusJTG@Nightstar-6i5vf7.sta.comporium.net] has quit [[NS] Quit: Program Shutting down]
04:25 Vornicus [vorn@ServerAdministrator.Nightstar.Net] has quit [[NS] Quit: Leaving]
05:22 Harlow [harlow@Nightstar-pq0497.il.comcast.net] has joined #code
05:35 Derakon is now known as Derakon[AFK]
05:57 Harlow [harlow@Nightstar-pq0497.il.comcast.net] has quit [[NS] Quit: sleep]
06:20 Turaiel is now known as Turaiel[Offline]
06:45 Kindamoody[zZz] is now known as Kindamoody
07:00 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:10 macdjord is now known as macdjord|slep
08:23 Orthia [orthianz@Nightstar-00q.ki4.224.119.IP] has quit [Ping timeout: 121 seconds]
08:29 Orthia [orthianz@Nightstar-hmkliq.callplus.net.nz] has joined #code
08:29 mode/#code [+o Orthia] by ChanServ
08:44 Kindamoody is now known as Kindamoody|afk
09:31 thalass [thalass@Nightstar-up51sl.bigpond.net.au] has joined #code
09:31 mode/#code [+o thalass] by ChanServ
10:05 RobinStamer [rstamer@Nightstar-d7h8ki.org] has joined #code
10:05 [R] [rstamer@genoce.org] has quit [Connection closed]
10:07
<@Azash>
https://community.rapid7.com/community/metasploit/blog/2014/09/15/major-android- bug-is-a-privacy-disaster-cve-2014-6041
10:16 RchrdB [0x2ba22e11@Nightstar-952.jvr.168.194.IP] has joined #code
10:16 mode/#code [+o RchrdB] by ChanServ
10:18 VirusJTG [VirusJTG@Nightstar-6i5vf7.sta.comporium.net] has joined #code
10:28 Orthia [orthianz@Nightstar-hmkliq.callplus.net.nz] has quit [Ping timeout: 121 seconds]
10:33 Orthia [orthianz@Nightstar-00q.ki4.224.119.IP] has joined #code
10:33 mode/#code [+o Orthia] by ChanServ
10:46
<@Tarinaky>
Fuck I hate Ruby
10:47 * TheWatcher hands you the club membership card and welcome pack
10:49
<@Tarinaky>
So. I have productions of the form $CMD string list
10:49
<@RchrdB>
I don't understand that. It's just Perl with modern syntax + OOP? *ducks*
10:49
<@Tarinaky>
Where string is a quoted string.
10:49
<@Tarinaky>
And list ::= value list
10:49
<@TheWatcher>
RchrdB: ... no, no it really isn't
10:49
<@Tarinaky>
and value can be either a string or an int.
10:50
<@Tarinaky>
Now, I can split tokens on spaces - that would work.
10:50
<@Tarinaky>
Except I can't get it to glue the tokens back together again if there's quote marks.
10:50
<@RchrdB>
TheWatcher, oh, it has blocks too! So sometimes you can sorta do FP with it. ;)
10:50
<@TheWatcher>
I do believe you might be taking the piss.
10:58 RchrdB [0x2ba22e11@Nightstar-952.jvr.168.194.IP] has quit [Ping timeout: 121 seconds]
11:00 RchrdB [0x2ba22e11@Nightstar-952.jvr.168.194.IP] has joined #code
11:00 mode/#code [+o RchrdB] by ChanServ
11:04
<@Tarinaky>
Ahah!
11:04
<@Tarinaky>
Working!
11:04 * Tarinaky checks it in quickly
11:06 thalass [thalass@Nightstar-up51sl.bigpond.net.au] has quit [Ping timeout: 121 seconds]
11:08 McMartin [mcmartin@Nightstar-rpcdbf.sntcca.sbcglobal.net] has quit [Ping timeout: 121 seconds]
11:16 McMartin [mcmartin@Nightstar-pct.9b0.223.107.IP] has joined #code
11:16 mode/#code [+ao McMartin McMartin] by ChanServ
11:42 Checkmate [Z@Nightstar-484uip.cust.comxnet.dk] has joined #code
11:42 mode/#code [+o Checkmate] by ChanServ
13:17
<@Azash>
http://securityreactions.tumblr.com/post/97488756234/ssl-handshake-successful
13:31 Turaiel[Offline] is now known as Turaiel
13:32 Turaiel is now known as Turaiel[Offline]
13:48 RobinStamer is now known as [R]
14:02
<@Tarinaky>
Remind me. In C, do you need to explicitly mark a function as having no arguments with void foo(void) ?
14:02
<@Azash>
It's been a while but I think, explicitly not, but it's Good Style
14:03
<@Tarinaky>
Ty
14:04
<@Azash>
You can just test this by trying it and seeing if your computer explodes
14:04
<@TheWatcher>
They mean different things: f(void) means "takes no arguments" while f() means "takes an unknown number of arguments"
14:06
<@TheWatcher>
(essentially, including the void allows the compiler to check the definition and calling of the function, omitting it means it can't do it properly)
14:07
<@TheWatcher>
(generally you want to include the void, unless you have a really good reason to not do so)
14:09
<@Azash>
Embrace the void
14:11
<@Azash>
Intredasting
14:12
<@Azash>
Apparently Rails uses a request parameter called "_method" which forces the request method
14:14 Mango [www.toao.ne@Nightstar-fqtlu3.abhsia.telus.net] has left #code []
14:35
<@Tarinaky>
More C questions...
14:35
<@Tarinaky>
I have some third party object code with some methods that return pointers to structs that're defined inside the object code.
14:35
<@Tarinaky>
I don't actually care about the parameters of the struct - I just want to pass those pointers around to calls to methods inside that object code...
14:36
<@Tarinaky>
Do I want the idiom "extern struct foo;" ?
14:36
<@TheWatcher>
do you actually have the struct definition?
14:36
<@TheWatcher>
If not, just use void *
14:38
<@Tarinaky>
Well I need to declare the methods as well, right?
14:38
<@Tarinaky>
I have the corresponding C file.
14:38
<@Tarinaky>
On reflection, it might be easier to just #include the .c file.
14:39
<@TheWatcher>
Oh god no
14:39
<@TheWatcher>
If you have the c file, make a proper header
14:39
<@TheWatcher>
If the c file contains the struct definition, move it into the header
14:39
<@TheWatcher>
and create the prototypes in the header
14:39
<&McMartin>
An opaque structure is "struct foo;"
14:39
<&McMartin>
You don't need extern.
14:40
<&McMartin>
Monocle uses this all over.
14:40
<&McMartin>
If you've declared "struct foo;" then you can have struct foo *s in your code and they won't be confused with other opaque types the way void * will.
14:40
<@TheWatcher>
True
14:40
<@TheWatcher>
#including .c files is almost never what you want to do, though.
14:41
<&McMartin>
Correct.
14:45
<@RchrdB>
Tarinaky, you do want to explicitly mark a function as having no arguments with void foo(void).
14:46
<@RchrdB>
Tarinaky, void foo() claims that foo() returns nothing and takes an arbitrary number of arguments.
14:46
<@Tarinaky>
RchrdB: You're late to that party :P
14:46
<@RchrdB>
Oh yes.
14:46
<@RchrdB>
We had that party like two months back anyway.
14:46
<@TheWatcher>
Did you get very, very drunk?
14:47 * Tarinaky blinks.
14:47
<@RchrdB>
You get slightly better object code output from the latter. :)
14:47
<@Tarinaky>
Where the fuck is this enum declared o.o
14:47
<@RchrdB>
er, you get slightly better object code output from void foo(void).
14:47
<@TheWatcher>
Tarinaky: In the place you'd least expect it to be
14:48
<@Tarinaky>
"Oh. There."
14:59
< Syka>
in the ceiling fan
15:00
< Syka>
next to the stray cat
15:04 * Tarinaky blinks wtf.
15:05
<@Tarinaky>
Okay. So. In the tinyalsa project.
15:05
<@Tarinaky>
Why does tinymix.c reference functions from mix.c...
15:05
<@Tarinaky>
But I can't see any way that those methods are declared.
15:06
<@Tarinaky>
Oh wait.
15:06
<@Tarinaky>
I am literally the world's biggest idiot.
15:38
<&ToxicFrog>
"How do I tell where my test server is writing its output to?" "You look at the [redacted] flag." "...that looks like a production path." "It does. ...could you just shut down that test server for a bit?"
15:41
<&ToxicFrog>
"Well, is it writing good output?" "That's what I was just about to check. No-one's gotten paged, so I guess so?"
15:44
<@TheWatcher>
...
15:50
<@Tarinaky>
cc1.exe: error: unrecognized command line option '-std=C99'
15:50
<@Tarinaky>
WTF
15:50
< Julius>
Try two -?
15:51
<@Tarinaky>
Same error
15:51
< Julius>
Try 89?
15:51
<@Tarinaky>
Same error
15:54 Derakon[AFK] is now known as Derakon
15:54
< Julius>
Try not including that option at all?
15:54
< Julius>
Try C++11?
15:54
< Julius>
Try rebooting your environment?
15:54
<@Tarinaky>
Then it complains at me for using C++ style comments if I omit the switch
15:55
<@Tarinaky>
Apparently, the correct bit of magic is '-std=gnu99'
15:55
<@Tarinaky>
AH!
15:55
<@Tarinaky>
-std=c99 works
15:55
<@Tarinaky>
It was the capital letter!
15:59
<&ToxicFrog>
TheWatcher: ...?
15:59
<@RchrdB>
c99 is C99, gnu99 is C99 + gnu extensions.
16:20
<@Tarinaky>
It was nonobvious that it would be case sensitive.
16:24 celticminstrel [celticminst@Nightstar-ak6p6n.dsl.bell.ca] has joined #code
16:24 mode/#code [+o celticminstrel] by ChanServ
16:28
<@Azash>
To be fair command lines parameters usually are
16:32
<&ToxicFrog>
Yeah, I'd be shocked if it weren't. Case-sensitivity is the norm.
16:34 Kindamoody|afk is now known as Kindamoody
16:37
<@TheWatcher>
ToxicFrog: the conversation you were quoting sounded to me like a prelude to numerous things breaking horribly
16:37 * Tarinaky blinks.
16:37
<@Tarinaky>
"warning: pFile may be used uninitialized in this function"
16:37
<&ToxicFrog>
TheWatcher: no, everything was fine.
16:38
<@Tarinaky>
Ah wait, I see the issue
16:56 Harlow [harlow@Nightstar-njlh22.wireless.uic.edu] has joined #code
17:14 Kindamoody is now known as Kindamoody|out
17:24
<@RchrdB>
Tarinaky, IME, gcc and clang's "foo may be used uninitialized in this function" warnings are correct more often than not. They're actually kinda conservative.
17:26
<&McMartin>
They also are unlikely to show up in your debug builds on gcc because you have to turn on at least -O1 for it to do the dataflow work to detect that.
17:29
<@RchrdB>
small projects, I prefer to build with -Os pretty much always, partly because it turns on some dataflow, partly because if I want to gaze at the asm, -Os output is easier to read than -O0
17:31
<@Tarinaky>
RchrdB: Yeah. It turns out it was because I'm unused to having pants on head retarded code style conv entions like must use gotos.
17:32
<&McMartin>
You know, I've been seeing an uptick in that in C code lately.
17:32
<&McMartin>
I blame destructors~
17:32
<@Tarinaky>
I blame people arguing that goto considered harmful is a product of its times and irrelevant today.
17:33
<@Tarinaky>
Gives the false impression that goto, you know... isn't harmful for /other/ reasons now >.>
17:33
<&McMartin>
There are two places goto can be "legit" used, IMO, in C code
17:33
<&McMartin>
One is "I have to do cleanup so instead of returns in the middle of the routine use goto out"
17:33
<@RchrdB>
"goto considered harmful" was written in response to people using goto to implement loops.
17:33
<&McMartin>
Yes, goto fail wrecked Apple's TLS, but a return would have done the same
17:33
<@RchrdB>
Forward goto for cleanup is actually quite nice.
17:34
<&McMartin>
The other semi-legit use is to simulate in-routine exception handling, with the caveat that this may be a more general case of the former
17:34
<&McMartin>
And any time you're doing that in C and it *isn't* 'for cleanup and exit' that's probably a yellow flag.
17:34
<@RchrdB>
That's what setjmp is for. ;)
17:35
<&McMartin>
setjmp: worse than goto. Just sayin'
17:41
<@Tarinaky>
Has google been slow for anyone else or just me?
17:44 RchrdB [0x2ba22e11@Nightstar-952.jvr.168.194.IP] has quit [[NS] Quit: Leaving]
17:44 RchrdB [0x2ba22e11@Nightstar-952.jvr.168.194.IP] has joined #code
17:44 mode/#code [+o RchrdB] by ChanServ
18:16 Harlow [harlow@Nightstar-njlh22.wireless.uic.edu] has quit [[NS] Quit: sleep]
18:19 RchrdB [0x2ba22e11@Nightstar-952.jvr.168.194.IP] has quit [Ping timeout: 121 seconds]
18:43 RchrdB [0x2ba22e11@Nightstar-952.jvr.168.194.IP] has joined #code
18:43 mode/#code [+o RchrdB] by ChanServ
18:44 Vorntastic [Vorn@Nightstar-k70f1n.ct.comcast.net] has joined #code
18:49
< Vorntastic>
I'm working on building a db view that counts entities with matching fks, in several tables. For instance: on facebook and stackexchange, posts have votes and comments. I have a table that says who liked a given post, and another table that says what comments a post has. I wish to make a view that tells me, for each post, how many votes and how many comments the post has.
18:49
< Vorntastic>
Unfortunately I can't think of a name for this task so my searches are unproductive.
18:58 RchrdB [0x2ba22e11@Nightstar-952.jvr.168.194.IP] has quit [[NS] Quit: Leaving]
19:01
<@Azash>
http://www.catonmat.net/ftp/sed/sedtris.sed
19:03
< Vorntastic>
Some people have too much time on their hands, if that's what it looks like.
19:03
<&McMartin>
It isn't clear to me how you make it go.
19:04
< Vorntastic>
I should clarify: I know how to do *one*; it's doing *two* that's the problem.
19:05
<&McMartin>
That is exactly what it looks like
19:05
<&McMartin>
And it is in color
19:09
< Vorntastic>
Vast ludicrosity
19:09
<&McMartin>
(You make it go by typing s then enter)
19:09
<&McMartin>
(because moving the pieces left and right do not make it descend)
19:12
<@Azash>
Or space if you are really confident
19:12
<&McMartin>
That didn't work for me until I'd let it descend at least one square
19:13
<@Azash>
That's true, until one square is drawn it's not "on the board"
19:16 Kindamoody|out is now known as Kindamoody
19:33 Kindamoody is now known as Kindamoody[zZz]
19:39
< Julius>
I'm increasingly disliking Visual Basic.
19:39
< Julius>
This seems positively correlated with the amount of exposure I have to it.
19:39
< Vorntastic>
Vb is not a good language.
19:40
<&McMartin>
Dim Sum as Integer
19:41
<@macdjord|slep>
... dammit, McMartin.
19:41
<@macdjord|slep>
Now I want Sui Mai.
19:41 macdjord|slep is now known as macdjord
19:41
< Julius>
Chinese food?
19:42
<&McMartin>
That's half the joke, yes.
19:43
<&McMartin>
The other half is how "sum" is a totally legit notion of a variable name and then VB's type declaration syntax
19:46
< Vorntastic>
Not syre how that other half is a joke, really
19:47
<&McMartin>
Merely "yay, Dim Sum is valid BASIC"
19:54
< Vorntastic>
double trouble;, clearly
19:56
< Vorntastic>
No, better. short &sweet;
19:56
< Julius>
You can put a space there, right?
19:56
<&ToxicFrog>
Yes.
19:57
<&McMartin>
You can, but it's only legal as a field specifier.
19:57
<&McMartin>
Or a formal.
19:57
<&McMartin>
Because you can't have uninitialized references.
19:57
<&ToxicFrog>
It is a matter of some debate whether the space goes before the &, after, or both~
19:58
< Vorntastic>
The rule I'm used to is before; in multi-initialization statements, only the first of int* foo, bar; is a pointer.
19:58
< Vorntastic>
Which will eat your brains.
20:00 * Vorntastic beats his head on his db problem; everything he's found wants to solve crosstab, not this.
20:03
< Vorntastic>
Multi-declaration statements that is. Not, you know, that such statements are advisable...
20:20
<@macdjord>
Vorntastic: Correct, because it is actually 'int *foo, bar;' - one of the things in C syntax I consider unambiguously a /mistake/.
20:24
< Vorntastic>
Imo allowing multideclarations was a bad move.
20:37 Turaiel[Offline] is now known as Turaiel
20:41
<@macdjord>
Even if it were single-dec only. It should be '*int foo;' - 'pointer to int'. It would also make the syntax around the const keyword a lot clearer.
21:11
< Vorntastic>
Const vs pointers = fear
21:12
<&McMartin>
const const const baked beans and const
21:25 * iospace points at Vorntastic
21:42 * Vorntastic bites iospace's finger off.
21:48
<@iospace>
D:
21:49
< Vorntastic>
Pointing is rude!
21:50 * macdjord defereferences Vorntastic
21:50
<@Azash>
Vorntastic: Did you remember to free() before you nulled that pointer
21:51
< Vorntastic>
I didn't malloc it in the first place, so no.
21:52 Derakon [Derakon@Nightstar-5fqf0m.ca.comcast.net] has quit [[NS] Quit: Leaving]
22:17 RchrdB [0x2ba22e11@Nightstar-qe9.aug.187.81.IP] has joined #code
22:17 mode/#code [+o RchrdB] by ChanServ
22:20 Vorntastic [Vorn@Nightstar-k70f1n.ct.comcast.net] has quit [[NS] Quit: Bye]
22:53
<@gnolam>
Bluh
22:53
<@gnolam>
SQL and a fever don't mix very well.
22:55
<@TheWatcher>
Which is curious, considering that I think some parts of SQL could only have been thought up when under the influence of one~
22:55
<@Azash>
TheWatcher: Under the influence, sure, but I wouldn't wager much on fever
22:56
<@Azash>
That aside, I wonder why SQL gets such a bad rap
22:56
<@Azash>
It's not like it's a bad language beyond requiring you to displace your brain a bit to grok it
22:57
<@TheWatcher>
Because it's very easy to get it very, very wrong and end up using literally a million times more resources than you actually need to if you aren't careful.
22:57
<@TheWatcher>
Sometimes just by using the wrong sort of join
23:05
<@RchrdB>
TheWatcher, I have recently been working on ZODB-using code that was using about a hundred times more resources than it actually needed to because that system's search functionality has indexes but no form of query planning. :)
23:06
<@Azash>
TheWatcher: Sure, but that's more "practice makes perfect" than anything
23:26
<@macdjord>
Gaaaah...
23:26
<@macdjord>
I need to update my video card drivers.
23:27
<@macdjord>
The driver for this chipset which I downloaded from the Intel site refuses to instal, telling me to instead get the version from my OEM's website.
23:28
<@macdjord>
But the latest version available from Toshiba is 4 years older than the one from Intel!
23:32
<@Reiv>
be fair
23:32
<@Reiv>
SQL was built to be easily optimised by a database, not a human
23:32
<@Reiv>
It's an Old School language, as it were
23:32
<@Reiv>
Much of its bad rap comes accordingly.
23:32
<@Reiv>
It's just probably the most pervasive Old Language out there short of C, y'know?
23:33
<@Azash>
It's going to be fairly hard to replace, I think
23:33
<@Reiv>
Very much so.
23:34
<@Reiv>
It's easy to fuck up, but it's good at what it does.
23:34
<@Azash>
MongoDB seemed at one point the best candidate for passing the torch
23:34
<@Azash>
However, upon receiving the torch, it fell onto its face mid-sprint, started crying, soiled itself and rolled a couple of feet backwards
23:35
<@gnolam>
Reiv: The fact that every database has its own, incompatible SQL dialect sure helps too.
23:37
<@Reiv>
ehhh
23:37
<@Reiv>
They're /mostly/ the same
23:37
<@Reiv>
I do wish they were /more/ the same, I truly do
23:38
<@Reiv>
I want Microsofts temporary tables with Oracles date and analytic functions, darnit~
23:38 Vornicus [vorn@ServerAdministrator.Nightstar.Net] has joined #code
23:38 mode/#code [+qo Vornicus Vornicus] by ChanServ
23:41
<@macdjord>
Fuuuuuuuck...
23:43
<@macdjord>
Anyone know anything I can do?
23:47
<@RchrdB>
You're boned, I think.
23:53 thalass [thalass@Nightstar-up51sl.bigpond.net.au] has joined #code
23:53 mode/#code [+o thalass] by ChanServ
--- Log closed Wed Sep 17 00:00:11 2014
code logs -> 2014 -> Tue, 16 Sep 2014< code.20140915.log - code.20140917.log >

[ Latest log file ]