11:25 < JulianAssange> sizeof(var) vs sizeof var 11:26 < JulianAssange> what is difference 11:27 < Learath2> in C sizeof is a operator which makes the first one bad syntax iirc 11:27 < LittleWhite> none as far as I remember 11:27 < Learath2> ofc they work the same :D 11:28 < LittleWhite> Learath2: In C ANSI, maybe ? 11:28 < LittleWhite> but now, there is no problem ? 11:29 < LittleWhite> Learath2: You ae right 11:29 < LittleWhite> in C, sizeof int does not compile at all 11:30 < Learath2> doesnt ?? 11:30 < LittleWhite> test.cpp: In function ‘int main()’: 11:30 < LittleWhite> test.cpp:5:30: erreur: expected primary-expression before ‘int’ 11:30 < LittleWhite> printf("Size : %d\n",sizeof int); 11:30 < JulianAssange> that will be 4 11:30 < JulianAssange> or 8 on 64-bit 11:30 < JulianAssange> i believe 11:31 < JulianAssange> oh 11:31 < JulianAssange> i should have read above 11:31 < LittleWhite> JulianAssange: 4 even in 64 bits 11:31 < LittleWhite> int, does not change size between arch 11:31 < JulianAssange> ok 11:33 < JulianAssange> char *p = malloc(21); 11:33 < JulianAssange> memset(p, 0, 21); 11:33 < JulianAssange> that's the reason i ask 11:33 < JulianAssange> i think i might need to do sizeof(char *) * 21 11:33 < JulianAssange> not just 21 11:33 < EastByte> sizeof(char *)? 11:33 < EastByte> doesn't make sense 11:34 < JulianAssange> sizeof(char)? 11:34 < EastByte> I guess you want to alloc a buffer of size 21? 11:34 < JulianAssange> yes 11:34 < EastByte> otherwise memset doesn't make sense 11:34 < EastByte> yea, then sizeof(char)*21 11:34 < JulianAssange> 20 characters + 1 nul 11:34 < EastByte> which is 21 11:34 < JulianAssange> ok 11:36 < Learath2> C99 6.5.3 says that its either sizeof (type-name) or sizeof unary-expression 11:36 < Learath2> so typenames need to be paranthesised :P 11:37 < JulianAssange> i guess for readability sizeof(*p)*21 is better 11:38 < JulianAssange> or, as you discussed, 21 * sizeof *p 11:38 < Learath2> i'd use the second but thats just me :P 11:39 < EastByte> usually you don't alloc dynamic sized buffers 11:39 < EastByte> and for static sized buffer you can simply us sizeof(var) 11:39 < EastByte> use* 11:40 < JulianAssange> hm 11:40 < JulianAssange> i can't remember why i used malloc for this 11:41 < JulianAssange> oh 11:41 < JulianAssange> it needs to be a pointer later on in the code 11:41 < EastByte> char buf[256]; 11:41 < EastByte> buf is a pointer aswell 11:41 < JulianAssange> you can't use pointer arithmetic on it though, no? 11:41 < EastByte> sure you can 11:42 < EastByte> well, changing its address isn't a good idea 11:42 < JulianAssange> ^ 11:42 < JulianAssange> NetworkFunctions.c:345:7: error: cannot increment value of type 'char [21]' p++; 11:42 < EastByte> rather do char *p = buf+... 11:43 < EastByte> ^ indeed that doesn't work 11:43 < JulianAssange> that's why i need it 11:44 < Learath2> char *p = &buf + 11:44 < EastByte> buf already is a pointer :/ 11:44 < Learath2> no it isnt 11:44 < Learath2> its an array 11:44 < EastByte> grr 11:44 < Learath2> only when passed as an argument arrays are passed by referance 11:45 < EastByte> *buf will derefence to it's first char 11:45 < EastByte> &buf is a pointer to a pointer to the first char 11:45 < Learath2> then im just mad 11:45 < JulianAssange> you can't do pointer arithmetic on references 11:45 < JulianAssange> iirc 11:45 < EastByte> you don't even have references in C 11:46 < JulianAssange> you have pseudo references 11:46 < EastByte> yea 11:46 < EastByte> so char buf[21]; 11:46 < EastByte> char *p = buf+... 11:46 < EastByte> would be the right way 11:46 < JulianAssange> yeah 11:46 < EastByte> the buffer even is allocated on stack 11:48 < Learath2> i bet char *p = buf; p += 1; would work :P 11:48 < EastByte> yep 11:49 < EastByte> also remember that p+=1 actually is p+=sizeof(char) 11:49 < EastByte> so it'll be different on integer pointers 11:50 < EastByte> int *i = NULL; 11:50 < EastByte> printf("%p %p\n", i, i+1); 11:50 < EastByte> output: 0x0 and 0x4 11:51 < JulianAssange> ok 11:51 < JulianAssange> well i'm going to go do weights so bbl 11:51 < EastByte> cya 12:14 < heinrich5991> EastByte: that's not correct, &buf is a pointer to the array 12:14 < heinrich5991> buf is coerced to be &buf[0] though, that's correct 12:16 < EastByte> okay, I see 12:17 < EastByte> Learath2: I was kinda wrong 12:44 <@matricks> why not convert teeworlds to javascript? it seem in at the moment 12:46 < JulianAssange> convert it to D 12:47 <@matricks> I would prefer rust 12:48 < JulianAssange> how about asm? 12:48 <@matricks> pcode? 12:48 < JulianAssange> no. 12:49 < heinrich5991> how about rust executing pcode? :) 12:49 < JulianAssange> how about we just make an IRL teeworlds 12:49 < heinrich5991> best of all worlds 12:49 <@matricks> but I've actually toyed with the idea to on how you would convert teeworlds to rust 12:49 < heinrich5991> convert or rewrite? 12:50 <@matricks> convert 12:50 < heinrich5991> gradually replacing parts with rust code? 12:50 <@matricks> yup 12:50 <@matricks> teeworlds has 4 very well separated parts.. take one of the parts and convert it :) 12:50 < heinrich5991> :) which ones? network - engine - game - ? 12:51 <@matricks> client/server, engine/game 12:51 <@matricks> so, perhaps take engine server and convert it first 12:51 < JulianAssange> write it in fourtran 12:52 <@matricks> said the man who can't even spell it 12:52 < JulianAssange> hey hey 12:52 < JulianAssange> when i first learnt about it 12:52 < JulianAssange> i thought it was a 4chan for trannies 12:52 < JulianAssange> fortran, then 12:53 <@matricks> but I was semi serious about the rust thing 12:53 <@matricks> on that I've thought about it 12:53 < heinrich5991> matricks: there's still the interesting problem to solve for implementing it in Rust 12:53 < heinrich5991> the back-references that everybody has 12:53 <@matricks> yup 12:54 < heinrich5991> one possibility for that is to give each callback function an object to its parent 12:54 <@matricks> I see it more as an exercise then a real solution to anything :) 12:54 < heinrich5991> that's how I did callbacks in a rust project of mine 12:54 <@matricks> and I don't have like any time to spend on it so... I just got a huge hobby project dumped in my lap :) 12:55 < JulianAssange> i've never seen rust, but it's basically "secure" C++, right? 12:55 <@matricks> JulianAssange: "yes" 12:55 <@matricks> but in reality, no D: 12:55 < JulianAssange> so it's like java? :> 12:55 <@matricks> no 12:55 < heinrich5991> lolno 12:55 < JulianAssange> that was a joke 12:55 <@minus> java ain't safe 12:55 <@matricks> JulianAssange: and you are not funny 12:55 < JulianAssange> yes i am 12:56 < JulianAssange> too many companies want java programmers atm though 12:56 < JulianAssange> i've noticed, anyways, here in australia 12:56 * minus is one 12:57 < JulianAssange> my view is that java is c++ on training wheels 12:58 <@matricks> rust does some really intressting stuff with pointers and lifetimes however that I really hope works out 12:59 <@minus> lifetimes are such a thing 12:59 < heinrich5991> they however make it really hard to do zero-alloc stuff 12:59 < heinrich5991> and the standard library works again you in this respect 13:00 <@matricks> *against 13:00 <@matricks> havn't really looked into it 13:00 <@matricks> I think there were loads of problems with this due to the lack of DST 13:00 <@matricks> which should be in now 13:01 < JulianAssange> seems not: https://github.com/rust-lang/rust/issues/12938 13:01 * matricks is gonna be a web monkey the comming months however 13:01 < JulianAssange> php? 13:02 <@matricks> most probably 13:02 < JulianAssange> also since you love to do it too... coming* 13:02 <@matricks> the club website needs a revamp and make it more modern 13:03 <@matricks> trying to figure out what to build it with 13:04 < JulianAssange> is that why you were talking about javascript? 13:04 <@matricks> no, not really 13:04 <@matricks> that was pure troll mode :D 13:05 < JulianAssange> :P 13:05 <@minus> :P 13:05 <@matricks> had a discussion on a pub about javascript and how bad it actually is 13:05 <@minus> something something 10ft pole 13:05 <@matricks> and how I more and more dislike dynamic typed languages 13:05 <@minus> i get the same feeling 13:05 <@matricks> and imlicit casts 13:05 < JulianAssange> i have a pic somewhere, probably on twitter, where someone compares 10 + 1, 10 + "1" and "1" + 10 in javascript 13:06 <@matricks> does should go a and die in the fire 13:06 < JulianAssange> and the results are all messed up 13:06 <@matricks> JulianAssange: https://www.destroyallsoftware.com/talks/wat 13:06 <@matricks> classic 13:06 <@minus> matricks: and implicity mutability 13:07 <@minus> is that the js talk? 13:07 <@matricks> yah 13:07 <@matricks> and some ruby 13:07 <@minus> ruby bad? 13:08 < JulianAssange> ok 13:08 <@matricks> [] + [] = "" in javascript 13:08 <@matricks> wat 13:08 < JulianAssange> wat 13:08 <@minus> also, on an unrelated note, fuckings to AVM, they're a bag of cunts 13:08 <@matricks> JulianAssange: just look at that video.. soo goood 13:09 < JulianAssange> i know 13:09 < JulianAssange> i'm watching it lol 13:09 < EastByte> https://www.destroyallsoftware.com/talks/the-birth-and-death-of-javascript 13:09 < EastByte> is awesome also 13:10 < JulianAssange> "enough talking about languages that suck, let's talk about javascript" 13:10 < JulianAssange> woo 13:10 <@minus> interesting, i now have ADSL2+ Annex J (was B before) 13:11 < JulianAssange> watman 13:11 < JulianAssange> kek 13:11 < JulianAssange> ye good presentation 13:11 < jxsl13> EastByte +1 13:13 < JulianAssange> YavaScript 13:13 < JulianAssange> i don't get the joke 13:14 < JulianAssange> oh, i guess he's european and pronounces j's as y 13:19 < Learath2> EastByte: so i wasnt completely wrong :D 13:21 <@minus> 10 days? 14:48 < JulianAssange> man.. 14:48 < JulianAssange> i got out my backup from a long time ago 14:48 < JulianAssange> for some reason.. now i can't remember why.. 14:50 < JulianAssange> grrr... 15:09 < jxsl13> put it back from where you got it and then you ll rememer 15:29 < JulianAssange> i remembered, and it isn't there -.- 15:30 < JulianAssange> it was a nanorc file 15:30 < JulianAssange> i have an email on the harddrive talking about it, but the file is gone.. 15:37 < JulianAssange> and on reboot my clock doesn't work anymore! :@ 21:12 <@minus> so, this just happened: aur/rust-nightly-bin 0.13.0_2015.01.03-1 -> 1.0.0_2015.02.07-1 23:28 < jxsl13> is the fake ping "exploit" ever gonna be fixed? 23:35 < heinrich5991> fake exploit? 23:35 < heinrich5991> oh fake ping exploit 23:46 < jxsl13> well, like ppl able to change their ping however they want