32,204 Topics
| |
Hi guys, I'm trying to count the comparisons in the mergesort algorithm so that I can compare it to other sorting algorithms. I've managed to get a count function to work for insertsort but mergesort is being a complete pain! It's probably a very simple problem but I've experimented around … | |
i want to passing a data from a method but in array.. some error occur like array required but double found and incompatible type.. i don't know how to do it..help me anyone... example: [code]public double getFood(Date date, double AA, double BB, double CC) { }[/code] [code]// below is in … | |
hiii am currently trying to use owl api to load an ontology from protege and use reasoner to query it.I was able to load the ontology but craeting reasoner it showed null pointer exception error.Could sumone help me with the code?can anyone give me a code for loading reasoner and … | |
hi all, thanks for viewing this post.. i have a java constant class for label and button [CODE]public class ButtonConstant { public static final String EXIT=ButtonConstant.getString("BUTTON_CONTENT"); private static String getString(final String key) { System.out.println("inside buttonconstant"); return new LocaleHelper().getString(key); } } [/CODE] here the button content is the key which is … | |
Hi and thanks for viewing my thread, i have a problem with JComboBox. in my situation, i have a code that display JTextArea and JComboBox. this is my code: [code] public class JScrollPanes extends JApplet { //-------------------------------------------------- static String[] t_value2 = { "2", "3", "4", "5", "6" }; // ----------------------------------------------- … | |
hi...... i am working on network Monitoring project.[I] am facing lot of problems in 1)getting the api's (functions) for particular feature.. where can i get those api's for my project.... 2)I am trying SNMP api to work on the project which is in package src,com,sun,jmx,snmp but when i try to … | |
Hey lads. Doing a while loop question but am having a little difficulty with this question. I thought i knew enough to get questions like this correct but unfortunately not experienced enough. The following code is attempting to get sum of values in array that are less than 10. When … | |
Im writing the demo for my class to demonstrate each method. The class takes a number and assigns it to a month, or is supposed to. I have it working to say month 1 is January, month 2 is February and so on. I want to user to enter a … | |
Hi, Im currently in a situation to get all the application name that is currently running in windows but i can get only the processes that is currently running using the following code Process p = Runtime.getRuntime().exec("tasklist.exe /v "); Can anyone help me out in getting the application name... Thanks … | |
Hi, My requirement is to covert the .DOC file to .PDF with the [B]proper formating [/B] using java or in Web Dynpro Java. I have already tried to POI to reading the doc and iTEXT for converting to PDF but the problem is this scenario doesnot maintain any formating :(, … | |
hi, i have some problem with my project, can u help me??? I google but no solution found...:( I used hibernate, strust 2 and spring to manage transaction. I want to try catch username in New.java, username is a PK, this pape throw can throw excetption error but the server … | |
Hi My program is trying to load properties but it is saying it can not read a line of it. Does anyone have an idea why not? [code] dbProperties.load(dbPropInputStreasm); [/code] but error [code] Exception in thread "main" java.lang.NullPointerException at java.util.Properties$LineReader.readLine(Properties.java:418) at java.util.Properties.load0(Properties.java:337) at java.util.Properties.load(Properties.java:325) error here -------> at model.dao.DerbyDAO.loadDBProperties(DerbyDAO.java:160) at … | |
import java.awt.*; import java.awt.event.*; import java.text.*; import javax.swing.*; import javax.swing.border.*; import java.util.Arrays; import java.io.*; public class BankAccount extends JFrame { // Make these variables publicly available String file = ("THUS.txt"); public static String acctNumber ; public static String custid , acctDateOpened; public static double balance ; private static final String … | |
[CODE] String test = "for (int i = 55; i < 60; i++)"; String line = ""; String replace = " Tester." + "n" + Tester.counter + ";"; Pattern p = Pattern.compile(reg); Matcher m = p.matcher(test); if (m.find()) { String s = "public static double n" + counter + " … | |
ok, so i have this [B]so far [/B] [CODE] String p = "(http|ftp|https):" + // sees if the proto is any of these " (\\:[\\w^\\:]+:)? " + // gets the sub-proto " \\/\\/" + // the two forward slashes "([\\w*.]+)" + // gets the subdomain(s), domain and tld "[\\:\\w*^"; [/CODE] … | |
Hi experts, I have done a very simple snake game but there are some error.. I would like to make it continue with 3 lifes before game over but I fail. Did any1 can help?? Here is the code: import java.awt.*; import java.awt.event.*; import java.applet.*; import javax.swing.*; import javax.swing.JOptionPane; import … | |
I am working on this programming probability assignment for class and I am having trouble figuring out how to work this problem below. 1.) Design and write a computer-based simulation to find an empirical probability for landing on GO TO JAIL/Boardwalk. | |
Hi guys, I'm trying to count the comparisons in the mergesort algorithm so that I can compare it to other sorting algorithms. I've managed to get a count to work for insertsort but mergesort is being a complete pain! It's probably a very simple problem but I've experimented around with … | |
Hi guys, I'm trying to count and time the comparisons in the mergesort algorithm so that I can compare it to other sorting algorithms. I've managed to get a count and stopwatch function to work for insertsort but mergesort is being a complete pain! It's probably a very simple problem … | |
Here is an example of the return statement in question: [CODE]public boolean either24(int[] nums) { boolean n1 = false; boolean n2 = false; for (int i=0;i<nums.length-1;i++) if (nums[i]==2 && nums[i+1]==2) n1 = true; else if (nums[i]==4 && nums[i+1]==4) n2 = true; return !n1 && n2 || n1 && !n2; //<----what … | |
The board game scrabble works by assigning points to wooden tiles arranged in cells on a board. It's described here:[url]http://en.wikipedia.org/wiki/Scrabble[/url]. We'll simplify this considerably, and consider the following question. We begin with the letter-scoring scheme from Scrabble: a = 1, b = 3, c = 3, d = 2, ..., … | |
Hi, I am trying to do an assignment about buying zoo tickets but I am becoming stuck on the last hurdle when trying to get the accumulate number. [CODE]import java.util.Scanner; public class ZooTaking { public static void main(String[] args) { // Create a Scanner Scanner input = new Scanner(System.in); // … | |
I have a difficult time with getting the programs started. I read the book but I am not getting anywhere. There just is not enough examples to help me. The book we are using for CSC 135 is called Java Software Solutions by Lewis & Loftus. We are starting on … | |
Is it a good programming practice to pass List as a parameter in a Constructor? Just learning.... Thank you .. | |
Hi everyone, I've written a small program to convert combinations of English characters into their corresponding Chinese and Japanese equivalents, and it's working on my computer at home, so so far so good. However, I'd also like it to work on computers which don't have Chinese or Japanese fonts installed, … | |
Code to Execute an SQL Script in JDBC. The SQL Script should have comments starting with - or -- only on new lines and each command should end with a ; . Reading a sql file and putting all of it in a string variable and feeding to the execute … | |
I've not programmed extensively, and I've got to create a program that's beyond my knowledge. I'm trying to create a program that will help me measure the amount of memory a certain IP routing algorithm will use to store address prefixes. The program must convert each dotted decimal address to … | |
just wondering if anyone could explain this... [code] if(loginF.equals("root") && passwordF.equals("root"))[COLOR="Red"]; [/COLOR] ---> if this semicolon is here, my program works.. but i can't have an else statement if i take out this semicolon, the code within the if statement don't execute.. but i can then have an else statement … | |
I am tring to draw a house & street & garden but i stop....? could plz someone help me and complete my job this is my code import java.awt.*; import javax.swing.*; public class Zzzzzzzzzzzzzz extends JApplet { public void paint(Graphics a) { house(a); door(a); roof(a); rode(a); } void house(Graphics b){ … | |
Hi all, I am a beginner in java.I have written a code to design a layout of a traffic signal.The lights are working fine.The problem i am facing is to randomly generate cars from all directions and to stop them at the junction.I am not understanding how to use repaint.Here … |
The End.