code logs -> 2011 -> Fri, 14 Oct 2011< code.20111013.log - code.20111015.log >
--- Log opened Fri Oct 14 00:00:25 2011
00:09 Reivles [orthianz@3CF3A5.E1CD01.C6689C.33956A] has joined #code
00:09 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has quit [Ping timeout: 121 seconds]
00:13<~Vornicus> What are you taking pictures of?
00:24 Reivles [orthianz@3CF3A5.E1CD01.C6689C.33956A] has quit [Ping timeout: 121 seconds]
00:24 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has joined #code
00:33 Derakon[AFK] is now known as Derakon
00:54 You're now known as TheWatcher[T-2]
00:56 You're now known as TheWatcher[zZzZ]
00:57 celticminstrel [celticminst@Nightstar-5d22ab1d.cable.rogers.com] has joined #code
01:01 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has quit [Ping timeout: 121 seconds]
01:08 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has joined #code
01:25 Tarinaky [tarinaky@Nightstar-dd7e4a05.net] has quit [[NS] Quit: leaving]
01:25 Tarinaky [tarinaky@Nightstar-dd7e4a05.net] has joined #code
01:47 Attilla [Some.Dude@Nightstar-f29f718d.cable.virginmedia.com] has quit [Ping timeout: 121 seconds]
02:37 Kindamoody[zZz] is now known as Kindamoody
03:10 * McMartin today transitioned between implementing COM objects for Windows 7 to interfacing to X Windows without a toolkit.
03:10
< McMartin>
I'll say this for my job: one doesn't end up in a rut.
03:41
< kwsn>
http://i.imgur.com/76RkJ.png
03:42
< Derakon>
To be fair, developers without clients are nothing.
03:42
< Derakon>
Like artists without an audience.
03:42
< Derakon>
There wouldn't be anywhere near as many developer jobs without Jobs and Gates.
04:16 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has quit [Ping timeout: 121 seconds]
04:24 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has joined #code
04:30 kwsn [kwsn@Nightstar-635d16fc.org] has quit [Ping timeout: 121 seconds]
04:30 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has quit [Ping timeout: 121 seconds]
04:34 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has joined #code
04:39 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has quit [Ping timeout: 121 seconds]
04:40 kwsn [kwsn@Nightstar-635d16fc.org] has joined #code
04:49 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has joined #code
05:02 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has quit [Ping timeout: 121 seconds]
05:07 celticminstrel [celticminst@Nightstar-5d22ab1d.cable.rogers.com] has quit [Connection closed]
05:07 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has joined #code
05:12 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has quit [Ping timeout: 121 seconds]
05:16 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has joined #code
05:23 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has quit [Ping timeout: 121 seconds]
05:23 Syloqs-AFH [Syloq@NetworkAdministrator.Nightstar.Net] has quit [[NS] Quit: ]
05:33 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has joined #code
05:35 Syloqs_AFH [Syloq@NetworkAdministrator.Nightstar.Net] has joined #code
05:36 Syloqs_AFH is now known as Syloqs-AFH
05:37 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has quit [Ping timeout: 121 seconds]
05:43 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has joined #code
05:47 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has quit [Ping timeout: 121 seconds]
05:47 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has joined #code
06:22 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has quit [Ping timeout: 121 seconds]
06:23 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has joined #code
06:42 Derakon is now known as Derakon[AFK]
07:00 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has quit [Ping timeout: 121 seconds]
07:04 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has joined #code
07:10 Vash[Maid|Packing] [Vash@Nightstar-f03c5637.sd.cox.net] has quit [[NS] Quit: Spaaaaaaaaaaaaaaaaace sleeeeeeeeeeeeeeeep!]
08:02 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has quit [Ping timeout: 121 seconds]
08:03 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has joined #code
08:37 Vornicus is now known as Vornicus-Latens
08:47 Stalker [Z@Nightstar-3602cf5a.cust.comxnet.dk] has quit [Ping timeout: 121 seconds]
09:08 Kindamoody is now known as Kindamoody|out
09:11 Phox [Phox@Nightstar-3e5deec3.gv.shawcable.net] has quit [Client closed the connection]
09:36 You're now known as TheWatcher
09:37 Rhamphoryncus [rhamph@Nightstar-14eb6405.abhsia.telus.net] has joined #code
09:55 Reivles [orthianz@3CF3A5.E1CD01.C6689C.33956A] has joined #code
09:56 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has quit [Ping timeout: 121 seconds]
--- Log closed Fri Oct 14 10:24:06 2011
--- Log opened Fri Oct 14 10:28:10 2011
10:28 TheWatcher [chris@Nightstar-3762b576.co.uk] has joined #code
10:28 Irssi: #code: Total of 20 nicks [2 ops, 0 halfops, 0 voices, 18 normal]
10:28 Irssi: Join to #code was synced in 39 secs
10:32 AnnoDomini [annodomini@FFB3F3.4C5BE8.2014E2.DC0864] has joined #code
11:00 Attilla [Some.Dude@Nightstar-f29f718d.cable.virginmedia.com] has joined #code
11:06 Reivles [orthianz@3CF3A5.E1CD01.C6689C.33956A] has quit [Ping timeout: 121 seconds]
11:06 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has joined #code
12:08 You're now known as TheWatcher[afk]
12:25 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has quit [Ping timeout: 121 seconds]
12:28 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has joined #code
12:41 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has quit [Ping timeout: 121 seconds]
12:51 AnnoDomini [annodomini@FFB3F3.4C5BE8.2014E2.DC0864] has quit [Ping timeout: 121 seconds]
12:52 AnnoDomini [annodomini@FFB3F3.4C5BE8.2014E2.DC0864] has joined #code
12:53 AnnoDomini [annodomini@FFB3F3.4C5BE8.2014E2.DC0864] has quit [[NS] Quit: leaving]
12:55 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has joined #code
13:16 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has quit [Ping timeout: 121 seconds]
13:21 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has joined #code
13:25 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has quit [Ping timeout: 121 seconds]
13:30 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has joined #code
13:36 Attilla [Some.Dude@Nightstar-f29f718d.cable.virginmedia.com] has quit [Ping timeout: 121 seconds]
13:38 You're now known as TheWatcher
14:08 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has quit [Ping timeout: 121 seconds]
14:10 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has joined #code
14:22 gnolam [lenin@Nightstar-202a5047.priv.bahnhof.se] has joined #code
14:32 Stalker [Z@Nightstar-3602cf5a.cust.comxnet.dk] has joined #code
14:50 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has quit [Ping timeout: 121 seconds]
14:54 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has joined #code
15:01 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has quit [Ping timeout: 121 seconds]
15:01 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has joined #code
15:37 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has quit [Ping timeout: 121 seconds]
15:37 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has joined #code
15:38 Attilla [Some.Dude@Nightstar-f29f718d.cable.virginmedia.com] has joined #code
15:56 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has quit [Ping timeout: 121 seconds]
15:58 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has joined #code
16:22 Kindamoody|out is now known as Kindamoody
16:30 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has quit [Ping timeout: 121 seconds]
16:31 You're now known as TheWatcher[afk]
16:32 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has joined #code
16:53 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has quit [Ping timeout: 121 seconds]
16:54 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has joined #code
17:09 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has quit [Ping timeout: 121 seconds]
17:10 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has joined #code
17:14 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has quit [Ping timeout: 121 seconds]
17:20 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has joined #code
17:26 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has quit [Ping timeout: 121 seconds]
17:29 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has joined #code
17:30 Alek [omegaboot@Nightstar-10752b3e.il.comcast.net] has quit [[NS] Quit: beroot]
17:34 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has quit [Ping timeout: 121 seconds]
17:34 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has joined #code
17:36 Alek [omegaboot@Nightstar-10752b3e.il.comcast.net] has joined #code
17:39 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has quit [Ping timeout: 121 seconds]
17:43 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has joined #code
17:47 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has quit [Ping timeout: 121 seconds]
17:50 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has joined #code
18:02 You're now known as TheWatcher
18:12 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has quit [Ping timeout: 121 seconds]
18:12 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has joined #code
18:20 Vornicus-Latens [vorn@ServerAdministrator.Nightstar.Net] has quit [Ping timeout: 121 seconds]
18:25 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has quit [Ping timeout: 121 seconds]
18:27 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has joined #code
18:27 Vornicus [vorn@ServerAdministrator.Nightstar.Net] has joined #code
18:27 mode/#code [+qo Vornicus Vornicus] by ChanServ
18:36 Syloqs-AFH [Syloq@NetworkAdministrator.Nightstar.Net] has quit [Ping timeout: 121 seconds]
18:40 Syloqs_AFH [Syloq@NetworkAdministrator.Nightstar.Net] has joined #code
18:41 Syloqs_AFH is now known as Syloqs-AFH
18:46 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has quit [Ping timeout: 121 seconds]
18:50 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has joined #code
19:11 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has quit [Ping timeout: 121 seconds]
19:17 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has joined #code
19:26 Alek [omegaboot@Nightstar-10752b3e.il.comcast.net] has quit [[NS] Quit: ]
19:29 Netsplit *.net <-> *.split quits: cpux, Attilla, jerith, kwsn, Lingerance, Derakon[AFK]
19:29 Vornotron [vorn@ServerAdministrator.Nightstar.Net] has joined #code
19:29 NSGuest29141 [omegaboot@Nightstar-10752b3e.il.comcast.net] has joined #code
19:29 Netsplit over, joins: jerith, kwsn, Derakon[AFK], cpux, Lingerance, Attilla
19:30 Vornicus [vorn@ServerAdministrator.Nightstar.Net] has quit [Ping timeout: 121 seconds]
19:33 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has quit [Ping timeout: 121 seconds]
19:33 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has joined #code
19:34 NSGuest29141 is now known as Alek
19:40 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has quit [Ping timeout: 121 seconds]
--- Log closed Fri Oct 14 19:52:21 2011
--- Log opened Fri Oct 14 20:03:54 2011
20:03 TheWatcher [chris@Nightstar-3762b576.co.uk] has joined #code
20:03 Irssi: #code: Total of 23 nicks [2 ops, 0 halfops, 0 voices, 21 normal]
20:04 Irssi: Join to #code was synced in 38 secs
20:05 celticminstrel [celticminst@Nightstar-5d22ab1d.cable.rogers.com] has joined #code
20:10 Kindamoody is now known as Kindamoody[zZz]
20:29 Reivles [orthianz@3CF3A5.E1CD01.C6689C.33956A] has joined #code
20:30 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has quit [Ping timeout: 121 seconds]
20:47 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has joined #code
20:47 Reivles [orthianz@3CF3A5.E1CD01.C6689C.33956A] has quit [Ping timeout: 121 seconds]
20:49 Derakon [chriswei@Nightstar-f68d7eb4.ca.comcast.net] has joined #code
20:51 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has quit [Ping timeout: 121 seconds]
20:52 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has joined #code
21:05
< Derakon>
I'm getting this really weird feeling of nostalgia and deja-vu.
21:05
< Derakon>
Coding up a linked list in C...
21:05 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has quit [Ping timeout: 121 seconds]
21:09 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has joined #code
21:11
< celticminstrel>
I hope it's really C, not C++. <_<
21:12
< Derakon>
I suppose I %Bcould%B use a std::vector. Ehh.
21:12
< Derakon>
s/%Bcould%B/could/
21:12
< McMartin>
Or a std::list!
21:13
< Derakon>
But it's already written! >.>
21:13
< Derakon>
And debugged!
21:13 gnolam [lenin@Nightstar-202a5047.priv.bahnhof.se] has quit [[NS] Quit: Goddamnit. I knew I shouldn't have gotten out of bed this morning.]
21:17 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has quit [Ping timeout: 121 seconds]
21:18 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has joined #code
21:22
< celticminstrel>
It would be std::list, yeah; not std::vector.
21:24
< Derakon>
The very fact I forgot about the STL is a sign I'm really rusty at C/C++...
21:26
< Tarinaky>
Yup.
21:27
< Tarinaky>
You probably should use the stl list anyway just in case you need to add more functionality or need to apply a stl algorithm.
21:29
< Derakon>
Yeah, I'm switching over now.
21:30
< Tarinaky>
Just be glad you only wasted N time instead of N+1 time.
21:30
< Tarinaky>
Or something.
21:30
< Namegduf>
N+1 is still N complexity
21:30
< Tarinaky>
Namegduf: I meant in terms of hours, not complexity.
21:30
< Namegduf>
Now what you really need to worry about is wasting N^2 time
21:30
< Tarinaky>
Time in a layman's terms.
21:31
< Tarinaky>
You know, be glad you only implemented a linked list and not something more horrible.
21:31
< Namegduf>
Hashmap!
21:31
< McMartin>
Standard C++ doesn't have that, does it? Only TR1...
21:31
< Derakon>
Yeah, I did my own hashmap once for an assignment.
21:31
< Tarinaky>
I think anything counts as more horrible than a linked list.
21:31
< Derakon>
That wasn't a whole lot of fun.
21:32
< Tarinaky>
And yeah, the standard STL only has std::map which is a self-balancing tree.
21:33
< McMartin>
In practice almost always good enough, often better.
21:33
< Tarinaky>
Oh sure.
21:33
< Tarinaky>
That's why they chose to include it rather than a hashmap.
21:33
< McMartin>
Well, that and because operator< was already in the standard and Object.hashCode() was not.
21:34
< Tarinaky>
Point.
21:34
< celticminstrel>
Heh.
21:35
< McMartin>
But yeah, hashtables are O(n) access in the worst case, while treemaps are O(lg n) all the time.
21:35
< Namegduf>
Yeeees, but it's a ridiculously perverse worst case, and the very much more common case is O(1)
21:36
< Derakon>
Ah yes, now I remember what I don't like about the STL.
21:36
< Derakon>
Compilation errors.
21:36
< Namegduf>
Welcome to C++ templates
21:36
< Derakon>
Though that's more due to templates than the STL inherently.
21:37
< Namegduf>
Heh.
21:37
< Tarinaky>
std::vector<std::pair<int,int>,std::list<std::list<std::pair<int,char> > > > >
21:38
< McMartin>
These errors have gotten better lately,t hough
21:38
< McMartin>
typedef is Yore Frend
21:38
< McMartin>
Also, don't forget the ::const_iterator at the end of all that, Tarinaky >_>
21:38
< Tarinaky>
McMartin: Less inherently amusing though.
21:38
< Tarinaky>
:D
21:39
< McMartin>
[X] Template_instantiation___ is inherently undecidable
21:39
< Derakon>
Okay, I need to iterate over the list...
21:39
< Derakon>
So I have this:
21:39
< Derakon>
std::list<struct buffer*>::iterator iterator;
21:39
< Derakon>
for (iterator = bufList.begin(); iterator < bufList.end(); ++iterator) {
21:39
< Derakon>
And it doesn't like that second line.
21:39
< McMartin>
You want "iterator != bufList.end()"
21:39
< celticminstrel>
List iterators are not comparable.
21:39
< Derakon>
Derp. Thanks.
21:39
< celticminstrel>
Because lists are not random access.
21:41
< Derakon>
Okay, looks like that should be working.
21:58 * kwsn runs the HCF instruction on Derakon's box
21:59
< Derakon>
Fortunately I redirected your attack to a decoy cluster immersed in liquid nitrogen.
21:59
< kwsn>
heh :P
22:10
< Rhamphoryncus>
Derakon: the only realistic complaint I've heard against hash tables is as a DoS vector
22:10
< celticminstrel>
HCF?
22:10
< Derakon>
Rhamph: I mostly just remember them being annoying to implement.
22:11
< Derakon>
CM: Halt and Catch Fire.
22:11
< Derakon>
A notional opcode for CPUs.
22:11
< Rhamphoryncus>
And to be really perverse it is possible to build a hash table that uses a tree on buckets with collisions, giving you O(1) average case and O(n) worst case. Nobody actually does though.
22:12
< Rhamphoryncus>
Derakon: Should be fun if I ever get around to it
22:13
< celticminstrel>
Doesn't a hashmap normally use an array/vector for collisions?
22:13
< Rhamphoryncus>
I've no idea about C++. I know much more about python's dict
22:13
< Derakon>
Your typical hashmap has an array of buckets, where each bucket is a linked list of objects that hash to the same value.
22:13
< celticminstrel>
Oh, a linked list. Okay.
22:14
< Derakon>
Though the array should probably be sparse in non-example implementations since the possible hash space is huge.
22:14
< Rhamphoryncus>
Python's dict uses open addressing. It's just an array of object pointers
22:14
< Derakon>
(I remember being asked some question at a Google interview where I suggested using a hash map, started getting into what to do in case of hashing collisions, and the interviewer interrupted with "Let's just assume that collisions don't occur")
22:15
< celticminstrel>
Why assume that!?
22:15
< Derakon>
Because with a sufficiently large hash space, collisions are implausible.
22:15
< Derakon>
That's basically what MD5 sums do, for example.
22:15
< Rhamphoryncus>
The trick is to keep the load below a certain mark. 50% would be quite conservative. However, compared to a linked list you're still using less memory
22:16
< Rhamphoryncus>
That's just the input hash. The table itself should be much smaller
22:16
< Rhamphoryncus>
hashes are truncated to the size of the table
22:28 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has quit [Ping timeout: 121 seconds]
22:29 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has joined #code
22:32
< Simon_Shine>
Derakon, hash tables aren't as annoying as balanced trees.
22:42 Reivles [orthianz@3CF3A5.E1CD01.C6689C.33956A] has joined #code
22:45 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has quit [Ping timeout: 121 seconds]
23:05
< Derakon>
...okay, it's a bit irritating that this music includes, as part of its drum line, what sounds like the alert ding from Windows 7. >.<
23:06
< McMartin>
Heh
23:07
< McMartin>
Also, one assumes "no collisions" because that wasn't actually the part of the question the interviewer cared about.
23:07
< McMartin>
If I'm asking a question about, say, string processing, and they get bogged down in character encoding issues, I can tell them "look, we have 10 minutes here, assume it's 7-bit ASCII".
23:08
< Derakon>
On that note, I'll have a lot of studying to do next time I start taking interviews. I've been working in high-level languages entirely too long.
23:12
< McMartin>
Well
23:12
< McMartin>
That depends on what you're interviewing *for*, right
23:12 Reivles [orthianz@3CF3A5.E1CD01.C6689C.33956A] has quit [Ping timeout: 121 seconds]
23:13
< Derakon>
I dunno...last job I had before this, the interviews did include C string manipulation.
23:13
< Derakon>
Though generally as far as datastructures are concerned, I've just needed to know the pros and cons and when to use each.
23:13
< Derakon>
Which is as it should be.
23:13
< Namegduf>
Most I've done is implement my own trie
23:14
< Derakon>
Trie? Tree?
23:14
< Namegduf>
No, trie
23:14
< McMartin>
Trie.
23:14
< McMartin>
Pronounced the same.
23:14
< Namegduf>
Tries are fairly unusual and the language didn't have one, nor did a non-awful library for one exist.
23:14
< McMartin>
Because the developer is a jerk.
23:14 * Derakon looks it up.
23:14
< Derakon>
Ah.
23:14
< Namegduf>
There WAS a library, but it used a goddamn hash table in each node
23:14
< McMartin>
Tries are, IIRC, mostly handy for doing rapid lookup on sets of pathnames and the like.
23:14
< Derakon>
So, like the "I want to find words that start with foo" design problem.
23:15
< Namegduf>
And did not compress run on characters
23:15
< Namegduf>
Yeah.
23:16
< Namegduf>
Also I wanted it to be non-blocking, and managed to make it lockfree for reads.
23:16
< McMartin>
Sounds pretty sweet
23:16
< Namegduf>
(Only because I could lean on the garbage collector)
23:16
< McMartin>
Heh
23:16
< McMartin>
Runtimes That Don't Suck: Actually improve the language
23:17
< Namegduf>
s/non-blocking/thread-safe/, that was stupid, but reads wanted to be "non-blocking" in the sense of lock free, because there could be a LOT more of them
23:17 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has joined #code
23:18
< Namegduf>
Better to just use atomic pointer writes and permit iteration to either include or exclude at whim things added/removed while ongoing.
23:18
< Derakon>
I suppose a thread-safe read basically means that writes wait until reads are done before deleting things?
23:18
< Derakon>
In this case anyway.
23:18
< Namegduf>
No. That requires read to do some kind of cross-thread communication so writes know about them.
23:19
< Namegduf>
Thread-safe, lockfree read is done by having writes use atomic pointer updates
23:19
< McMartin>
Generally it means atomic machine operations so that read operations are guaranteed safe without explicit ... yeah
23:20
< Namegduf>
Read can observe pointers changed by writing either as before or after the write (I exploit full fence behaviour on the part of the mutex used for writing to make sure reads pick it up if they actually happen chronologically after, but there's no way for the read to know whether it is or not)
23:20
< Namegduf>
But it can't observe a pointer mid-change.
23:21
< Namegduf>
It was a fun thing to work on.
23:28 * Derakon mutters at the Windows commandline.
23:28
< Derakon>
I sent ^C to my script, so bloody well kill it already.
23:29
< celticminstrel>
Windows has ^C?
23:29
< Derakon>
Yeah, but it doesn't always work properly, apparently.
23:33
< McMartin>
Well
23:33
< McMartin>
You can capture it if you hook control events.
23:33
< McMartin>
Just like UNIX scripting programs can, should they so choose, handle and swallow SIGTERM.
23:33
< McMartin>
(And, tbh, neither one works right for scripts~)
23:34
< McMartin>
(Since it tends to kill whatever process the script is running at the moment, at which point the script continues, probably with incomplete data, resulting in hilarious surprise and tragic consequences)
23:38
< celticminstrel>
By scripts do you really mean "bash scripts"?
23:39
< McMartin>
shell scripts and batch files bothd o this
23:48 Reivles [orthianz@3CF3A5.E1CD01.C6689C.33956A] has joined #code
23:48
< Rhamphoryncus>
Namegduf: your description's enough to make me cringe and not be convinced you did it right x_x
23:49 Derakon [chriswei@Nightstar-f68d7eb4.ca.comcast.net] has quit [[NS] Quit: leaving]
23:49 Reiver [orthianz@3CF3A5.E1CD01.C6689C.33956A] has quit [Ping timeout: 121 seconds]
23:52
< Rhamphoryncus>
But that's threading for you
23:53
< Namegduf>
Rhamphoryncus: Anything in particular?
23:53
< Namegduf>
Rhamphoryncus: I looked into the implementation of the mutexes, and am aware I'm relying on the nature of the exact instructions they use.
23:54
< Namegduf>
Using atomic pointers to make a larger object coherent to access (especially a trie which compresses lines of nodes) is tricky, but I think I did that right.
23:55
< Namegduf>
(If the mutexes didn't use instructions which included a full fence in their effect, I'd have to add them myself)
23:57 Reivles [orthianz@3CF3A5.E1CD01.C6689C.33956A] has quit [Ping timeout: 121 seconds]
23:58 celticminstrel is now known as celmin|away
--- Log closed Sat Oct 15 00:00:11 2011
code logs -> 2011 -> Fri, 14 Oct 2011< code.20111013.log - code.20111015.log >

[ Latest log file ]