-
Replied To a Post in Make Client a thread in UDP transfer
Wrap the code in a no-args method, eg public static void doMyStuff() { ... then new Thread(Client::doMyStuff).start(); Easy or what? ps: I don't like seeing all that in static methods, … -
Replied To a Post in slide puzzle game
That's a huge improvement in readability. -
Replied To a Post in Bitmap Flickering when animating
Acceleration may be due to starting a new timer each time you click - n timers = n times as many events per second (?) -
Replied To a Post in java servlet
http://bit.ly/1FmD8P3 -
Replied To a Post in Having a problem with this assignment
We've all been there and done that :) -
Replied To a Post in Having a problem with this assignment
Some of the cases do have breaks, but that's not the real problem. (sorry Ant695 but you're going to kick yourself when you read this...) You should be switching on … -
Replied To a Post in byte array print rounding values down
Because bytes are integer values. Doubles are 8 byte floating point values. When you assign a float value to a byte it's rounded down to the nearest integer value. You … -
Replied To a Post in How Can I Read A Specific Line From A Text File ?
You have no choice but to read the file from the start until you get to the line you want. (Unless the lines are all the same fixed length, in … -
Replied To a Post in Rendering Tiles with Effeciency
This sounds like the "premature optimisation" anti-pattern! I would concentrate on getting it working properly with a simple implementation (eg re-draw everything each tick). If you try to optimise too … -
Replied To a Post in Rendering Tiles with Effeciency
What are the Tile objects - are they RGB Images, or something that needs more elaborate "rendering"? Passing the position is not an issue. The only thing to worry about … -
Replied To a Post in java database system
Many many people run Java Database code in Eclipse, and it works very well. There are many tutorials on the web. If you would like help here you must explain … -
Replied To a Post in Rendering Tiles with Effeciency
The only thing that matters is that you load the tile once to create a Tile object that persists for the whole game. Provided you do that, `static` or `final` … -
Replied To a Post in BlueJ Some common problems
They are two different Objects that happen to have the same values in them. They occupy different places in the JVM's heap, and have different hashes. The == operator will … -
Revoked Solved Status for naive Bayes
Is there anyone who can start discussion on "naive bayes classifier" -
Gave Reputation to stultuske in Exception Handling
That is a nice assignment to learn to work with Exceptions. Thank you for sharing it with the community. If, however, your point was to attempt to convince us to … -
Replied To a Post in isle of birds
You are right. I am either blind or an idiot. J -
Replied To a Post in isle of birds
This looks like a pretty way of describing a Convex Hull to me. ps: I wonder why they specify the max number of records of data (20), but not the … -
Began Watching isle of birds
A super-intelligent species of coconut-eating tropical bird has decided to develop a scenic ight path roughly following the perimeter of the island that they inhabit. Owing to the impressive energy … -
Replied To a Post in AREA CALCULATOR JAVA
What's CircleClass? - I don't see any definition for that. -
Gave Reputation to Slavi in collection.sort each person address and phone number, so far i have done
shouldn't address and phone number be fields of the person class? Person Name Age Address PhoneNumber Then if you want to have your objects in the arraylist person1 = new … -
Replied To a Post in getLength
Do you have a question? -
Replied To a Post in 2d point cloud
This is a Swing context, so never use sleep etc. It looks like this code is the "model", so best to use a Java.util.Timer (runs in its own thread) -
Replied To a Post in Spreadsheets and JDBC
Do you have the spreadsheet as a file, or do you have all the data in arrays or some other data structure. If it's the latter then you can use … -
Replied To a Post in Deleting duplicate element from an Array
Ambrish Read the whole thread before posting. That way you won't look foolish when you post. -
Replied To a Post in Using Unicode to Produce Better Looking Cards and Decks
In the same vein... Unicode also has characters for displaying chess pieces, starting at u2654 -
Replied To a Post in Deleting duplicate element from an Array
I sense a non-argument here! If the goal is to write the simplest Java code then use a set. If this is a beginners exercise in arrays and algorithms then … -
Replied To a Post in Implementation of Genetic Algorithm
Without seeing what you have done, and because you hae not asked any specific questions, how can anyone help? -
Replied To a Post in can somebody explain this line of code to me
The dot refers to the current working directory. -
Replied To a Post in Having a Problem with Rock Paper Scissors Program
That's the compiler being a bit smart. It's checking that you always return a value as specified in the method signature. Suppose your data is such that none of the … -
Replied To a Post in Java Class file convert into java
Rubbish. Text pad will not convert a .class file to Java source. Never has. -
Replied To a Post in Old old programmer needs some personal help!
Ahhhhh APL what memories! I used APL in IBM in 1969 on an 1130 mini with a golfball typewriter terminal. I had to have my own personal APL character set … -
Replied To a Post in connect to server
http://bit.ly/18tAL1T -
Replied To a Post in connect to server
[Here's](http://docs.oracle.com/javase/tutorial/networking/sockets/index.html) a good tutorial on using input and putput streams over Sockets, but instead of using print streams, you can use ObjectOutputStream and ObjectInputStream to transfer your image object. -
Replied To a Post in Creating A Clas Using A Mutator And Accessor
You just copy/pasted your assignment without even a moment taken to explain what help you need. That's highly disrepestectful to the many people who give their time to help others … -
Replied To a Post in Algorithmic challenge
Nice! I think this one is done now? cheers J -
Replied To a Post in Algorithmic challenge
All I meant was If there are many letters, then there are many many possible sequences, and a random sequence has a good chance of being a solution. So trying … -
Replied To a Post in Algorithmic challenge
The statistical approach (see pdf above) is based on the monumentally unlikely assumption that all the 2^16 chars are equally likely, so given any sensible file size there are very … -
Replied To a Post in Algorithmic challenge
Two points: 1. It still involves guessing random strings until one is found,so not deterministic and in bad cases may run idefinitely long 2. The REGEX hides the fact that … -
Replied To a Post in Algorithmic challenge
Yes, there are UniCode symbols that need more than 2 bytes, but frankly they are a mystery to me. For substrings >= 2 chars I can't think of anything that … -
Replied To a Post in Algorithmic challenge
I don't know Python, but can't you just create an array of 2^16 booleans, corresponding to the 2^16 basic UniCode characters, do one pass of the string and set the … -
Replied To a Post in Algorithmic challenge
How short is "short"? If the string/file is less than 2^16 characters long then there will be at least one UniCode character that's not in the string, and which will … -
Gave Reputation to michael.james.90475 in Can't see why I'm getting this error
System.out.print ("there are "+weeks+"in "+month+"and "+days+"days"); -
Replied To a Post in Help! Java Newbie
Hello Michael: You may not see why, but the compiler does not agree with you. Did you not understand the previous posts, or were you too busy to read them? … -
Gave Reputation to michael.james.90475 in Help! Java Newbie
public void calcTemp (int tempM, int tempT, int tempW, int tempR, int tempF) { double averageTemp; averageTemp = (tempM + tempT + tempW + tempR + tempF)/5.0; return averageTemp; if … -
Replied To a Post in Jframe to display database
OK. I was talking about the user updating the database, so it's propbably not relevant here. If the database is updated every second then maybe you have to use a … -
Replied To a Post in Jframe to display database
The OP said "display", which may imply that its not an updatable view - in which case its a lot lot simpler to do! To handle updates, rather than a … -
Replied To a Post in Java Rotation Matrix 2 x 4
I had this problem a while back using AffineTransforms, and solved it like that. Eg if you want to rotate about the center of the object, move it so its … -
Replied To a Post in Jframe to display database
You can do this by using JDBC to read the data and a JTable to display it. It's a fairly common thing to do, so you'll find many examples and … -
Replied To a Post in Java Rotation Matrix 2 x 4
I guess that rotates about the 0,0 origin of your coordinate system. If you want to rotate about (say) the center of the object you can: translate the object so … -
Replied To a Post in Java Rotation Matrix 2 x 4
Where is the centre of rotation (is it the top left corner?)
The End.