@# Quotes DB     useful, funny, interesting





Google
 
Web www.quotesdb.info
Undernet  |  EFnet  |  Quakenet  |  Freenode  |  Dalnet  |  Ircnet  |  Galaxynet
Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17



Comments:

<0> k, thanks
<0> is there an easy way to do a for loop, but in either direction? ie, I have two values, one might be larger or smaller than the other. I need to go from the first to the second
<0> ie, for(i=x1; i<=x2; i++) will only go positive direction
<1> std::min/max or a condition and std::swap, to guarantee one is less than the other
<1> if (x2 < x1) { std::swap(x1,x2); } // proceed.
<2> or you could just count down
<1> well, ***uming x2 is always less than x1.
<2> or...
<2> eh, whatever
<1> for (int i=std::min(x1,x2); i < std::max(x1,x2); ++i) // proceed
<1> heh
<1> not quite as efficient.
<1> unless the compiler can optimize?
<2> T begin = ...; T end = ...; for( iter = begin; iter != end; ++iter )
<1> still has to be modified such that the start iterator is before the end iterator, and that T actually supports iterators.
<1> but ya.



<2> well, yea
<2> thats the point of ...
<1> ah.
<2> put your min/max junk there
<2> int begin = min(x1,x2); int end = max(x1,x2); for( int iter = begin; iter != end; ++iter ){}
<2> and hopefully your larger value is guaranteed 'one past the end'
<2> otherwise adjust the conditional
<1> somehting is missing there.
<2> ?
<1> your just naming the int values iterators in that example.
<2> an 'index' is an iterator
<2> you don't like my names?
<1> well, I would change the condition to < unless I was using actual iterators
<2> doesn't really make a difference
<1> right, I am just paranoid.
<2> if you guaranteed that begin < end, you're fine
<1> my example was flawed as well actually
<3> How can you launch an external application within a win32 panel?
<2> a win32 panel?
<1> err, nm I did not add the for loop heh...
<1> win32 console?
<2> CreateProcess() sounds good
<1> whats the other one? ShellExecute() ?
<1> don't think its all that good though
<3> i have to launch the application through the COM interface
<3> so shell execute or CreateProcess wouldn't work that way
<2> why?
<4> Due to some graphic violence, khan may not watch
<5> pfft
<5> due to poor acting and ridiculous plot, khan may not watch
<4> Haha
<5> OMG THAT GUY TOUCHED ME
<5> RAPE
<5> why'd they introduce that character?
<6> poor peter!
<6> maybe we should find a fund
<6> to save peter hu :P
<5> ?
<4> huhuhu
<6> huuuhuuu
<6> i wanted to say something really funny, but my english failed me
<4> Heh
<6> :)
<5> well, at least you have it better than JBlitzen, who has a command of english comparable to a retarded 5 year old child and hasn't been funny the 6-7 odd years he's been here
<6> oh
<4> They certainly have been odd. A gay man named Hu keeps trying to convince us he's not Asian.
<5> ME LOVE YOU LONG TIME
<4> Haha
<6> i think you broke your habbit JBlitzen
<5> negatory
<6> that was a bit funny :P
<5> not even remotely
<6> uhm
<6> if hu says so :)
<5> i say therefore it is
<4> huhuhu
<6> huuuhuuu
<5> mmm, good sub
<5> and good workout tonight
<5> <--- ripped
<7> hehe



<7> I had a good workout tonight too
<7> <-- tired
<6> lol
<7> certainly not ripped yet, though :)
<4> After browsing gay porn for years, khan has decided to emulate it
<7> hahaha
<8> anyone knows how to send when you got nonblocking socks?
<6> i didnt have a good workout yet
<6> <-- not tired
<7> HellMind, you just send()
<7> what's the difference?
<8> Swish yeah but
<1> I had a good workout today too. heh
<8> you can get -1
<7> and what's that -1 mean?
<8> SOCKET_ERROR
<7> and why would that happen?
<8> Cuz the buffer is full
<8> so we must store it
<7> so then you either while loop until you get no -1
<7> or you have to store it
<8> nah thats ugly
<8> maybe in linux you do that
<7> depending on how your program is written and if you're thready, or whatever
<8> here you got FD_WRITE
<7> nah it doesn't depend on the OS
<7> it depends on how your program is structured
<8> that tell you when to send
<8> that loop that you said is very wrong
<7> you mean select() returns that?
<7> dude it really depends.
<8> yeah select, or wsasynselect
<7> if all you're writing is a dirt simple 2-person chat client, a spin loop with a Sleep() in there is probably more than sufficient
<7> not that you'd likely overflow the buffer in an app like that anyway, but.. :)
<8> its like you ve to got for every connection a fifo buffer
<7> yep
<7> 64k usually, iirc
<7> I forget if it's configurable at runtime or if the tcp/ip stack must be reconfigured
<7> (the buffer size, I mean)
<8> so i must create a struct with the SOCKET and a pointer to the Buffer?
<7> beats me man
<7> you seem pretty clued in.
<7> pick a method you like and go with it. :)
<7> you know your own program structure best and what's going to work for you
<7> struct with socket, buffer, size... should be good
<8> yeah but i just wanna know how the pro do that on a nonblocking socks with msgs
<7> an array of those
<7> erm
<8> that ll be a long recode :(
<7> pros don't over-engineer a solution ;)
<7> if a spin-loop is good enough, they'll go with that and move on ;)
<9> how can i p*** a function as parameter ?
<7> otherwise they might use a multithreaded solution + spin..
<7> or perhaps a varray of backed-up packets to send when the tcp/ip stack's buffer is empty...
<8> P-Brasil voce must p*** &function?
<7> P-Brasil, google how to typedef a function type
<8> isnt easy to think how the buffer must work
<8> i know there is a code showing how to do this
<7> why isn't it easy?
<7> have you taken a CS cl***?
<7> it's just a FIFO right?
<7> a fifo that you never ever want to overflow. you don't want to deal with the situation of your array of buffers not having enough room ;)
<7> so.. varray.
<7> use the STL, luke.
<4> http://www.drudgereport.com/
<4> Now THAT's hail
<8> i dont like cl***es
<8> cl***es are for young ppl
<10> hi JB
<4> Hi floyd
<8> my mind is procedural
<4> peterhu's mind is homo***ual
<8> a mind cant ve ***


Name:

Comments:

Please enter the result of the sum 63 + 46 (to avoid spam):






Return to #c++
or
Go to some related logs:

#php
misskitten
mikylie efnet
#london
irgiel liba
failed to mount due to error 95. (no mountable file systems)
selinux kernel audit denied shorewall
#skype
#javascript
#linuxhelp



Home  |  disclaimer  |  contact  |  submit quotes