32,204 Topics
| |
I'm making a map editor for my game and I'm at the point where I need to save the map to a file. My Maps contain multiple layers though, which will be stacked on eachother for display. I know I could save each file seperately but I wanted these to … | |
import java.io.*; import java.net.*; import java.nio.ByteBuffer; import java.nio.charset.Charset; import java.text.DecimalFormat; public class Client { static double difference=0; static int totalTransferred=0; static StartTime timer; static double previousTimeElapsed=0; static int sizeDifference=0; static int previousSize=0; public static void main(String args[]) throws Exception { final int lossRate = Integer.parseInt(args[0]); final String hostName = args[1]; … | |
I want convert the .csv file to .arff file can someone suggest what to do? my code is: package csvtoarff; import java.io.File; import weka.core.Instances; import weka.core.converters.ArffSaver; import weka.core.converters.CSVLoader; public class CsvToArff { public static void main(String[] args) { try{ String f1 = "C://Users//user//Desktop//testfold//test.csv"; String f2 = "C://Users//user//Desktop//testfold//output.arff"; // load the … | |
help please PART 1: Quiz Version 1, simple quiz [100 marks] a) Your Quiz class will need the following additional methods as shown in the instructions in Quiz.java (See sections marked “TODO”). 1. void printQuizClosedMessage() [5] 2. void close() [5] 3. void showAttemptsRemaining() [5] 4. void showSum() [5] 5. void … | |
/*Additional selection structures 16/3/2015 Programme to display weight on a given planet*/ import java.util.*; public class planets { public static void main (String []args) { Scanner keyboardIn = new Scanner (System.in); int weight; char planet; double planet_weight; System.out.print ("Enter your weight"); weight = keyboardIn.nextInt (); System.out.print ("Enter your planet of … | |
Hoe efficient is it to convert java codes into web based programs? | |
I want to automate an application developed in java and swing controls using python. I tried pywinauto but it is not able to detect java objects. I tried using QTP but my applications dynamic java windows dosen't hava parent window so not able to use it . Any suggestion of … | |
double fileSizeKB = (fileByteArray.length) / 1024; double transferTime = timer.getTimeElapsed() / 1000; double fileSizeMB = fileSizeKB/1000; double throughput = fileSizeMB/transferTime; System.out.println("The size of the File was "+fileSizeMB+ " MegaBytes"); System.out.println("Time for transfer was " +timer.getTimeElapsed()/1000+ " Seconds"); System.out.printf("Throughput was %.2f MB Per Second\n",+throughput); System.out.println("Number of retransmissions: " + retransmissionCounter); byte[] … | |
So I know in a Tile Based game its more effecient to have static final instances of each tile, then populate your array with those instances. But what about Rendering? You have to pass the position that tile should be rendered into your method you use for rendering. Is there … | |
I have facing few problems with my lab questions. and i am using BlueJ software for my lab work. 1. Are two objects equal if their state is the same? And i answered No, however they are still different objects with the same state. But how can i explain it? … | |
I am trying to develop an interface for my hotel reservation system where for a particular date, the interface should display rooms that are booked so that the staff can book the rooms that are available (similar to airline seating reservation system which displays reserved and open seats) Can I … | |
Who can help me and guide me through the setting up the server using Netbeans/ Tomcat. It is necessary and I have tried it many times, but not able to do it until now.. Please help/ guide. | |
Hey everyone! I have to write a program that generates random shapes in a window, but when the window is resized the program can still remember the shapes and redraw the same ones. My code so far draws the random shapes, but when I resize the window, the shapes change … | |
I have a class project i am working on that is aimed at creating an airport weighing system. The program inputs the weight of the passenger and the weight of the luggage to be transported and computes the total to find whether a passenger is eligible to travel or not. … | |
I am having trouble figuring out how to read input from the keyboard and inserting that into a LinkedList. Any help or suggestions would be greatly appreciated. import java.util.*; import java.util.Scanner; import java.io.*; public class listlist{ public static void main(String [] args){ LinkedList ll = new LinkedList(); Scanner in = … | |
Write a program in java for a user defined exception named as Illegal Age Exception. If the age entered by the user is less than 18 or greater than 60, then the program should raise a user defined exception which is explicitly handled by the code. | |
I run build.xml file in linux is fine but not in windows ant: build.xml:14 taskdef class net.sourceforge.cobertura.ant.InstrumentTask cannot be found using the class loader AntClassLoader [Path to my cobertura\cobertura-2.0.3-sources.jar] | |
This is what I have in the main class: public static void main(String[] args) { final login login = new login(); login.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); login.setVisible(true); login.setResizable(false); login.btnEnter.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent e) { login.inputText.getText(); new crosswordWindow().setVisible(true); login.dispose(); } }); } *there is a third class called login, where the jTextField is. The … | |
| I am currently busy working on an instant messenger program using the UDP `DatagramSocket` and `DatagramPacket` instead of the usual connection-based `Socket` and `ServerSocket`. I need the server-side of the application to check the online status of its clients. I have attempted doing this by connecting to the server using … |
How do I display the individual integers from the scanner input stream for example if the user enters 500 I would like to display it as 5, 0, 0. Here is the code guys import java.util.Scanner; public class Digit { public static void main(String[] args) { int number, i = … | |
public void setState(String state) { if(state.length() <=3) this.state = state; else this.state = state.substring(0, 2); `}` | |
Hello All! I'm reviewing Java (SE, ver 8) and I'm using one of the "Teach Yourself Java..." books. I'm up to the chapter on Java Web Start and I'm stuck. I'm trying to run the sample app (a .jnlp file), but I get an error that reads: "Application Blocked by … | |
Hello guys. Im having trouble figuring out why I keep getting an error saying the compier cant find my class. its all the way down at the end of the code called circle class. Any suggestions? package circle.pkg7.pkg2.app; import java.util.Scanner; /** * * @author Jay */ public class Circle { … | |
import java.util.ArrayList; import java.util.Collections; public class PersonMaker { public static void main(String[] args) { ArrayList<Person> personAL = new ArrayList<Person>(); ArrayList<Address> addressList = new ArrayList<Address>(); Address c0 = new Address("2100 Pleasant Hill road", "duluth", "GA", "30096"); Address c1 = new Address("3392 fairway oaks", "lawrenceville", "Georgia", "30044"); Address c2 = new Address("4493 … | |
import java.util.ArrayList; import java.util.List; public class Task7 { static int count=0; String arr[]=new String[40]; /** * * @param list * @return an array consisting of vowels from the passed character array, * in the order they appear. for example, if list = {'t','h','e','s','a','u','r','u','s'}, * the method returns {'e','a','u','u'} */ public … | |
import java.awt.Frame; import java.awt.event.KeyEvent; import java.awt.event.KeyListener; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import javax.media.opengl.*; import javax.media.opengl.awt.GLCanvas; import javax.media.opengl.glu.*; import com.sun.opengl.util.Animator; import com.sun.opengl.util.FPSAnimator; public class Object3D implements GLEventListener, KeyListener { GLProfile glp; GLCapabilities caps; GLCanvas canvas; GLU glu; float rotX = 0.0f; // Rotate screen on x axis float rotY = 0.0f; // … | |
My build.xml can run junitTest well but when I tried to build with cobertura instrument, JunitTest failed, Why? <target name="instrument" depends="compile"> <echo> ====== run target instrument ==== </echo> <!-- Remove the coverage data file and any old instrumentation. --> <delete file="${junit.dir}/cobertura.ser" /> <delete dir="${instrumented.dir}" /> <!-- Instrument the application classes, … | |
can anyone say best way to convert java class file into java file appreciate for your help thanks | |
I am trying to make a code that makes a random point cloud that changes every five seconds for a minute. I have it so that it makes the inital cloud, but I am stuck on how to make it change every five seconds. private class newCloud implements ActionListener { … |
The End.