Thursday, June 28, 2012

46 things that foreigners find surprising in Japan.

Actually, the title of the article is 外国人が日本に来て驚くこと46個. The highlights for me were:

1. The trains run on time. (I've never understood why they don't in other places)

8. Tabacco and SAKE vending machines. (I don't know why these aren't in other places)

22. Japanese like using Yahoo. (I was speaking once to a Google employee, and I told him why Yahoo, and why it was better and he called me stupid. You might have a good search engine, but your other service offerings are terrible Mr. Google. Also, したい should not always default to 死体! Your input methods and autocomplete are disgusting!)

46. The cutest Japanese girls are always dating the ugliest foreigners (カッコ悪い just doesn't translate well, but yes, they are that.)

Monday, June 25, 2012

Google's take on the Post.

This is the best summary of the Beech Daly Post Office, and sadly, it is true.

Tuesday, June 19, 2012

SerialPort and C#

The SerialPort class in C# has some interesting behavior when combined with a GUI.  The GUI threads seem to fight with the SerialPort IO.  I found the solution to be to use the BackgroundWorker class.


private void backgroundThread_read(object sender, DoWorkEventArgs e)
{
  BackgroundWorker worker = sender as BackgroundWorker;
  try
  {
     while ((worker.CancellationPending!=true))
     {
                       //serial IO
     }
     //when the shutdown occurs
     if (worker.CancellationPending == true)  
     {
        backgroundThread.CancelAsync();
      }
   }
   catch (Exception exc)
   {
      backgroundThread.CancelAsync();  //cancel the thread due to error
   }
}
I wrapped this with a messaging class that I made.

Tuesday, June 12, 2012

I need a Java preprocessor.

I like to have line numbers with my exceptions. Currently, I put them in statically.
try{
...
}catch(Exception e)
{  System.out.println("Exception at line LINENUMBER: "+e);  }
Or I will put it into my custom logger class that has the same format.
The best way that I have found to do this so far is:
String linenumber = new Exception().getStackTrace()[0].getLineNumber();
System.out.println("The line number is " + linenumber);
The problem with StackTrace is that it brings things to a halt.

Sunday, June 10, 2012

Haircut in North Conway?

I needed a haircut, and I happened to be in North Conway, NH.
The "Old Village Barbershop" is behind the Met Coffee shop downtown.  It was very interesting as I got a haircut, and got to look at schematics of weapons.   Tim Martineau was very interesting to speak with.  


View Larger Map