Saturday, August 13, 2011

Mercurial seems to hang in SourceForge connection because of host key change

Had a problem where mercurial seemed to hang forever in a SourceForge transaction.
It was run from within Eclipse via MercurialEclipse, and there was no indication as to
what's happening nor any way to stop it other than to kill Eclipse.

This was under Windows with hg calling putty, which in turn was configured to use an ssh key pair registered with SourceForge that had worked OK some time ago.

When executing hg from the command line, it would also hang, but I could stop it with Control-C, and then it would show the following message:

hg clone ssh://name@....hg.sourceforge.net/hgroot/....
interrupted!
remote: The server's host key is not cached in the registry. You
remote: have no guarantee that the server is the computer you
remote: think it is.
remote: The server's rsa2 key fingerprint is:
remote: ssh-rsa 2048 86:7b:1b:12:85:35:8a:b7:98:b6:d2:97:5e:96:58:1d
remote: If you trust this host, enter "y" to add the key to
remote: PuTTY's cache and carry on connecting.
remote: If you want to carry on connecting just once, without
remote: adding the key to the cache, enter "n".
remote: If you do not trust this host, press Return to abandon the
remote: connection.
remote: Store key in cache? (y/n) ^C

Again this was under Windows. On a real operating system the host key change prompt might have appeared before the Ctrl-C and thus be more obvious.

Anyway, the fix:

Run
putty -i path\to\the\key.ppk
once which will show the same host key change prompt and this time you can accept it.

From then on, hg works OK again.

Friday, July 29, 2011

JG1XHO



First signal from JG1XHO-7 from a Pizza place.

When zooming in, you can almost tell which table in the restaurant.







Next morning visited Rocket Radio in Akihabara to get parts for Dipole.

Friday, July 15, 2011

Change Eclipse plugin_customization.ini via feature

Eclipse has an elaborate hierarchical preference mechanism:
  • Plugins have a preferences.ini.
  • The product can override the settings of any plugin via a plugin_customization.ini file
  • Finally you can provide your own defaults via a command-line option -pluginCustomization /path/to/my/settings.ini.
When you create products, you typically include a plugin_customization.ini file in your product.

What if you need to create products with different settings?

Can you put the plugin_customization.ini file into fragments for your product plugin? That doesn't work. Plugin customization.ini files in fragments seem to be ignored.

But here's what you can do: Fake localization.

In your product plugin, have a plugin_customization.ini file that looks like this:

some.plugin/some_setting=%some_value

Then, in a fragment of the product plugin, place a plugin_customization.properties file that contains

some_value=Value A

In another fragment, you can have

some_value=Value B

By loading the appropriate fragments, for example from an update site, you can now install the settings that you want!

Friday, May 20, 2011

Associative JavaScript Arrays by Numeric 'ID'

I needed to keep browser-side information about certain objects by numeric ID.
When using an associative JavaScript array like this:

var gadgets;
gadgets[4711].name = 'Fred';
gadgets[4711].color = 'red';

you will find that it creates an array with (mostly empty) elements gadgets[0] to gadgets[4711].
On the other hand, when initializing the array like this:

gadgets['4711'].name = 'Fred';

it creates a single element in an associative container. Once created, you can access such elements with either gadgets[4711] or gatgets['4711']!

Friday, March 11, 2011

Belkin Play B600 Duplicate IP Address Problem

I have a cable modem internet connection that's shared by several computers at home via a Belkin wireless router. A Windows Vista PC is actually wired to the router, the other computers are on a WLAN.

The router is at http://192.168.2.1/. The wired PC is usually at 192.168.2.2. Other wireless devices get addresses like 192.168.2.3, 192.168.2.9 etc., meaning: Everything is on the same subnet, contrary to my previous wireless router that used different subnets for the wired and wireless devices.

Sometimes the wired PC reports a duplicate IP address error. The "easiest" fix seems to be:
  1. Power the PC down
  2. Power-cycle the wireless router
  3. Start the PC back up

Thursday, March 10, 2011

"Portable" Eclipse Projects

When you create a new Eclipse 'Plug-in' project, its initial configuration will lock to your current JRE and compiler settings.
When you then share that project with other people, they will see compiler errors because you may have used Java 1.6_19 on Linux while they use Java 1.6_20 on Windows.

To make your project more portable, do this:

  1. In the Package Explorer, right-click on your Plug-in Project and select "Properties"
  2. Under "Java Build Path", select tab "Libraries", item "JRE System Library", button "Edit". It should default to a specific "Execution environment" like "JavaSE1-6 (MacOS X 1.6.0 System). Change that to "Workspace default JRE", meaning: Use whatever the developer has configured in her workspace.
  3. Under "Java Compiler", by default "Enable project specific settings" will be checked. Uncheck that, meaning: Use the compiler settings that the developer has selected in her workspace.
  4. When you now switch to the Navigator view, you should find that the ".settings" directory that previously contained project-specific compiler settings is now empty. You can delete it.
After these steps, developers on other operating systems with slightly different java versions will have fever problems when they try to use your Plug-in source. Your MANIFEST.MF can still require a certain execution environment, so you are not loosing much control.

Wednesday, March 2, 2011

Hudson ignored CVS updates

In a setup where Hudson polls CVS for updates I ended up in a situation where newly added directories were ignored, and thus Hudson did not trigger a re-build of the product.

The Hudson "CVS Polling Log" looked like this:

[workspace] $ cvs -q -z0 -n update -PdC -D "Wednesday, March 2, 2011 3:51:38 PM UTC"
cvs update: New directory `.....' -- ignored


The fix was to delete everything inside the "workspace" directory. On the next Hudson run, it performed a complete cvs checkout and that included all changes.

Friday, February 11, 2011

Java Audio, FreeTTS "LINE UNAVAILABLE" Error

A program based on FreeTTS, the free text-to-speech engine for Java, was getting occasional errors
"LINE UNAVAILABLE: Format is ..."
The reason was later found in the KDE desktop: Its configuration panel has options to keep the audio device open for some time after playing beeps or other desktop sounds. The default seemed to be rather high at 60 seconds. But even after changing that to only 2 seconds, the FreeTTS library still needs to compete with some occasional other users of the audio devices.
Turns out there is no Java Exception or other mechanism to detect this error that occurs inside the FreeTTS library. All you get is the message on System.out, so there is no good way to react programatically.

Workaround: Configure the FreeTTS audio player to attempt accessing the audio device more than once until it succeeds. In this example, a short delay of 0.1 seconds is used to not miss an opportunity to grab the audio device; we keep trying for 30 seconds:
System.setProperty("com.sun.speech.freetts.audio.AudioPlayer.openFailDelayMs", "100");
System.setProperty("com.sun.speech.freetts.audio.AudioPlayer.totalOpenFailDelayMs", "30000");
If the audio device is permanently used by another program, there is of course no way to get access. Under Linux, this command will display the ID of the process that is currently holding the audio device, so you can then try to get rid of the offending program:
  /sbin/fuser /dev/dsp

Tuesday, January 18, 2011

Eclipse Build Path Problem After Mac OS X Java Update

In early January 2011, I received a Mac OS X Software Update that included Java changes.
This was on a Mac that had been upgraded to Snow Leopard, so older Java setups were still present, but this update must have removed older JVMs and JDKs.

As a result, Eclipse builds would fail with this error:
The container 'JRE System Library [J2SE-1.5]' references non existing library '/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Classes/laf.jar'
In general, the OS X Java setup changed from using
/System/Library/Frameworks/Java.VM.framework/Versions/...
to using a path like
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home

After going to Eclipse/Preferences/Java/Installed JREs and "Add..."ing a new JVM that uses the above path with ".../JavaVirtualMachines/..." all is fine again. You might have to look for the full path to that .../Home in a terminal window and copy/paste it into the Eclipse preference dialog, because the "Browse" button in the dialog might only show the 1.6.0.jdk as a package, not as a subdirectory into which you can drill down.

Next issue: You might not have a src.jar in that JDK to be able to view the Java sources, so you cannot view the source code for String, Map, ... and the other standard Java classes. That's because the default JDK is really more like a JRE.

After downloading the Java Development package from the Apple Developer Connection, something like javadeveloper_10.6_10m3261.dmg, you get a new JDK in

/Library/Java/JavaVirtualMachines/1.6.0_22-b04-307.jdk

and that one has a Content/Home/src.jar.
Note that the JDK that you install yourself, the one that includes the sources, is under /Library/Java/... while the Java stuff that comes with the OS is under /System/Library/Java/...

Eclipse should automatically detect the src.jar in the JDK that you install.

Note on finding the Java Development package as of August 2011:
  • http://developer.apple.com/
  • Member Center
  • Dev Centers: Mac
  • Resources
  • Mac OS X Developer Downloads
  • Java
  • Java for Mac OS X ... Developer ...

Friday, January 14, 2011

Eclipse Draw2D and GEF Sources, Online Help

When installing the Eclipse IDE for RCP development, it includes the Draw2D and GEF binaries, but not the sources. At least not in the Mac OS X version for Eclipse 3.5 and 3.6(.1).

How to get them: Also download the "Modeling" version of the IDE, and copy the following plugins from that into your RCP IDE's plugins directory:
  • org.eclipse.draw2d.doc.*.jar
  • org.eclipse.draw2d.source_*.jar
  • org.eclipse.gef.doc.*.jar
Yes, this contradicts everything you ever learned about P2, but it seemed the simplest way to get the sources & help.

Saturday, December 25, 2010

WII Coding

Tuesday, December 21, 2010

Light Switch Replaced

Light in one bedroom failed. Wasn't the light bulb. Worried that it's the light fixture or the wiring in the attic, but turned out to be the light switch. At Home Depot, found that it's the cheapest type of 15A, 120V single-pole switch: $1.30 incl. tax.

Monday, December 13, 2010

Top 5 Reasons NOT to use CA

CA (Cyanoacrylate) glue, super glue, instant glue, ... may just be the greatest thing that comes in small bottles.
Especially for model airplane kits where everything "interlocks", you can puzzle the pieces together, add a drop of CA to each joint, and you're done.
On the other hand, there also disadvantages, the top 5 being:
  1. The bottle always clogs up
  2. The fumes sting my eyes
  3. I've glued myself to the plane too often
  4. I'm in no hurry to finish an airplane because I already have too many airplanes
  5. It doesn't "sand" well

Tuesday, September 21, 2010

FreeMind

.. from http://freemind.sourceforge.net/wiki/index.php/Main_Page now has interesting extensions:

Friday, September 17, 2010

Netflix error in Safari: errorcode 2105

Netflix player stopped working from one day to the next with "ErrorCode 2105".
There was a link to nonsense about checking for fonts.

What helped:
  1. Close Safari
  2. Delete the file /Library/Internet Plug-Ins/Silverlight.plugin
  3. Start Safari, access Netflix, try to play movie, install the now missing Silverlight again
  4. Safari's Help/Installed Plugins shows Silverlight Plug-In version 4.0.50826.0

Saturday, September 4, 2010

Top 10 Computer Languages

According to http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html, it's
  • Java on top - Couldn't agree more
  • C before C++ - I'd still prefer C++ over C if used 'carefully', whatever that means
  • C# gains, but is behind
  • PHP, python above Perl - Hmm. For quick hacks, I do like perl
Systems that sound interesting, but looking at them I get a "well, maybe not":
  • go, Limbo: Inspired by Plan 9, built-in communication channels
  • Erlang
No longer seem to matter:
  • Prolog way down on list
  • Smalltalk off top-50

Saturday, August 14, 2010

LEGO Mindstorms RCX 2.0

Still have LEGO Mindstorms RCX 2.0 from ca. 2003. The original software that came with it does not run under Vista. It does run under Windows XP, but caused 2 problems:
  1. Will quit with an out-of-memory error when a current version of Quicktime is installed. Installing the older version of QT from the LEGO CD works, but will break online movie sites that require a more recent QT.
  2. The "Robotics Invention System" software will auto-start when Windows starts up. Remove the corresponding entry from the registry via regedit.exe in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
LEJOS, http://lejos.sourceforge.net, might be a better choice for the actual program, but the graphical LEGO program is neat for children.

Tuesday, August 3, 2010

Garage Door Repair

How long do garage door mechanisms last?
Don't remember all the dates, but had to replace a motor and a spring already. Today another spring. While doing that, noticed that a wire was damaged, so swapped that and also needed a new pulley.

WhenWhat
2006?Left garage spring
2008?Right garage Motor
2010Left garage spring, wire ropes, pulley $60