Tuesday, June 30, 2009

wine: remove Wine gnome menu

In my system (Arch Linux) after removing wine (sudo pacman -R wine), the Wine gnome menu was still in the Gnome Menus. To remove it, I had to delete it manualy from my .local folder:rm -rvf ~/.local/share/applications/wine

Thursday, June 18, 2009

python: numbers starting with zero are octagonal

I was debugging my script and I found that a number that starts from zero is different that the number without zero. This is because these numbers are octal literals. For example In [1]: a=23
In [2]: b=023
In [3]: a==b
Out[3]: False
In [4]: print a,b
23 19
It appears that when a number starts from zero it is treated as an octagonal number rather than decimal number. Good to know, as it is easy to make mistake.

Wednesday, June 17, 2009

CentoOS: problem to install Abacus 6.8

When I was installing Abacus 6.8 on CentOS 5.2 x86_64 I run into three problems. The first one was that installation script did not recognize my Linux distribution (i.e. CentOS 5.2), the second was that that after successful installation, I could not start freshly installed abacus because of missing one library, and the last problem was that the GUI would not start. Below more details on these problems are given, along with my solutions to them.

1. Unable to determine Linux Distribution

When a user (or a root) wants to install Abacus 6.8 on CentOS 5.2, at the beginning of installation process the error appears: "Unable to determine Linux Distribution". In another words, CentOS is not supported and the user should use Red Hat Enterprise or SuSE. The full list of the supported distributions is in the contents of the error and the error itself is shown below:
Checking system requirements for installation. This will
take just a moment...

***ERROR: One or more system tests have failed the minimum installation
requirements. The installation procedure will not continue.
Hit to view the output from this system check.

Checking for GNU Lib C version 2.3.2 or newer.
Pass - Found GNU Lib C Version 2.5.
WARNING: Problem parsing /etc/redhat-release to determine version of Red Hat.

Running system configuration checks for Linux/x86-64.
Please wait until all the needed information has been gathered...

System requirement status is:

Requirement: SuSE 9.3, 10.0, 10.1 or 10.2, SuSE Enterprise Linux 9.0
or 10.0, SuSE Enterprise Desktop 10, Red Hat Enterprise
3.0, 4.0 or 5.0, or Fedora Core 6.0
Products: All Abaqus Products
Status: Fail - Unable to determine Linux Distribution.

Requirement: GNU Lib C 2.3.2 or greater
Products: All Abaqus Products
Status: Pass - Found GNU Lib C 2.5, which was installed with

Not all requirement checks succeeded.
The solution to this problem is quite easy. After going through some installation scripts, I found that, they relay on the file /etc/redhat-release. This file can be found in RHEL and CentOS. Therefore, instalation script checks the contents of this file, and if it does not find something familiar e.g. Red Hat Enterprise Linux AS 5, the error occurs and the installation stops. In CentOS 5.2. the contents of this file is just one line:[W@localhost ~]$ cat /etc/redhat-release
CentOS release 5.2 (Final)
Therefore, what can be done is to change this file temporary, just for the purpose of the installation of Abacus. I just add "Red Hat Enterprise Linux AS 5" as a second line /etc/redhat-release and the installation script should worked.
The installation went good, no more problems. The other two problems occurred after successful installation, when I wanted to start Abaqus.

Error while loading shared libraries: libstdc++.so.5

I installed Abaqus in /opt/abaqus68. During the first attempt to start Abaqus CAE or Viewer I got the error that there are was no libstdc++.so.5 library:[W@localhost ~]$ /opt/abaqus68/Commands/abq682 cae
/opt/abaqus68/6.8-2/exec/ABQcaeK.exe: error while loading shared libraries: libstdc++.so.5: cannot open shared object file: No such file or directory
Abaqus Error: Abaqus/CAE Kernel exited with an error.
This problem was easily solved, because CentOS 5.2 DVD comes with this library. So, I just installed it using pirut. To be specific I installed the following rpm: compat-ibstdc++-33-3.2.3-61.x86_64

Insufficient system resource available.

After installing the missing library, the finall error was "ValueError: Insufficient system resource available."[W@localhost ~]$ /opt/abaqus68/Commands/abq682 cea
Abaqus License Manager checked out the following license(s):
"cae" version 6.8 from abaqus.some.example.com
ValueError: Insufficient system resource available.

Abaqus Error: Abaqus/CAE Kernel exited with an error.
Abaqus Error: Abaqus/Viewer exited with an error
This problem has something to do with X11 server and graphics hardware acceleration. My server does not have 3D graphic card, so no chance for hardware acceleration. The solution was to disable it by starting abaqus with and option -mesa:/opt/abaqus68/Commands/abq682 cae -mesaor/opt/abaqus68/Commands/abq682 viewer -mesaFinnaly, after some time spent on installing and starting Abaqus I and other users could use it:

Monday, June 15, 2009

Kyoto subway

Recently I visited Kyoto (Japan) for business. Before the visit I was looking for some info about how to use subway, if there are English signs and is it easy to use for a foreigner (yes, its very easy!). I could not found much info about this, so when I was in Kyoto I decided to take some pictures of Kyoto subway station next to my hotel.

I was using everyday Karasuma Line to get from my hotel (i.e. Gimmond hotel - it have no complains about this hotel) to my destination. The Gimmond hotel is just next to station K08 (i.e. Karasuma Oike). So I took some pictures from this station:

Kyoto subway map

This map is taken from this website.

Buying tickets

To my surprise using tickets wending machines, buying tickets and using subway was very easy. So I was basically traveling from station K08 to station K01 (the cost was 280 yen) and from K08 to K11 (i.e. main Kyoto station, cost 210 yen). So to use the subway we off course need to buy tickets. This is done using tickets vending machines available on each station:

To buy tickets it:

1. First check how expensive tickets you have to buy for your destination. You do this buy analysis subway map board above the wending machines (see above picture).

2. Put required amount of money to the wending machine. You can put more. For example if you want to go from K08 to K01 it costs 280 yen. You can put 500 yen coin or a 1000 yen bill into the wending machine or more. The machine will return you the change.

3. Once you put some money into the machine, the machine shows you the available tickets for this price:
4. You select thicket that you want and you collect the ticket and change if necessary:

5. When you have tickets you go to subway gates and use it there to "tag in". At your destination you use it again to "tag off". Or just follow the crowd:-) It's worth noticing that at the destination station when you "tag off" your tickets is automatically taken by the gate, so you loose it. If you want to keep it and have a recite, because for example you want a refund from your company for the tickets, you should not "tag off" using gates. Instead go to a booth next to the gates, there will be a subway stuff person and ask him for a recite. He will give you a red, rectangular stump on your ticket (see below):

Basically there are no problems using the subway in Kyoto. There are plenty of English signs next to Japanese ones, so everyone that knows a little bit of English should be fine. The only challenge at the very beginning might be buying tickets, but I hope that my post will help with this.

Some other sites in English about Kyoto public transport


Sunday, June 14, 2009

Mathematica: xset: bad font path element (#23)

I have Mathematica 7.0 installed on a Linux server with CentOS 5.2. I'm using my PC (now Arch Linux) to x forwad (ssh -Y login@server) mathematica from the server to my PC. Unfortunately I was getting error xset: bad font path element (#23), possible causes are:
Directory does not exist or has wrong permissions
Directory missing fonts.dir
Incorrect font server address or syntax
After 20-30 seconds I was getting the following window:
This is a common problem and the solution is here. For clarity I write what I did:
  1. From Mathematica's CD I unpacked /Unix/Files/Fonts/contents.tar.gz into my home directory in my Arch Linux PC. After unpacking the font path was: /home/W/SystemFiles/Fonts/Type1
  2. I added this path to my font path: xset fp+ /home/W/SystemFiles/Fonts/Type1; xset fp rehash
  3. I chacked if the new path was included: xset q
  4. I logged into the serwer using ssh -Y login@server and started mathematica and it worked!

Saturday, June 13, 2009

imagemagick: change color image to gray

convert -type Grayscale old.tiff new.tiffor to overiate original imagemogrify -type Grayscale old.tiff or to convert all images in a current folder:for f in *.tiff; do mogrify -type Grayscale $f ;done

Tuesday, June 02, 2009

Paired t-test assumption of normality

It is important to remember that paired t-test is valid if the differences of pairs of variables are normally distributed. It appears that the variables itself do not need to be normally distributed, as paired t-test only operates on the differences. This observation is based on [Bland2000, p. 161 and 260].

Normality of a sample can be evaluated using Q-Q plots [Bland2000, ch. 7.5]. However, the problem with these plots is that they are not objective, i.e. for one person a sample is normally distributed, for other person the same sample may be only approximately normally distributed while for the third person it is not normally distributed. For that reason quantitative methods are better. One of such methods is Shapiro-Wilk test. The other method is Kolmogorov-Smirnov test. For small samples (i.e. 50) Shapiro-Wilk is generally more accurate [Marques2003 p.157].

If sample was found to be non Normal, Wilcoxon signed-rank test (called also Wilcoxon matched pairs test) can be used [Bland2000, ch.12.3].

All the above tests can be performed easily in SPSS.

Bland, Martin. An Introduction to Medical Statistics 3th ed, Oxford University Press, 2000
J. P. Marques de Sá Applied statistics: using SPSS, STATISTICA, and MATLAB, Springer, 2003