January 27, 2015

Matlab 2013b crash at start-up

If Matlab 2013b crashes at start-up with the "java.lang.NullPointerException" error, one possible solution is to temporarily change the Mac OS X version number.

For this, change the ProductVersion value from e.g., 10.10.1 to 10.90 in the file "/System/Library/CoreServices/SystemVersion.plist".

This change can be reverted once Matlab starts (recommended, since changing the OS version seems to interfere with Safari, etc.).

Reference: http://mathworks.com/matlabcentral/newsreader/view_thread/336387

March 6, 2014

static linking in gcc

In order to force static linking in gcc/g++ you need to use the option
'-static'. However, unless you have installed in advance the static
versions of the glibc libraries you will receive an error such as:
> /usr/bin/ld: cannot find -lm

To install the static versions of the libraries, on RHEL variants for
instance, run:
> sudo yum install glibc-static

December 2, 2013

using external JARs in Eclipse

In order to use external JAR files in Eclipse, the most robust way if
you develop on multiple platforms is to use "Preferences > Java > Build
Path > Classpath Variables" to add a classpath variable. You can give it
any name you wish, and you must associate to it the file name of the JAR
that you want to include.

import source code in eclipse

To import existing source code in Eclipse, do the following:
1) Create a new project and give it the same name with the directory
containing your source code.
2) Uncheck "Use default location" and manually set the location to the
directory containing the source code.
Usually Eclipse automatically detects your source code, and you can
simply click "Finish" to finalize project creation.

November 26, 2013

color code messages in thunderbird

In order to color message lines in the message pane in Thunderbird, you need to edit the CSS file "chrome/userChrome.css" in your profile directory. On Mac OS X this is located in "~/Library/Thunderbird/Profiles/xyz.default/". If the CSS file (or the chrome directory ) do not exist, create them.

A possible application is color coding replied messages. The code below uses green color to highlight them:

/*
 * Do not remove the @namespace line -- it's required for correct functioning
 */

/*
 * Set default namespace to XUL
 */
@namespace
url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");

/* background for normal message lines */
treechildren::-moz-tree-cell(replied) {
background-color: LightGreen !important;
}
/* background for current message line */
treechildren::-moz-tree-cell(replied,current) {
background-color: Green !important;
}
/* background for selected message lines */
treechildren::-moz-tree-cell(replied,selected) {
background-color: Green !important;
}

More examples can be found here:
http://www.eriwen.com/css/tweaking-thunderbirds-chrome/