--- Log opened Wed Sep 10 00:00:51 2014 |
--- Day changed Wed Sep 10 2014 |
00:00 | < Harlow> | k, well thanks for the help [R], I'm just going to read up some more on structs and how they work with accessors. |
00:01 | < [R]> | Hint: if you've got a struct, you use .; if you've got a pointer to a struct you use -> |
00:01 | < Harlow> | k |
00:01 | < Harlow> | gtg battery low |
00:01 | < [R]> | bye |
00:01 | | Harlow [harlow@Nightstar-jh0kti.wireless.uic.edu] has quit [[NS] Quit: BED] |
00:34 | | Thalass|gamey is now known as Thalass |
00:54 | | Turaiel[Offline] is now known as Turaiel |
00:58 | | Checkmate [Z@Nightstar-484uip.cust.comxnet.dk] has quit [Ping timeout: 121 seconds] |
01:02 | | Alek [omegaboot@Nightstar-c8t.a00.36.73.IP] has quit [Ping timeout: 121 seconds] |
01:06 | | Alek [omegaboot@Nightstar-c8t.a00.36.73.IP] has joined #code |
01:06 | | mode/#code [+o Alek] by ChanServ |
01:29 | <@RchrdB> | McMartin, free(NULL) is specifically defined to be a no-op, IIRC by ANSI C89 and also by POSIX according to this man page I have here.. |
01:29 | <&McMartin> | RchrdB: So it was quoted. I distinctly recall having burned by this in the past though, so it's a thing I try to avoid. |
01:30 | <@RchrdB> | a stackoverflow poster finds chapter and verse http://stackoverflow.com/a/1938758/157044 |
01:30 | <&McMartin> | It's already been quoted above, like I said. |
01:31 | <@RchrdB> | Sorry, I missed that somehow. |
01:43 | | Thalass [thalass@Nightstar-5gtf3h.bigpond.net.au] has quit [Ping timeout: 121 seconds] |
02:09 | <@RchrdB> | INTERESTING THING THAT I JUST LEARNED: |
02:09 | | Thalass [thalass@Nightstar-5gtf3h.bigpond.net.au] has joined #code |
02:09 | | mode/#code [+o Thalass] by ChanServ |
02:09 | <@RchrdB> | setjmp() triggers undefined behaviour unless you call it in certain contexts. |
02:16 | <@RchrdB> | if(setjmp()), while(setjmp()), switch(setjmp()), for (whatever; setjmp(); whatever) are all allowed, as !setjmp() in any of those places, as are "setjmp() = some_integer_constant". |
02:16 | <@RchrdB> | setjmp(); and (void)setjmp(); as entire statements with no other code in the same statement are also allowed. |
02:17 | <@RchrdB> | so "int i = setjmp()" is undefined behaviour according to ISO/IEC 9899:1999 :) |
02:22 | | Alek [omegaboot@Nightstar-c8t.a00.36.73.IP] has quit [Ping timeout: 121 seconds] |
02:25 | | Alek [omegaboot@Nightstar-c8t.a00.36.73.IP] has joined #code |
02:25 | | mode/#code [+o Alek] by ChanServ |
02:43 | <@macdjord|slep> | RchrdB: ... it seems weird to allow 'switch(setjmp())' but not 'int i = setjmp();switch (i)' |
02:43 | | macdjord|slep is now known as macdjord |
02:43 | | Thalass is now known as Thalass|AFK |
02:53 | | Alek [omegaboot@Nightstar-c8t.a00.36.73.IP] has quit [Connection reset by peer] |
02:53 | | Alek [omegaboot@Nightstar-c8t.a00.36.73.IP] has joined #code |
02:53 | | mode/#code [+o Alek] by ChanServ |
03:22 | <@RchrdB> | macdjord, yeah, but that's what C99 says. |
03:22 | <@macdjord> | RchrdB: What is the official return type? |
03:23 | <@RchrdB> | int |
03:23 | <@RchrdB> | setjmp() is magic in a few other ways, like it's undefined behaviour if you declare it extern yourself instead of importing setjmp.h, because the spec reserves the right for it to be a macro in setjmp.h |
03:26 | <@RchrdB> | I would *guess* that "int i=setjmp();" is given as undef behaviour because longjmp() is allowed to clobber local variables in the function that setjmp() was called in, under some circumstances, and so the semantics of assigning to a variable that longjmp() might clobber would be way too awkward to specify so it's easier for everybody to leave it as UB and refrain from doing that. |
03:28 | <&McMartin> | ... Oh right |
03:28 | <&McMartin> | if (setjmp()) {} is basically call-with-escape-continuation, so let's not demand we can store aspects of those in locals |
03:39 | <@RchrdB> | I get the impression that some of the UB circumstances in the C spec are actually "we _could_ define this behaviour, and compilers _could_ implement it, but the complication would make the spec worse and the compilers buggier, and it's easy enough for programmers to simply not do that". |
03:41 | <@RchrdB> | McMartin, is call/ec a restricted case of call/cc? |
03:41 | <&McMartin> | Yes. |
03:41 | <&McMartin> | It's one where the continuation becomes invalid once the evaluation context of call/ec is done. |
03:41 | <&McMartin> | So basically exceptions and nonlocal return. |
03:42 | <@RchrdB> | oh this is nice |
03:42 | <@RchrdB> | http://docs.racket-lang.org/reference/cont.html |
03:42 | <&McMartin> | Yes |
03:42 | <&McMartin> | Racket is pretty much the go-to language for crazy-ass control constructs once Scheme has been mastered. |
03:42 | <@RchrdB> | I don't think it's all that crazy... |
03:43 | <@RchrdB> | The thing I was thinking was nice is that the documentation for Racket (née PLT Scheme)'s continuations module appears to *start* by recommending delimited continuations rather than full continuations :) |
03:45 | <@RchrdB> | I didn't dig in enough to understand it but there are a bunch of Oleg Kiselyov papers/demonstrations/rants about how delimited continuations (which I think is what call-with-continuation-prompt implements) are more powerful than full continuations (call-with-current-continuation) |
03:47 | <@RchrdB> | ... |
03:47 | <@RchrdB> | (call/slep RchrdB) |
03:47 | | RchrdB [0x2ba22e11@Nightstar-qe9.aug.187.81.IP] has quit [[NS] Quit: Leaving] |
03:52 | | Orth [orthianz@Nightstar-knd.hn1.224.119.IP] has joined #code |
03:54 | | Orthia [orthianz@Nightstar-4bn.db2.224.119.IP] has quit [Ping timeout: 121 seconds] |
03:54 | | Orth is now known as Orthia |
03:54 | | mode/#code [+o Orthia] by ChanServ |
04:03 | | VirusJTG_ [VirusJTG@Nightstar-6i5vf7.sta.comporium.net] has quit [[NS] Quit: Program Shutting down] |
05:04 | | Vornicus [vorn@ServerAdministrator.Nightstar.Net] has quit [[NS] Quit: Leaving] |
05:17 | | Kindamoody[zZz] is now known as Kindamoody |
05:25 | | Thalass|AFK [thalass@Nightstar-5gtf3h.bigpond.net.au] has quit [Ping timeout: 121 seconds] |
05:40 | | thalass [thalass@Nightstar-5gtf3h.bigpond.net.au] has joined #code |
05:41 | | mode/#code [+o thalass] by ChanServ |
05:43 | | Turaiel is now known as Turaiel[Offline] |
05:50 | | Harlow [harlow@Nightstar-pq0497.il.comcast.net] has joined #code |
06:03 | < Harlow> | hey [R] you still around? the point you made about init, yeah thats the single most important mistake that i made in my actual program. thanks |
06:03 | < Harlow> | the stuff i was sharing was just a mock to try and understand what i could have done wrong. |
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!] |
07:17 | < Harlow> | if anyone has any insight as to why this simple statement would throw an invalid lvalue error, I'm all ears. int modify=0;//Value of ")" |
07:17 | < Harlow> | check==41?modify=1:modify=2;//Value of ")" is 41. |
07:20 | <&McMartin> | You want "modify = check == 41 ? 1 : 2;" |
07:20 | <&McMartin> | If the actual error is "invalid lvalue" |
07:21 | <&McMartin> | It's reading it as (check == 41 ? modify = 1 : modify) = 2 |
07:21 | <&McMartin> | Don't use ?: in place of if-then when you're doing statements. |
07:23 | < Harlow> | Well that was simple enough, didn't know it worked like that, only used it sparingly and just to call functions, seemed to work fine there, but i guess if you call a void function there is no return so it would work fine. |
07:28 | <&McMartin> | The way you thought ?: worked is the way if statements work in languages like Lisp. |
07:28 | <@froztbyte> | McMartin: ping |
07:28 | <@froztbyte> | oh you're awake |
07:28 | <&McMartin> | What's up |
07:28 | <@froztbyte> | uhm |
07:28 | <@froztbyte> | the idea in https://inconshreveable.com/09-09-2014/sweat-the-small-stuff/ |
07:28 | <@froztbyte> | of the cli exit hook |
07:28 | <@froztbyte> | do you know if there's a common thing in windows country for that? |
07:29 | <@froztbyte> | like a lib or a build-time setting? |
07:29 | <&McMartin> | I'm not aware of one. Explorer.exe and console apps do not live in harmony. |
07:30 | <@froztbyte> | haha |
07:30 | <@froztbyte> | kk |
07:31 | <&McMartin> | That means "hey, this thing he wrote is a big deal, it should be ported beyond Go library extensions", in case that wasn't clear ;-) |
07:31 | <@froztbyte> | yeah that was my guess too, but I haven't tried to compile anything outside of a nasm target in literal years |
07:31 | <@froztbyte> | McMartin: this was /also/ another thing I guessed ;) |
07:33 | <&McMartin> | This looks like a thing I could do in C. |
07:34 | <&McMartin> | I have another Project I'm fiddling with just now but this is probably readily doable on a lazy weekend |
07:34 | <&McMartin> | When you test console apps in visual studio, when you say "run" it instead runs a batch file that calls your program and then "pause" |
07:34 | <@froztbyte> | it's one of those pieces of software that initially looks really dumb to me, but then I realize what kind of knowledge I carry |
07:35 | <@froztbyte> | like I have the first reaction of '....why bother?' |
07:36 | <&McMartin> | I didn't know about cmd /K, actually, that's pretty great |
07:46 | | Harlow [harlow@Nightstar-pq0497.il.comcast.net] has quit [[NS] Quit: BED] |
08:07 | | Kindamoody is now known as Kindamoody|afk |
09:06 | | Checkmate [Z@Nightstar-484uip.cust.comxnet.dk] has joined #code |
09:07 | | mode/#code [+o Checkmate] by ChanServ |
10:12 | | AverageJoe [evil1@Nightstar-fb1kt4.ph.cox.net] has joined #code |
10:33 | | RchrdB [0x2ba22e11@Nightstar-952.jvr.168.194.IP] has joined #code |
10:33 | | mode/#code [+o RchrdB] by ChanServ |
10:55 | | AverageJoe [evil1@Nightstar-fb1kt4.ph.cox.net] has quit [[NS] Quit: Leaving] |
11:03 | <@Tarinaky> | Regular Exressions: |
11:03 | <@Tarinaky> | I have a base16 stream with no seperating characters. |
11:04 | <@Tarinaky> | I want to 'split' it into blocks of 4 digits, prepended by 0x |
11:04 | <@Tarinaky> | Suggestions? |
11:05 | < Syka> | Tarinaky: a loop? |
11:05 | <@RchrdB> | Tarinaky, python? |
11:05 | <@Tarinaky> | That would actually be sensible. |
11:08 | <@Azash> | s/(.{4})/0x\1 /g ? |
11:10 | <@Tarinaky> | I don't have a decent enough shell for copy-pasting between vim and irb though :( |
11:10 | <@Tarinaky> | So that solution fails >.< |
11:11 | <@Tarinaky> | Azash: Your regexp doesn't work in vim :( |
11:12 | <@Azash> | Shame |
11:12 | <@Azash> | McMartin: "modify = check == 41 ? 1 : 2;" is not very readable though |
11:16 | | Tarinaky [tarinaky@Nightstar-e99cts.net] has quit [Operation timed out] |
11:17 | | Tarinaky [tarinaky@Nightstar-e99cts.net] has joined #code |
11:17 | | mode/#code [+o Tarinaky] by ChanServ |
11:19 | | RchrdB [0x2ba22e11@Nightstar-952.jvr.168.194.IP] has quit [Ping timeout: 121 seconds] |
--- Log closed Wed Sep 10 11:34:27 2014 |
--- Log opened Wed Sep 10 11:34:36 2014 |
11:34 | | TheWatcher [chris@Nightstar-ksqup0.co.uk] has joined #code |
11:34 | | Irssi: #code: Total of 30 nicks [18 ops, 0 halfops, 0 voices, 12 normal] |
11:34 | | mode/#code [+o TheWatcher] by ChanServ |
11:35 | | Irssi: Join to #code was synced in 38 secs |
11:35 | <@Tarinaky> | Well, that sucked. |
11:38 | | VirusJTG [VirusJTG@Nightstar-6i5vf7.sta.comporium.net] has joined #code |
11:52 | | RchrdB [0x2ba22e11@Nightstar-952.jvr.168.194.IP] has joined #code |
11:52 | | mode/#code [+o RchrdB] by ChanServ |
13:44 | | Netsplit *.net <-> *.split quits: @Ogredude, Julius, @iospace, McMartin, Turaiel[Offline], [R] |
13:46 | | PinkFreud [WhyNot@Pinkfreud.is.really.fuckin.lame.nightstar.net] has quit [Ping timeout: 121 seconds] |
13:46 | | [R] [rstamer@Nightstar-d7h8ki.org] has joined #code |
13:47 | | Ogredude [quassel@Nightstar-dm1jvh.projectzenonline.com] has joined #code |
13:47 | | mode/#code [+o Ogredude] by ChanServ |
13:47 | | PinkFreud [WhyNot@NetworkAdministrator.Nightstar.Net] has joined #code |
13:47 | | mode/#code [+o PinkFreud] by ChanServ |
13:48 | | * TheWatcher stabs the mingw devs |
13:48 | | Julius [abudhabi@Nightstar-7nkq9k.de] has joined #code |
13:48 | | iospace [Alexandria@Nightstar-fkokc2.com] has joined #code |
13:48 | | mode/#code [+o iospace] by ChanServ |
13:48 | | Turaiel[Offline] [Brandon@Nightstar-vku52k.resnet.mtu.edu] has joined #code |
13:48 | | * Azash sympathizes with coworker dealing with an API that requires ordered XML elements |
13:48 | | McMartin [mcmartin@Nightstar-rpcdbf.sntcca.sbcglobal.net] has joined #code |
13:48 | | mode/#code [+ao McMartin McMartin] by ChanServ |
13:54 | | Netsplit *.net <-> *.split quits: @McMartin, Julius, Turaiel[Offline] |
13:56 | | PinkFreud [WhyNot@NetworkAdministrator.Nightstar.Net] has quit [Ping timeout: 121 seconds] |
13:58 | | Netsplit over, joins: Julius |
13:58 | | Netsplit over, joins: McMartin |
13:58 | | mode/#code [+ao McMartin McMartin] by ChanServ |
14:01 | | Turaiel[Offline] [Brandon@Nightstar-vku52k.resnet.mtu.edu] has joined #code |
14:18 | | celticminstrel [celticminst@Nightstar-ak6p6n.dsl.bell.ca] has joined #code |
14:18 | | mode/#code [+o celticminstrel] by ChanServ |
14:34 | <@TheWatcher> | Why is this thing not creating start menu entries anymore? Piece of shit. |
14:46 | | Checkmate [Z@Nightstar-484uip.cust.comxnet.dk] has quit [Ping timeout: 121 seconds] |
14:46 | | thalass is now known as Thalass|sleep |
14:48 | | Xon [Xon@Nightstar-j72.ku7.252.119.IP] has quit [Ping timeout: 121 seconds] |
14:52 | | Turaiel[Offline] is now known as Turaiel |
14:55 | | Xon [Xon@Nightstar-j72.ku7.252.119.IP] has joined #code |
15:10 | | Thalass|sleep [thalass@Nightstar-5gtf3h.bigpond.net.au] has quit [Operation timed out] |
15:12 | | PinkFreud [WhyNot@NetworkAdministrator.Nightstar.Net] has joined #code |
15:12 | | mode/#code [+o PinkFreud] by ChanServ |
15:19 | | PinkFreud [WhyNot@NetworkAdministrator.Nightstar.Net] has quit [Ping timeout: 121 seconds] |
15:20 | | PinkFreud [WhyNot@NetworkAdministrator.Nightstar.Net] has joined #code |
15:20 | | mode/#code [+o PinkFreud] by ChanServ |
15:24 | | gnolam [lenin@Nightstar-sanfmp.cust.bredbandsbolaget.se] has quit [[NS] Quit: Reboot] |
15:34 | | gnolam [lenin@Nightstar-sanfmp.cust.bredbandsbolaget.se] has joined #code |
15:34 | | mode/#code [+o gnolam] by ChanServ |
15:37 | | Orthia [orthianz@Nightstar-knd.hn1.224.119.IP] has quit [Ping timeout: 121 seconds] |
15:39 | | Turaiel is now known as Turaiel[Offline] |
15:43 | | Orthia [orthianz@Nightstar-knd.hn1.224.119.IP] has joined #code |
15:43 | | mode/#code [+o Orthia] by ChanServ |
16:06 | | Checkmate [Z@Nightstar-ro94ms.balk.dk] has joined #code |
16:06 | | mode/#code [+o Checkmate] by ChanServ |
16:50 | | ToxicFrog [ToxicFrog@ServerAdministrator.Nightstar.Net] has quit [Ping timeout: 121 seconds] |
16:58 | | ToxicFrog [ToxicFrog@ServerAdministrator.Nightstar.Net] has joined #code |
16:59 | | mode/#code [+ao ToxicFrog ToxicFrog] by ChanServ |
17:11 | | Orthia [orthianz@Nightstar-knd.hn1.224.119.IP] has quit [Ping timeout: 121 seconds] |
17:17 | | Orthia [orthianz@Nightstar-knd.hn1.224.119.IP] has joined #code |
17:17 | | mode/#code [+o Orthia] by ChanServ |
17:35 | | Reiv [NSwebIRC@Nightstar-q8avec.kinect.net.nz] has quit [Ping timeout: 121 seconds] |
18:22 | <&jerith> | Azash: XML elements are supposed to be ordered. |
18:39 | <@Azash> | jerith: According to the coworker, the specification doesn't guarantee any order |
18:40 | <@Azash> | His problem being that the older version of Ruby he uses doesn't sort arrays in order of addition |
18:43 | <&jerith> | Azash: The XML specification says that element order matters. |
18:45 | <&jerith> | Unless this is a particular schema which explicitly says it doesn't. |
18:48 | <@Azash> | I suppose he meant it doesn't guarantee XML to follow a certain ordering scheme then |
18:49 | <@Azash> | Anyway whichever way it goes, it's also pretty terrible of an API to literally bring down its entire system if mandatory fields are not where they are expected to be |
18:53 | | Tarinaky_ [tarinaky@Nightstar-e99cts.net] has joined #code |
18:56 | | Tarinaky [tarinaky@Nightstar-e99cts.net] has quit [Connection closed] |
18:56 | | Tarinaky_ [tarinaky@Nightstar-e99cts.net] has quit [Connection closed] |
18:58 | | Tarinaky [tarinaky@Nightstar-e99cts.net] has joined #code |
18:58 | | mode/#code [+o Tarinaky] by ChanServ |
20:01 | | Kindamoody|afk is now known as Kindamoody |
20:22 | | Turaiel[Offline] is now known as Turaiel |
20:29 | | thalass [thalass@Nightstar-5gtf3h.bigpond.net.au] has joined #code |
20:29 | | mode/#code [+o thalass] by ChanServ |
20:34 | | Kindamoody is now known as Kindamoody[zZz] |
20:43 | | thalass [thalass@Nightstar-5gtf3h.bigpond.net.au] has quit [[NS] Quit: stupid short weekends. ] |
21:53 | | Checkmate [Z@Nightstar-ro94ms.balk.dk] has quit [Ping timeout: 121 seconds] |
22:06 | | Reiv [NSwebIRC@Nightstar-q8avec.kinect.net.nz] has joined #code |
22:06 | | mode/#code [+o Reiv] by ChanServ |
22:32 | | Checkmate [Z@Nightstar-484uip.cust.comxnet.dk] has joined #code |
22:32 | | mode/#code [+o Checkmate] by ChanServ |
23:05 | | RchrdB [0x2ba22e11@Nightstar-952.jvr.168.194.IP] has quit [[NS] Quit: Leaving] |
23:40 | <@TheWatcher> | fuck you, g++ |
23:41 | <&McMartin> | All the murderings |
23:41 | <&McMartin> | Some of this is C++'s fault, but not all of it |
23:41 | <&McMartin> | "Oh, you wanted to link across compilation units, that's adorable" |
23:42 | | RchrdB [0x2ba22e11@Nightstar-qe9.aug.187.81.IP] has joined #code |
23:42 | | mode/#code [+o RchrdB] by ChanServ |
23:42 | <&McMartin> | I'm going to apportion that one about 60% C++ 40% g++ |
23:47 | <@TheWatcher> | "error: expected unqualified-id before 'char'" |
23:47 | <@TheWatcher> | my mos favourite error |
23:47 | <@TheWatcher> | *most |
--- Log closed Thu Sep 11 00:00:35 2014 |