| |
| |
| |
|
Page: 1 2
Comments:
<0> evening d. <1> tnx Asmodee` <2> C_Dreamer, are you around? <2> c-bot fopen <3> danimal, here you go: fopen - #include <stdio.h> FILE * fopen (const char *filename, const char *opentype) Opening Streams (ISO) see - http://www.msunix.co.uk/manual/glibc-2.2.3/html_chapter/libc_12.html#SEC178 <4> c-bot socket <3> neax, here you go: socket - #include <sys/socket.h> int socket (int namespace, int style, int protocol) Creating a Socket (BSD) see - http://www.msunix.co.uk/manual/glibc-2.2.3/html_chapter/libc_16.html#SEC326 <2> c-bot, tell neax about beej <3> neax, here you go: Beej"s Guide to Network Programming Using Internet Sockets - http://beej.us/guide/bgnet/ <2> just in case <4> :) <4> beej's guide to sockets is terrific <2> yep, that's where i got my first taste of sockets <2> c-bot, restrict <5> That's new, I don't think it knows it. <3> danimal, the magic 8 ball says... reply hazy, try again.
<5> It's an optimization keyword. It probably ought not have made it in, but it is there. <4> c-bot ptr <3> neax, the magic 8 ball says... better not tell you now. <4> heh <6> c-bot: pointe <3> dbtid, stop smoking crack and ask again. <6> c-bot: pointer <3> dbtid, stop smoking crack and ask again. <6> c-bot i love you <3> dbtid, here you go: i love you too! <6> actually i thought we had restrict in c-bot's database <6> c-bot restrict <3> dbtid, stop smoking crack and ask again. <6> hrm <6> odd <6> c-bot snprintf <3> dbtid, here you go: snprintf - #include <stdio.h> int snprintf (char *s, size_t size, const char *template, ...) Formatted Output Functions (GNU) see - http://www.msunix.co.uk/manual/glibc-2.2.3/html_chapter/libc_12.html#SEC196 <6> same db <6> c-bot restrict <3> dbtid, the magic 8 ball says... you're not making any sense; try again. <6> c-bot VLA <3> dbtid, here you go: Very Large Array radio telescope in Arizona or New Mexico <6> c-bot long+long <3> dbtid, the magic 8 ball says... concentrate and ask again. <6> c-bot vfscanf <3> dbtid, here you go: vfscanf - #include <stdio.h> int vfscanf (FILE *stream, const char *template, va_list ap) Variable Arguments Input Functions (ISO) see - http://www.msunix.co.uk/manual/glibc-2.2.3/html_chapter/libc_12.html#SEC216 <6> c-bot inline <3> dbtid, stop smoking crack and ask again. <7> ok, why is this happening? <7> http://rafb.net/p/jR1KRN62.html <7> the printf outside the for loop prints a higher value <7> than inside the loop <2> byte is unintialized <7> ?? <2> how long have you been doing C? <7> not so long <7> i thought char *byte = malloc(8); <7> did it <7> not the case? <7> why does strlen change during this loop? <7> http://rafb.net/p/q9yTBn56.html <7> why does strlen() change values here? <7> http://rafb.net/p/q9yTBn56.html <8> Considering that the code, as written, is completely nonfunctional, couldn't say for sure. <7> the only difference <7> is that binary exists <7> the funciton looks like foo(char *binary) <8> And what value does it have coming in? <7> "011011110110110101100111" <7> if i add a printf that checks the strlen before the loop, it checks out fine <7> but its changing during <8> FWIW, a quick test locally says it isn't changing. <7> hmm <8> This is why the 12th commandment is "Create a standalone test case". Otherwise who can test the code? :) <9> So, I'm having an awful time with this reading off of sockets. Here's what I got. http://rafb.net/p/88YCzK57.html <2> c-bot tell Mel_ about beej <3> Mel_, here you go: Beej"s Guide to Network Programming Using Internet Sockets - http://beej.us/guide/bgnet/ <9> does it cover blocked reading? I have been using Beej's guide all along, but I didn't see anything about blocked reading <0> what's the problem? <2> yes <2> select is blocking
<2> by default <9> if there isn't data on the socket, then it hangs. So the first iteration reads and allocates, but the second iteration is blocking, waiting for a message, doesn't see that there's nothing on the socket...should I set the read to nonblock? <0> Mel_: you seem to mishandle strings. <9> yeah, heh, I need to brush up on that at some point...I just want to get this project done for this cl*** at this point :) <2> its suppose to block if there's no data, that's why its called blocking <0> fixing your string handling is integral to getting your code to work. <9> hmmmm <0> you have a loop. you return only the last count of bytes read. doesn't seem too useful if there were 12 receives that were successful. <9> ahh yeah i just added the loop, i forgot to move that up <0> so you receive 100 bytes. strlen(out) is 0. so you allocate space for 100 bytes. then you copy 101 bytes. <0> sizeof (char) is always 1. <0> you call strlen quite a lot. <9> is strlen expensive? <8> Yes. <0> just wondering why you bother when recv provides a count. <8> Technically, strlen doesn't _have_ to be expensive... but in practice, it is. <9> yeah i suppose it would be easier to total the recvd bytes <0> have you considered what happens if you receive all 256 bytes you request? <9> that's what I'm trying to account for... <0> well, all 256 bytes of tmp are written to, so you have no trailing \0 to terminate it as a string, thus a mistake to use it in strcat. <8> Or what happens if the sender sends a buffer longer than the size you're reading - meaning there's no \0 for your strcat to end on? <9> arg stupid interprited languages ****ing with my conceptions of string handling... <0> there's no need to use strcat (any string handling) if you'll keep a counter. <0> further, you misuse realloc. <9> i'm a C failure. <2> Mel_, its completley curable <9> do they make a drug for it? <8> Yes; it comes in this novel format known as "books". :) <10> -.- <11> <12> =_= <8> She gots, she gots. :) <11> =^.^= <11> hey You! :) <11> ~ <8> Wrong channel, silly. :) <11> newp <11> it's communication thru ascii ;) <11> it's like 'performance art' <11> Tamama, Squeeeez and I were all just getting to know each other :) <10> That is ok.. It is always quiet here anyway <8> Well, hell, don't let me stop you. :) <12> thank you blu^ <11> oh, my pleasure <11> it's 'always' quiet? <11> :/ <8> Pretty much. Feel free to add some color. :) <11> omg! there's a novel idea <11> they'd all prolly die of shock!! lol <11> so... 57 people and almost NO chatting.. what's up with that? <11> cyfo%y fo <11> ..%;%.. <11> 2. >%o< . A bunch <11> 2;)4)15)0(4(2(~`; of roses <11> 2%;.(14(5(0(15)2)2.;% just for you, Tamama :) <12> we're waiting for the next meal >:) <12> omg <13> Tamama doesn't want to be loved <8> Depends, I suppose, how one defines "loved". :) <13> Right, c-bot is just your jealous lover <12> if I multiply two 127bit numbers together... this might give a 254bit number, right? <6> what happens when you multiply 2 8 bit numbers? <6> or 2 16 bit numbers? <6> you do the math. <12> true... <12> thank you <12> and sorry for the dumb questions <6> not dumb <6> just trying to prod you to think about the problem in other ways
Return to
#c or Go to some related
logs:
psybnc freenode tor linux apmsleep doesn't awake #skype switchdesk wmii #AllNiteCafe #mirc #c++ Adds-on for Minefield 12WHAT DRUG CAN BE FOUND IN TONIC WATER ? aleksandar the grates
|
|