32,204 Topics

Member Avatar for
Member Avatar for Doogledude123

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 …

Member Avatar for ~s.o.s~
0
324
Member Avatar for michael.james.90475

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]; …

Member Avatar for michael.james.90475
0
531
Member Avatar for vivekH

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 …

Member Avatar for vivekH
1
4K
Member Avatar for sabata mmoledi

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 …

Member Avatar for DaveAmour
0
193
Member Avatar for bongumusa
Member Avatar for Ant695

/*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 …

Member Avatar for JamesCherrill
0
184
Member Avatar for victorblue
0
76
Member Avatar for Ragunath_1

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 …

Member Avatar for vegaseat
0
67
Member Avatar for michael.james.90475

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[] …

Member Avatar for JamesCherrill
0
230
Member Avatar for Doogledude123

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 …

Member Avatar for JamesCherrill
0
174
Member Avatar for gahhon

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? …

Member Avatar for gahhon
0
201
Member Avatar for Shilpa_3

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 …

Member Avatar for stultuske
0
185
Member Avatar for Gurjeet Singh

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.

Member Avatar for Shilpa_3
0
139
Member Avatar for compscigirl

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 …

Member Avatar for mKorbel
0
208
Member Avatar for ema-miles

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. …

Member Avatar for Ant695
0
400
Member Avatar for cabosun

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 = …

Member Avatar for stultuske
0
7K
Member Avatar for Vaibhav_5

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.

Member Avatar for stultuske
-1
134
Member Avatar for Wei_3

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]

Member Avatar for peter_budo
0
112
Member Avatar for fredy21

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 …

Member Avatar for Phaelax
0
174
Member Avatar for Search_not

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 …

Member Avatar for Search_not
0
250
Member Avatar for Varunkrishna

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 = …

Member Avatar for Varunkrishna
0
1K
Member Avatar for sameer.a.awan1

public void setState(String state) { if(state.length() <=3) this.state = state; else this.state = state.substring(0, 2); `}`

Member Avatar for Slavi
0
50
Member Avatar for TekknoDraykko

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 …

Member Avatar for TekknoDraykko
0
204
Member Avatar for jjones0150

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 { …

Member Avatar for stultuske
0
308
Member Avatar for sameer.a.awan1

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 …

Member Avatar for stultuske
0
191
Member Avatar for Praveen_10

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 …

Member Avatar for JamesCherrill
0
144
Member Avatar for michael.james.90475

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; // …

0
134
Member Avatar for Wei_3

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, …

Member Avatar for Wei_3
0
941
Member Avatar for anandhachandru

can anyone say best way to convert java class file into java file appreciate for your help thanks

Member Avatar for anandhachandru
0
617
Member Avatar for alemojarro

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 { …

Member Avatar for JamesCherrill
0
93

The End.