| |
| |
| |
|
Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
<syscode> its hard to look this up but for pointers what is the difference between type* var1 and type** var2? I have been searching but hard to figure out the search term for ** <syscode> oh never mind it is just double pointer <NKD> glad I could help. <NKD> /bow <NKD> lol <syscode> lol <Bunkai-> i am sorry if this question is tupid: but will this occur once or twice? for (int iLoop = 0; iLoop < 1; iLoop++) Nesuhlas_poskyt_udajov[iLoop] = 0; <_m_> once <Bunkai-> _m_ thank you.. <dizzi> Bunkai-: takze nesuhlas poskytovanych udajov hej? ;) <threat> with sockets (TCP/IP), is there a way to send data across of an unknown size? <dizzi> threat: what do you think? <_m_> Is it possible to eat a bread of unknown size? <NKD> ... <NKD> that analogy amuses me <NKD> You would not know when to open and close your mouth :P <Jey> why do you need to? <Jey> just keep putting hte bread in your mouth and biting until you run out of bread <dizzi> Jey: but its not system solution... in real life you usualy need know how this end <dizzi> you can be ok, and you can puke all the day <Trazer> threat: Through a TCP stream you can send any data you want.. But other end would probably like some way of knowing what's incoming.. <Trazer> An IP packet has to be of a known size though.. <Jey> dizzi: so shove down a potato afterwards as an end of bread marker <_m_> It's amazing how similar the discussions on Undernet/#C++ and Efnet/#C++ evolve. <dizzi> yea, but you can do it only if you are lucky, and youve eat all bread already, in other case (worse), you will puke before you finish bread job :) <_m_> Yes, just like your adsl router will puke when you start uploading. <_m_> Oh man, the bread analogy really works. <dizzi> :)) <Genia4> _m_: I don't think I've ever heard you use "man" before... <Bunkai-> ha, this is miracle: I have generated console application in MS VS 2005 Beta 2, however, I can run on my computer, but if I want to run it in another computer, I get a message "can not execute the file specified" from a MSDos console window. The OS is WinXP on both machines.. <NKD> Sir I believe you have my stapler <llah> Staplers are staples of an office environment. The irony is dizzying. <dizzi> Bunkai-: are you sure that you have all required .dlls on 2nd machine? <shaneC> http://instant-e-gold.com/visit.php?id=43&refid=2516772 get free e-gold for like 10 seconds of work <mauke> what is e-gold? <NKD> probably some scam <sculptor> hey <Bunkai-> dizzi, no I dont have the runtime installed in target machine.. <Bunkai-> I just figured it out.. <llah> Oh boy, e-Gold <dizzi> :)) <Bunkai-> dizzi, when I used VS 6, I did not need anything like that <dizzi> its all about your project settings <Bunkai-> ok, I am going to find it and set it up <lck> what does ascii[i] >>= 1; do? <dizzi> shift value of ascii[1] one bit right <mauke> same as ascii[i] /= 2; <sculptor> C++ lacks rotating shift operators <lck> so ascii[i] <<= 1; moves one bit left? <Jey> nothing two shifts and an or can't handle <binrapt> Indeed <dizzi> lck: yes, or its multiply value by 2 <lck> ok <binrapt> But rotations aren't supported natively on most CPUs anyway, are they not <sculptor> hm, two shifts, 2 ands with mask, and an or <binrapt> Huh? Why and? <sculptor> to remove unecessary bits <sculptor> and, rotations are natively supported by almost all CPUs <Bunkai-> dizzi, the console runtime library, do you know please where is its settings in project properties? <sculptor> even C64s 6510 and ZX Siclairs Z80A <binrapt> What about PPC <sculptor> sure <sculptor> IA32 supports rotating shift operations <binrapt> Yes <dizzi> Bunkai-: i really dont know, im using mingw+eclipse, its only what i remember from old times <sculptor> through Carry flag, or not through it <dizzi> binrapt: rotating and shifting is so basic and easy to realize operations <Bunkai-> dizzi, ok.. thanks.. <dizzi> that i think that its support almost all cpus <sculptor> just realized - no ands operations are necessary - zero bits are padded <mauke> n >> k | n << 32 - k <sculptor> smart copmiler could convert that to native ***ebler instruction <binrapt> Why - k? <_m_> binrapt: what else would you suggest? <binrapt> Hmm two shifts and an or, as Jey already mentioned? <_m_> isn't that two shifts and an or? <binrapt> Two shifts an or and a subtraction..? <_m_> ok. How many bits would you like to shift then? <dizzi> uh <binrapt> Hmm well, depending on left/right, sizeof(type) * bits_per_byte - k and k <dizzi> 1110 ror 2 -> 0011 | 1000 <snibril> (x << 1) | (x > (~0 >> 1)) <lck> for (int i=0; i<sLen; i++) { ascii[i] = (int)p***wd[i]; ascii[i] >>= 1; codedPw += (char)ascii[i];} how do i reverse that <binrapt> Reverse the process :) <upb> eee you cant :P <sculptor> revese engineer it :) <upb> its more like a hash <lck> upd: i can't? <binrapt> Ah, of course, didn't even read it :( <binrapt> I thought it manipulated a string or something <lck> it does <lck> i didn't past the whole program <binrapt> Well, codedPw is what it's about, isn't it? <upb> heh its clear from this part <snibril> since a biot is thrown away, there is no way to reverse it <binrapt> It's a sum apparently <snibril> binrapt: += works on strings <sculptor> there is no single solution <snibril> and he did not state types <binrapt> Hmm oh well <lck> cout << "enter pw: "; cin >> p***wd; sLen = p***wd.length(); int ascii[sLen]; <upb> but if you know codedPw and want to generate p***words <upb> its very easy ;) <binrapt> >>= 1, a bit is lost, hmm <lck> i know codedPw and wanna decoded it or what ever you call it <binrapt> Well, there are multiple possible solutions <snibril> you cannot <snibril> btw, coded is an exaggeration <snibril> it'S slightly obscured at most <binrapt> And that is...2^(sLen) possibilities or so? :) <lck> i choose to think i can, since it's a ex. from my teacher... <snibril> reinventing scurity wheels is even more dangerous than normal wheels <upb> lol <upb> take 30 sec to think what it actually does <snibril> techers are expecially clueless <binrapt> He apparently wants you to find out that you cannot recreate the original string :) <lck> darn, gtg, another cl*** starts <binrapt> Write a supar cool key generator! <<= 1; &= rand() % 2 <snibril> that code is convoluted to start with, the whole casting business is useless <_m_> I suggest you replace the >>=1 with >>=8. After that, the p***word checking code can get optimized. <hac_> what's the most efficient way to compute a hash code for three small integers? <binrapt> _m_: Hah <snibril> not to mention storing temp results in an array <_m_> hac_: 0 <snibril> binrapt: rand%2 is unrandom <binrapt> snibril: Nothing is random! <hac_> _m_: i don't follow :) <matja> windows failures are random <snibril> hao: define efficient and "hash code" <mauke> hac_: 0 is an efficient hash code for anything <binrapt> matja: Nope <matja> hash_code=x*biggest_value_of_x*biggest_value_of_y+y*biggest_value_of_y+z <matja> :p <mauke> int hash(int, int, int) { return 0; } // fast!! <hac_> i see :P <noam_> inline it <snibril> that is an encoding, not a hash <noam_> xor them <binrapt> I claim that a copy of this universe would have the same things happening <dizzi> its hash with pretty much colisions :) <binrapt> dizzi: Kinda :P <hac_> well, sorry, a unique hash code <matja> binrapt: a copy isnt possible :) <matja> so how would you ever prove it <hac_> for instance, two integers.. x << 16 | y <snibril> hashes are seldom unique <snibril> a hash, or a digest? <binrapt> matja: Simply, never! <matja> :D
Return to c++ or Go to some related
logs:
wow.no
|
|