| |
| |
| |
|
Page: 1 2 3 4 5 6
Comments:
<0> the bot factoids are listed at http://javafaq.mine.nu/lookup?383 the functionality is still read-only, but will be switched to read-write the next few days. <0> see you later <1> smsie: Clackwell did using the pircbot api's. <1> pretty nice framework that is, IMO ofcourse. My tutorial bot (on neko) also utilizes that. <1> oooh, now this is a good one <1> !testcase <2> The SSCCE - Short, Self Contained, Correct (Compilable), Example: http://www.physci.org/codes/sscce.jsp (mirror: http://javafaq.mine.nu/lookup?364) <1> ... I think. I liked Clackwell's shortcut better though ;) "What is a testcase, why would you write one?" <3> sscce.... *sneeze & cough* <3> Ah, X ! <4> hehe <4> where? <5> rabble rabble rabble
<6> http://rafb.net/p/LWKrOQ76.html <6> why doesnt it sort "---" as last? <7> hi @ all, requesting help concerning double to int conversion.. compiler means it cannot resolve symbol: method round.. <7> double steps = 2.3654; <7> int step = Math.round(steps); <4> honkey: because Math.round() returns a long, not an int <7> when i write long step = .. the error remains exactly the same <4> sorry, Math.round(double) returns a long. Math.round(float) returns an int <4> pastebin the code somewhere, let's have a look <7> got a working paste page somwhere? <4> pastebin.ca perhaps? <7> okay <7> http://pastebin.ca/340694 <7> i want to make a linear gradient.. but this conversion just doesnt work <8> ? <4> honkey: works fine as far as I can tell. <7> MyCanvas.java:14: cannot resolve symbol symbol : method round (double) <9> honkey: same here <8> do you have a method called round ? <8> that takes a double <4> it's Math.round() <7> yes.. <4> and that does <7> int myint = Math.round(mydouble); <7> no that's wrong <7> its <4> honkey: well, use a long. But your paste has used a long, so that's okay <7> long mylong = Math.round(mydouble); <8> paste the line and be done with it <7> long step = Math.round(steps); <10> long mylong = (long) Math.round(mydouble); <8> what does Math.round( double) return ? <7> a long <10> a double i think <10> are you sure ? <4> calchas: a long <7> yes <8> why do you think it returns a long? <4> kmh: according to the api docs anyway <8> ok <7> i am very sure ;) <10> ok ignore me then <7> no no <4> calchas: public static long round(double a) <7> yes.. <7> and i imported java.lang.Math <8> yep, I just checked <7> i can't understand it <10> understand what ? <7> why it just doesnt work like this <10> meaning ? <7> long mylong = Math.round(mydouble); <10> well that's fine <7> cannot resolve symbol symbol : method round (double) <10> if your program has a problem it is not with that line i think <5> honkey: Is your cl*** called 'Math'? <5> honkey: Try using the fully qualified cl*** name - java.lang.Math just to avoid any namespace confusion <10> did you define mydouble properly ?
<7> http://pastebin.ca/340694 <7> hmmm <7> i imported java.lang.Math <8> which java version are you compiling with <11> Is there a Math cl*** in the .* import? <4> honkey: grab this Scratch cl*** and see if it compiles: http://pastebin.ca/340706 <4> it compiles fine here at least <4> ah, Talden's notion sounds good <11> honkey - also, there's no need to import a java.lang.* cl***. <4> honkey: my scratch cl*** just extracts the part of your code that wasn't working for you. Try mine, if that compiles then I think Talden's idea is going to be the right one <11> honkey... does javax.microedition.lcdui.Math exist? <5> The other thing - does Math.round(double) exist in J2ME? <10> delete the import java.lang.Math <10> if you do that you need to/can use round i think <4> javax.microedition.lcdui doesn't seem to provice a Math cl*** <4> http://www.j2medev.com/api/midp/javax/microedition/lcdui/package-summary.html <11> honkey - you don't import java.lang.Math... it's implicitly imported for you. Use the explicit java.lang.Math.round(...) and see if you have a problem <11> rhowe - good point... no idea. <8> I doubt that <10> Talden : well there's that new alias feature with importing cl***es <7> scratch cl*** not working <10> oh <7> not working with <7> double steps = 2.3654; <7> long step = java.lang.Math.round(steps); <10> so you're running it in JME ? <7> yes but its a sony ericsson sdk.. <10> see smsie's comment then <7> but this shouldnt matter <4> ?! <4> what's the output of java -version? <4> oh <5> honkey: Maybe J2ME doesn't have <long> Math.round(<double>) <10> JME ****s <7> java version "1.6.0" <7> Java(TM) SE Runtime Environment (build 1.6.0-b105) <7> Java HotSpot(TM) Client VM (build 1.6.0-b105, mixed mode, sharing) <5> Hell, maybe J2ME doesn't have 'double' :) <10> hmm isn't that the normal java version ? <5> Yes, but J2ME is 'special' <5> In the olympic sense <10> honkey : don't use your regular desktop java, make sure you use the JME environment <10> rhowe : i mean his qyuery was for the installed SE not ME <7> hmm i'm using this sony ercisson sdk to compile it.. everything else worked fine.. its going to run on a cell phone.. <10> so he*s quering the wrong thing <10> honkey : the java on your desktop which very well might be used for your sdk/software is different from the tarhet platform you are compiling for <7> meaning there's no round function? <10> i guess (trusting smsie) :) <7> strange <7> i want to divide a number and then have a result with no decimal numbers.. <7> is there another way to do this than to round? <10> honkey : there should be but i don't know the micro edition at all <7> whats in bla when i just write: int bla = 12 / 13; <8> 1 <7> i mean there can't be any decimal numbers <8> try it and see <7> i can't convert to string :-D <7> so i cant write it out <7> and so on <7> its difficult <8> honkey do you know this detail in SE yet ? <7> ? <8> standard editiong <8> -g <10> http://java.sun.com/javame/reference/apis/jsr030/ <10> jme ****s big time <10> java.lang.Math is basically empty <4> what is there that you couldn't implement yby hand if it were needed? <10> smsie : all standard math functions ? <4> kmh: like...? <10> sin,cos,tan,exp,ln <4> kmh: it's a cut down java for devices with very limited resources...of course stuff had to go <10> rounf,floor,ceil <4> kmh: the trig functions are there
Return to
#java or Go to some related
logs:
TIELA ELTON
#linux #chatzone #AllNiteCafe #chatzone trophic look ubuntu #mirc googledeskop #linuxhelp priority_queue inheriting
|
|