Charles Keller

Greenhorn
+ Follow
since Jan 31, 2004
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Charles Keller

The other I saw a posting asking for an IDE evaluation; however, I can't find it anymore.
A few days ago, I prepared such a sheet and I would like to post here as an answer to your query. Here it is:

IDE Editor Evaluation-Oct.2.05
File Server \\586\E\Data\Java-doc\*.*
----------------------------------------------
Best #1: TextPAD : - Good for WIN-98 and WIN-XP
- to create and edit programs � good
- to print programs : good but black only
- to see Line numbers > go to View > Line numbers
- You can even print programs with line numbers
in black only
- To Compile: Go to Tools> Compile (Good)
- If it compiles, program shows up on screen
- If compile does not work: you get �Printable
Command Results�
- To RUN program: Go to Tools> Run Java
Application
or Run Java Applet
- For difficult �Copy/Paste� in Websites with
Netscape: very good
- Under File> Manage File: you can copy, delete
or rename a file

#2 : Netbeans 4.1: - to create & to edit programs
- No �Save as� available, which is rather
annoying
- NetBeans 4.1 is good for WIN-XP, but not for
WIN-98 (too slow)
- Good to print programs in color with line
numbers
- COMPILE and RUN are good


#3 ConTEXT: - Good for WIN-98 and WIN-XP
- To create and edit programs (�Save as� is
available)
- To print programs in color, with \\AMD +
Networked \\586
-For line Numbers: Go to Options>
Environment.> Editor>Line #
-Line numbers are only available on screen,
not for Print
-Drawback: no COMPILE nor RUN available, use DOS-BOX


#4 : DOS Box or MS-DOS Editor for LFNames = to Compile and RUN programs: good.

------------------------------------------------------------------------------------------------------

This is my 2 cents worth..... Charles.
Memo to Kym:
I followed your advice and made a revised program called HourExampleCKH3.java.
It works fine, but I am just wondering if I could use the SimpleDateFormat
as new Date in the first part of my comparison (before &&) and the HourOfDay in the second part (after &&) or would I have difficulty with "char" in the first part and "int" in the second part, or can I convert the "char" into an integer?

Here is the new program:

//File: HourExampleCKH3.java
// Created: Oct.07.05
// Output: compiling & running on DOS Box: fine
// Output #1 = from SimpleDATEfORMAT:
// date "H" gives 16 or whatever the hour is.
// #2 = from new GregorianCalendar:
// before 11 H.=prints "Good morning" on every hour
// between 12 and 17 H= prints "Good afternoon" on every hour
// on or after 18 H+ prints "Good evening" on every hour
//-------------------------------------------------------------------------
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Calendar;
import java.util.GregorianCalendar;

public class HourExampleCKH3 {

public static void main (String[] args) {

SimpleDateFormat bartDateFormat = new SimpleDateFormat("H");

Date date = new Date();

{System.out.println("File Name: 'HourExampleCKH3.java' - Oct.7.05");
System.out.println("To print this page, add >prn to your java command");
System.out.println();
System.out.println("From SimpleDateFormat:");
System.out.println(bartDateFormat.format(date));
System.out.println("The hour 'H' became: " + bartDateFormat.format(date));
System.out.println();}
Calendar calendar = new GregorianCalendar();

System.out.println("From the new Gregorian Calendar:");
System.out.printf("The current time is %1$tH:%1$tM%1$tp\n", calendar);
System.out.println("Testing over 24 hours...");
System.out.println();

calendar.add(Calendar.MINUTE, 30 - calendar.get(Calendar.MINUTE));
calendar.add(Calendar.HOUR_OF_DAY, - calendar.get (Calendar.HOUR_OF_DAY));

int hourOfDay;

for (int h = 0; h <=23; h++) {
System.out.printf("Test time: %1$tH:%1$tM, ", calendar);
hourOfDay = calendar.get(Calendar.HOUR_OF_DAY);
if (hourOfDay < 11 ) {
System.out.println("Good morning"); }

if (hourOfDay > 12 && hourOfDay < 17 ) {
System.out.println("Good afternoon"); }

else if (hourOfDay >= 18 ) {
System.out.println("Good evening"); }

calendar.add(Calendar.HOUR_OF_DAY, 1);
}
}
}

Thank you very much for your valuable help.

Charles.
19 years ago
Memo to Kym:
Thank you very much for your most valuable help. I will work on your program and hopefully I will make some progress with my grasp of the complexity of the Gregorian Calendar.
Charles.
19 years ago
I though my revised program �DatacomparedtoGregDate2..java� worked,
but it doesn�t. I noticed that the first part, which says:
if �value >6= && value <=12)�
works, but not the second part, which says:
if �value >13= && value <= 18)�
does not.

I am at a loss to understand why it does not work.
I even tried another program called �DatecomparedtoGregDate3.java�
which does not work at all.

What do I do wrong?

Here is the revised program, which does work at all:
// File \\586\C\Java-CK\DatecomparedtoGregDate3.java - Oct.1.05
// Output:
// RUN: it says: "Good Morning, it's :" , but no Date and Hours
// Trial: instead of: bartDateFormat.format(new Date));
// I changed it to: + new Date());
// Result: it worked !
// New Trial: instead of int value = 6;
// changed to: char value = '6';
// in order to make comparison using >= and <=
// Result: it worked very well !
// New Trial: I should be able to compare
// the hour of "(value >=6 && value <12)"
// or the hour of "(value >=13 && value >=18)"
// to the hour of the Gregorian Calendar, which is
// new SimpleDateFormat("H");
// Oct.1.05 = 6 to 12 seems to work,
// it compiles and it runs...
// but at 19.30 H. it stays at "Good Morning".....
// -----------------------------------------------------------------------
import java.text.SimpleDateFormat;
import java.util.Date;

public class DatecomparedtoGregDate3
{
public static void main (String[] args)
{
SimpleDateFormat bartDateFormat = new SimpleDateFormat("H");
// "H" stands for hour and gives 06, 14 or 21, no minutes.
Date date = new Date();
char value;
if (new SimpleDateFormat ("H") || (value >=6 && value <=12))
{
System.out.println("Good Morning, Today it's: " + new Date());
}
else if (new SimpleDateFormat ("H") && (value >=13 && value <= 18))
{
System.out.println("Good Afternoon, Today it's: " + new Date());
}
else if (new SimpleDateFormat ("H") && (value >19 && value >=23))
{
System.out.println("Good Evening, Today it's: " + new Date());
}
else
System.out.println("Good Night, sleep well, see you Tomorrow: " + new Date());
}
}
19 years ago
I though my revised program �DatacomparedtoGregDate2..java� worked,
but it doesn�t. I noticed that the first part, which says:
if �value >6= && value <=12)�
works, but not the second part, which says:
if �value >13= && value <= 18)�
does not.

I am at a loss to understand why it does not work.
I even tried another program called �DatecomparedtoGregDate3.java�
which does not work at all.

What do I do wrong?

Here is the revised program, which does work at all:
// File \\586\C\Java-CK\DatecomparedtoGregDate3.java - Oct.1.05
// Output:
// RUN: it says: "Good Morning, it's :" , but no Date and Hours
// Trial: instead of: bartDateFormat.format(new Date));
// I changed it to: + new Date());
// Result: it worked !
// New Trial: instead of int value = 6;
// changed to: char value = '6';
// in order to make comparison using >= and <=
// Result: it worked very well !
// New Trial: I should be able to compare
// the hour of "(value >=6 && value <12)"
// or the hour of "(value >=13 && value >=18)"
// to the hour of the Gregorian Calendar, which is
// new SimpleDateFormat("H");
// Oct.1.05 = 6 to 12 seems to work,
// it compiles and it runs...
// but at 19.30 H. it stays at "Good Morning".....
// -----------------------------------------------------------------------
import java.text.SimpleDateFormat;
import java.util.Date;

public class DatecomparedtoGregDate3
{
public static void main (String[] args)
{
SimpleDateFormat bartDateFormat = new SimpleDateFormat("H");
// "H" stands for hour and gives 06, 14 or 21, no minutes.
Date date = new Date();
char value;
if (new SimpleDateFormat ("H") || (value >=6 && value <=12))
{
System.out.println("Good Morning, Today it's: " + new Date());
}
else if (new SimpleDateFormat ("H") && (value >=13 && value <= 18))
{
System.out.println("Good Afternoon, Today it's: " + new Date());
}
else if (new SimpleDateFormat ("H") && (value >19 && value >=23))
{
System.out.println("Good Evening, Today it's: " + new Date());
}
else
System.out.println("Good Night, sleep well, see you Tomorrow: " + new Date());
}
}
19 years ago
Thanks to Barry, Layne and Kym, I was finally able to get my program working and I called it now: "DatecomparedtoGregDate.java".
Here it is:

// File \\586\C\Java-CK\DatecomparedtoGregDate.java
// (Text-Pad is best for editing and printing)
// (only GEL has line numbers)
// (Dos Box is best for Compiling and RUN)
// Sep.27.05
// Output:
// RUN: it says: "Good Morning, it's :" , but no Date and Hours
// Trial: instead of: bartDateFormat.format(new Date));
// I changed it to: + new Date());
// Result: it worked !
// -----------------------------------------------------------------------

import java.text.SimpleDateFormat;
import java.util.Date;

public class DatecomparedtoGregDate
{
public static void main (String[] args)
{
SimpleDateFormat bartDateFormat = new SimpleDateFormat("H");
// "H" stands for hour and gives 06, 14 or 21, no minutes.

Date date = new Date();

int value = 06;

if (value >=06 && value <=12)

{
System.out.println("Good Morning, Today it's: " + new Date());
}

if (value >=13 && value <= 18)

{
System.out.println ("Good Afternoon, Today it's: " + new Date());
}

if (value >=19 && value <=23)

{
System.out.println ("Good Evening, Today it's: " + new Date());
}
}

}

-----------------

Java Ranch is an excellent site: Charles.
19 years ago
Memo to Layne:
Thank you very much for your swift reply. I reconstructed my program and I took away the bad curly brace. Now, that how my program looks:
// File \\586\C\Java-CK\HelloDate2.java (only GEL-IDE has line numbers)
// (Text-Pad is better for command results)
// Sep.25.05
//
//Output:See listing = 4 errors
// Trials: 1) with if (date... (no good)
// 2) with if (new Date)...twice....(no good)
// 3) with if ((Date)... twice (no good)
// 4) with if (bartDateFormat... twice (no good)
// 5) no curly bracket before if (GOOD!)
// 6) use else without "if"
// 7) use bartDateFormat at "else section"
// 8) use second if instead of "else"
// 9) Hint: operator >= cannot be applied to
// Java.text.SimpleDateFormat.int bartDateFormat
// 10) applied again: if ((new Date) twice...No Good
// 11) Hint: operator >= cannot be applied to
// 12) java.util.Date.int & new Date()
// 13) morning replaced by value.int: VERY GOOD ! Now, only 1 error
// which is: line 28: cannot find symbol "class string"
// "public static void (string[] args) {"
// -------------------------------------------------------------------------
import java.text.SimpleDateFormat;
import java.util.Date;

public class HelloDate2 {

public static void main (string[] args) {

SimpleDateFormat bartDateFormat = new SimpleDateFormat("H");
// "H" stands for hour and gives 12, 14 or 18, no minutes

Date date = new Date();

int value;

if (value >=06 && value <=12)
//morning = 'A';
{
System.out.println ("Good Morning, it's: ");bartDateFormat.format(date);
}

if (value >=13 && value <= 18)

// afternoon = 'B';
{
System.out.println ("Good Afternoon, it's: ");bartDateFormat.format(date);
}
}
}
-----------------------
and the command result is only 1 error (cannot find symbol class
string, which I don't understand what they mean).

Java:Line 28: cannot find symbol
symbol: class string
location: class HelloDate2
public static void main(string[] args) {
^

I am still not able to create a class file, on account of that error

Can you help me please? Thank you very much for your valuable help.

Charles.
19 years ago
I just realized that I sent you the results twice, but not the actual program.

Here it is:


Command Results for HelloDate2.java:

C:\java-CK\HelloDate2.java:22: illegal start of type
if (new Date) =06 && date <=12))
^
C:\java-CK\HelloDate2.java:24: <identifier> expected
morning = 'A';
^
C:\java-CK\HelloDate2.java:29: illegal start of type
if (new Date) >=13 && date <= 18))
^
C:\java-CK\HelloDate2.java:31: <identifier> expected
afternoon = 'B';
^
4 errors

Tool completed with exit code 1
// File \\586\C\Java-CK\HelloDate2.java
// Sep.24.05
//
//Output:See listing = 4 errors
// -------------------------------------------------------------
import java.text.SimpleDateFormat;
import java.util.Date;

public class HelloDate2 {

public static void main (string [] args) {


SimpleDateFormat bartDateFormat = new SimpleDateFormat("H");

Date date = new Date();

char morning;

}

if (new Date) =06 && date <=12))

morning = 'A';
{
System.out.println ("Good Morning, it's: ");bartDateFormat.format(date);
}

if (new Date) >=13 && date <= 18))

afternoon = 'B';
{
System.out.println ("Good Afternoon, it's: ");bartDateFormat.format(date);
}


}

Now it worked.... Sorry for the mix-up.

Charles.
19 years ago
Thank you Barry and Layne for your valuable input. Thanks to your help, I was able to make some inroads with my problem, but I still have 4 errors in my program:

Here it is:


Command Results for HelloDate2.java:

C:\java-CK\HelloDate2.java:22: illegal start of type
if (new Date) =06 && date <=12))
^
C:\java-CK\HelloDate2.java:24: <identifier> expected
morning = 'A';
^
C:\java-CK\HelloDate2.java:29: illegal start of type
if (new Date) >=13 && date <= 18))
^
C:\java-CK\HelloDate2.java:31: <identifier> expected
afternoon = 'B';
^
4 errors

Tool completed with exit code 1

Here are the 4 errors:


Command Results for HelloDate2.java:

C:\java-CK\HelloDate2.java:22: illegal start of type
if (new Date) =06 && date <=12))
^
C:\java-CK\HelloDate2.java:24: <identifier> expected
morning = 'A';
^
C:\java-CK\HelloDate2.java:29: illegal start of type
if (new Date) >=13 && date <= 18))
^
C:\java-CK\HelloDate2.java:31: <identifier> expected
afternoon = 'B';
^
4 errors

Tool completed with exit code 1

I am looking forward to receive your answers.
Thank you in advance: Charles.
19 years ago
I am trying to make a program which will compare the hours
with the actual hour of new Date() and I have difficulties with it.
Here is what I have so far:

File HelloDate3.java

import java.util.Date;
public class HelloDate3
{
public static void main (string [] args)
{
int hour = Integer.parseInt (args[0]);
if (hour >= 06:59:00:00 && hour <=12:59:00:00)
{
System.out.println (�Good Morning, Today is � + new Date());
}

else if (hour >= 13:00:00:00 && hour <= 16:59:00:00)
{
System.out.println (�Good Afternoon, Today is � + new Date());
}
}
}

Instead of �hour� should I use another word? �time� perhaps ?

Later, as soon at it works, I shall extend the program to include �Good Evening��..�

Your help will be very much appreciated.

Charles.
19 years ago
Memo to John Dell'Oso, Barry Gaunt and Layne Lund:
Thank you very much for your valuable help. You showed me the way to find out what was wrong with my Java program; I only had
C:\Program Files\Java\bin instead of
C:\Program Files\Java\jdk1.5.0.04\bin.
So I made an instruction shteet how to download jdk1.5.0_04 and followed it religiously. And now, my Java program works like a charm!
Here it is:

Foolproof Downloading of Java Program JDK-1_5_0_04 � NB-4_1.win.exe
Into a Pentium IV Computer with Windows XP:
Log on to: http://java.sun.com/J2SE/
For J2SE-5.0

1.D/L: JDK-1_5_0_04-NB-4_1.win.exe (127 MB) D/L went fine on \\AMD)

2. Install at C: Same as under 1. (and <Enter>
gives: Welcome to the Install Wizard for Java 2- SED Kit, Update 4
and Netbeans IDE, 4.1.

This will install the above file on your computer; to
continue: choose NEXT.

3.Accept agreement

4. Installation locations will be as follows:
Netbeans:C:\Program Files\netbeans-4.1
J2SDK : C:\Program Files\Java\jdk1.5.0_04
Total size: 453 MB

5. Now installing: - Netbeans
-JDK
-Java Runtime Environment
-Building Storage
-Creating Uninstaller

6. Installation: Successful.

7.J2SE Development Kit, Update 4, Install location
C:\Program Files\Java\jdk1.5.0_04

J2SE Runtime Environment, Update 4
C:\Program Files\Java\jre1.5.0_04

Netbeans IDE 4.1
C:\Program Files\netbeans-4.1

8.To run the IDE command, launch:
C:\Program Files\netbeans-4.1\bin\netbeans.exe

To uninstall the IDE:
C:\Program files\netbeans-4.1\uninst\uninstaller.exe

To uninstall J2SE Development Kit, Update 4:
Use Add or Remove Program in Control Panel

To uninstall J2SE Runtime Environment, Update 4:
Use Add or Remove Program in Control Panel.

9. Add the following line to your Autoexec.bat file:
SET PATH=%PATH%; C:\Program Files\Java\jdk1.5.0_04\bin

For Classpath, also add to your Autoexec.bat:
SET CLASSPATH=C:\Program Files\Java

10. Finish (Netbeans 4.1 icon showed up on Desktop)

11. To print �Tutorial� , go to the same URL as mentioned above.

--- End. (Thank you for your wonderful help). Charles.
19 years ago
With Java-4 (jdk2sdk1.4.1.02) I was always able to create a class file using:
C:\Java-CK\>javac �d C:\Java-CK HelloDate.java
and I would get a file called HelloDate.class.
and I would be able to run this short program.

I am trying to do the same with Java-5 (jdk1.5.0_04) and it does not work.
It always gives me the following error message:
-Javac is not recognized as an internal or external command,
operable program or batch file.

In my C:>autoexec.bat I have a line:
SET PATH=%PATH%;�C:\Program Files\Java\bin�
and another line:
SET CLASSPATH=�C:\Program Files\Java�

Ii did that, because �javac.exe� is under \bin.
What did I do wrong?

Your help would be very much appreciated.
Charles.
19 years ago
I have a Wireless-B Notebook Adapter Linksys(WPC11 v.4) in my DELL -WinXP Laptop and in the "Network connection" it says:
Wireless Network Connection
Wireless-B Notebook Adapter
NOT CONNECTED, Firewalled
and I get a red cross across the icon.

I used to be able to go wireless to the internet via a router, Linksys,
Wireless-B Broadband router, Mod. BEFW11S4, and now it doesnot work anylonger.

What can I do to make it work again, e.g. how to make the connection
wireless between the Router and the adapter?

I tried to phone the support line of Linksys in India, and unfortunately
they have such a funny accent, that I can't understand what they say.
Your help would be very much appreciated.
Charles.
19 years ago
Is there a PDF File Creator which you can edit after the PDF file is reated? I also cannot see a "save" option in the "PDFCreator 0.8" program or do I look at the wrong place?
Besides "PDFCreator 0.8" are there other PDF file Creators Programs on the Shareware market which I should look at?
20 years ago
I have on an old 586 (Win98) two data files called
E:\data\ with about 25 subdirectories and a total of 300 files and
E:\data-1\ with about 30 subdirectories and a total of about 400 files
Now I intend to amalgamate E:\data into E: data-1 and I was thinking of using
xcopy E:\data\*.* E:\data-1\*.* /s
but my question is:
"if file in E:\data\ already exists in E:\Data-1\= do not copy"
what is the proper DOS syntax to achieve this?
Thank you for your input.
Charles.
20 years ago