IRC Logs for #crux-devel Tuesday, 2015-01-13

*** leo-unglaub has quit IRC00:56
*** Feksclaus has quit IRC01:05
*** mavrick61 has quit IRC03:41
*** mavrick61 has joined #crux-devel03:42
*** Feksclaus has joined #crux-devel06:43
*** Roosevelt has quit IRC09:14
*** leo-unglaub has joined #crux-devel10:29
*** leo-unglaub has quit IRC11:00
*** Workster has quit IRC14:02
*** Workster has joined #crux-devel14:21
*** Workster has quit IRC14:21
*** Workster has joined #crux-devel14:21
*** Romster has quit IRC18:59
*** Romster has joined #crux-devel19:00
*** diverse has quit IRC19:45
*** crash_ has joined #crux-devel20:09
*** diverse has joined #crux-devel20:56
*** diverse has quit IRC20:56
*** diverse has joined #crux-devel21:00
*** Feksclaus has quit IRC21:26
*** xetver has quit IRC21:32
*** novak has quit IRC21:32
*** prologic has quit IRC21:32
*** mavrick61 has quit IRC21:33
*** prologic has joined #crux-devel21:34
*** novak has joined #crux-devel21:34
*** xetver has joined #crux-devel21:34
*** mavrick61 has joined #crux-devel21:34
*** nrxtx has quit IRC21:42
*** nrxtx has joined #crux-devel21:42
*** diverse has quit IRC21:44
*** crash_ has quit IRC21:44
*** Workster has quit IRC21:44
*** heroux has quit IRC21:44
*** tvaalen has quit IRC21:44
*** pitillo has quit IRC21:44
*** Romster has quit IRC21:44
*** nrxtx has quit IRC21:44
*** xetver has quit IRC21:45
*** novak has quit IRC21:45
*** prologic has quit IRC21:45
*** mavrick61 has quit IRC21:45
*** teK_ has quit IRC21:46
*** nrxtx has joined #crux-devel21:51
*** mavrick61 has joined #crux-devel21:51
*** xetver has joined #crux-devel21:51
*** novak has joined #crux-devel21:51
*** prologic has joined #crux-devel21:51
*** Romster has joined #crux-devel21:51
*** teK_ has joined #crux-devel21:51
*** erdic has joined #crux-devel21:51
*** diverse has joined #crux-devel21:52
*** crash_ has joined #crux-devel21:52
*** Workster has joined #crux-devel21:52
*** heroux has joined #crux-devel21:52
*** tvaalen has joined #crux-devel21:52
*** pitillo has joined #crux-devel21:52
*** heroux_ has joined #crux-devel21:54
*** teK_ has quit IRC21:55
*** erdic has quit IRC21:55
*** heroux has quit IRC21:55
*** pitillo has quit IRC21:56
*** pitillo has joined #crux-devel21:56
*** teK_ has joined #crux-devel21:59
*** erdic has joined #crux-devel21:59
*** Romster has quit IRC22:02
*** teK_ has quit IRC22:02
*** erdic has quit IRC22:02
*** diverse has quit IRC22:03
*** crash_ has quit IRC22:03
*** Workster has quit IRC22:03
*** tvaalen has quit IRC22:03
*** nrxtx has quit IRC22:03
*** xetver has quit IRC22:04
*** novak has quit IRC22:04
*** prologic has quit IRC22:04
*** pitillo has quit IRC22:04
*** mavrick61 has quit IRC22:05
*** erdic has joined #crux-devel22:06
*** teK_ has joined #crux-devel22:06
*** pitillo has joined #crux-devel22:06
*** heroux has joined #crux-devel22:06
*** tvaalen has joined #crux-devel22:06
*** Workster has joined #crux-devel22:06
*** crash_ has joined #crux-devel22:06
*** diverse has joined #crux-devel22:06
*** nrxtx has joined #crux-devel22:06
*** mavrick61 has joined #crux-devel22:06
*** xetver has joined #crux-devel22:06
*** novak has joined #crux-devel22:06
*** prologic has joined #crux-devel22:06
*** Romster has joined #crux-devel22:06
jaegerteK_: I'm futzing with my hashmap implementation and using the alternate djb2 hash as a starter (the xor version) - should it return negative numbers occasionally?22:18
jaegerIf it were an int I'd expect some overflow but I'm using unsigned long22:18
jaeger <-- a sample run22:22
jaegerI guess there's no reason it shouldn't do that, looking at the math22:22
jaegerI wonder if that negatively impacts the hash distribution or if it was intentional22:23
jaeger(a bit of searching online indicates that overflow is the expected result without a modulo operation, which makes sense)22:26
diverseis it for error handling?22:26
jaegernope, this is the actual hashing function of the hashmap implentation22:27
jaegerand the bucket number is the hash value modulo buckets22:27
jaegerI have never implemented a hashmap in C before this so I may sound dumb :D22:28
jaegerunsigned long appears to only be 2^32-1 so yeah, I should expect some overflow22:29
diversewait, did you want to have negative values?22:32
jaegerThat was kinda my question. I wasn't sure if it should but from what I can find searching around, the hash function was designed with that in mind22:33
diversejust in case if you do, you would want to use signed ints not unsigned22:35
diversewell you could use negative values in an unsigned, it will just wrap to the largest positive side.22:37
jaegeractually, it was a typo! but your comment pointed me in the right direction22:37
jaegerthe hash function was NOT returning negative numbers22:37
jaegermy printf was converting them to signed longs22:37
diversewell I wasn't sure, so I went into "detective" mode and made my comment22:38
diverseand as for me, when I program, I don't always know what I'm doing, but I learn as I go ;)22:44
jaegersomewhat the same for me, I don't do it very often22:44
jaeger <-- another sample run but with the proper display of unsigned longs22:44
diverseand another thing I like about hosting my work on github is that I can learn from people who are smarter than I am :)22:46
jaegerI plan to put mine on github as well, it's just that right now it doesn't DO anything yet22:47
jaegeronce there's some actual function to it besides reading the package db into a hashmap I'll share it22:48
jaeger==2671== All heap blocks were freed -- no leaks are possible22:49
jaegeryay for valgrind22:49
diverseanother thing I can mention is that while translating pkgutils (and asking a lot of people), I use btree hashmaps for my db struct which holds the information in sorted order22:50
*** Roosevelt has joined #crux-devel22:51
diversewhen Per wrote pkgutils he must of wanted everything sorted to begin with22:52
diversebut I'm only following his example ;)22:53
diverseI can probably make it as a hashmap instead and sort the keys and values when I need to22:54
diversebut I really haven't tested it yet to find out22:55
diversejaeger: it's good that you got all the allocations freed :)22:56
jaegersorry, had to go enable PoE on a camera port23:11
jaegerMy intent is to use the hashmap for any complicated operations but not bother with it when listing packages is the only operation23:12
jaegerindeed, good to free all your allocations, otherwise memory leaks23:13
jaegerIncodentally I'm not referencing pkgutils' current code, I'm implementing this from scratch23:15
jaegerI feel like I'll learn more that way23:15
diverseI know, that's what a "rewrite" is all about? ;)23:16
diverseI try to avoid the term "rewrite" but everyone keeps calling my project that.23:17
jaegerI'm not too picky about the term, myself23:18
diversebasically my goal is to port the source (because I have zero knowledge in package managing or advanced programming) and afterwords keep changing and evolving it23:21
diverseI've already refactored the code somewhat, so it's not a complete direct translate either, it's done in a way that makes logical sense to me23:22
diverse(and hopefully people who read it)23:23
diverseplus it's fun23:25
diverseand it helped break programming barriers23:27
diverseheh, leo was right after all23:28

Generated by 2.11.0 by Marius Gedminas - find it at!