35,618 Topics
![]() | |
Hey guys, I have a problem, I have to take a text and depending if a boolean - split_words is true or false I have to parse the text on some lines splitting the words or leaving them whole. for example, text is: This is the text I have to … | |
I need to create different strings inside a while loop, the problem is how to name them and not having them overwritten each time for ex: [CODE] while (i<10) { String x=scan.nextLine(); //here is the problem, x gets overwritten each time i++} [/CODE] Thank you in advance. | |
package sha; import java.security.MessageDigest; /** * * @author deepak */ public class Sha { public static void main(String[] args) throws Exception{ MessageDigest sha = MessageDigest.getInstance("SHA-1"); byte [] i1 = args[0].getBytes("UTF8"); sha.update(i1); byte[] hash = sha.digest(); System.out.println ("Result: Success"); // Display plain text and digest System.out.println ("Original plain text was : … | |
Hi, how can i count the users online on site? followed this guide [url]http://www.stardeveloper.com/articles/display.html?article=2001112001&page=1[/url] but i would like something that updates every 5 minutes and destroy the session when a user logs out | |
[CODE]mport java.net.*; import java.io.*; class Ur { public static void main(String[] arg) throws Exception { URL u = new URL("http://www.whitehouse.gov/"); InputStream ins = u.openStream(); InputStreamReader isr = new InputStreamReader(ins); BufferedReader whiteHouse = new BufferedReader(isr); System.out.println(whiteHouse.readLine()); } }[/CODE] It shows the error.. when i changed the site to [url]www.google[/url] .com \Program … | |
Hi all, I'm working on a project where I will have 4 ArrayLists of different types of items(stock, sales etc.). I have one list done but there is going to be a lot of duplication between the 4 list types. I'm trying to create a List superclass which will accept … | |
Hi guys, This week Ive been wrecking my head trying to write a code to run the following program: This program must test the dice 50 times. Then the results will be recorded and summarised. For each number (1 to 6), the program will print the most times that number … | |
Hello! I have the problem with my program visualization at different computers (but the same OS). Below you may see some code pieces related to creating the user interface. Everything is ok with this code at my computer. But I cannot understand why it produces different layouts at some other … | |
Currently trying to understand why this intersection method doesn't work properly, I think the problem is the if statement line but not sure if the problem solely lies there. I've included the necessary files to make my question clearer. The setIntersection method is part of the ArraySet class. The main … | |
i want to make a calculator in which a user allowed to input two numbers in text fieldand on pressing the particular operation button the operation performed.but how could i restrict user to input only numbers and no strings ?? [CODE] import java.awt.*; import java.awt.event.*; import java.applet.*; public class calsc … | |
what does it mean , use printf in JNI from C ??? i searched alot and found this, [url]http://java.sun.com/docs/books/jni/html/start.html[/url] but didn't find the specific answer :( i need the answer by tomorrow !:( help! | |
[CODE]else if(choice == 3){ System.out.println("what is your name? "); String name = kb.nextLine(); boolean x = Member.checkMember(name); System.out.println(x); } [/CODE] when i run this, it prints "what is your name?" and instead of waiting for me type in something, it just skips that part and go ahead and prints x. … | |
I am configuring Struts2 HelloWorld application in standalone TOMCAT.But when i run tomcat i am getting this error. Nov 25, 2010 11:17:11 AM org.apache.catalina.core.StandardContext start SEVERE: Error filterStart Nov 25, 2010 11:17:11 AM org.apache.catalina.core.StandardContext start SEVERE: Context [/struts2example] startup failed due to previous errors plz help | |
![]() | This probably wasn't clear from the initial prompt, but this is a multi part question I am trying to write a program that will scan what is being typed [not only into Eclipse, but into word or in a browser or whatever] My purpose for doing this is something along … |
hey guys , i had a problem with classes and objects , i need to get the class name form a text file for example and open an object from that class , is that possible if so how can i do it . the object parameters i can send … | |
Hi all! anyone can please tell me how to retrieve and display a blob data (which is a html page) which is stored in MySql databae by using JDBC on a jsp page Thanks. | |
I know that it's possible to "force" a class to have a certain function through interfaces, but is there any way to "force" a class to have and assign certain variables? Also, is there way to "force" a class to assign inherited variables? | |
I've been driving myself crazy with something I originally thought would be incredibly simple. Here's a really simple example of what I'm trying to accomplish: I have a picture sized 800x530, all I need to do is center this picture in a new image that is 800x800 with a black … | |
I know that multithreads in java allows me do multi tasks in the same time, but in the following code I'm not make a sense that the three threads done in the same time [CODE]public class myThreads { public static void main(String [] args) { System.out.println("Begin main Function"); mThread Thread_One … | |
Hi, it's been a long time since I've had a problem worthy of this forum, but I've got a real stumper. I've got some sockets, and after running through a get (through print writer sending a command, then an ObjectInputStream recieving an object) from the server code once, and trying … | |
Hello, I'm having some problems creating an executable jar. I have written all my code in Eclipse and am able to run the program in it, but I cannot create a jar that runs it successfully and I cannot use Eclipse to export a jar that does it either. Here … | |
Hi I am doing a java program. In which I have a jsp page, and on that I have two combobox. I have a create a java bean, in which I write a method "result" which return a arraylist. I want to populate the combobox by extracting data from database. … | |
I'm supposed to modify this method ([url]http://pastebin.com/6xF1pN51[/url]) to this (translated): "A faster algorithm to compute the average can be done by looping through the entire image in two passes in each session and make a one-dimensional mean value. In the first pass compute the mean value of the y-axis (one … | |
I have written a program to create a 4x4 grid Sudoku style. The numbers for the puzzle are read from a file and placed in the puzzle. As you can see, i have assigned the first numbers 'a' and the second 'b' etc However, i can not access the a,b,c,d … | |
Hello, How do I send a class (that extends from JFrame) back and forth between Client and Server? I would grateful for any pseudocode. Thank you! | |
Hello! I am facing a problem over and would like to ask if anyone knows the solution. On the following code i am looping files for sentences and then words. If a specific word is found i would like to store a String with the specific phrase. In example word[x-3] … | |
Alright, this is a school assignment. Unfortunately, we were given about a paragraph of info on apps so I'm not sure what I'm doing wrong. I know it's a pretty random app, but these are the elements that she wanted. My problem is that it runs infinitely when I run … | |
I need to provide web user interface... When client choose search option I want to call method which runs on remote cluster. So I need to use apache tomcat which runs on my localhost for servlet implemenation. From servlet I want to make RMI communication towards cluster machine and then … | |
Hi! I'm building a program which connects to a MySQL server. The program saves the server passwords in SHA format. There's one class responsible for converting and checking the passwords, and another one for DB connection. Now, when the user starts the program, (s)he types in the username and password. … | |
Could you please show me a very small program with the explanation how the data can be passed between classes. I said very small program (as small as you can) because I just started in Java and if the program is big I'll get lost !!! I'm a bit confused … |
The End.