bill abbott’s weblog

Entries from June 2009

Now that’s odd… Java really IS different

June 30, 2009 · 2 Comments

My friend Harrison sent me a  Java file that was giving him trouble. He wanted to read in an Integer from in a command-line program. He found the method readInt() in the class Console. But it wouldn’t compile:

for ( i = 0; i < 5; i++)
System.out.println(“Array["+ i +"] = “+ array[i]);
String name = null;
int age = 0;
age = Console.readInt(“Enter Age:”);
}
}

PersonTest.java:74: cannot find symbol
symbol  : method readInt(java.lang.String)
location: class java.io.Console
age = console.readInt(“Int Enter Age:”);
^
1 errors

I did a little searching and found suggestions that he was going in the right direction:

   char letter = Console.readChar("Enter a letter: ");
   double d = Console.readDouble("Enter a real number: ");
   int i = Console.readInt("Enter an integer: ");
   String name = Console.readLine("Enter your full name: ");

http://faculty.cs.wwu.edu/martin/Software%20Packages/BreezyGUI/breezyguijavadoc/breezygui/console.html

hahaha! Turns out breezygui.console isn’t the same as console… the base language doesn’t actually have the readInt method, or readChar or readDouble. But apparently C# and or J++ and/or some dialect/library for C++ DO have a Console class with a readInt, readChar and readDouble members…

SO… you have to be VERY careful what the on-line document you’re counting on really says. It might have the method you want but only in a library you don’t have, or in another language completely. Ooof! is this fun or what???

Of course I showed Harrison how to get integer, double and char values he wanted. That’s what friends are for.

So be careful what you read and believe. Including this!

Categories: Personal Computers · Tools
Tagged: , ,

The best and worst plastic kits IMHO.

June 19, 2009 · Leave a Comment

Which are the best and worst plastic model kits?

So many qualify, but the criteria I might use are worth discussing, even if nobody ought to care what my personal picks are.

What IS a plastic model  kit? A set of parts, injection molded, on runners or “trees”, vacuum formed on a sheet of plastic, cast in resin and attached to  “pour blocks”,  laid-up with resin  and fiberglass cloth backing, perhaps including some cast metal, photo-etched sheet copper,  brass or stainless steel, possibly vinyl or rubber, metal or plastic tubing, rod and sheet, lead or other soft metal foil, soft wire, music wire. Most kits contain waterslide decals, though dry transfers or preformed stencils are also seen.

A good kit can be assembled without having to be re-designed, re-engineered or re-built, by the builder.

So the shapes have to be correct, within the limits of the materials and techniques.

All the parts have to be supplied- what can be seen looking at the model from outside, but including what can be seen inside windows, doors, vents, hatches, etc.

The pieces supplied have to assemble correctly, without having to be modified or re-thought-out

It should suggest an accurate representation of a specific object- real, imaginary, even speculative, but always specific.

It should be consistant with itself- textures, features, thicknesses, transparent parts, blank holes or paint/decal for windows, etc., should all be similar across the whole of the model.

More as I get time to add it.

Categories: Hasegawa · Heller · Hobby Shops · Italeri · Kato · Macintosh Computers · Matchbox · Military Models · Uncategorized

Completed Java 1, wrote a tidy bit of code:

June 16, 2009 · 2 Comments

If I’d turned in one last homework it would have been an “A”. Mia Culpa.  I nailed all the homework I did turn in- 12.5/12.5 for 1-6, but only got #7 ready to compile by the deadline.

Here’s I neat piece of code I wrote and used in a couple of places- give it a string containing a number and it will give you back the number- the base language doesn’t keep this in any obvious place, but perhaps I should check the utility library before claiming to have set them right. :^)
/* Here’s an object that packages the messy job of converting Strings that represent numbers into a double.  Int/float/double/long don’t appear to even offer a polymorphic solution. That I’ve found anyway.
Instantiate with a string,
get back a double

anything else I might want

Ok wise guy, how do you get the base classes text value??
Ah ha! String is final- no extending it! This class can HAVE one but can’t BE one
*/

public class NumericString{  // can’t “extends String” its final

String input;
Double value;
// Constructor

public void NumericString( String inputValue ) {

input = inputValue;

// later we can filter out all but the signed numeric nugget we care about…

if (-1 == input.indexOf(‘.’)) {   //only numerals, no decimal, its an integer.
value = (double) Integer.parseInt( input )
;
} else {   // there must have been a decimal, its a float/double
value = ((Double.valueOf(input).doubleValue()));
} // if -1 … else…
}

public Double num() {
return value;
}

} // class NumericString

Categories: Personal Computers
Tagged: , , , , , ,

Dr. G. R. Tiller, M.D. Murdered.

June 3, 2009 · Leave a Comment

In memoriam, Dr. George Richard Tiller, M.D., August 8, 1941- May 31, 2009.

Rest in Peace, Dr. Tiller. If the name isn’t ringing a bell, he was a doctor, in Kansas, who would perform late term abortions. Constantly threatened, shot over a decade ago, he was assassinated as he ushered at his church, on Sunday. A victim of violence which can fairly be called terrorist. Not the first doctor assassinated by anti-abortion activists. FoxNews’s Bill BO’Rielly repeatedly rabble-roused against him in recent years. Why DOES O’Rielly hate our freedom?

If you don’t like abortions, don’t have one.

Want to stop other people from having abortions? Make accurate and complete sex education a priority, and make sure a wide variety of contraception alternatives are readily available. This is proven to work.

Love babies? Help some teenage mother take care of hers. Help her finish high school Help her get the training and experience for a real job that pays more than minimum wage. Do the same for the father. Nothing is better for a child than an educated, self-reliant parent. Two educated and self-reliant parents are even better.

Want to teach only abstenence, allow no abortions and restrict informations and access to contraception?  Sorry, you’re delusional. The data’s in. Whole, *European*, countries, Ireland and Romania, for example, tried it. It doesn’t work. Saudi Arabia has and carries out the death penalty for sex outside of marriage. That doesn’t stop it.

Categories: Female roles in society · Geopolitics · Male Roles In Society · Politics · Popular Culture · What · Why · television