What’s the diff?

My problem was that my revised version of the Java program did not work as expected. While I believed that I had changed nothing but comments, the results were not the same. What had I changed?

“Oh, that’s easy” says I, “I’ll just diff the files and see what changed”. Well according to diff, EVERYTHING had changed. I used the regular options like -w, and -E, and -d, and -B and still no improvement.

“Duh”, he says, “it’s the encoding”. What is the diff option to compare two texts with different encoding? The short answer seems to be that there is no option.

But where there’s a will, there’s a way, particularly with Linux (and Unix). In Linux use the iconv command to do the conversion and pipe the output to diff for the compare.

If you do not know iconv, the short form is:

iconv -f from-file-encoding -t to-file-encoding from-file-name

Output to stdout.

Pipe it to diff and tell diff to pick up the input from the pipe with a dash – .

If you do not know the encoding of the files, use the file command to show you the encoding.

To find out if the encoding is supported (and spelled correctly), use

iconv -l

for a list of supported encodings.

The answer to the original question looks like:

iconv -f ISO-8859-1 -t UTF-8 ../x3-2.14/x3navaldv0.2.14/java/bateau/Bateau.java | diff -w - java/bateau/Bateau.java

I had changed only comments. Compiler difference? Compiler option difference?

It’s a gas, gas, gas…

During the Viet Nam era, many of my colleagues went through “boot camp”. Boot camp for me meant a basic training in the arts and skills required to be member of the U.S. Navy. Two of the basic skills that were “cancelled” because of weather were “Firefighting practice” and “Gas Mask experience”. The Navy training then was in my opinion, then, and, in retrospect, very good. Given the broad cross-section of young men (only men in my company), an instructor explained the the background of each element of the important knowledge. We took notes in an notebook that was always with us because it was tucked in the top of the legging that we wore to keep our uniform pants from dragging in the ever-present slush on the parking lot like areas where, when we were not busy with some other activity, we learned close-order drill.
I sincerely hope that those in my boot camp company escaped both the firefighting experience and the gas mask experience in serious situations.
In the Spring of 1969, the country was at war with itself over the War in VietNam. Students had been killed at Kent State University in Ohio. I remember where I was when I heard that news because my sister was a student at Kent State. In the pre-cell phone era, I had to wait until I could get off duty and get to a payphone to call my folks to find out that my sister was all right.
So, when I was “volunteered” to protect the old “Main Navy Building” (http://www.history.navy.mil/library/online/main_navy_bldg.htm#2) from a peace march, I was less than thrilled. When the crowd control training started, OK, I can do that. When the weapons training started with “strip this weapon and reassemble”, I was less than enthusiastic. The big weekend arrived. They gave us a gas mask and a rifle and loaded us on a bus, drove us to Washington D.C. First person I saw when we got off the bus was a First Class Petty Officer, who said, “we are putting these away unless we need them”, took my weapon and tucked it in a closet. Prayers answered.
The building was closed. All of the doors and windows were supposed to be locked. They assigned “watch’s” as the Navy calls what the other services call “guard duty”. My watch assignment was as a messenger. While on my 4-hour watch (4-on, 4-off 24x?) I circulated to each doorway on the ground floor. I guess in those days we did not have to worry about drones and roof invasions. The guys watching the doors got to see lots of hippy guys and GIRLS going by. I got to see lots of hallway. Late one evening, while walking this endless hallway, I smelled a strange and pretty awful smell. “That’s tear gas” he says to him self, half-way through a breathe-in event. STOP. Mask out of the bag, onto the face, breath out to clear the mask, fix the mask to the head, continue breathing, continue duty. I rouned the corner to discover that the “command center” had opened the window to permit fresh air while the officers and senior petty officers smoked.
Meanwhile, on the other side of the National Mall, the Weathermen had vandalized the Treasury Building and the police/guard/NationalGuard had responded with a massive tear gas response. Prevailing winds and pervasive gas, probably gassed the entire area including the command center.
In reviewing the situation, I find that the Navy has moved the fire fighting and gas training to a large indoor center. My wish is that the Navy boot camp training continues to prepare our sailors for the unexpected events they may encounter.

Building an Empire

My son’s girlfriend gave me a great Christmas gift.DSC_4409
In one shot it satisfies my longing for metal-working, model making, real estate, architecture. WOW!

DSC_4410
These laser-cut pieces of sheet metal can be re-arranged into actual models of things New York City, New York
I previously put together the model of the Chrysler Building but have not yet posted the pictures. In this post, I will discuss the Empire State Building

DSC_4412
I have shown some of the tools that I used to assemble the Chrysler building but as always, experience teaches and I added a couple tools, tips, and techniques down the road. I tried to rotate the image so that the instructions were on top but it did not seem to take. If you buy the kits, you will get a separate instruction sheet for each model.

The diagonal cutters may be useful on the larger pieces that are anchored in three places to break the third point so the model piece can be rotated about the other pair of points to get it to separate. Be careful not accidentally flex or bend the individual pieces while removing them from the carrier flat sheet.

DSC_4414

The pieces have folds. The dotted-line folds are “valley folds”. The solid line folds are “mountain folds”. Only make the folds as described by the directions. Making a fold too early may make a later assembly difficult.
DSC_4418

Visible joints are tab-thru-slot folded over. The hidden ones, mostly on the base, are tab-thru-slot twisted to tighten. The instruction sheet notes these with an icon dipicting the correct technique.

DSC_4419
The architectural and visual interest of the Empire State Building comes from its intersecting solid volumes. To construct these from sheet metal makes the challenge of marrying two not-quite square folded sheets and getting all of the tabs to line up with all of the slots. I found that the Popsicle stick, a scribe, the needle-nose pliers and a lot of patience were all helpful.

I realized as I was working that some of the longer folds were difficult to keep flat and square without a hard surface with a flat edge. I made a “brake” from a Popsicle stick that helped make the folds flat and square without distorting the adjacent surface. Cut one of the rounded ends off square with a hobby-knife or fine saw. You can also use this tool as a poker to flatten internal tabs or to flatten a surface that has been pushed in too far during assembly.

DSC_4421

DSC_4422

You may be able to see that I squeezed to hard and curved a side that needs to be flat. Using the edge of Popsicle stick was helpful in correcting this problem. In each of the following illustrations, I have tried to be faithful to the directions by showing the pieces to be added and in the next picture how they look after they are installed.
DSC_4423

DSC_4425

DSC_4428

DSC_4430

DSC_4431
Did I mention that the Empire State Building is not huge?

DSC_4433
With the base plate applied with the twist-tab method and the final bits to add to the top. Now you may see why not folding down the top plate makes assembly easier.
DSC_4434

You can get these models from Fascinations.com MetalEarth series directly from the web or from select retailers. The home page has a Where-to-buy button.

The New York City set includes Chrysler Building, Empire State Building, Checker Cab, and Staten Island Ferry.

Marbled Orb Weaver

Araneus marmoreus,AKA Pumpkin spider. Found on the ground after several days of rainy weather with highs in the 40F’s (4-6C) range.

Picture of orange spider with black and white legs
Marbled Orb Weaver

Picture of orange spider with black and white legs
Marbled Orb Weaver
Picture of orange spider with black and white legs
Marbled Orb Weaver
Spiders eyes are visible
Spiders eyes
Picture of orange spider with black and white legs
Marbled Orb Weaver

Freedom

Freedom is a word I rarely use without thinking. And without thinking of Richie Havens. I have an LP that I had before Woodstock. Did not get to go there. Glad that Mr. Havens remains will be there.
If you have never heard it, find it, play it, listen.

Listen also to the Woodstock soundtrack.


Freedom!
Free-ee-dom!
Free-DOM!

Sometimes I feel like I’m almost gone

A long, long, long, way, way from my home

Like every day, today is a confluence. Snowden, Kim Dotcom, Richie Havens, freedom.

Perhaps this interview interview will be required reading someday. Or banned/buried if the current administration has its way.

Marking? What marking?

I have heard about of couple of cases this week involving farmers abused by patent owners. I am sure that the lawyers involved looked at this: “Except on proof that the infringer was notified of the infringement and continued to infringe thereafter, in which event damages may be recovered only for infringement occurring after such notice”.
That is from: This Cornell Law Posting
So where on that seed was Pat. nnnnnnnn?
Just saying.
I am not alwyer and do not aspire to be but lawyers and judges are expected to be able to read.

Oh, if the infringer had made best efforts to avoid buying the “falsly unmarked” product, how can he/she be an infringer? Is he/she entitled to compensation for frivolous suit?

Who pays? You pay.

Once upon a time I went to a Halloween costume party.  There I met a man dressed as a gangster with a woman in a rabbit (as distinct from a bunny) costume.  Nice couple.  He was an IRS auditor and we talked a bit about IRS and that kind of thing.

The take away from that conversation was “if you are non-compliant, never brag about”.  The vast majority of people investigated are under suspicion because a neighbor called them on it.

Back when the Presidential race was on and Wanna-be King Obama squared off against RichBoy Romney.  A controversy was that Mr. Romney would not make some of his older returns public.  Hey folks, put your mouth where your money is (Washington). They could have called him a tax cheat and gotten him audited.

The fact of the matter is that most wealthy folk can afford to hire very good accountants and very good lawyers to advise them.  Why do they need good lawyers and accountants.  *BAD TAX LAW*

Who makes *BAD TAX LAW*? It starts with the House and is amplified by the Senate. Why should YOU have to pay someone to do your taxes? Any tax that complicated cannot be fair. Period.

The Republicans say they want to reform the tax system. So do the Democrats. Republican voters mostly want lower taxes and smaller government. Democrats seem to want larger government and the higher taxes required to pay for it, as long as it is perceived that someone else is paying.

My prediction is that even with sequester and all of that nonsense, taxes will go up and you will pay more, regardless of you income.

FLTK – Fast Light Tool Kit

While working on an earlier project, I ran across a very good, portable window/widget tool kit. It goes by the name of FLTK (pronounced full-tick). A good tutorials exist here (note especially the “label pitfall”) and here which will teach you the basics. There are example programs in the full install found at the FLTK website along with an excellent programming manual. Documentation for previous releases is available. Ubuntu 10.4 LTS comes with FLTK 1.1.0.
When I began a new project, I decided to self-educate and used the second, pdf, tutorial above. I quickly worked through the examples until I got to 16. Handling mouse events part2 for the follow-the-mouse drawing program where I ran into a problem with the offscreenbuffer functions. I searched a bit for solutions. After reading more tutorials and more manuals, I discovered that the problem is that the example is omits several required includes. <stdlib.h> and <stdio.h>  are easy. A bit more difficult is #INCLUDE <FL/x.H>. This include provides environmental information for X11, in particular the definition for FL_Offscreen. These details are covered in Appendix F Operating System issues and briefly at “Drawing Things with FLTK” in the later on-line versions of the programming manual. But x.H may not be apparent at first glance. A corresponding win32.H also exists but including x.H will pick up the correct info if your environment variables are set.
With those three additions, the example 16 program compiles and runs.

Hacker Attire

Hacker in balaclava and black sweater using laptop
Hacker hacking
I was taking some “security training” for work. When they referred to “hackers”, the training showed “hackers” dressed in dark clothes and balaclava’s. I had seen this with other web sites. Since it is on the web and pervasive, it must be they way hackers really dress. I wondered why so I e-mailed my son who has degree in computer science and often is well informed on technical topics.

His response:

Dad,
This is a carryover from the days before surface mount technology, when computer hacking required the use of a soldering iron.

The jumpsuit protected the “hacker’s” body from stray molten solder. The balaclava, which you’ll note covers the nose and mouth, protected the individual’s lungs from harmful fumes that can be released during soldering, including lead, arsenic, organobromides and resin acid particulates. Some of these gases can also cause contact dermatitis, a risk that is also abated by the jumpsuit.

Of course, modern-day hackers can simply exploit operating system design flaws to perform their work. The dress is now ceremonial, though its use is required in the EU (some laws are slow to change!)

Hope this helps…

Yep.

Forward.  Ennui! You voted. Or perhaps did not.
Here we are just about the same
Foggy little fella, drowsy little dame
Two sleepy people by dawn’s early light
And so much in love, so much in love
Too much in love to say good night.