Thursday, July 12, 2012

aclocal and ./configure

If you ever have a ./configure file, you need to be sure that you have automake and autoconf installed; however, that does not mean that it will work. Today I received this error:
aclocal.m4:14: error: this file was generated for autoconf 2.61.
You have another version of autoconf.  If you want to use that,
you should regenerate the build system entirely.
aclocal.m4:14: the top level
The solution is to do the following to rebuild the autoconf dependencies:
autoreconf && ./configure

Wednesday, July 4, 2012

MacOS 10.6 and building libjpeg


I had a terribly time getting jpeg-lib to compile under MacOS X, but I figured it out.   
uname -a gives me:
Darwin suiginnomaku.local 10.8.0 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386 i386
The simple instructions would be to download the tar.gz from http://sourceforge.net/projects/libjpeg/files/libjpeg/6b/ and untar the file.
You then change into the jpeg-6b directory. You must now copy configuration files for libtool into the directory and configure:
cp /usr/share/libtool/config/config.sub .
cp /usr/share/libtool/config/config.guess .
./configure --enable-shared --enable-static
You then need to edit the Makefile and change ./libtool to be:
LIBTOOL = glibtool
This is because of the fact that libtool that ships with the libjpeg source is outdated for MacOS, and glibtool is the version that is built-in.

You then type:
make
to build the files.

You then do a:
sudo make install

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