@# 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



Comments:

<0> 1245
<0> tried it..
<0> showmessage(floattostr(RoundTo(1245.23005843, -2)));
<0> just depends whether you're satisfied with bankers..
<1> thats really weird
<1> showmessage(floattostr(RoundTo(1245.23005843, -2)));
<1> http://www.vkarlsen.no/pastebin/default.asp?id=7337
<1> try to run this code
<2> thats the way floating point works
<0> returns a double
<0> change it to a double..
<1> i dont need double, i need single
<2> the only "exact" representation is in a string not in a double or single
<0> best method is string then, or you're only going to have to start type casting anyway
<1> bealtine, in single i need to CUT data after . leave only a few digits
<3> CyberK: may i ask why on earth you need this?



<2> if you "cut" the representation will NOT be exact
<3> im failing to see why this would make any sense outside of being a string
<1> there is a reason
<1> it will take too long to explain
<1> but there is
<2> reason or no, it still wont work.
<4> CyberK, ShowMessage(Format("%.2f", [mySmall]));
<3> just multiply with 10000, int it, and divide by 10000 :P
<1> TAtari, i dont need a string.. i need single
<4> then why the hell does it matter if it has 1 decimal or 10?
<3> and besides, the decimals/floating point number might not be that accuratea anyhow since its floating point
<5> oh yeah, and it won't work in c/c++ either :P
<2> it doesnt work on any platform
<1> because this data is used in computer game over network.. and i need to send it to another machine
<2> thats the nature of floating point
<1> and as you all know floating data calculated differently on diff machines
<1> so i want to reduce the precision of the float
<1> to the minimum
<2> send it as a string
<2> thats the only guaranteed way
<1> bealtine, i can't, too much traffic...
<2> then you're foobar
<5> either that or use a memory method?
<5> would that work?
<1> 124343.2342 as string is many times larger than the same as float
<5> truncate a couple of bytes :P
<3> uh
<3> isnt extended already like 4-8 bytes or so?
<5> 10
<3> yeah, so...
<3> duh :P
<3> tell you what then
<3> encode the fraction as an int, and the integer part as .. an int
<5> what I mean is, copy it to a memory buffer, shrink the buffer and copy it back
<3> with an unsigned word you can atleast store 0-9999 without problems
<5> that should reduce the precision :P
<3> if he's that serious about size
<5> he must be running it on dialup or something
<3> 12:48 < CyberK> and as you all know floating data calculated differently on diff machines
<3> 12:48 < CyberK> so i want to reduce the precision of the float
<3> sending it as a float then is kindof meaninless
<3> atleast if you want to parse it on different platforms that might not even understand the format you're sending it in
<5> big endian or little endian :P
<0> i think he's looking for the 4 byte advantage over the 8 byte double..
<0> since it's for networking..
<5> its smaller
<5> and it has less precision
<5> thats it :P
<6> hi guys
<6> threading problem - anyone awake
<6> ?
<6> my app is threaded and it uses criticalsections to manage the flow.
<6> all works fine - but when I close my program, it stays open - the UI vanishes but the taskbutton remains and delphi is never given back control
<6> I think it will be something to do with my TEvent.waitfor
<4> sounds like a missing if Terminated then Exit in the threads
<7> Do you have it set to wait forever?
<6> yes
<7> I've never used TEvent, but send it the "stop waiting" command :)
<7> TEvent.ResetEvent



<6> yeah - I do that in the overriden DoTerminate but it still seems to do nothing
<7> Are you sure you're hitting the line?
<6> just checking now
<6> hmm no - not even getting to my thread terminate
<7> k, problem solved :P
<8> Google kicks the lama's ***. Share prices Google $385.50 Yahoo $27.08 Amazon $26.26 ebay $24.43
<7> Share price is rather dependant on the number of shares available :P
<9> that really doesn't mean too much
<9> exactly
<8> Available shares Google: 7,102,490 Yahoo 22,769,400 Ebay 20,849,900 Amazon 7,254,990
<9> http://www.youtube.com/watch?v=AFh8hUUGN84
<8> Google $385.50 ebay equivalent $71.70 with shares in consideration calculated :)
<8> still kicks the lama's ***
<6> ok - next problem - how do I get my doterminate to occur when my thread is waiting on a TEvent?
<10> http://www.realtechnews.com/blog/wp-content/worth1000.jpg
<7> WraithX, Terminate only sets Terminated to true
<7> Call Terminate, then call TEvent.ResetEvent
<7> Your thread should then be watching Terminated and terminate properly
<6> yes
<6> oka
<11> Hi. how can i declare a constant integer with a default value in delphi?
<7> or, you could override Terminate if you were bored :P
<12> var i: integer = 1;
<7> Make it call inherited; then TEvent.ResetEvent
<7> :P
<7> constant?
<12> const
<12> just replace var to const ;)
<11> Thnx :)
<0> sweet.. offloaded my fender hotrod amp..
<0> :)
<13> Does anybody knows what I have to do to let null a date variable?
<13> *set
<14> heya.
<13> Hello! Does anybody knows what I have to do to set null a date variable?
<14> Yourik: in a db?
<13> a date array variable
<13> I tried vac_date[i] := null, but didn't work
<8> Yourik try nil don't know if it will work
<13> Stooge, thanks, but didn't work -> Incompatibles types : 'TDate' and 'Pointer'
<15> You can't null or nil a date variable.
<15> Set it to 0.
<14> even then
<14> it's still a valid date
<14> somewhere in the 1900's
<15> Yeah, all values are a valid date. Have to pick something unlikely.
<14> MinDouble ;)
<14> that said
<14> DB's have their own "null"
<15> Yeah, that typically gets translated to 0 if you try to just drop into into a TDateTime.
<14> afaik it get's translated to an exception
<14> with IsNull being true
<14> Got my airconditioner btw
<14> they instaleld it this morning.
<13> So, Can't I set null?
<16> ki9a: and it's raining now
<16> and might rain till next year who knows :)
<8> Yourik : nope no nulls for dates
<14> oLeOlE: it's still here 10 degrees colder than outside
<14> :)
<13> ok :|, anyway, thanks
<16> ki9a: oh I see to boast about your AC you set it to 10C
<16> and you are freezing with a pullover
<14> oLeOlE: that's a technical detail
<15> I r teh tired.
<16> oh yes you are
<10> http://www.realtechnews.com/blog/wp-content/worth1000.jpg
<15> hm. Can find any detailed specs on Dell power supplies. Guess I'll take the case off when I get home.
<14> cool
<14> I'm in World 8
<14> of super mario 3
<17> hax
<16> ki9a: what console ?
<14> NES


Name:

Comments:

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






Return to #delphi
or
Go to some related logs:

#dsl
#red
Error code 000000f4, parameter1 00000003,
The multi-part identifier+could not be bound
slave4lov
#computers
#gentoo
trailor(boolywood)
missnglnk
#beginner



Home  |  disclaimer  |  contact  |  submit quotes