code logs -> 2014 -> Tue, 08 Apr 2014< code.20140407.log - code.20140409.log >
--- Log opened Tue Apr 08 00:00:35 2014
00:08
<@RchrdB>
there is an FAQ about deletion order in Python-2.7.5/Objects/typeobject.c
00:20 Thalass [thalass@Nightstar-90oetb.bigpond.net.au] has joined #code
00:20 mode/#code [+o Thalass] by ChanServ
00:21
<@RchrdB>
No wonder the documentation is inscrutable, the behaviour that the code implements is complicated too. ¬_¬
00:30
<&McMartin>
Man, that heartbleed bug is serious business
00:43
<@RchrdB>
I find it a little iffy.
00:43
<@RchrdB>
Not the bug, the way it's being publicised.
00:43
<@RchrdB>
That is *not* what I'd call "responsible disclosure".
00:43 himi [fow035@Nightstar-v37cpe.internode.on.net] has quit [Ping timeout: 121 seconds]
00:44 macdjord|wurk is now known as macdjord
00:50
<&McMartin>
This seems to be at the level of "um, you may have been broadcasting your private keys for three years"
00:50 Turaiel[Offline] is now known as Turaiel
00:51
<&McMartin>
At which point your paranoia teams I think should be assuming the cat is very thoroughly out of the bag
00:57 himi [fow035@Nightstar-v37cpe.internode.on.net] has joined #code
00:57 mode/#code [+o himi] by ChanServ
00:58
<&ToxicFrog>
aaaa fuck argparse
01:36 Reiv [NSwebIRC@Nightstar-q8avec.kinect.net.nz] has quit [Ping timeout: 121 seconds]
01:37
<@RchrdB>
aaaa firefox just segfaulted with a massive python rant in progress
01:38 celticminstrel [celticminst@Nightstar-mhtogh.dsl.bell.ca] has joined #code
01:38 mode/#code [+o celticminstrel] by ChanServ
01:41
<@RchrdB>
ToxicFrog, http://pastebin.starforge.co.uk/631 â read the sources to work out what I think the semantics are.
01:42 himi [fow035@Nightstar-v37cpe.internode.on.net] has quit [Ping timeout: 121 seconds]
01:42
<@RchrdB>
oh, I forgot one thing
01:42
<&ToxicFrog>
RchrdB: er
01:42
<&ToxicFrog>
like I said ages ago
01:42
<@celticminstrel>
I wish I could tell XCode to not step into C++ library headers.
01:42
<&ToxicFrog>
I'm completely ignoring this until I get into work tomorrow and can construct a minimal test case
01:43
<@celticminstrel>
Sometimes it steps into them even when I tell it to "step over".
01:43
<&ToxicFrog>
Knowing the semantics doesn't help at all when I don't have the faulty code to check against
01:43
<&ToxicFrog>
At the moment I am working on something completely different and, since rolling my own argv parser is a pain in the ass, decided to use argparse
01:43
<&ToxicFrog>
This appears to have been a terrible mistake
01:43
<@RchrdB>
getopt? It's been in the stdlib for ages.
01:43
<@RchrdB>
corrected: http://pastebin.starforge.co.uk/632
01:44
<@celticminstrel>
How on earth are there three ampersands in a row in this signature.
01:45
<@RchrdB>
ToxicFrog, yeah anyway, I wanted to know what the semantics were because I actually didn't know what happened if you mixed properties with __getattribute__().
01:46
<@RchrdB>
so you can still have AttributeError in a descriptor get suppressed in favour of trying __getattr__(), but you shouldn't see any other exceptions get suppressed.
01:47
<&ToxicFrog>
RchrdB: no, argparse, getopt is deprecated and has been for ages
01:48
<@RchrdB>
Deprecated my butt, they haven't bothered to make it emit deprecation warnings.
01:49
<@RchrdB>
No, it's really not marked deprecated anywhere in 2.x or 3.x's docs.
01:49
<@celticminstrel>
...wait, did this error start when I tried using threads.
01:49
<@celticminstrel>
Because accessing something that was in a thread after the thread died would cause a segfault, right?
01:50
<@RchrdB>
celticminstrel, what do you mean by "in a thread"?
01:50
<&ToxicFrog>
RchrdB: oh, it's optparse that is deprecated
01:50
<@celticminstrel>
Uh, not quite sure.
01:50
<&ToxicFrog>
And getopt that is a python implementation of the C getopt api
01:50
<&ToxicFrog>
Which is only barely better than rolling your own parser, hence my attempt to use argparse
01:50
<@celticminstrel>
Wait, it wasn't passed by reference...
01:51
<@RchrdB>
celticminstrel, let's say we have threads t0 and t1 and a global char* c. t0 runs for a bit, saves a pointer into an argument on its stack into c, then terminates. t1 then attempts to dereference *c. t1 may segfault because t0's stack has been deallocated.
01:52
<@celticminstrel>
Yeah, that would be what's happening here, I think.
01:52
<@celticminstrel>
But why did it work before I used threads? I'm pretty sure it shouldn't've.
01:52
<@celticminstrel>
Oh well, I guess I have to convert to boost::any sooner than I wanted to.
01:52
<@RchrdB>
because you had only one stack, and you were always touching *c from procedure calls that came *after* the assignment to c?
01:53
<@celticminstrel>
Maybe?
01:53
<@RchrdB>
er, *after* the assignment to c and *before* the function invocation which assigned the address of one of its local variables to c, returned?
01:53
<@celticminstrel>
I think it was after the function returned.
01:53
<@RchrdB>
celticminstrel, do you have the ability to run your code under valgrind?
01:53
<@celticminstrel>
But not long after.
01:53
<@celticminstrel>
I probably do have the ability to do that.
01:54
<@RchrdB>
Uh okay. Accessing a pointer to a local variable in a function invocation that already returned⦠is undefined behaviour.
01:54
<@celticminstrel>
I've done it before, and usually it leads to segfaults and stuff, but this time it didn't. Though it could be I'm just not exactly clear on what's happening here.
01:55
<@RchrdB>
Unfortunately it usually doesn't segfault (!), because in practice compilers don't have any good mechanism for marking the currently-unused-due-to-having-popped-those-frames-by-returning bit of the stack as read-only.
01:55
<@RchrdB>
s/usually/often/
01:55 himi [fow035@Nightstar-v37cpe.internode.on.net] has joined #code
01:55 mode/#code [+o himi] by ChanServ
01:55
<@celticminstrel>
And in this particular case, it could've worked if the memory where it had been allocated was still as it had been, since I was storing the pointer as an integer.
01:55
<@RchrdB>
Okay, you need to stop doing⦠all of that.
01:56
<@celticminstrel>
Yeah, like I said, I'm going to convert to boost::any.
01:57
<@RchrdB>
Dereferencing a pointer or reference to a local variable, after the function invocation in which it was allocated returned, is undef behaviour. If your program "works" with undefined behaviour in it, then it's really only working by _coincidence_. ¬_¬
01:57
<@celticminstrel>
And as soon as I introduced threads, it broke, I think.
01:57
<@celticminstrel>
Or maybe it broke before that, I can't quite remember/
01:57
<@celticminstrel>
^.
01:57
<@RchrdB>
celticminstrel, but hey yeah, introducing threads seems to have turned your subtle undef-behaviour bug into a nice clean segfault bug. ;)
01:58
<@celticminstrel>
Indeed, so I guess that's good.
01:58
<@RchrdB>
celticminstrel, btw, are you on Windows?
01:58
<@celticminstrel>
I had planned to do fix this anyway, though.
01:58
<@celticminstrel>
No, Mac.
01:59
<@RchrdB>
Good. Use valgrind. You're already using valgrind, right? valgrind valgrind valgrind valgrind valgrind valgrind, like seriously everything to do with C and C++ gets like fifty times easier when you have an automated tool for picking up much (but unfortunately not all) bad behaviour that would normally be accidentally silently accepted.
02:00
<@celticminstrel>
I'm not explicitly using valgrind.
02:00
<@RchrdB>
Seen Lego Movie? I want you to start repeating "valgrind" like the 80s spaceman repeats "spaceship".
02:00
<@celticminstrel>
I haven't seen it, no.
02:01
<@RchrdB>
You should, it has lasers, robots, explosions, piratesâ¦
02:01
<&ToxicFrog>
VALGRIND
02:01
<&ToxicFrog>
And yeah, stop storing your pointers as ints.
02:02
<&ToxicFrog>
(if you absolutely must do this for some reason, use intptr_t)
02:02
<@celticminstrel>
I wrote the code to do that three or four years ago.
02:02
<@celticminstrel>
(It was stored as an unsigned long long.)
02:04
<@celticminstrel>
Well, switching to boost::any was trivial, involved deleting 90% of my inline template file, and made it Just Work.
02:05
<@RchrdB>
\o/
02:05
<&ToxicFrog>
Oh goddamnit
02:06
<&ToxicFrog>
argparse has no provisions for triggering on arbitrary flags?
02:06
<@celticminstrel>
But now I've broken modality again. Sigh.
02:21 Orthia [orthianz@Nightstar-3tp.juj.184.203.IP] has joined #code
02:21 mode/#code [+o Orthia] by ChanServ
02:29
<&McMartin>
valgrind is sadly useless in SDL code because SDL leaks X descriptors and produces megabytes of output unrelated to your code but holy shit man, I can't prove you didn't leak 478 bytes
02:29
<@celticminstrel>
Argh, that "can't fetch event on worker thread" is really annoying.
02:30
<@celticminstrel>
I think it means I have to revert to not using threads, somehow.
02:30
<&McMartin>
What do you mean "can't fetch event on worker thread"?
02:30
<&McMartin>
If your worker thread needs access to the event stream it is *not a worker thread*
02:30
<@celticminstrel>
I dunno, it's coming from Cocoa's event system and spamming my console.
02:31
<@celticminstrel>
I assume Cocoa designates the main thread a worker thread and won't dispatch events to any other thread, or something.
02:31
<@celticminstrel>
Sure, I guess it's not a worker thread, but Cocoa doesn't know this.
02:34
<@celticminstrel>
If I use threads here, either both need to access the event queue or the temporary thread needs to access the event queue while the main thread waits.
02:35
<@celticminstrel>
I'm not sure I actually need threads; the point is to make a window modal.
02:35
<&McMartin>
That should be a flag in QDialog.
02:35
<@celticminstrel>
I have no idea what a QDialog is. I'm trying to use Cocoa directly as little as possible.
02:36
<&McMartin>
I was under the impression you were using Qt.
02:36
<@celticminstrel>
No, I'm not.
02:36
<&McMartin>
Ah. What *are* you using?
02:36
<@celticminstrel>
I'm not using a GUI framework.
02:36
<&McMartin>
... so, um, that means you're using Cocoa directly for the entire program.
02:37
<&McMartin>
Dialogs should have some flag to set in whatever it is you are using that says modal/nonmodal.
02:37
<@celticminstrel>
I'm not using a library that gives me dialogs; I'm implementing dialogs using a graphics engine.
02:38
<@celticminstrel>
Something like SDL (it's actually SFML).
02:38 himi [fow035@Nightstar-v37cpe.internode.on.net] has quit [Ping timeout: 121 seconds]
02:41
<@celticminstrel>
Well, the implementation is more or less finished. I'm just trying to add modality to it.
02:47
<@celticminstrel>
I actually have it working, but the way it's implemented seems to cause other issues.
02:50
<@celticminstrel>
Although, maybe that's an issue with something else.
02:51
<@celticminstrel>
Ohhh.
02:51
<@celticminstrel>
I was telling it to sleep for 8 seconds.
02:51 himi [fow035@Nightstar-v37cpe.internode.on.net] has joined #code
02:51 mode/#code [+o himi] by ChanServ
02:51
<@celticminstrel>
When in fact I wanted 8 "ticks".
02:51
<@celticminstrel>
Or uh.
02:52
<@celticminstrel>
I think that's about 133 milliseconds.
02:53
<@celticminstrel>
So maybe the problem wasn't where I thought it was at all.
02:54
<~Vornicus>
125 ms/f = 8 fps
02:58
<@celticminstrel>
A tick in this context seems to be about 1/60th of a second.
03:04
<@celticminstrel>
Blargh, I accidentally closed a tab.
03:06
<@celticminstrel>
Framerate is irrelevant here, the waiting time was to let a sound finish.
03:07
<@celticminstrel>
Also framerate is largely irrelevant anyway, since everything is turn-based. (But there's animations, so it's relevant there.)
03:38 himi [fow035@Nightstar-v37cpe.internode.on.net] has quit [Ping timeout: 121 seconds]
03:42 Kindamoody[zZz] is now known as Kindamoody
03:51 himi [fow035@Nightstar-v37cpe.internode.on.net] has joined #code
03:51 mode/#code [+o himi] by ChanServ
03:57 Reiv_ [NSwebIRC@Nightstar-q8avec.kinect.net.nz] has joined #code
04:13 McMartin [mcmartin@Nightstar-rpcdbf.sntcca.sbcglobal.net] has quit [Ping timeout: 121 seconds]
04:26 himi [fow035@Nightstar-v37cpe.internode.on.net] has quit [Ping timeout: 121 seconds]
04:28 VirusJTG [VirusJTG@Nightstar-6i5vf7.sta.comporium.net] has quit [[NS] Quit: Program Shutting down]
04:28 HotShot [theeaznon@Nightstar-u5kl13.sfldmi.sbcglobal.net] has joined #code
04:39 himi [fow035@Nightstar-v37cpe.internode.on.net] has joined #code
04:39 mode/#code [+o himi] by ChanServ
05:00
< froztbyt1>
http://heartbleed.com/
05:00
< froztbyt1>
http://filippo.io/Heartbleed/
05:00
< froztbyt1>
everyone click that ritenao
05:00
< froztbyt1>
(seriously)
05:00
< froztbyt1>
if you're in any way associated with software or servers
05:00
< Xon>
openssl. /why/ did you fuckup so hard
05:02
<@celticminstrel>
?
05:03
< Xon>
celticminstrel, unauthenticated, and unlogged, remote 64kb reads to the process hosting openssl
05:04
< Xon>
http://arstechnica.com/security/2014/04/critical-crypto-bug-in-openssl-opens-two -thirds-of-the-web-to-eavesdropping
05:04
< Xon>
the researchers demonstrated being able to recover private keys in memory of apache
05:04
<@celticminstrel>
...
05:04
<@celticminstrel>
First Apple, now OpenSSL...
05:05
< Xon>
Apple, GnuTLS now OpenSSL =p
05:05
< Xon>
(well GnuTLS's flaws have been around a hell of a lot longer)
05:12 Reiv [orthianz@Nightstar-3tp.juj.184.203.IP] has joined #code
05:12 mode/#code [+o Reiv] by ChanServ
05:14 Orthia [orthianz@Nightstar-3tp.juj.184.203.IP] has quit [Ping timeout: 121 seconds]
05:14 Reiv [orthianz@Nightstar-3tp.juj.184.203.IP] has quit [[NS] Quit: Going dooooown...]
05:14 Orthia [orthianz@Nightstar-3tp.juj.184.203.IP] has joined #code
05:15 mode/#code [+o Orthia] by ChanServ
05:17
<@celticminstrel>
I hadn't heard of the GnuTLS one until that article.
05:19
< Xon>
GnuTLS is because GnuTLS is baddly written
05:21
<@celticminstrel>
I really need to go through this code and remove the millions of unused variables. It makes it harder to see the actually useful warnings.
05:22
< Xon>
warn as error =p
05:22
<@celticminstrel>
Not for that one.
05:22
< Xon>
lol
05:22
<@celticminstrel>
I did set -Werror=format
05:22
< Xon>
it's really only viable for new projects
05:22
<@celticminstrel>
I might set it for non-void functions not returning as well.
05:22
<@celticminstrel>
It might be viable, but I don't think I'd set it anyway.
05:23 himi [fow035@Nightstar-v37cpe.internode.on.net] has quit [Ping timeout: 121 seconds]
05:37
<@celticminstrel>
I would also set it for ObjC selectors not existing, but when I tried that clang complained the flag was unrecognized.
05:37 himi [fow035@Nightstar-v37cpe.internode.on.net] has joined #code
05:37 mode/#code [+o himi] by ChanServ
05:39 HotShot [theeaznon@Nightstar-u5kl13.sfldmi.sbcglobal.net] has quit [[NS] Quit: Trespassers will be shot, Survivers will be shot again! [Time wasted on Mirc 1hr 8mins 58secs]]
05:55 himi [fow035@Nightstar-v37cpe.internode.on.net] has quit [Ping timeout: 121 seconds]
06:09 himi [fow035@Nightstar-v37cpe.internode.on.net] has joined #code
06:10 mode/#code [+o himi] by ChanServ
06:19 Thalass is now known as Thalass|afk
06:31 ErikMesoy|sleep is now known as ErikMesoy
06:34 McMartin [mcmartin@Nightstar-rpcdbf.sntcca.sbcglobal.net] has joined #code
06:34 mode/#code [+ao McMartin McMartin] by ChanServ
06:47 RchrdB [RichardB@Nightstar-c6u.vd5.170.83.IP] has quit [[NS] Quit: Gone.]
06:51 RchrdB [RichardB@Nightstar-c6u.vd5.170.83.IP] has joined #code
07:05 Turaiel is now known as Turaiel[Offline]
07:33 McMartin [mcmartin@Nightstar-rpcdbf.sntcca.sbcglobal.net] has quit [Ping timeout: 121 seconds]
07:40 McMartin [mcmartin@Nightstar-rpcdbf.sntcca.sbcglobal.net] has joined #code
07:40 mode/#code [+ao McMartin McMartin] by ChanServ
07:43 celticminstrel [celticminst@Nightstar-mhtogh.dsl.bell.ca] has quit [[NS] Quit: And lo! The computer falls into a deep sleep, to awake again some other day!]
08:01 McMartin [mcmartin@Nightstar-rpcdbf.sntcca.sbcglobal.net] has quit [Ping timeout: 121 seconds]
08:13 McMartin [mcmartin@Nightstar-rpcdbf.sntcca.sbcglobal.net] has joined #code
08:13 mode/#code [+ao McMartin McMartin] by ChanServ
08:16 JackKnife [Z@Nightstar-484uip.cust.comxnet.dk] has joined #code
08:16 mode/#code [+o JackKnife] by ChanServ
08:40
<@gnolam>
froztbyt1: o_O
08:41
< froztbyt1>
yup
08:41 froztbyt1 is now known as froztbyte
08:41 Thalass|afk [thalass@Nightstar-90oetb.bigpond.net.au] has quit [Ping timeout: 121 seconds]
09:11 Kindamoody is now known as Kindamoody|afk
09:24 himi [fow035@Nightstar-v37cpe.internode.on.net] has quit [Ping timeout: 121 seconds]
09:37 himi [fow035@Nightstar-v37cpe.internode.on.net] has joined #code
09:37 mode/#code [+o himi] by ChanServ
10:12 Orthia [orthianz@Nightstar-3tp.juj.184.203.IP] has quit [Ping timeout: 121 seconds]
10:15 himi [fow035@Nightstar-v37cpe.internode.on.net] has quit [Ping timeout: 121 seconds]
10:21 Thalass|afk [thalass@Nightstar-90oetb.bigpond.net.au] has joined #code
10:27 Thalass|afk is now known as Thalass
10:28 mode/#code [+o Thalass] by ChanServ
10:29 himi [fow035@Nightstar-v37cpe.internode.on.net] has joined #code
10:29 mode/#code [+o himi] by ChanServ
10:39 Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has quit [Connection closed]
11:00 mode/#code [+o RchrdB] by ChanServ
11:13 Xon [Xon@Nightstar-j72.ku7.252.119.IP] has quit [[NS] Quit: ]
11:14 Xon [Xon@Nightstar-j72.ku7.252.119.IP] has joined #code
11:29 himi [fow035@Nightstar-v37cpe.internode.on.net] has quit [Ping timeout: 121 seconds]
11:34 Syk [the@Nightstar-s57.sib.126.1.IP] has quit [Ping timeout: 121 seconds]
11:36 Syk [the@Nightstar-s57.sib.126.1.IP] has joined #code
11:36 VirusJTG [VirusJTG@Nightstar-6i5vf7.sta.comporium.net] has joined #code
11:42 JackKnife [Z@Nightstar-484uip.cust.comxnet.dk] has quit [[NS] Quit: Changing client settings.]
11:43 himi [fow035@Nightstar-v37cpe.internode.on.net] has joined #code
11:43 mode/#code [+o himi] by ChanServ
11:44 JackKnife [Z@Nightstar-484uip.cust.comxnet.dk] has joined #code
11:44 mode/#code [+o JackKnife] by ChanServ
11:57 himi [fow035@Nightstar-v37cpe.internode.on.net] has quit [Ping timeout: 121 seconds]
12:11 himi [fow035@Nightstar-v37cpe.internode.on.net] has joined #code
12:11 mode/#code [+o himi] by ChanServ
12:17 Orthia [orthianz@Nightstar-3tp.juj.184.203.IP] has joined #code
12:17 mode/#code [+o Orthia] by ChanServ
12:31 Reiver [quassel@Nightstar-ksqup0.co.uk] has quit [Connection closed]
12:32 Reiver [quassel@Nightstar-ksqup0.co.uk] has joined #code
12:32 mode/#code [+ao Reiver Reiver] by ChanServ
--- Log closed Tue Apr 08 12:37:11 2014
--- Log opened Tue Apr 08 12:37:21 2014
12:37 TheWatcher [chris@Nightstar-ksqup0.co.uk] has joined #code
12:37 Irssi: #code: Total of 37 nicks [20 ops, 0 halfops, 0 voices, 17 normal]
12:37 mode/#code [+o TheWatcher] by ChanServ
12:37 Irssi: Join to #code was synced in 39 secs
13:21 macdjord is now known as macdjord|wurk
13:39 Turaiel[Offline] is now known as Turaiel
13:44 himi [fow035@Nightstar-v37cpe.internode.on.net] has quit [Ping timeout: 121 seconds]
13:44 McMartin [mcmartin@Nightstar-rpcdbf.sntcca.sbcglobal.net] has quit [Ping timeout: 121 seconds]
13:47 Turaiel is now known as Turaiel[Offline]
13:51 McMartin [mcmartin@Nightstar-rpcdbf.sntcca.sbcglobal.net] has joined #code
13:51 mode/#code [+ao McMartin McMartin] by ChanServ
13:57 himi [fow035@Nightstar-v37cpe.internode.on.net] has joined #code
13:57 mode/#code [+o himi] by ChanServ
14:44 himi [fow035@Nightstar-v37cpe.internode.on.net] has quit [Ping timeout: 121 seconds]
14:51 celticminstrel [celticminst@Nightstar-mhtogh.dsl.bell.ca] has joined #code
14:51 mode/#code [+o celticminstrel] by ChanServ
14:57 himi [fow035@Nightstar-v37cpe.internode.on.net] has joined #code
14:57 mode/#code [+o himi] by ChanServ
16:06
<@celticminstrel>
It's really odd how XCode can't store more than one search key.
16:07
<@celticminstrel>
To the extent that if you have search visible in two windows at once, you can type in one field and notice the contents of the other search field matching it.
16:11 Thalass [thalass@Nightstar-90oetb.bigpond.net.au] has quit [Ping timeout: 121 seconds]
16:43
<@celticminstrel>
If I have colours whose components are in the range 0..65535, and I want to convert them to the range 0..255 while (when possible) not altering the colour at all, how would I do it? (And when not possible, altering it as little as possible.)
16:43
<@celticminstrel>
Divide by 255?
16:44
<@gnolam>
Divide by 256.
16:44
<@celticminstrel>
Alright.
16:45
<@celticminstrel>
Incidentally, doesn't "256 colours" imply 8-bit components?
16:45
<@celticminstrel>
Or maybe even less?
16:46
<@gnolam>
"256 colours" says you have a color palette of 256 colors. It doesn't specify the number of bits per channel.
16:47
<@gnolam>
(If you're talking classic mode 13h, it's 6 bits per channel)
16:47
<@celticminstrel>
Whatever it meant on Mac Classic.
16:59 AnnoDomini is now known as Julius
17:56
< simon>
has anyone here played with WebM yet?
17:56
< simon>
it seems really slick.
18:15
<@JackKnife>
I've hated the implementation Firefox used to use back when Youtube ran its HTML5 trial and firefox used WebM.
18:15
<@JackKnife>
That doesn't really count though.
18:22 HotShot [theeaznon@Nightstar-to80q5.sfldmi.sbcglobal.net] has joined #code
18:22 Kindamoody|afk is now known as Kindamoody
18:33 HotShot [theeaznon@Nightstar-to80q5.sfldmi.sbcglobal.net] has quit [[NS] Quit: Trespassers will be shot, Survivers will be shot again! [Time wasted on Mirc 11mins 10secs]]
18:54 Vornicus [vorn@ServerAdministrator.Nightstar.Net] has joined #code
18:54 mode/#code [+qo Vornicus Vornicus] by ChanServ
18:57
<@celticminstrel>
Calling glDisable(blah) without having called glEnable(blah) wouldn't cause any problems, would it?
19:02
<@Tamber>
That's rather an optimistic attitude to take.
19:02
<@Tamber>
It'll probably result in everything imploding.
19:04
<@celticminstrel>
Yeah, I didn't think it was likely.
19:05
< simon>
JackKnife, right, I did actually find Firefox'es a little annoying.
19:06
<@gnolam>
celticminstrel: nope. That's perfectly allowed.
19:07
<@Tamber>
Huh.
19:27 Syk [the@Nightstar-s57.sib.126.1.IP] has quit [Connection closed]
19:29 Kindamoody is now known as Kindamoody[zZz]
19:33
<@celticminstrel>
Argh, TextEdit, why do you not show newly installed fonts.
19:34
<@celticminstrel>
Even after restarting.
19:34
<@celticminstrel>
TextEdit, not the computer,
19:45 PinkFreud is now known as the
19:45 the is now known as PinkFreud
19:51 HotShot^Work [HotShot^Wor@Nightstar-v7se27.try.wideopenwest.com] has joined #code
19:54 HotShot^Work [HotShot^Wor@Nightstar-v7se27.try.wideopenwest.com] has quit [Connection closed]
20:58 Vornicus [vorn@ServerAdministrator.Nightstar.Net] has quit [[NS] Quit: Leaving]
21:11
<@Julius>
What's a good tree data structure? I find that Qt lacks one.
21:12
<@RchrdB>
Julius, you're working in C++ and do you want a mapping that you can iterate in sorted order, or do you want a rose tree?
21:12
<@Azash>
Do you mean a tree or an implementation?
21:13
<@RchrdB>
IIRC, std::map is a Red-Black tree in most C++ STL implementations.
21:13
<@Julius>
I want to model a star system. I want to traverse parent-child relations up and down.
21:16
<@RchrdB>
Julius, I've not tried any, but http://stackoverflow.com/a/206011 looks promising.
21:18 Julius is now known as AnnoDomini
21:19
<@RchrdB>
adobe::forest sounds like the data structure you want, but it looks like they omit parent pointers to save memory.
21:21
<@TheWatcher>
Honestly, for something like that, I'd just roll my own
21:22
<@AnnoDomini>
Mm'kay. Sounds interesting to try.
21:22
<@AnnoDomini>
How does one make a tree?
21:24
<@RchrdB>
The data structure that you just asked for is: struct Forest< leaf > { public leaf data; public std::vector< Forest< leaf > > children; }
21:24
<@TheWatcher>
OBjection!
21:24
<@RchrdB>
Oh, you also want parent pointers.
21:24
<@TheWatcher>
quite
21:25
<@AnnoDomini>
Yes. Parent and child pointers I require. Sibling pointers are optional.
21:25
<@RchrdB>
More like: struct Forest<leaf> { leaf data; std::vector< Forest<leaf> > children; Forest<leaf> *parent; }
21:26
<@RchrdB>
Note that finding your own index amongst your parent's children is O(this->parent->children.size()), but that will probably be fine for you.
21:28
<@RchrdB>
If each child has a variable containing their own index into the parents' children vector, then operations like removing the first child get more expensive because you have to renumber the rest.
21:36
<@AnnoDomini>
I'll try to think on this later, when my mind is clearer.
21:36
<@AnnoDomini>
Thanks.
22:31 Reiv_ is now known as Reiv
22:42 ErikMesoy is now known as ErikMesoy|sleep
22:48 gnolam [lenin@Nightstar-471pis.cust.bredbandsbolaget.se] has quit [[NS] Quit: Das Reboot]
22:52 gnolam [lenin@Nightstar-471pis.cust.bredbandsbolaget.se] has joined #code
22:52 mode/#code [+o gnolam] by ChanServ
23:03 JackKnife [Z@Nightstar-484uip.cust.comxnet.dk] has quit [Ping timeout: 121 seconds]
23:59 macdjord|wurk is now known as macdjord
--- Log closed Wed Apr 09 00:00:21 2014
code logs -> 2014 -> Tue, 08 Apr 2014< code.20140407.log - code.20140409.log >

[ Latest log file ]