2013-03-23 00:11 jekhor_ has quit [Ping timeout: 276 seconds] 2013-03-23 00:29 lekernel has quit [Quit: Leaving] 2013-03-23 00:34 apelete has quit [Ping timeout: 264 seconds] 2013-03-23 00:52 kristianpaul has joined #qi-hardware 2013-03-23 00:52 kristianpaul has joined #qi-hardware 2013-03-23 00:52 kristianpaul has quit [Changing host] 2013-03-23 00:52 erikkugel has quit [Quit: Leaving.] 2013-03-23 00:54 emeb has quit [Quit: Leaving.] 2013-03-23 01:15 unclouded has joined #qi-hardware 2013-03-23 01:18 Calyp has quit [Quit: gone working on freeconomy =o)] 2013-03-23 01:19 KokAz has quit [Ping timeout: 260 seconds] 2013-03-23 02:14 woakas has quit [Ping timeout: 260 seconds] 2013-03-23 02:15 Freemor has joined #qi-hardware 2013-03-23 02:17 Freemor has left #qi-hardware [#qi-hardware] 2013-03-23 02:25 xiangfu has joined #qi-hardware 2013-03-23 02:28 woakas has joined #qi-hardware 2013-03-23 02:35 gbraad has joined #qi-hardware 2013-03-23 02:35 gbraad has quit [Changing host] 2013-03-23 02:35 gbraad has joined #qi-hardware 2013-03-23 04:03 DocScrutinizer05 has quit [Read error: Operation timed out] 2013-03-23 04:04 DocScrutinizer05 has joined #qi-hardware 2013-03-23 04:15 qi-bot has quit [Ping timeout: 276 seconds] 2013-03-23 04:28 gbraad has quit [Ping timeout: 240 seconds] 2013-03-23 04:41 rz2k has quit [] 2013-03-23 04:53 fire has quit [Ping timeout: 264 seconds] 2013-03-23 04:57 fire has joined #qi-hardware 2013-03-23 05:02 guanucoluis has joined #qi-hardware 2013-03-23 05:26 guanucoluis has quit [Read error: Connection reset by peer] 2013-03-23 05:26 guanucoluis has joined #qi-hardware 2013-03-23 06:13 wolfspraul has quit [Ping timeout: 255 seconds] 2013-03-23 06:23 gbraad has joined #qi-hardware 2013-03-23 06:23 gbraad has quit [Changing host] 2013-03-23 06:23 gbraad has joined #qi-hardware 2013-03-23 06:23 xiangfu has quit [Ping timeout: 256 seconds] 2013-03-23 06:24 xiangfu has joined #qi-hardware 2013-03-23 06:31 fire has quit [Quit: WeeChat 0.4.0] 2013-03-23 06:32 hm.. for example, i have "out = 25 >= input" in my code. Both out and input are unsigned char 2013-03-23 06:32 do i need to use the U suffix with 25? 2013-03-23 06:34 for what i understand, it makes a difference.. for (25 >= input) the comparison is carried out on type int, whereas for (25U >= input) the comparison is done on type unsigned int 2013-03-23 06:38 gbraad has quit [Ping timeout: 264 seconds] 2013-03-23 06:44 guanucoluis has quit [Ping timeout: 258 seconds] 2013-03-23 06:46 fire has joined #qi-hardware 2013-03-23 07:14 gbraad has joined #qi-hardware 2013-03-23 07:26 gbraad has quit [Ping timeout: 264 seconds] 2013-03-23 07:30 fire has quit [Quit: WeeChat 0.4.0] 2013-03-23 07:55 kyak has quit [] 2013-03-23 07:58 kyak has joined #qi-hardware 2013-03-23 08:06 jekhor_ has joined #qi-hardware 2013-03-23 08:41 apelete has joined #qi-hardware 2013-03-23 08:41 shouldn't matter 2013-03-23 08:56 roh has quit [Ping timeout: 260 seconds] 2013-03-23 08:56 roh has joined #qi-hardware 2013-03-23 09:00 larsc: what if it's 32768, not 25? 32768 can be ambigous depending on platform 2013-03-23 09:05 well, 128 can be ambigous, too, since MSB is 1 2013-03-23 09:08 your unsigned char should get promoted to int 2013-03-23 09:08 since the whole range of unsigned char fits into a signed int 2013-03-23 09:10 things get messy if you compare a signed int with an unsigned int 2013-03-23 09:11 what happens in this case? 2013-03-23 09:13 good question, I'd need to look it up 2013-03-23 09:14 but I think you'd end up with both signed 2013-03-23 09:14 speaking about the promotion.. if i have (128 >= input), and compile it for 8-bit processor, i might not get the same results when i compile it for 16-bit.. Right? 2013-03-23 09:14 because for 8bit it essentially becomes (-1 >= input).. 2013-03-23 09:15 because of promotion.. So it is generally a godo practice to use U suffix, that would avoid this problem? 2013-03-23 09:16 http://pastebin.com/KxE44R0P 2013-03-23 09:16 It might depend on your platform, some 8bit archs still have 16bit integers 2013-03-23 09:17 but the extra U shouldn't hurt 2013-03-23 09:17 http://codepad.org/jHRcJzKF :) 2013-03-23 09:17 yeah, you are right 2013-03-23 09:17 i meant the integer size, not the architecture 2013-03-23 09:20 xiangfu has quit [Ping timeout: 245 seconds] 2013-03-23 09:36 jekhor_ has quit [Ping timeout: 264 seconds] 2013-03-23 10:13 wolfspraul has joined #qi-hardware 2013-03-23 10:20 qi-bot has joined #qi-hardware 2013-03-23 10:33 unclouded has quit [Ping timeout: 245 seconds] 2013-03-23 10:48 kilae has joined #qi-hardware 2013-03-23 10:49 lekernel has joined #qi-hardware 2013-03-23 10:54 mth has quit [] 2013-03-23 11:25 if you have signed and unsigned, promotion is to unsigned 2013-03-23 11:25 that's why things like -1 > 1U yield "true" 2013-03-23 11:28 Calyp has joined #qi-hardware 2013-03-23 11:48 why does -1+1U yield 0 then, not -2? :) 2013-03-23 11:49 i mean, maxint/2+2 2013-03-23 11:49 because 0xfff....+1 is 0+carry :) 2013-03-23 11:49 -1 is not maxuint/2 (or anything nearby) but maxuint-1 2013-03-23 11:50 err, just maxuint of courwe 2013-03-23 11:50 i.e., it's 0xff...ff 2013-03-23 11:51 not according to wikipedia :) 2013-03-23 11:51 http://en.wikipedia.org/wiki/Signed_number_representations 2013-03-23 11:51 huh ? 2013-03-23 11:51 0xff is -0 2013-03-23 11:51 0xff-1 is -1 2013-03-23 11:51 wat? 2013-03-23 11:52 -0? 2013-03-23 11:52 0xff is -1 in 2's complement machines 2013-03-23 11:52 well, i'm talking about two's complement 2013-03-23 11:52 oh, ok, i'm sorry 2013-03-23 11:52 which is what almost everything uses. if you can find a machine that used one's complement natively (good luck with that :), then you're right with -0 2013-03-23 11:53 so then -1+1U, promoted to unsigned int, is 0xff+0x01 - should be 0x01? 2013-03-23 11:54 kyak: no. 0xff + 0x01 = 0x100, but it's then truncated to 8 bits 2013-03-23 11:54 i.e. 0x00 2013-03-23 11:54 oh! i see! 2013-03-23 11:55 now i understand how it wraps aroudn zero.. 2013-03-23 11:56 what is we have a machine where integer size is 8bit? 2013-03-23 11:57 how would it be able to hold 0x100? 2013-03-23 11:57 kyak: it doesn't hold 0x100 2013-03-23 11:58 you can emulate that by using two 8bit integers manually 2013-03-23 11:58 or let your compiler do that 2013-03-23 11:58 then each arithmetic operation will take more than one instruction. much more, usually 2013-03-23 11:58 how would it work without emulation? 2013-03-23 11:59 kyak: it won't 2013-03-23 12:00 the one extra bit is usually represented by a "carry" flag. so in assembler, you'd just use that if you need to make larger operations. in C, the carry flag is not accessible. 2013-03-23 12:00 0x100 is not stored anywhere 2013-03-23 12:00 ^ that 2013-03-23 12:01 wpwrak: does this carry flag essentially lets us use 9-bit integers or what? 2013-03-23 12:01 sort of, yes 2013-03-23 12:01 can we use two carry flags? :) 2013-03-23 12:01 e.g., you'd implement a 16 bit addition on an 8 bit cpu like this: 2013-03-23 12:02 mov r0, a_low; mov r1, a_high; mov r2, b_low; mov r3, b_high 2013-03-23 12:02 add r4, r0, r2; addc r5, r1, r3 2013-03-23 12:03 mov result_low, r4; mov result_high, r5 2013-03-23 12:04 "add" would be addition without carry while "addc" would be addition with carry. i.e., "add" does A+B while "addc" does A+B+C, where A and B are the summands and C is the carry bit. 2013-03-23 12:04 both add and addc would set the carry bit if the result wraps around 0xff 2013-03-23 12:05 the same concept applies to larger word sizes. i.e., if your cpu is 32 bits and you want to implement uint64_t addition, you'd use exactly the same algorithm 2013-03-23 12:05 yep, that's clear. .This is something you would do if you want to keep your result and not to overflow 2013-03-23 12:08 so if i do a -1+1U, and compile it for a machine with 8-bit integer size, i would suddenly get all of this extra code? 2013-03-23 12:09 what would happend if r0 holds 0xff, r1 holds 0x01, and i do add r3, r2, r1? 2013-03-23 12:10 hat's going to be in r3? 2013-03-23 12:40 jekhor_ has joined #qi-hardware 2013-03-23 12:40 pcercuei has joined #qi-hardware 2013-03-23 12:45 xiangfu has joined #qi-hardware 2013-03-23 12:52 xiangfu has quit [Ping timeout: 264 seconds] 2013-03-23 12:54 xiangfu has joined #qi-hardware 2013-03-23 13:01 xiangfu has quit [Read error: Connection reset by peer] 2013-03-23 13:05 xiangfu has joined #qi-hardware 2013-03-23 13:14 xiangfu has quit [Read error: Connection reset by peer] 2013-03-23 13:23 xiangfu has joined #qi-hardware 2013-03-23 13:26 xiangfu has quit [Read error: Connection reset by peer] 2013-03-23 13:39 xiangfu has joined #qi-hardware 2013-03-23 13:43 xiangfu has quit [Ping timeout: 245 seconds] 2013-03-23 13:53 jekhor_ has quit [Ping timeout: 246 seconds] 2013-03-23 14:15 pcercuei has quit [Ping timeout: 258 seconds] 2013-03-23 14:16 pcercuei has joined #qi-hardware 2013-03-23 14:18 LunaVorax has joined #qi-hardware 2013-03-23 14:24 pcercuei has quit [Ping timeout: 260 seconds] 2013-03-23 14:26 xiangfu has joined #qi-hardware 2013-03-23 14:30 dlan^ has joined #qi-hardware 2013-03-23 14:35 pcercuei has joined #qi-hardware 2013-03-23 14:41 xiangfu has quit [Ping timeout: 260 seconds] 2013-03-23 14:48 xiangfu has joined #qi-hardware 2013-03-23 14:52 pcercuei has quit [Ping timeout: 258 seconds] 2013-03-23 14:55 pcercuei has joined #qi-hardware 2013-03-23 14:59 kyak: r3 would be 0x00 (0xff+0x01 is 255 + 1 = 0 (mod 256)) 2013-03-23 15:01 things would be a little different if you do this in C. e.g., int x = (unsigned char ) -1+1; would result in 256 2013-03-23 15:02 xiangfu_ has joined #qi-hardware 2013-03-23 15:15 dlan^ has quit [Remote host closed the connection] 2013-03-23 15:28 pcercuei has quit [Read error: No route to host] 2013-03-23 15:29 pcercuei has joined #qi-hardware 2013-03-23 15:29 kristianpaul has quit [Quit: leaving] 2013-03-23 15:44 wpwrak: how is (mod 256) calculated if 256 (0x100) is not stored anywhere according to whitequark? 2013-03-23 15:52 pcercuei has quit [Ping timeout: 252 seconds] 2013-03-23 15:52 pcercuei has joined #qi-hardware 2013-03-23 15:57 in the assembler example ? well, it's implicit. (mod 256) means that you only have 8 bits 2013-03-23 16:05 maybe it becomes clearer if you picture it as an adder: each bit of the adder has three inputs and two outputs. the inputs are A and B, plus the Carry from the previous bit 2013-03-23 16:05 the outputs are the sum (just one bit) and the carry to the next bit 2013-03-23 16:06 the output is result = (A+B+Cin) & 1; carry_out = (A+B+Cin) >> 1; 2013-03-23 16:07 you have an adder for each bit, with the carry bits connected from LSB to MSB. Cin of LSB is either 0 or the carry flag, depending on whether you have an "add" or an "add-with-carry" operation 2013-03-23 16:07 pcercuei has quit [Ping timeout: 258 seconds] 2013-03-23 16:07 this is what it looks like: http://en.wikipedia.org/wiki/Adder_(electronics) 2013-03-23 16:10 guanucoluis has joined #qi-hardware 2013-03-23 16:12 if it helps think of it as AND 0xff rather than mod 256 2013-03-23 16:13 or just a bit falling off the edge of the world :) 2013-03-23 16:14 a sacrifice to entropy 2013-03-23 16:14 the lemming bit 2013-03-23 16:16 we should patent the carry as "lemming-bit catching aparatus". then sure intel, arm, etc. for a few cubic-gazillions 2013-03-23 16:16 s/sure/sue/ 2013-03-23 16:16 wpwrak meant: "we should patent the carry as "lemming-bit catching aparatus". then sue intel, arm, etc. for a few cubic-gazillions" 2013-03-23 16:17 :) 2013-03-23 16:21 heh :) 2013-03-23 16:22 wpwrak: thanks for explanation 2013-03-23 16:25 i hope i made it clearer :) 2013-03-23 16:25 you did 2013-03-23 16:25 and and found some pictures of 8 bit adders 2013-03-23 16:46 xiangfu_ has quit [Remote host closed the connection] 2013-03-23 16:46 xiangfu has quit [Remote host closed the connection] 2013-03-23 16:50 (( this is what it looks like: http://en.wikipedia.org/wiki/Adder_(electronics) )) which is what I built with Braun Lectron for our 150 year aniversary at my highshcool, been 13 y o iirc 2013-03-23 16:51 I built if from memory/designing it realtime in my mind 2013-03-23 16:51 and I actually used simple NAND /NOR gates only 2013-03-23 16:52 actually been a 4bit adder 2013-03-23 16:56 oops, I think I also had XOR 2013-03-23 16:57 and I must've been 15 already 2013-03-23 16:57 or 14 2013-03-23 16:58 did you mean you were 0xE? :) 2013-03-23 16:58 hehe 2013-03-23 16:58 :-> 2013-03-23 16:59 016 2013-03-23 16:59 there are only 10 kind of people 2013-03-23 17:00 those who know binary and those who don't 2013-03-23 17:09 jekhor_ has joined #qi-hardware 2013-03-23 17:19 kyak: it should be mentioned maybe that you usually have only one ALU wide carry flag (and one sign flag), it gets used for all ADDC (and SUBC, and a few others) operations, no matter which registers are the operands and which the result 2013-03-23 17:21 at 13 you had your 150th anniversary ? are you a very small dog ? :) 2013-03-23 17:21 my highschool had 150 2013-03-23 17:23 ding says "secondary school" 2013-03-23 17:23 while "highschool" seems to be no english but a german word X-P 2013-03-23 17:24 and gymnasium is for sure a false friend :-P 2013-03-23 17:26 I prepared some show-off stuff for physics, in chemistry section a mad teacher made a ~10ml of trinitroglycerene 2013-03-23 17:28 my adder went mad each time the van-der-graaf nearby went "BANG" with a one meter spark. In chemistry all clothes trembled each time the teacher did a BANG with one drop of his stuff 2013-03-23 17:29 the highlight of the day been when I watched this teacher burning down the remaining 9.5ml of nitro 2013-03-23 17:30 at end of the day 2013-03-23 17:30 that was when they started building the new school ? 2013-03-23 17:30 I probably thought exactly same in that moment, but amazingly enough nothing specacular happened 2013-03-23 17:32 he poured the whole shit into a white ceramic bowl and burned it down with a bunsen 2013-03-23 17:32 about as spectacular as a candle with a slightly wet wick 2013-03-23 17:33 i'm sure the pouring needed a steady hand, though :) 2013-03-23 17:33 I think he didn't pour it from extreme height into that bowl, yeah 2013-03-23 17:36 but actually that stuff is quite inpredictable but usually less critical than urban legends suggest. In even younger years I tried to produce nitro maybe 50 times, and I was *sooo* sure this time it worked, everything exactly as it should, reaction observed, result like it should. Alas (or luckily) it _never_ exploded when I had a drop of it fall from 1st floor to stone pavement 2013-03-23 17:37 so every single time the content of the glaspipe ended in the bathroom sink and got flushed by plenty of tap water ;-) 2013-03-23 17:37 sometimes, failure can keep you out of juvenile jail :) 2013-03-23 17:37 yeah :-) 2013-03-23 17:38 or out of the hospital 2013-03-23 17:39 some austrian ashole here shipped letters with nitro and electric ignition some years ago 2013-03-23 17:39 none of them exploded prematurely 2013-03-23 17:40 some neonazi asshole 2013-03-23 17:41 several people lost fingers or a hand 2013-03-23 17:41 usually the secretary of those he meant to hurt 2013-03-23 17:43 jekhor_ has quit [Ping timeout: 252 seconds] 2013-03-23 17:43 http://en.wikipedia.org/wiki/Arabella_Kiesbauer 2013-03-23 17:44 jekhor_ has joined #qi-hardware 2013-03-23 17:44 >>However she did not open the letter; this being done by her assistant who was subsequently injured by the bomb<< 2013-03-23 17:45 those were nitro in a macdonalds straw 2013-03-23 17:50 CR2023 and some small electr(on)ics, and a spark device plugged into one end of straw 2013-03-23 17:51 2032 2013-03-23 17:58 did they ever catch him ? 2013-03-23 18:03 jekhor_ has quit [Ping timeout: 260 seconds] 2013-03-23 18:05 yep 2013-03-23 18:06 I seem to recall he even had an "accident" with one of his creations ;-P 2013-03-23 18:07 ooh, no. http://de.wikipedia.org/wiki/Franz_Fuchs_(Attentäter) 2013-03-23 18:08 suicide 2013-03-23 18:09 Jurting_pc2 has joined #qi-hardware 2013-03-23 18:09 argh 2013-03-23 18:10 whoever wrote the http://de.wikipedia.org/wiki/Rohrbombe page is a terrible person 2013-03-23 18:10 (NSFL.) 2013-03-23 18:11 * whitequark just financed the extortioners in ISO: http://imgur.com/tATMmEs 2013-03-23 18:12 Calyp has quit [Quit: gone working on freeconomy =o)] 2013-03-23 18:16 DocScrutinizer05: attempted suicide, followed a few years later by a successful one. not too bad in terms of poetic justice. 2013-03-23 18:21 :nod: 2013-03-23 18:21 nice ... xpdf is broken in ubuntu 12.10, too (was in 12.04 as well). i suppose the whole QA department of ubuntu was reassigned to work on their "value-added" gadgets ... 2013-03-23 18:21 who's using buntkuh? :-o 2013-03-23 18:22 (fortunately, building xpdf from source does solve the problem) 2013-03-23 18:23 well, it used to be quite good. but recently they seem to be confused. 2013-03-23 18:23 http://xkcd.com/424/ 2013-03-23 18:23 I wholeheartedly agree with xkcd here, regarding buntkuh 2013-03-23 18:24 pcercuei has joined #qi-hardware 2013-03-23 18:24 worst of all... I don't even see how is that (proprietary services / stupid forking / mobile devices) going to help them 2013-03-23 18:24 ;-) naw, once you apt-get remove consolekit it's almost clean :) 2013-03-23 18:25 huh? what's up with consolekit? 2013-03-23 18:36 removing it gets rid of a number of things i don't want :) 2013-03-23 18:36 oh, the dependency hell 2013-03-23 18:37 the person who wrote ruby's parse.y was on some serious drugs. 2013-03-23 18:37 my preferred session goes like this: boot, log in at the /bin/login prompt, startx, ... weeks pass 2013-03-23 18:37 I think I've poured around 2 weeks into rewriting it in a sane way already 2013-03-23 18:37 (why? need precise location reporter, otherwise type inferencer's error messages are unreadable) 2013-03-23 18:38 messy grammar ? or just poor implementation ? 2013-03-23 18:38 these two, combined 2013-03-23 18:38 the grammar is incredibly overloaded, { for example has four distinct context-specific meanings 2013-03-23 18:38 plus the implementation is utterly insane 2013-03-23 18:38 sounds like fun :) 2013-03-23 18:39 it depends on bison actions with side effects changing stacked state in the lexer in some way I *still* do not really understand 2013-03-23 18:39 I even bought the ISO standard in a hope that it would clear some of this mess 2013-03-23 18:39 well, it kinda helped, but not enough 2013-03-23 18:40 worst of all 2013-03-23 18:40 I think I began to understand this stuff ~today. and do you know why is it all needed? 2013-03-23 18:41 LunaVorax has quit [Ping timeout: 260 seconds] 2013-03-23 18:41 to handle two special cases of really, really screwed up syntactic combinations which are so utterly inconvenient, apart from being bad practice, that I think they weren't written by anyone ever once 2013-03-23 18:42 and I mean things like a while..do (not just while) loop in the condition (not body!) clause of which there is another while..do loop 2013-03-23 18:42 I mean I didn't even *know* ruby has while..do loops before I started hacking its parser. 2013-03-23 18:42 neither did anyone I have asked since 2013-03-23 18:43 writing a parser, compiler, or similar often furthers your understanding of the language ;-) 2013-03-23 18:44 ... reverse-engineering a parser. 2013-03-23 18:44 reverse-engineering a frikkin open-source parser. 2013-03-23 18:44 it is easier to just treat it as a black box... 2013-03-23 18:45 the C lexer has three nested levels of switches with fallthoughs and breaks and continues *and* plenty of gotos 2013-03-23 18:46 11KLOC 2013-03-23 18:46 this could serve as a poster example of why you should never, ever, use C to write complex software. 2013-03-23 18:46 http://rxr.whitequark.org/mri/source/parse.y 2013-03-23 18:49 LunaVorax has joined #qi-hardware 2013-03-23 18:52 pcercuei has quit [Ping timeout: 258 seconds] 2013-03-23 18:53 pcercuei has joined #qi-hardware 2013-03-23 19:16 unclouded has joined #qi-hardware 2013-03-23 19:22 jekhor_ has joined #qi-hardware 2013-03-23 19:32 KokAz has joined #qi-hardware 2013-03-23 19:33 KokAz has quit [Remote host closed the connection] 2013-03-23 19:33 KokAz has joined #qi-hardware 2013-03-23 19:47 KokAz has quit [Remote host closed the connection] 2013-03-23 20:06 whitequark, if you need standards, I€€€ publications etc. send me an email. I have access to many of those. 2013-03-23 20:09 lekernel: too late in this case, but thanks for the offer! 2013-03-23 20:09 I'll keep that in mind 2013-03-23 20:15 they're also available for free at your local (physical) library, sometimes 2013-03-23 20:15 doubt so 2013-03-23 20:16 well, a ГОСТ will probably be available. 2013-03-23 20:16 guest? 2013-03-23 20:16 (a CIS international standard.) 2013-03-23 20:16 aka GOST. 2013-03-23 20:20 jekhor_ has quit [Ping timeout: 245 seconds] 2013-03-23 20:23 pcercuei has quit [Ping timeout: 258 seconds] 2013-03-23 20:46 Jurting_pc2 has quit [Read error: Connection reset by peer] 2013-03-23 20:48 Jurting_pc2 has joined #qi-hardware 2013-03-23 21:47 pcercuei has joined #qi-hardware 2013-03-23 21:47 jekhor_ has joined #qi-hardware 2013-03-23 21:56 guanucoluis has quit [Ping timeout: 258 seconds] 2013-03-23 22:30 unclouded has quit [Ping timeout: 245 seconds] 2013-03-23 22:36 unclouded has joined #qi-hardware 2013-03-23 22:37 jekhor_ has quit [Ping timeout: 256 seconds] 2013-03-23 22:41 kilae has quit [Quit: ChatZilla 0.9.90 [Firefox 19.0.2/20130307023931]] 2013-03-23 23:14 lekernel has quit [Ping timeout: 240 seconds] 2013-03-23 23:24 pcercuei has quit [Quit: Bye] 2013-03-23 23:27 lekernel has joined #qi-hardware 2013-03-23 23:31 apelete has quit [Ping timeout: 264 seconds]