|
firstly, it's really strange that the applet doesn't work with a JRE 1.6, which is supposed to be retrocompatible.
BTW, if both JREs are installed, the application will point to what is in the environment variable JAVA_HOME ...
|
|
|
|
|
toxcct wrote: applet doesn't work with a JRE 1.6
We are working on PKCS and some ikey token. we have used 1.5 to developed java code for pkcs but in 1.6 argumets are different and there is no oveloaded methods for that . we are also shocked.....
but we need to run it on jre 1.5 or we need to build on 1.6 .
please help !!!
|
|
|
|
|
Hi, there!
I'm learning to program with Java and I'd like to begin to read about design patterns applied to Java.
I tried to read "The design patterns - Java Companion" (by James W. Cooper), but I think it's a little advanced for me.
Somebody can tell me where do I find reading matter about design patterns?
Thank you in advance.
[Adrián Córdoba]
|
|
|
|
|
It's amazing what you can find ("design patterns java") on GOOGLE!!
http://www.fluffycat.com/Java-Design-Patterns
John P.
|
|
|
|
|
Notice the comments. What's wrong here?
import java.lang.*;
import java.lang.Math.*;
public class Exponent
{
public static void main(String[] args)
{
int iBase = 10;
int iExponent = 2;
double dCubed = Math.pow ( iBase, iExponent);
System.out.println( dCubed );
int iResult = iBase ^ iExponent;
System.out.println( iResult );
}
Everything makes sense in someone's mind
|
|
|
|
|
In Java, the ' ^ ' is a bitwise operator, not a power operator!
John P.
|
|
|
|
|
Which does exactly what?
Everything makes sense in someone's mind
|
|
|
|
|
Gosh, all I did was go to "java.sun.com" --- all the answers are RIGHT THERE!
Here! I did it for you:
The bitwise ^ operator performs a bitwise exclusive OR operation.
So 10 = 1010
2 = 0010
Exclusive OR = 1000 = decimal 8!
John P.
modified on Wednesday, August 20, 2008 3:58 PM
|
|
|
|
|
I looked it up too. I don't understand what 'bitwise' means.
It it was so much trouble for you, why bother responding at all?
Everything makes sense in someone's mind
|
|
|
|
|
KMAROIS wrote: It it was so much trouble for you, why bother responding at all?
if it's too much for you to 1) search the web, 2) read the docs, and 3) try to understand a wise answer you got, why bothering asking ?
bitwise operators are operators operating directly on the bits rather than full bytes.
so, as the other guy was saying, the ^ operator is the XOR (exclusive OR) bitwise operator.
10 = 1010
2 = 0010
----------
^ 1000 -> 8
|
|
|
|
|
Hallo, I have a little problem.
I need to read an XMI file generated by a CAD software and convert the model saved in a specific language thatmy team has developed.
I the book "Mastering XMI..." I saw that with com.ibm.xmi.job package you can retrive objects from XMI simply calling a function to read that returns a list of objects. On the internet I saw that IBM doesn't continue the developement of this package and I can't find it to download. IBM refers to EMF, but I can't find a simple tutorial to simply open XMI file and retrive objects.
Can you tell me how can I do this?
Thank you very much...
|
|
|
|
|
_Comet_Keeper_ wrote: IBM refers to EMF, but I can't find a simple tutorial to simply open XMI file and retrive objects.
Take a look at the samples in this article[^]
led mike
|
|
|
|
|
Hi , I'm an electronic man with 5+ years experience and I have some knowledge of C and C++ I have written quite big projects with C++ for windows(multi thread, kernel programming,...) and also in C I have written many programs for different microcontrollers. My knowledge about Java and .Net is zilch. Now I feel the need to learn a new language that just like C can be both helpful in firmware development and also in software development. I have heard that Java is platform independent and can be run on any device using a virtual machine and I've heard microsoft has tried to copycat Java and ended up to something that it calls it .Net So I want to learn something that 5 years later I do not regret wasting time to learn it. I do not want to learn something that is living its last days. as I said one of my main purposes is to be able to program new fast big microcontrollers they can run Linux programs, Java Programs and make people doubt if they need desktop computers anymore.
now please put your Java patriotism aside and give me a piece of professional advice that with regard to my experiments in C and my need to program new emerging embedded devices what will be the best choice to learn Java, Linux, .Net, C# or something else... It will be appreciated if you can give some solid rock reasons about your recommendation.
Thanks
|
|
|
|
|
maybe you'd want to read this[^] thread ?!
I've already argued on the matter, and this site is mainly populated with microsofties, so it's hard to make a voice for java out there... but feel free to argue if you want to.
|
|
|
|
|
Oh!
Sorry I had to search before posting
Your posts in that thread was informative, thank you.
I had no doubt that Java is a great Language, millions of people use Java applications in their mobile and other embedded stuff.
As a matter of fact speed and power of microcontroller are increasing so fast that many of them can run OS and big applications, for example a microcontroller that I'm playing with it for awhile(ARM9) has 200 MIPS power @ 200MHz @ 32bit. dose anybody remember 80286@16Mhz running Windows 3.1
Now there are two thing that I seriously considering as my next learning project
1- Linux
2- Java
many embedded devices can run small versions of linux, its programming shouldn't be very different from C++ in fact there is C++ for linux I only have to become familiar with this OS and APIs
about Java I honestly have no idea how hard would be to develop a big graphical program comparing it to development time in C++.
regards,
|
|
|
|
|
Java is standard language .... runs on any platform therefore its code is same for windows, linux, mac, etc.
This is the best feature of Java.
so if u wanna java u learn java i dont think there is downside for it else its first time compilations for its code
BlaCk WolViX
|
|
|
|
|
Hi , One thing about Java is almost all programs that I've seen written in Java are small programs. I hadn't seen a major program like a powerful spread sheet / word processor program (like microsoft word or microsoft excel) written in Java. Maybe I haven't seen it maybe there are reasons programmers prefer other languages for major programs, I don't know. maybe someone here can explain about it.
Best wishes
|
|
|
|
|
if you know Eclipse (I mean, if you know it well), you might have found that it's a quite big one... and it's Java !
I've myself worked on a project which was all J2EE based, but I can't say much as this is not a software people can find anywhere. it was an application (in fact, a set of many applications interconnected) which was to manage the whole trains in France. there were GUI ones, for end users to park the trains in the station, and such tasks ; there were non graphical ones as well for the integration streams parts too...
|
|
|
|
|
Hi , Thanks for enlightening. I don't know Eclipse. But what you said about the application you worked on was quite interesting for me because that sounds that specific application runs on different platforms. That was very important for me because many of my applications also have to interconnect different platforms. For example one of my big headaches always is how to write a firmware that is running on a MicroController(MCU) and the computer GUI that connects to it with the same scaffold. Let me explain, For example in a firmware application I have to calculate value of a parameter measured with an analog to digital converter(ADC) and display it to the user on device LCD and also I have to send the value of this variable to the computer for display on computer screen and storage and further data processing. There are many identical operations that have to be done both in MCU and computer. Also I struggle to write variables and functions that do the same work with the same name so at the time of Debug or Upgrading of the software/firmware I do not get confused with different variable names that actually do the same thing or with different programming style for the same purpose. It is not easy at all. I don't know what kind of life I would have with Java. Maybe If I can develop my software and firmware with the same IDE it makes my life a lot more easier. By the way is Eclipse open source or I have to buy it? and is J2EE version 2 of Java? If I want to begin Java where should I begin? Can you recommend good books or Online Resources?
thanks
|
|
|
|
|
Electronic75 wrote: By the way is Eclipse open source or I have to buy it?
Eclipse 3.4[^] (Free and Open source)
Electronic75 wrote: is J2EE version 2 of Java?
J2EE means 2 things : J2 for Java 2, EE for Enterprie Edition (by oposition to SE - Standard Edition).
Electronic75 wrote: If I want to begin Java where should I begin?
Eclipse is an excelent IDE, but if you don't know Java yet, a book should be a best answer. unfortunately, I have to online resources for that ; I used to read paper books only when I'm learning new programming languages.
|
|
|
|
|
i do not know how to do it....
please help me
task: Cattle Weighing Calculator
One job that a typical farmer needs to do from time to time is to record the individual weights of all his cattle. To do this, he records the number on the ear tag of each animal, along with its weight, which is output by a weighing platform in the cattle yards.
Your task is to program an application that will allow a farmer to record the cattle weight data, and then allow him to get certain kinds of useful information from the recorded data.
Your program should consist of a single form and two separate classes, Form.cs which provides the form functionality, and Queue.cs which provides a dynamic (linked list based) implementation for queues.
The data will be stored in a queue, where each node contains separate data fields for both tag number and weight, and a reference to the next item in the queue.
To begin with, your application should have a form including
a rich textbox, for output only
a textbox, labelled Tag Number, for input of animal ear tag numbers
a textbox, labeled Weight, for input of corresponding animal weights
a button Record
a button Print
When a number is entered into each of the textboxes and the Record button is clicked your program should
(i) Check that there is valid data in textbox; if not, display a suitable message, otherwise
(ii) Call the queue method enqueue to insert the appropriate record into the data queue.
When the Print button is clicked your program should
(i) Check that the data queue is not empty; if it is empty display a suitable message, otherwise
(ii) Call the queue method printQueue to print out to the rich textbox a list of the
(tag number, weight) pairs stored in the data queue.
You should get a first version of the program working that supports this part of the application.
must be written in C#.
|
|
|
|
|
Hi, I am very new to Java and Eclipse and want to create an array of objects and use the objects methods? I have put together the following code:
public class aub {
private int iNumber;
public void setNumber(int iNewValue){
iNumber = iNewValue;
}
public int getNumber(){
return iNumber;
}
public static void main(String[] args) {
// TODO Auto-generated method stub
aub[] ExObj = new aub[10];
for (int i=0;i<10;i++){
ExObj[i].setNumber(i);
}
//ExObj[0].setNumber(8);
System.out.println(ExObj[0].getNumber());
System.out.println(" End of program " );
}
}
When I run the code in Eclipse I get the following error:
Exception in thread "main" java.lang.NullPointerException
at aub.main(aub.java:20)
which is the for loop object method line. I want to use methods to assign values to the objects properties.
Please help|
|
|
|
|
|
you can initialize the array before using it.
public static void main(String[] args) {
aub[] ExObj = new aub[10];
for (int i=0;i<10;i++){
ExObj[i]=new testclass();
ExObj[i].setNumber(i);
}
System.out.println(ExObj[0].getNumber());
System.out.println(" End of program " );
}
}
|
|
|
|
|
Member 3363498 wrote: Exception in thread "main" java.lang.NullPointerException
at aub.main(aub.java:20)
That was pretty clear, wasn't it ?
A NullPointerException means you are dereferencing a pointer which contains null rather than a valid address. Basically, it means that the Reference has not been initialised, or that no object is created.
As already suggested, you then have to create a new aub instance in each cell of your array, because creating an array doesn't create the objects itself. It only reserve the space for the pointers to point to a laterly allocated instance of the aub class.
|
|
|
|
|
The problem is you have not assign the real instance of sub into that array.aub[] ExObj = new aub[10]; is just declared an array which have the capacity to store 10 aub instances, so you should write like this:
for (int i = 0; i < 10; i++){
ExObj[i] = new sub();
}
for (int i = 0; i < 10; i++){
ExObj[i].setNumber(i);
}
or:
for (int i = 0; i < 10; i++){
ExObj[i] = new sub();
ExObj[i].setNumber(i);
}
|
|
|
|