|
hi, every one!!!!
I need a java code for tranfarring the process from one client to another client.....please..any one help me!!!
|
|
|
|
|
hello all,
i am new to java and
I'm trying to add a new library 'hibernate-3.2.4.sp1.tar.zip', to netbeans. I understand that to do so, I click tools;libraries;add new library and then select the folder which contains all the .java files. I've done this, but still when I try to import that library, it the IDE says that it doesn't exist? What's the issue? Either the correct procedure for how to add new libraries or an analysis of my issue from my vague description would be great! Also, when I name the library, do I import the name I give it, or the name of the file? For example, if the name of the file is hibernate, and it contains some files. i write
import org.hibernate.*;
but in org package doesn't exist the hibernate.
Regards!
---------------------
Areff Bahrami(KAVEH)
Areff.HB@Gmail.com
---------------------
|
|
|
|
|
Hi,
I have a Fortran program which I have to convert into Java originally. I have converted the code completely but can't get appropriate resutls. The code contains lot of arithmetic calculations using double precision data type of Fortran.
I believe the data types of Java are based differnt than Fortran. Fortran's double precision type is based on IEEE756. I want to know how to convert these double precision calculations into Java. For example:
double precision d1 = 0.3648564D0;
d1**2
DSIN(d1)
DCOS(d1)
The above are my main concerns which I find very difficult to convert. I use Math.sin & cos for DSIN & DCOS. But Fortran 77 deals somthing differntly with double precision. How to convert/translate that into our java application is what I am looking for.
If you can provide the same for C++ that would also be a plus for me, I will use the code accordingly of Java application.
Please help me out. Am stuck up very badly.
Thanks
Terry
|
|
|
|
|
do you know something called "javadoc" ? just kidding
in java (and in C++), the type double handles such precision.
then, you just have to call the correct functions, which you'll find reference in the online documentation.
in C++, just #include <cmath> and use sin() and cos() like this.
in Java, just call Math.sin() and Math.cos()...
|
|
|
|
|
Hello
i'm just downloaded apache tomcat 6.0 but i can't set it to netbeans 6.0.1 please help me...
|
|
|
|
|
I have this problem too, I don't know how I should use Apache Tomcat 6.0 in my NetBeans, is there anyone that can help?
While (true) { Human.isLearnable = true; }
|
|
|
|
|
I just finished writing this program, what it does is takes your name and assigns each letter a number and adds them up,
ie. Tanner would give you 27
The program then checks to see if the number is one or two digits, which in this case it is two (2 and 7)
It then adds those two digits together. Comments explain everything
What I would like input on is if anyone could give me a couple pointers on how to optimize my code, make it faster or take away some of the writing to reduce it's length
import javax.swing.*;
public class bruce_tanner_A2Q2
{
public static void main (String [] args)
{
int firstNameTotal = 0;
int secondNameTotal, thirdNameTotal;
int currentLetter;
String input = JOptionPane.showInputDialog("Numerology Calculator -\nEnter a Name");
int inputLength = input.length();
for(int i = 0;i < inputLength;i++)
{
currentLetter = (int)input.charAt(i) % 60;
if (currentLetter == 5 || currentLetter == 14 || currentLetter == 23
|| currentLetter == 37 || currentLetter == 46 || currentLetter == 55)
{
firstNameTotal++;
}
else if (currentLetter == 6 || currentLetter == 15 || currentLetter == 24
|| currentLetter == 38 || currentLetter == 47 || currentLetter == 56)
{
firstNameTotal = firstNameTotal + 2;
}
else if (currentLetter == 7 || currentLetter == 16 || currentLetter == 25
|| currentLetter == 39 || currentLetter == 48 || currentLetter == 57)
{
firstNameTotal = firstNameTotal + 3;
}
else if (currentLetter == 8 || currentLetter == 17 || currentLetter == 26
|| currentLetter == 40 || currentLetter == 49 || currentLetter == 58)
{
firstNameTotal = firstNameTotal + 4;
}
else if (currentLetter == 9 || currentLetter == 18 || currentLetter == 27
|| currentLetter == 41 || currentLetter == 50 || currentLetter == 59)
{
firstNameTotal = firstNameTotal + 5;
}
else if (currentLetter == 10 || currentLetter == 19 || currentLetter == 28
|| currentLetter == 42 || currentLetter == 51 || currentLetter == 0)
{
firstNameTotal = firstNameTotal + 6;
}
else if (currentLetter == 11 || currentLetter == 20 || currentLetter == 29
|| currentLetter == 43 || currentLetter == 52 || currentLetter == 1)
{
firstNameTotal = firstNameTotal + 7;
}
else if (currentLetter == 12 || currentLetter == 21 || currentLetter == 30
|| currentLetter == 44 || currentLetter == 53 || currentLetter == 2)
{
firstNameTotal = firstNameTotal + 8;
}
else if (currentLetter == 13 || currentLetter == 22 || currentLetter == 45
|| currentLetter == 54)
{
firstNameTotal = firstNameTotal + 9;
}
}
secondNameTotal = ((firstNameTotal % 10) + (firstNameTotal - (firstNameTotal % 10)) / 10);
thirdNameTotal = ((secondNameTotal % 10) + (secondNameTotal - (secondNameTotal % 10)) / 10);
if(thirdNameTotal == 1)
System.out.println(input + " (1) is ambitious, independent, and self-sufficient");
if(thirdNameTotal == 2)
System.out.println(input + " (2) is supportive, diplomatic, and analytical");
if(thirdNameTotal == 3)
System.out.println(input + " (3) is enthusiastic, optimistic, and fun-loving");
if(thirdNameTotal == 4)
System.out.println(input + " (4) is practical, traditional, and serious");
if(thirdNameTotal == 5)
System.out.println(input + " (5) is adventurous, mercurial, and sensual");
if(thirdNameTotal == 6)
System.out.println(input + " (6) is responsible, careful, and domestic");
if(thirdNameTotal == 7)
System.out.println(input + " (7) is spiritual, eccentric, and a bit of a loner");
if(thirdNameTotal == 8)
System.out.println(input + " (8) is money-oriented, decisive, and stern");
if(thirdNameTotal == 9)
System.out.println(input + " (9) is multi-talented, compassionate, and global");
}
}
|
|
|
|
|
<font color="blue">for</font> (int i = 0;i < inputLength; i++) {
currentLetter = (<font color="blue">int</font>)input.charAt(i) % 60; <font color="green">
currentLetter = input[i]; <font color="green">
<font color="blue">switch</font> (currentLetter) {
<font color="blue">case</font> 'A': <font color="blue">case</font> 'J': <font color="blue">case</font> 'S':
firstNameTotal += 1;
<font color="blue">break</font>;
<font color="blue">case</font> 'B': <font color="blue">case</font> 'K': <font color="blue">case</font> 'T':
firstNameTotal += 2;
<font color="blue">break</font>;
<font color="green">
}
|
|
|
|
|
Oh dear.. cases totally slipped my mind. Also, I never knew that you could do something like
currentLetter = input[i] . I'm assuming that that will access the String as a character array and return the letter at position i?
|
|
|
|
|
TannerB wrote: I'm assuming that that will access the String as a character array and return the letter at position i?
yup. the [] operator gets the character at position passed in parameter (0-based).
also, a thing I shown in my sample, which i'm not sure you noticed, is using the characters literals instead of their ascii code... this is very handy when you come later and read back your code
|
|
|
|
|
Hello everybody,
I would implement it like this to avoid if or switch statements :
int incrementAmount;
for(int i = 0;i < inputLength;i++){
currentLetter = input.charAt(i);
incrementAmount = (Character.toUpperCase(currentLetter)-'A')%9+1;
firstNameTotal += incrementAmount;
}
Also we can replace :
incrementAmount = (Character.toUpperCase(currentLetter)-'A')%9+1;
By :
incrementAmount = (Character.toUpperCase(currentLetter)-'A')%('J'-'A')+1;
just to be more readable, that means "restart counting after the letter 'J'", which is better than "restart counting after the 9th letter".
I also just noticed that you don't manage the case where thirdNameTotal is equal to 0.
|
|
|
|
|
yup, that's a pretty smart implementation... i didn't took too much time to think on a better optimization, but yours is good
|
|
|
|
|
i have make an appliction on j2me and use digestmesage from java .securtiy but on cldc 1.1 the java.securty not supported
ihad import that
import java.security.MessageDigest;(not supported on cldc1.1 )
and i was import it to use this code
MessageDigest md2 = MessageDigest.getInstance("MD5");
//[CMPE 295B] Following code group added
md2.update(abyPassword,0,abyPassword.length);
md2.update(abySalt,0,abySalt.length);
md2.update(abyPassword,0,abyPassword.length);
byte[] abyFinal = new byte[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };//[CMPE 295B]
md2.digest(abyFinal,0,16); //[CMPE 295B]
pleas if any body now how to use the md5 algrothim on j2me cldc 1.1
|
|
|
|
|
I would like to know how to debug MSJVM in Eclipse. I can see Java console of MSJVM but I can't debug my code. Please let me know if you can do it. Thanks!
|
|
|
|
|
you can't if you don't have the source code...
otherwise, set a breakpoint, and start your program with 'debug as...' > 'Java Application'
|
|
|
|
|
Sure. I have a source code. I can debug with JRE. But I can't debug with MSJVM.
|
|
|
|
|
My application is an applet. So, I have to add parameter into JRE. When I run the debug, I see message below:
Failed to connect to remote VM. Connection refused.
Connection refused: connect
Please advise me in this case. Thanks!
|
|
|
|
|
Hi everyone,
i'm working on a project and i need to draw a graph (not a chart, a network).
I think there are some classes or library to do that but i didn't find anything.
Can someone help me? Articles, links...all welcome.
Thanks in advance,
Enrico
Program your life ^^
|
|
|
|
|
|
thanks you were very helpful!
Program your life ^^
|
|
|
|
|
I have a question (or more an impulse for discussion) regarding an implementation of Mergesort with a generic list.
How is a list (let's say an ArrayList) object stored in the memory? How are the list's values stored? I would assume that each list item is a pointer to a value stored in memory, since duplicate objects are possible. How much space is this pointer using in memory?
If I stay with my Mergesort example:
I have a list of n integer values, which means n values of 16 bit stored in the memory, along with n pointers + the "overhead" for the list.
If i split the list in the first step, i have the same integer values in the memory, but now 2n pointers + the "overhead" of 3 lists...
So for implementing an out-of-place sorting like mergesort, it would be very relevant to know how long pointers are and how big the memory overhead of a list is to estimate the total memory use.
Any suggestions, hints, recommendations?
Robert
|
|
|
|
|
hi i have a client server where my client is mobile and server is PC every thing works fine for me like sending and receiving data but the problem is when the there is no clients then the server will will be blocked by acceptandopen, so how can i make it close for some time if there is no clents connections.
|
|
|
|
|
I have dont have any background in java..
i have to make a simple prog with the basic concept of text twist i need some help pls.......
|
|
|
|
|
and you want help about what ?
what have you done so far in your application ?
|
|
|
|
|
i dont know how to use a word bank for the game....
i mean your suppose to have a text file were you get all the words from...right!?
in short I dont know how to get strings from a txt file....
|
|
|
|