@# Quotes DB     useful, funny, interesting





Google
 
Web www.quotesdb.info
Undernet  |  EFnet  |  Quakenet  |  Freenode  |  Dalnet  |  Ircnet  |  Galaxynet
Page: 1 2



Comments:

<0> #%#%" Never put complex object in DnD
<0> :S
<1> Hi everyone, I got a quick question I receive some data from a network socket, and i need to read a 64 bit (long) value...
<1> the problem is when i put it in my long value it shows as signed when i print it and I need it to be signed :S
<1> how I can do this??
<2> it is signed and you need it to be signed? excellent. and the problem is?
<2> hallo everyone
<1> well when i read it i do a loop because its in an "network socket data.. so an array"
<1> and i need to do a loop to put array[32] to array[39] containing bytes into a long value
<2> why do you
<1> but java transform it to signed...
<2> split your message so much?
<1> well because i type fast and during the time you read the line before the other one just appears :)
<2> Frank-23: http://java.sun.com/docs/books/tutorial/java/nutsandbolts/datatypes.html
<1> http://www.noidea128.org/sourcefiles/15831 is actually my code
<2> Frank-23: http://www.cafeaulait.org/course/week2/02.html



<2> Frank-23: more human readable: http://www.idevelopment.info/data/Programming/java/miscellaneous_java/Java_Primitive_Types.html
<1> I know about that
<1> but it still prints the negative one...
<2> Frank-23: consider providing a test case, not just a snippet, something to work with.
<1> when I use Long
<1> how with Long (as cl*** object) i can tell to system.println.... as unsigned?
<2> in my opinion you screw it up when ***igning the value.
<2> java does not have unsigned data types, except for char.
<2> primitive data types, that is.
<1> actually using ethereal i know what the value should be and they are all good...
<2> Frank-23: possibly related: http://www.google.com/search?complete=1&hl=en&q=byte+array+to+int+java&btnG=Google+Search
<1> It is just when I print it that it get bad
<2> Frank-23: what does the ethereal have to do with your possibly broken re***embling of the value?
<1> cuz I know what the value from the packet that i received is to be
<2> Frank-23: i don't see the relation to "you made a mistake in ***embling the value properly inside of java"
<2> java only knows signed primitive data types. if your value needs to be int i = 10; then you should perhaps analyse the outcome of converting the value in i to an int[4].
<1> its not really like there can be a mistake you take the 8 bytes and you put them at pox X by doing << or << and >>>
<1> http://www.noidea128.org/sourcefiles/15831
<2> Frank-23: there are 4 lines of code. even a single line can contain errors.
<2> if you provide a test case someone can look at it, until then we only have your speculation that you do everything correctly.
<1> everything is in that tho
<2> TESTCASE The SSCCE - Short, Self Contained, Correct (Compilable), Example: http://www.physci.org/codes/sscce.jsp (mirror: http://javafaq.mine.nu/lookup?364)
<1> or how can i do the two's complement on a negative long then?
<1> isnt it mylong & 0xfffffffff +1?
<1> actually i am sure it isnt that :D
<1> i just cant remember what it is
<2> Frank-23: here is the test case i had to build up myself based on your input. note that it took my time, even though it is your problem: http://pastebin.com/511034
<2> i am sure my input is "incorrect", but since you didn't provide something to work with that is the best i could think of right away.
<1> http://pastebin.com/511035
<2> Frank-23: possibly related, not sure if you can see the answers, i can for unknown reasons: http://www.experts-exchange.com/Programming/Programming_Languages/Java/Q_20273040.html
<1> not really, the only think i know is java is signed only so I am stuck
<3> for what are the keywords: future, generic and rest ?
<2> Frank-23: http://pastebin.com/511065
<2> Frank-23: code ripped from http://www.google.com/search?hl=en&lr=&q=convert%20long%20to%20byte%20array%20java&qt_s=Search&sa=N&tab=gw -> http://jdbm.sourceforge.net/V1.0/doc/api/jdbm/helper/Conversion.html -> http://jdbm.sourceforge.net/ -> http://prdownloads.sourceforge.net/jdbm/jdbm-1.0-src.zip?download
<2> there are other suggestions, to use dataoutputstream on a bytearrayoutputstream as well as NIO.
<1> k,
<1> will take a look thx
<4> good morning
<5> bah. typicall of our bloody technology department.. to get logging support I need to add all sorts of junk to the deployment procedure and install extra native tools, according to them, yet the standard loggin API works just as nicely and requires zero configuration
<6> Anyone available to help with what is probably a VERY DUMB question?
<2> make it easy for people to answer by not requiring them to ask what you want.
<6> k.
<6> I have a Exception in thread "main" java.lang.NoCl***DefFoundError
<2> is that the exact error message, did you leave anything away?
<6> And I have tried all the obvious things that I am aware of... cl***path including .
<6> Just the cl*** at the end: DTracker/cl***
<2> and that is the vital hint.
<2> you specified a filename, not a cl*** name.
<2> java wants to be told what cl*** to run.
<6> Doh!
<6> Leave off the ".cl***", no?
<6> Argh!
<6> Yes... that was it.
<6> I *knew* it was something dumb. Sorry... most of my work thusfar has been with jsp's.
<6> This is the first time I had a "main"
<6> and ran from the CLI
<6> Thanks a LOT!!!
<2> odd way to get started. java basics are required for anything else, be it j2me, j2ee, etc. pp. so learning java basics first should be first.
<6> Well, yah, I did that, but moved to JSP because that was what I needed to do at work. Now having to go BACK to CLI programs to fix a few of them.
<6> I sorta had to "jump in the deep end"
<2> i see.



<2> the sun java tutorial also helps with the first steps, see "hello world" chapter.
<2> TUTINDEX Quickly locate information about your topic of interest in the *big* tutorial index: http://java.sun.com/docs/books/tutorial/reallybigindex.html
<6> Yup... looked there. Just had a mental block or something with the filename vs. cl*** thing.
<2> yeah, happens, gotta keep doing things to keep fluent.
<2> (and to know the typical traps by heart)
<6> I'm not as dumb as I may seem :-) This was one of those, "just had to get SOMEONE else to look at it" things... and I knew that *shrug*
<2> yeah, you demonstrated some cluessfulness by mentioning cl*** path.
<6> Every once in a while I bang my head against the wall with a problem that someone just STARTING coding would see with a blindfold. :-)
<6> Heh... thanks.
<6> Like I said, I looked at the docs, the tutorials and, for whatever reason, just didn't SEE what you pointed out.
<6> And the instant you said it was a "bang myself on the forhead" moment
<6> Anyhow, thanks again... Time for bed... Goodnight
<7> I need a tutorial on encrypted communication between a java server and a C# client
<7> are there any good resources with samples out there for doing this ?
<2> donzaemon: i doubt it. fiddle with encrypted communication between java-java, then see how to transfer the approach to c#.
<8> anyone here has programmed j2me midlets for sony-erricsson k500 ?
<8> i have a question does k500 support comunication trough the COM port (via j2me ) ?
<2> Vaan: typically unlikely.
<2> j2me is considered for app programming, not system programming (accessing device specific stuff, like that com port).
<8> well i read some documentation and aparently there is a method but i dont know on what phones does it work
<2> ***ume next to none.
<8> hold on a sec
<8> Connection conn = Connector.open("comm:0;baudrate=9000");
<2> j2me is just an additional layer for writing programs in, not for accesing device specific stuff. if you want to do full scale system programming you may have to dive into whatever language/dev system that the respective OS supports best.
<8> this is the piece of code
<8> though i dont know on what models does it work
<2> you won't know until you have tested each individual device.
<8> well to be honest i have no idea what k500 OS has
<2> some may support j2me, but not that bit. or the j2me implementation may be broken. and some may have updated their j2me implementation and now they support this, etc. pp.
<8> i have tried on k500 and it generates an exception
<8> yeah i suppose i have a crappy phone but still ....
<2> to me it looks like you are in the process of finding out why j2me is a bad choice for anything but self contained apps.
<2> i never said anything about crappy phone.
<9> Hiya guys :-)
<9> tera
<0> hi
<10> please, I'm using Netbeans on Mandriva and trying to connect to mysql. I can access the database using webmin and terminal. I downloaded the connectivity driver and configured it in Netbeans but I still get a "Connection Refused" error - Shouldn't the Database URL be as follows "jdbc:mysql://localhost/dbname"?
<9> compFreak: Its not enough.. I will find.. hang on
<9> compFreak: http://www.google.com/search?sourceid=navclient&ie=UTF-8&rls=GGLG,GGLG:2005-19,GGLG:en&q=java+mysql+connection
<10> any one in specific
<10> ?
<9> first one is a good choice
<9> but I won't decide for you
<9> you should learn how to use google though
<10> I did, but the problem is from within NetBeans I suppose, most grateful, thanks
<9> hehe I won't say it so loud so netbeans lovers can hear it
<9> NETBEANS ****S!
<10> Thunder^: what alternative do you suggest?
<9> compFreak: A great free IDE is JCreator you can download from: http://www.jcreator.com/
<9> compFreak: An experienced free user IDE is: Eclipse, download from: http://www.eclipse.org/
<9> compFreak: A great experienced user IDE is: IntelliJ IDEA, download from: http://www.intellij.com/
<5> Thunder^: I've grown less displeased with netbeans lately
<5> Thunder^: It's starting to resemble a real IDE
<9> why use a wannabe when you can have a GOOD one?
<5> Thunder^: Because work wants me to use netbeans?
<5> Thunder^: And besides, I dont' use netbeans unless I have to. normally I use IDEA
<9> your works loss lol
<9> wlfshmn: yeah I know :-)
<9> anyways.. later all
<5> I only said I disliked netbeans less than I used to, but they will need to break my fingers before I release my grip on IDEA
<11> hahaha
<11> wlfshmn++
<5> 'lo there Epesh
<5> so, what's up?
<11> namuch
<5> personally, I'm trying to get some portlets to work using a homegrown framework written a while back when our technology department apparently had a policy that all coders had to freebase cocaine during workhours
<11> heh
<5> I get annoyed at this places severe NIH syndrome..
<5> -everything- seems to be customized or reimplemented inhouse, even if there are prefectly good free or commercial alternatives
<5> they even decided to standardize on ccc/Harvest (said freebasers were probably involved), but that choice wasn't enough. no, we need to have customized clients to interact with the beast
<12> hello
<12> which certification is easier? 1.4 or 5?
<12> scjp
<5> Leirbag: Would a more appropriate question be which one is the most relevant?


Name:

Comments:

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






Return to #java
or
Go to some related logs:

cum floodez pe mirc
#linux
#linuxhelp
#mirc
#mysql
mythstreamtvlive
#linuxhelp
#linuxhelp
#skype
#skype



Home  |  disclaimer  |  contact  |  submit quotes