32,199 Topics
| |
Unfortunately Array's aren't my strong point and this final lab is giving me a bit of trouble. Basically I need to make it so the code will return true if the given array is sorted in ascending order (lowest to highest). or it will return false. Then i need to … | |
Hello everybody, I have a xml socket server which get data from xml sockets out of actionscript3. Now I'm having a lot of if statements. Can I use another way to make my code more clean? Ivibot is a piece of hardware my school provided. LedBlink is a runnable class … | |
Hi, I'm iterating an Arraylist inside a synchronized method, and I've set the Arraylist synchronized inside the method, but I still got the error ConcurrentModificationException. Why this is happening? [code] private synchronized TaskInProgress findTaskFromList( Collection<TaskInProgress> tips, TaskTrackerStatus ttStatus, int numUniqueHosts, boolean removeFailedTip) { synchronized(tips) { Iterator<TaskInProgress> iter = tips.iterator(); while … | |
Hi guys, Im trying to write a program that find the biggest rectangle by its area. I've tried and it doesnt seem to compile. Can you help me please, thanks. [CODE] public class Rectangle { private int width; private int height; public Rectangle(int width, int height) { this.width = width; … | |
[CODE]import java.io.FileReader; import java.util.Scanner; public class diverScores { public static void main(String[] args) { Scanner kb = new Scanner(System.in); double [] score = new double [8]; double totalScore = 0.00; Scanner fileScanner=null; try{ fileScanner= new Scanner(new FileReader("divingdata.txt")); }catch(Exception e) { System.out.println("Input file not found"); System.exit(1); } while(fileScanner.hasNext()) { String fileLine … | |
i am working on a project in which, i have a text area and when the user enters some details in that text area, the data should be saved in a text file and the path should be saved in the database, when another user wants to access that text … | |
I have never heard of it. I am researching on how to implement the internet to my program and I come across it. it seems to be easier then what I was trying to do for the past while. Could someone please link me to a website that can provide … | |
Hello friends, Forgive me If I am posting this on a wrong Section. I am developing an application in Android. In that I need to compare a Audio file with the Audio input(Singing Voice input) and tell that whether that is same song or not. So I dont know which … | |
Hello everybody!! I'm trying to print a *.pdf file from Java code, and the printer out gives the right document, but smaller than the original pdf (smaller text, images, margins, everything), the print result seems shrinked from the original... Here is the code I'm using: [CODE] File f = new … | |
When I parse this date: [code] SimpleDateFormat sdf = new SimpleDateFormat(); Date utilDate=sdf.parse(txtFieldArray[i].getText());//12/31/1955 java.sql.Date sqlDate=new java.sql.Date(utilDate.getTime()); instructorBean.setStartDate(sqlDate); [/code] error [code] May 9, 2011 7:10:43 PM view.forms.profileForms.InstructorProfileForm actionPerformed SEVERE: null java.text.ParseException: Unparseable date: "12/28/1955" at java.text.DateFormat.parse(DateFormat.java:337) [/code] Can someone show me some code on a date that can be parsed? | |
Hello Members, Given an undirected Graph, G, is there any standard algorithm to find the value of k, where (k-1) represents the number of vertices whose removal results in a graph that is still connected and the removal of the kth vertex makes the graph disconnected? Thank you! sciprog1 | |
Hi guyz. My challenge is that I can manually run the following command from linux shell: [CODE] sh /usr/bin/sshlogin.sh 192.168.0.37|danga|dan1ga|java -jar /shared/smsfiles/coin/MySSH.jar [/CODE] successfully. The challenge from java is getting the same command to run. The snippet of my code that handles this is as follows, though it does not … | |
i know how to add many things into arraylist at once, like: [CODE] String [] things = {"eggs ", "pie ", "lasers ", "hat "}; List<String> list1 = new ArrayList<String>(); for (String x: things) list1.add(x); [/CODE] but is there a way to add things into arraylist iteratively one by one? | |
[INDENT]We know that out of local variables if no initialization is provided, a default initialization takes place [B][I]at the time of[/I] class loading [I]or[/I] instantiation[/B]. :icon_rolleyes:But the question is [U]where it takes place in a programming code?[/U] Either [COLOR="Green"]it is after the declaration then and there to protect and optimise … | |
hey guys, when do we use "long"? and what is it anyway? like: [B] public [COLOR="Red"]long[/COLOR] someStuff([COLOR="Red"]long[/COLOR] n) { ..... ..... } [/B] thanks :) | |
First page & second page refer attachment!! I have success validate the new limit cannot exceed 2000 for 3rd Party Transfer. Coding for first page !! -------------------------- [CODE]<jsp:useBean id="labelBean" scope="session" class="my.com.infopro.ibank.ui.bean.LabelBean" /> <jsp:useBean id="txLimitMaintBean" scope="session" class="my.com.infopro.ibank.ui.bean.TxLimitMaintBean" /> <jsp:useBean id="lang" scope="session" class="my.com.infopro.ibank.ui.bean.LanguageBean" /> <%@ page import="java.util.Iterator"%> <%@ page import="my.com.infopro.ibank.dto.TxLimitMaintDto"%> <%@ page … | |
| Hi, i am currently doing a system for the rental video. I am new to java coding.. Problem is how to add data to access database using java coding in method? Thank you. |
I have been reading a textbook on Java-- I am a C/C++ programmer so my view of addresses and pointers are based on what I know from those languages. I am trying to make sense of something the textbook said about object addresses. The textbook basically said when one object … | |
Hi, I am trying to write run a small script in java console. I managed to compile the script but getting an error while running them. How do i get it fixed. I Have attached the error screenshot here. I know its a noob question as i am unable to … | |
I understand this is not Java related, but since [B]a lot[/B] of Java Developers out there use Netbeans as their IDE. I figured that I'll get help here easier. Anyways, I downloaded Netbeans 7 (the full version), and tried installing it on Windows 7. The installer starts, and right after … | |
The software developer of an object-oriented programming API wishes to design a Stackdata type by ‘adapting’ an underlying Listdata structure. Describe how the Adapter Design Patterncould achieve this via:- i.Inheritance ii.Composition Please reply as soon as possible. I have my exam. | |
i am using tomcat7.0,jdk1.6,and i downloaded the jax-wsri jar files. first i created folder named ws in webapps in tomcat folder. then in ws folder i created WEB-INF folder and META-INF.and in WEB-INF i created folder classes&folder lib. then i created the web service class as follows [CODE]package hello; import … | |
i have a problem. i don't know where i am making the mistake.... i need to refreshed my JPanels automatically with time..... i have used timers for this. i used in the constructor of the class... public class HoursPanel{ //.... //..... public HoursPanel(){ int delay = 60000; Timer timer = … | |
I have a program that runs a binary search tree and lists a menu of options. Two of the options are the only ones I can't seem to get to work which are saveToFile and buildFromFile. These methods include asking for a name to save as an output file (save) … | |
I have an assignment below: 1. Create a class called Furniture with the following attributes: furnitureType – a String modelNumber – a String price – double quantitySold – int totalCharge - double. Provide the following: 1. A non-default constructor for Furniture 2. Settors and gettors for price and furnitureType (don’t … | |
Hi everyone, As part of an assignment we have to develop a recursive backtracking solution in java to a sort of knapsack problem - you have a 150mm bar, a set of orders you have to cut and you need to come up with the best solution that gets the … | |
Hello, let's say I have these classes: [code=java] public class ClassA extends JFrame{ private JButton btn1; private JPanel panel; public JPanel getPanel(){ return this.panel; } ClassA(){ this.setSize(500,500); this.setVisible(true); panel=new JPanel(new FlowLayout()); btn1=new JButton("LALALA"); this.add(panel); panel.add(btn1); } } public class ClassB { ClassA a; ClassB(ClassA a){ this.a = a; JButton button2 … | |
I'm having trouble formatting a binary tree. In my program, the tree format should print every output as such: 35 30 29 25 24 20 15 This is the code that I have thus far. [CODE]public void treeFormatTraversal(){//begin int level = 0; if(root !=null) treeFormatHelper(root, level); else System.out.println("\nTree is Empty\n"); … | |
| Hi all, I recently made a web crawler as part of a Uni team project building a small search engine. I've managed to incorporate it into our GUI, there is a button which starts the crawling process by creating the crawler in a thread. (I did this because otherwise the … |
Hello, I'm making an application that supports sending text/files. It will use a server and 2+ clients. The clients won't communicate directly with each other, their messages will be forwarded by the server. My problem is this: in C++, after starting a client, I'd have 1 thread stuck on RECEIVE … |
The End.