Need Help with a Java Question Plz
Hi
Could someone help me out with this please?
I need to know the difference between the two String methods equals and equalsIgnoreCase
Thanks
The former tests if the Strings are equal, the latter tests if they're equal, but ignores case...
I.e. "A".equalsIgnoreCase("a") returns true, among other things...
Similar Messages
-
I am currently living in Tunisia but it's not on the Apple Contact Support list. I need help with my security questions which I cannot remember the answers. There is no link to send a reset email. What do I do?
Click here and ask the iTunes Store staff for assistance.
(114040) -
I need help with the security Questions is there some way to get you to remember them by e-mail of other wise
Read the HT5312 page that you posted from, it has instructions for how to reset them i.e. if you have a rescue email address set up on your account then steps 1 to 5 half-way down that page should give you a reset link.
If you don't have a rescue email address then you will need to contact iTunes Support / Apple in your country to get the questions reset.
Contacting Apple about account security : http://support.apple.com/kb/HT5699
When they've been reset (and if you don't already have a rescue email address) you can then use the steps half-way down the HT5312 page that you posted from to add a rescue email address for potential future use -
I need help with my security questions/answer?
I forgot my security questions answer
The Three Best Alternatives for Security Questions and Rescue Mail
1. Use Apple's Express Lane.
Go to https://expresslane.apple.com ; click 'See all products and services' at the
bottom of the page. In the next page click 'More Products and Services, then
'Apple ID'. In the next page select 'Other Apple ID Topics' then 'Forgotten Apple
ID security questions' and click 'Continue'. Please be patient waiting for the return
phone call. It will come in time depending on how heavily the servers are being hit.
2. Call Apple Support in your country: Customer Service: Contacting Apple for support or
Apple ID- Contacting Apple for help with Apple ID account security. Ask to speak to
Account Security.
3. Rescue email address and how to reset Apple ID security questions.
How to Manage your Apple ID: Manage My Apple ID -
Need Help with a JAVA programming assignment
How do I write a JAVA program that could be used as the start of an MS-DOS/Windows simulation of the IEEE 802.3 protocol? I am to only code the parts necessary to build the 802.3 frame. For the initial implementation, the Checksum function need not be a CRC function, and the Destination and Source addresses wil be in input, stored, and output, and in dotted-decimal format.
I need:
1. A record to describe the frame, with each field being a (byte-) string of the required size, except that the Data field is of variable size. Although the "Source address" and "Destination address" would be 6 bytes for a real implementation, for this first implementation you can either assume they'll be text strings in the usual "dotted decimal" form (e.g. "14.04.05.18.01.25" as a typical example--from Tanenbaum, p. 429), or 6 hex digits.
2. Suitable constant declarations for values such as the standard "Preamble" and "Start of Frame" values.
3. Suitable functions to Get the three variable values "Destination address", "Source address", and "Data" from the standard input device.
4. A suitable function to display each of the fields of a given frame in a format such as:
Preamble: ...
StartofFrame: ...
Destination: ...
etc.
5. A suitable function to generate a "Pad" field if necessary.
6. A "dummy" Checksum-generating function which just takes the first 32 bits (4 bytes) of the Data (or Data+Pad, if necessary) rather than an actual CRC algorithm.
I have no experience with Java. Can you help me or start me in the right direction?
Thanks...........TKIf you have no experience with Java, then it seems to me your first step should be to start learning the language. But it's difficult to advise how, since we don't know anything about your background. There are many good books available on Java, some are for beginners and some are for advanced programmers, so I'd suggest you go somewhere that has a large selection and start looking for something that doesn't seem completely over your head.
-
Need Help with a Java programming exercise.
I have to Write a program that reads two times in military format (0900, 1730) and prints the number of hours and minutes between two times. Supply your own test program. Here are two sample runs. User inputs are the numbers.
Please enter the first time: 0900
Please enter the second time: 1730
8 hours 30 minutes
Please enter the first time: 1730
Please enter the second time: 0900
15 hours 30 minutes
Test Program I can write up myself. But the entire constructor I have no idea how to start. This is basic Java Coding. no C++ no importing anything.
So far this is what I got and I'm sure it's wrong:
public class TimeInterval
private double hours;
private double minutes;
public TimeInterval(double Time1, double Time2)
hours =
minutes =
}tad2382 wrote:
Jverd,
I'm guessing that in your early days on this forum you must have spent a lot of time explaining constructors, object creation, etc. Now, after some 40K posts to the forum, you figure newbies should just go and read the documentation. Is that what a lot of veteran posters feel?Perhaps the OP is not aware of the fact the Sun has a good deal of high quality study material published on their website. What's wrong with posting it in a thread? Why should one copy the same thing over and over again? If after reading that tutorial, the OP still has some questions about it, s/he is free to post a follow up question. I am sure that many of the regulars here are more than happy to answer them.
Also note that the OP's problem description is rather vague. A "I don't know where to start" is IMO best answered by a link to a comprehensive tutorial or a beginners book.
Being one of the (relatively) novice posters on the forum, I still feel the need to customize posts,Well, by all means: do so.
trying to see things from the poster's side. Maybe after a few thousand posts, I'll just keep throwing the same documentation at newbies, instead of detailed customized responses, heh.IMO, that's a load of cr@p. -
I need help with a java assignment
I am being taught java but dont really understand what i have to do. If you send me an email to [email protected] ill send you a copy and so help me with the assignement.
I am currently working on free web page so you can download the assignment.
Thank You Allhey, there's something wrong with my internet, i clicked on your email adress and nothing happened :(
too bad. maybe i can't do your assignment.
go see somee tutorials, maybe these will help you, also try to understand how API will elp you (to both you may find links from left column of this page) and also, see if there area some samples of how to do what you need to be done.
http://www.javaalmanac.com -- my favorited place for code samples.
also whan you have some saaignment or other task, then see if google finds you apropriate solution. and there's a search function in these forums as well.
i hope you get your homework doen in time... -
Need help with error java.lang.IllegalArgumentException: timestamp on bar b
My company uses Java based applications for real time streaming stock market information and I have come across 2 users that are generating the same error:
Bar.addBar failed adding com.abwg.bar.BasicBar 20071210-08:27:00.000 104.34 104.35 104.25 104.25 950 to com.abwg.bar.BasicBar 20071210-09:30:00.000 104.11 104.38 104.11 104.38 436 :java.lang.IllegalArgumentException: timestamp on bar being combined older than original bar
I have had no luck trying to determine what the cause of this error is, however both users experience very laggy performance shortly after launching the application. I have not been able to duplicate the problem, and the developers have not been able to provide any response or possible causes yet.
I'd be very appreciative if anyone could help me make some sense of what this error type might mean. It's got something to do with the computer that the application is being run on. One user is on a Mac 10.3 using J2SE 1.4.2_12 and the other is on Win XP using Java 1.6_3Thank you Frank and Carole for your response. The stated issue/error is resolved. It had to do with the upgrade somehow which lead to multiple certs for the same agent. Anyway, I had to delete ADS and all attached Agents, re-create ADS, re-create all Agents and re-register with the new ADS. I then manually re-registered the Directory Server instances on both the Primary and Secondary Servers with the new ADS. Voila, the DSCC Web console no longer prompts for server credentials.
But importing the Wild card cert issue still remains. I added the issuing CA chain to the ldap instance CA store and I see the certs listed. But when I try to import the P12 cert/key combo, I get an error which says something like: "The certificate is already in the database". But it is not, verified using certutil.
Yes internal CA or Self-signed Certs are fine. If I add the internal CA and Root CA to the cert store on my LDAP clients, then I am fine. No SSL errors. But want to avoid using such as we do have quite a few clients which would be connecting to the store. Hence want to use our enterprise wild card Cert. I am not sure if it is an issue importing a wild card pkcs12 format.
As mentioned above I did add the CA chain (which issued the wild card) to the actual instance, not the ADS. I can try that. But are you sure we need to add the Root CA to Tomcat ks.
And while we are at it, the Self-signed certs generated using the Console is only valid for 2 years. Is it possible to change the term ?
Thanks again. -
Need help with basic Java programming
I'm having a little bit of trouble with my code. For the sake of argument, I've removed the code I'm having trouble with, because I know it was inaccurate. I'm trying to create a loop so that this program will keep going through and through until the user enters an invalid variable. I thought the default after the case statements was supposed to make the system exit and output my message. Those two problems, the loop and the default, are what I'm really having problems with. My code is posted below.
import javax.swing.JOptionPane;
import java.util.Locale;
import java.text.NumberFormat;
public class Retail
public static void main(String args[])
String firstNum;
String secondNum;
String result;
int prodNum; //first number to input
double quantity; //second number to input
double total = 0.0; //total of Prod * Quantity Sold for all items
// To use American Dollar
NumberFormat moneyFormat = NumberFormat.getCurrencyInstance( Locale.US );
// first number entered as string
firstNum = JOptionPane.showInputDialog( "Enter product number 1-5" );
// second number entered as string
secondNum = JOptionPane.showInputDialog( " Enter quantity of items sold" );
// convert values to type double or int from type string
prodNum = Integer.parseInt( firstNum );
quantity = Double.parseDouble( secondNum);
result="";
if ( prodNum >=1 && prodNum <=5 ) {
switch (prodNum)
case 1: // 1st product
total = 2.98 * quantity;
break;
case 2: // 2nd product
total = 4.50 * quantity;
break;
case 3: // 3rd product
total = 9.98 * quantity;
break;
case 4: //4th product
total = 4.49 * quantity;
break;
case 5:
total = 6.87 * quantity;
break;
default: JOptionPane.showMessageDialog( null, "Wrong product number entered" );
JOptionPane.showMessageDialog( null, moneyFormat.format(total), "Total Price of Items Purchased", JOptionPane.INFORMATION_MESSAGE );
System.exit(0);
***I know I need to put something in the user input message to state that any value other than 1-5 entered will cause the program to skip to the output, I'll put that in later.***When you post code, please use [code] and [/code] tags as described in Formatting Help on the message entry page. It makes it much easier to read and prevents accidental markup from array indices like [i].
-
Need Help With NetBeans (Java Studio Enterprise 8)'s code generation
Hi!
I am using Java Studio Enterprise 8 with NetBeans 4.1 IDE bundled together with it. When trying to create GUI out from NetBeans Form Designer, I don't like the way it generates the code. When I try to use a JTextField, it uses "Fully Qualifed Class Names" (e.g: javax.swing.JTextField) on the code. How do I set NetBeans not to use it but rather use only the class name and generate import lines on top of the code? Also, how do I set it up that it will generate the variable declarations (which is on the uneditable blue portion of the code) on top rather than the default which is placed at the bottom of the class code body. I have tried tweaking the Options menu of this IDE but haven't got any luck...
Hope you could help, and thanks in advance!To address the location of the var decl codegen section (or any codegen location issues), there is a workaround, admittedly, it is a bit tedious.
Once the form code is generated, as Kris mentioned, open the class in an external editor so that you can edit the generated code.
Then cut the entire var declaration section along with the begin/end gen-code markers and paste it to the section of the file you desire.
When you add more components to your form, the codegen will find this section wherever it is and add to it.
Alternatively, you could just move the non-protected code around the protected within the NB editor, but you would not be able to rearrange the order of the actual code-genned sections.
craig -
Need help with a java chat software!!! Anyone pls give ideas
I need to implement a chat protocol with sockets for my course!!
As of now i have only got to the simple client server application with sockets and have a user interface with panels.
How could I proceed...
How should i use login names and passwords??
Should i use if else loops to specify :
various headers like
login
pass
send
exit
if you could point out som esite that will be helpful or even a book it would be of great help!!Don't use if/else loops, they have this nasty habit of not existing.
My quarter-pence:
For passwords, use a map which maps name/hashed password. That way, you'll never actually store the password. -
Hey
I am doing a bachelor of Multimedia and for some reason I was forced to do Programming 1 which is just Java programing.I have been doing pretty well but we have the final exam coming up on Thursday and they told us to learn how to do this question but I have no idea how to do it, could someone please help me?
Write a program that reads a file containing a list of students' student numbers and names, and then writes out another file in which the students have been formed into project groups.
Sample input file:
96439530 Naranek, Kosh
08532109 Ivanova, Susan
87642078 Sheridan, John
44327889 Varner, Dell
98100023 Kotto, Vir
66345689 Sinclair, Jeffrey
77421009 Garibaldi, Michael
88775544 Winters, Talia
54321098 Alexander, Lyta
12345098 Mollari, Londo
03465499 Takashima, Laurel
88765432 Kyle, Benjamin
08876500 Keffer, Warren
07687878 Cole, Marcus
For the project course: no group should have more than 5 members; and it is desireable that all groups have as close to 5 members as possible; and that students be allocated to groups alphabetically by family name, as in this sample output file:
Group 1:
Lyta Alexander (54321098)
Susan Ivanova (08532109)
Benjamin Kyle (88765432)
John Sheridan (87642078)
Dell Varner (44327889)
Group 2:
Marcus Cole (07687878)
Warren Keffer (08876500)
Londo Mollari (12345098)
Jeffrey Sinclair (66345689)
Talia Winters (88775544)
Group 3:
Michael Garibaldi (77421009)
Vir Kotto (98100023)
Kosh Naranek (96439530)
Laurel Takashima (03465499)
Students' names are first sorted (Alexander, Cole, Garibaldi, Ivanova, ...), then allocated to the tutes in rotation (Alexander to 1, Cole to 2, Garibaldi to 3, Ivanova to 1, ...).
Note also that the student's details are written in a different format from the input. You may make the (usually wrong!) assumption that each student has a simple one-word family name and one other name.I'm sorry too annoy you again but I don't know how to implement what you told me. Here is my current code:
import java.io.*;
import java.util.*;
class DetailSortTest {
public void run() {
try {
BufferedReader in = new
BufferedReader(new FileReader ("Data.txt"));
String line = in.readLine();
String[] names = new String [10];
int i = 0;
PrintWriter FileOut = new
PrintWriter(new FileWriter ("Data 2.txt"));
processFilesTest(in, FileOut);
in.close();
FileOut.close();
} catch (FileNotFoundException f) {
System.out.println("Could Not Open The File");
} catch (IOException i){
System.out.println(i.getMessage());
public void processFilesTest (BufferedReader in, PrintWriter FileOut)
throws IOException {
String data[] = new String[100];
List dList = new ArrayList();
String NLine = in.readLine();
FileOut.println(NLine);
public static void main(String[] args) {
DetailSortTest anObject = new
DetailSortTest();
anObject.run();
How would I do it I tried:
NLine.split(data[2]+""+data[1]+""+data[0]);
But all that displays is null, null, null
I know I am probably so stupid but I really appreciate the help -
URL: newbie needs help with simple programming question!
Hi everyone,
Please direct me to a FAQ or other resource, or help me with this problem:
I want to create a text field (or similar container) that contains both ordinary text AND a URL/hyperlink in it. For example, the following text might appear in the text field:
"I have many _pictures_ from my vacation"
where the word "pictures" is actually a hyperlink to a web site, and the other portions of the string are simple text.
All advice and help is appreciated!
-Dennis Reda
[email protected]Well here is one way you code do it but if you do alittle research on them links above it will explain how this code works.Well it will explain how jeditorpane and hyperlinklistener work
import javax.swing.*;
import java.awt.*;
import javax.swing.event.*;
import java.net.*;
public class b extends javax.swing.JApplet implements HyperlinkListener {
JEditorPane field = new JEditorPane();
public b() {
Container pane = getContentPane();
FlowLayout flo = new FlowLayout();
pane.setLayout(flo);
field.setPreferredSize(new Dimension(200, 25));
field.setEditable(false);
pane.add(field);
setContentPane(pane);
String gg1 = "<html><body>I have many_<a href='http://www.home.com'>pictures</a>_from my vacation</body></html>";
field.addHyperlinkListener(this);
field.setContentType("text/html");
field.setText(gg1);
public void hyperlinkUpdate(HyperlinkEvent e) {
if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
try{
URL url = new URL("http://www.msn.com");
getAppletContext().showDocument(url,"_self");
}catch(Exception r) {};
public void init() {
b c = new b();
ps hope this helped -
Need help with the classic question: iMac or MacPro?
HI all,
I have been tossing this questions for a little while now, high end iMac or low end MacPro? So if I can request your patience, please allow me to rattle this lot off and see if you can help.
My current spec is:
• MacPro 1,1
• 2 x 2.66 Dual Core Xeon
• I have 2 screens, 24"
• All 4 internal bays have HDs, 1 is designated for TimeMachine.
• 2 external HDs, 1 for iTunes and misc, 1 for boot HD backup.
The software I run are mostly the Adobe CS suites, some 3d, some audio, and soon some FCPX.
I have had the computer for about 4 years now, and although it has served me very well it is getting tired etc. I am a long-term tower computer fan, but I can't ignore the question.
So, I have been thinking of either:
• Going for the high-end iMac, and consolidate much of my internal HDs into an external RAID system.
or
• Getting the low-end MacPro, with the 3.2ghz Nehalem chip upgrade, and basically keep the same 'style' of system I have now.
The
What would you recommend? My concern is of course related to price, and bang for the buck, but more than that - longevity for the upcoming years. Pretty much now is the time when I will be updating, and I expect to keep whatever system for the next few years.
I don't see my uses for the Mac to be too much different from what is listed above. I have not installed anything other than additional HDs and RAM into my current Mac - so in that respect expandability isn't too much of an issue.
The price is similar enough to be comparable.
In case you wonder, the current MacPro has been earmarked for use in another task, which is likely to include usage of the screens... Hence in somerespects, this is a "starting from scratch" situation...
Thoughts?
Many thanks,
AaronForgot to mention Aperture. Lot's of photos.
-
Needed help with updating java code
Hello all,
Let me begin by let you know I am not a programmer and I have tried to solve this by reading on the net. I am a network admin so I tech knowledge but no programming.
I have a webcam sending a Jpg to an FTP site and there I have used an applet called view.class to refresh once a second.
site:http://70.154.170.253/webcamold.html
My problems is now that it refreshes the same image over and over. It refreshes the cached image not the new image.
From reading I suspect that it has to do with the newer version of java (it used to work fine).
I have tried using JavaCam but same issue it just refreshes cached image. Also image flickers, the applet I am trying to fix was really smooth.
I have also tried to compile code that I found on this forum but I got error dealing with deprecated code.
Any help would be greatly appreciated!!!
Code:
import java.applet.Applet;
import java.awt.*;
import java.io.PrintStream;
public class View extends Applet
implements Runnable
public void init()
setBackground(Color.white);
String s = getParameter("refresh");
if(s == null)
update = 30;
else
try
update = Integer.parseInt(s);
catch(Exception _ex)
update = 30;
filename = getParameter("picture");
if(filename == null)
System.out.println("No filename given as parameter.");
md = new MediaTracker(this);
off = createImage(size().width, size().height);
refreshImage();
public void paint(Graphics g)
g.drawImage(off, 0, 0, this);
public void update(Graphics g)
paint(g);
public void refreshImage()
img = getImage(getDocumentBase(), filename);
md.addImage(img, 0);
try
md.waitForID(0);
catch(Exception exception)
exception.printStackTrace();
Graphics g = off.getGraphics();
g.drawImage(img, 0, 0, this);
img.flush();
public void run()
while(th != null)
try
refreshImage();
repaint();
Thread.sleep(update * 1000);
catch(Exception exception)
System.out.println("Error when thread was supposed to sleep: " + exception.getMessage());
public void start()
if(th == null)
th = new Thread(this);
try
th.start();
return;
catch(Exception exception)
System.out.println("Couldn't start thread: " + exception.getMessage());
return;
} else
return;
public void stop()
if(th != null)
th.stop();
th = null;
public void destroy()
stop();
public View()
update = 30;
Thread th;
String filename;
int update;
Image img;
Image off;
MediaTracker md;This is compile error free code and regarding your issues i don't think am good at this stuff
import java.applet.Applet;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.MediaTracker;
public class View extends Applet implements Runnable {
Thread th;
String filename;
int update;
Image img;
Image off;
MediaTracker md;
public void init() {
setBackground(Color.white);
String s = getParameter("refresh");
if (s == null) {
update = 30;
} else {
try {
update = Integer.parseInt(s);
} catch (Exception _ex) {
update = 30;
filename = getParameter("picture");
if (filename == null) {
System.out.println("No filename given as parameter.");
md = new MediaTracker(this);
off = createImage(size().width, size().height);
refreshImage();
public void paint(Graphics g) {
g.drawImage(off, 0, 0, this);
public void update(Graphics g) {
paint(g);
public void refreshImage() {
img = getImage(getDocumentBase(), filename);
md.addImage(img, 0);
try {
md.waitForID(0);
} catch (Exception exception) {
exception.printStackTrace();
Graphics g = off.getGraphics();
g.drawImage(img, 0, 0, this);
img.flush();
public void run() {
while (th != null) {
try {
refreshImage();
repaint();
Thread.sleep(update * 1000);
} catch (Exception exception) {
System.out.println("Error when thread was supposed to sleep: "
+ exception.getMessage());
public void start() {
if (th == null) {
th = new Thread(this);
try {
th.start();
return;
} catch (Exception exception) {
System.out.println("Couldn't start thread: "
+ exception.getMessage());
return;
} else {
return;
public void stop() {
if (th != null) {
th.stop();
th = null;
public void destroy() {
stop();
public View() {
update = 30;
}
Maybe you are looking for
-
I have bought a new ipod touch and when i went to sync my music library on to it only a few songs went over, the ones that didnt had a ! next to them. I had no problem when using my last ipod touch but i was using a pc at the time not a mac though.
-
My Toolbar has a huge space for URLs, but a very tiny space for search items, question etc. It is very frustrating to use and I can't seem to find an easy way to adjust the space. My aging eyes like Safari better, but my brain prefers Firefox. Is the
-
Diary / Calender at vendor master level detailing vendor contact etc
Hi all, Just wondering if anyone is aware of some method of attatching a diary or calender to a vendor account within material master. Essentially this would detail AP contact previously, the next date contact should be made etc, etc nice to haves wo
-
Request_id as parameter
Hi, Is there an easy way to get the request_id of the concurrent request to be set as value of one of its parameters? TIA
-
Casio Commando 4g Pictures from SD Card and Google not showing in Gallery!
Hello everyone it's been a while! So I've had a couple of these shiny new Commandos and guess what?!? They've got issues :-/ Here's my gripe, let see if the community is better help than Verizon Support and/or Casio Support. I picked up a new Command