| |
| |
| |
|
Page: 1 2
Comments:
<0> ohh good idea <0> then when you open or close you can add or remove from the master <1> yes. <1> especially handy when you have 500 fd's, which usually makes a loop a hotspot in the code. <2> anyone know what lib or .dll the win32 COM functions are in (CoInitialize() et al)? <1> doesn't msdn say? <1> Header: Declared in objbase.h. <1> Library: Use ole32.lib. <2> msdn doesn't say! <2> oh yeah ok <2> cool <2> i actually had to use PE explorer to find it
<2> thanks though <2> :) <1> i copied that from msdn -- online though. <2> hmm i couldn't find it.. guess i am retarded today <2> where do you find that stuff? <1> near the bottom. <1> Requirements section. <0> has anyone experianced bad things happening when you send s SIGCLD to a threaded app? <3> what kind of bad things? <0> seg <3> hm <3> you are mixing threads and processes? <4> thnx <4> hello <0> well the main app forked and exited <0> then the app threads then forks and execs <0> not the app i am currently working on however <0> i am just adding a pid lock file to the one i am working on and contimplateing if detecting it already running with a sigcld a good idea <4> I was wondering if it's possible to have a long number1 = 20000 and then convert to a char (and remain the value 20000) <0> c-bot tell RaKeSh about strtol <5> RaKeSh, here you go: strtol - #include <stdlib.h> long int strtol (const char *restrict string, char **restrict tailptr, int base) Parsing of Integers (ISO) see - http://www.msunix.co.uk/manual/glibc-2.2.3/html_chapter/libc_20.html#SEC422 <0> oops <0> wrong way <0> c-bot tell RaKeSh about snprintf <5> RaKeSh, 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 <4> wow who's that <4> is that a automated system or something? <0> henc the "bot" ;-) <4> hehe <4> haha good one <3> well SIGCHLD is the signal you get when a child process exits <4> I wanted to convert it because, I have to send it to a serial port <0> cn28h i wasn't catching it <0> or useing a "handler" <3> then you were using the default handler <0> why would that cause a seg? <3> no idea <3> why don't you try making your own signal handler so you know what it is doing? <0> ohh waid <0> signal handlers are not thread safe? <3> hm <0> if there was multiple threads that had forked? <3> to be honest I'm not sure of the semantics of signals and threads together <0> and each tryed to use the handler <3> you could write a threadsafe handler <3> http://www.serpentine.com/blog/threads-faq/signals.html
<0> hrm <0> interesting <4> yo winkey, it's not really what I was searching for <4> it's more like piping it, high and low nibble to 1 byte ;-) <0> your wanting to store 4 bytes in one byte? <0> ***uming a byte is 8 bits it can only store 0-255 <0> you could use a char array to store them <0> char myarray[sizeof (long)]; long mylong = 20000; memcpy (myarray, &mylong); something like this what your after? <0> erm <0> oops <0> char myarray[sizeof (long)]; long mylong = 20000; memcpy (myarray, &mylong, sizeof(long)); <0> there better ;-) <6> using GCC / C a,b,c are uint what generate the best result :a=5;b=5;c=5; OR a=b=c=5 ? <1> nokolo: it won't make any difference with gcc. <6> ok thanks <1> winkey: asynchronous signals are delivered to the process, to any thread that didn't have it masked, so if the thread accidentally selected isn't prepared for the signal the process will terminate. <7> hi world! I have just a question, I want to retrieve a web page then i use sockets, i send a http request and so on, however, I want to retrieve the whole page and I don't know what's is the best for create my buffer (should I use char buffer[500000] because web pages are almost never greater than 0.5Mo, or is there a best method to do that?) thanks <3> Ikiteiru, you probably want a dynamic allocation, like with malloc(). Sometimes the server will tell you how large the file is and you can make an appropriate sized buffer. If the server does not tel you, you can start with a default size and realloc() as needed. <7> ok thanks but when I have the Content-Length propertie in the http header, I have the page length but not the header length <3> hm <3> I never ran into that problem, though I was using HTTP/1.0 <7> if I create a giant buffer, because it's not filled the memory is just reserved and the size is no important isn't it? <3> I would avoid creating a "giant buffer" <7> and with socket (on windows) must I use recv or an other function for this task? <7> ok <3> on windows I am not sure <3> on *nix systems you could also use read() <7> ok tanks <7> bye <0> i like rarely use them do the scanf family need \n's before they will do anything? <1> it isn't scanf that cares. <3> hm? <1> well, unless you tell it to care. <0> its like standard to but a \n at the end of a txt file though? <1> mostly it is the o/s that enforces the need for a whole line, so it can provide primative line editing. <0> s/but/put/ <3> yeah, usually t4ext files should end in a line terminator <0> well <0> i suppose iu can put one in <0> ohh and a wacky idea poped into my head <0> tell me if i am cracked ;-) <0> a generic function wrapper function that auto does a error print on failure <1> sometimes that makes sense. sometimes it is annoying. you get to decide which you have. <0> so its not a new idea? <1> it isn't unknown. often it turns out too coarse, so is discarded or made greatly complex. <0> welp my app won't start if its already running <0> must mean i did atleast 1 thing right <1> heh -- i'm sure you did. <0> is it a good idea to remove a pid lock file on exit? <0> don't seem like it would matter alot <3> how else will the next instance know the last instance went away? <0> cn28h kill pid sigchld
Return to
#c or Go to some related
logs:
Can't create TCP/IP socket php Unable to find library containing res_mkquery() #linux #AllNiteCafe #MissKitten #MissKitten #php #linux #windows florin salam
|
|