The locale environment variables can affect the encoding of Java applications.
Thus, sometimes if you do not set the variables correctly, you can't run your Java applications.
You can run command "locale" to display all the locale environment variables of current shell:
$ locale
LANG=en_US.utf8
LC_CTYPE=de_DE.utf8
LC_NUMERIC=de_DE.utf8
LC_TIME=de_DE.utf8
LC_COLLATE=de_DE.utf8
LC_MONETARY=de_DE.utf8
LC_MESSAGES=en_US.utf8
LC_PAPER=de_DE.utf8
LC_NAME=de_DE.utf8
LC_ADDRESS=de_DE.utf8
LC_TELEPHONE=de_DE.utf8
LC_MEASUREMENT=de_DE.utf8
LC_IDENTIFICATION=en_US.utf8
LC_ALL=
You can see all the supported locale settings using:
$locale -a
The setting of LC_CTYPE seems to be decisive over all other variables except for LC_ALL. Setting LC_ALL overrides any other locale variable.
Wednesday, January 20, 2010
Sunday, January 3, 2010
How to use the internal language model of moses on Windows
the Internal LM is meant to mimic SRILM,
and you need to use SRILM to train your language model under Linux first,
and then copy the trained language model files to Windows.
You also need to copy all the translation models, including phrase table, reordering model to Windows, and of course changing the moses ini file is needed, because the path names are different.
On Windows, you can use language models which are up to trigram.
Although the windows version of moses can run with 4-gram or higher language models,
but the translation results are incorrect.
and you need to use SRILM to train your language model under Linux first,
and then copy the trained language model files to Windows.
You also need to copy all the translation models, including phrase table, reordering model to Windows, and of course changing the moses ini file is needed, because the path names are different.
On Windows, you can use language models which are up to trigram.
Although the windows version of moses can run with 4-gram or higher language models,
but the translation results are incorrect.
Saturday, January 2, 2010
How to compile moses under Visual Studio 2005
Moses can be compiled under Visual Studio 2005.
Fortunately, moses provides all the necessary files for you including solution and project files.
However, you also need to download some source files and library files as described in:
http://www.statmt.org/moses/?n=Moses.LibrariesUsed
For me, I need to download VLD and zlib. They are both pre-compiled version, and what you need to do is to add the directories to your moses solution under Visual Studion 2005.
When you first open the solution of moses, you will see four projects as follows:

After that you need to download VLD and zlib, and I put the two downloaded folders under the solution directory of moses as follows:

For the project "moses", you need to add "Additional Include Directories" in the property of the project:

and you also need to add "Additional Library Diretories":

For the other three projects, you need to add "Additional Include Directories" and "Additional Dependencies" as follows:


Finally, you did it, and you can compile the whole solution now.
Fortunately, moses provides all the necessary files for you including solution and project files.
However, you also need to download some source files and library files as described in:
http://www.statmt.org/moses/?n=Moses.LibrariesUsed
For me, I need to download VLD and zlib. They are both pre-compiled version, and what you need to do is to add the directories to your moses solution under Visual Studion 2005.
When you first open the solution of moses, you will see four projects as follows:
After that you need to download VLD and zlib, and I put the two downloaded folders under the solution directory of moses as follows:
For the project "moses", you need to add "Additional Include Directories" in the property of the project:
and you also need to add "Additional Library Diretories":
For the other three projects, you need to add "Additional Include Directories" and "Additional Dependencies" as follows:
Finally, you did it, and you can compile the whole solution now.
Thursday, December 31, 2009
How to jailbreak ipod touch (itouch) 3.1.2
The itouch I got is the newest one, maybe which is the 3G.
I did all the things in Windows 7.
1. Install itune from the apple official website
2. download blackra1n from:
http://blackra1n.com/
3. connect your itouch to your PC, and open the itune you installed already.
4. open blackra1n.exe

5. Click the "make it ra1n" button.
6. blackra1n will now put your iPod Touch into recovery mode and your itouch will display the following picture of Geohot. While in recovery mode, blackra1n will jailbreak your iPod touch.

7. Once blackra1n finishes jailbreaking, your iPod Touch will reboot and you should see the blackra1n icon as follows on your iPod touch screen.
I did all the things in Windows 7.
1. Install itune from the apple official website
2. download blackra1n from:
http://blackra1n.com/
3. connect your itouch to your PC, and open the itune you installed already.
4. open blackra1n.exe

5. Click the "make it ra1n" button.
6. blackra1n will now put your iPod Touch into recovery mode and your itouch will display the following picture of Geohot. While in recovery mode, blackra1n will jailbreak your iPod touch.

7. Once blackra1n finishes jailbreaking, your iPod Touch will reboot and you should see the blackra1n icon as follows on your iPod touch screen.

Friday, December 18, 2009
fix the ikee worm on iphone

One day, I found the background of the lock screen (the background image on the "slide to unlock" screen) was changed by some application.
In fact this is the first worm which infects iphone.
The worm is known as ikee, and it only affects “jail-broken” phones, because a user has removed Apple’s protection mechanisms to allow the phone to run any software.
How to fix:
http://www.austech.info/mobile-phones/29790-quick-fix-iphone-ikee-never-going-give-you-up-ssh-virus.html
P.S.
Firmware 3.0 doesnt have apt-get installed by default when you jailbreak it, so u need to install Aptitude from Cydia.
Thursday, December 17, 2009
Install packages for Kile on Ubuntu
you can install the corresponding texlive packages by Synaptic.
1. Open the Synaptic program (System->Administration->Synaptic)
2. click on search and search for algorithm for algorithm.sty
3. You will find some package contains the style. Choose and install that.
1. Open the Synaptic program (System->Administration->Synaptic)
2. click on search and search for algorithm for algorithm.sty
3. You will find some package contains the style. Choose and install that.
Wednesday, December 16, 2009
install ubuntu 9.10 on Macbook air
Install OS
1. Install rEFIt (this step is optional, you can hold 'Alt' to select partition everytime instead).
2. Use Boot Camp Assistant (it's in Applications/Utilities) to create new partition.
3. Insert the live CD (Ubuntu 9.04) into the drive (no need to be the Apple External Drive) and reboot
4. Hold down ‘C’ button at the black screen to boot from CD.
5. Follow usual Ubuntu installation step. In keyboard selection screen, choose “US-macintosh”
6. In partitioning screen, choose ‘manually edit partition table’.Just create a swap partition and a ext3 partition(Mount it as ‘/’).
7. Complete the installation process. Then reboot.
8. If you install rEFIt, the boot menu will show up. If not, hold 'Alt' button for a while and select the Windows partition for Ubuntu.
9. Upgrade your ubuntu to Ubuntu 9.10
Mac touchpad
in Ubuntu 9.04, the touchpad do not support the right click (two fingers tap),
and after upgrading to 9.10, it can work well.
Wifi
For the first boot of Ubuntu, wifi does not work(can't find any network, but the driver is OK).
And after reboot, it can work well.
Sound
sudo modprobe snd-hda-intel
sudo echo "options snd-hda-intel model=mbp3" >> /etc/modprobe.d/alsa-base.conf
, then restart alsa - i.e
sudo /sbin/alsa force-reload
Then reboot
for your reference:
http://ubuntuforums.org/showthread.php?t=205449
Brightness
The brightness button of macbook air works very slowly in Ubuntu 9.10.
You need to press it for a while to adjust the brightness of your LCD.
I also tried to directly install Ubuntu 9.10 on my macbook air, and I found that there was also no sound and the wireless driver was not installed by default. You can refer to:
http://www.ubuntugeek.com/fix-for-broadcom-4328-v3-wireless-problem-in-ubuntu-9-10-karmic.html
to solve your wireless problem.
The original post I used to solve my wireless problem is as follows:
1. Install rEFIt (this step is optional, you can hold 'Alt' to select partition everytime instead).
2. Use Boot Camp Assistant (it's in Applications/Utilities) to create new partition.
3. Insert the live CD (Ubuntu 9.04) into the drive (no need to be the Apple External Drive) and reboot
4. Hold down ‘C’ button at the black screen to boot from CD.
5. Follow usual Ubuntu installation step. In keyboard selection screen, choose “US-macintosh”
6. In partitioning screen, choose ‘manually edit partition table’.Just create a swap partition and a ext3 partition(Mount it as ‘/’).
7. Complete the installation process. Then reboot.
8. If you install rEFIt, the boot menu will show up. If not, hold 'Alt' button for a while and select the Windows partition for Ubuntu.
9. Upgrade your ubuntu to Ubuntu 9.10
Mac touchpad
in Ubuntu 9.04, the touchpad do not support the right click (two fingers tap),
and after upgrading to 9.10, it can work well.
Wifi
For the first boot of Ubuntu, wifi does not work(can't find any network, but the driver is OK).
And after reboot, it can work well.
Sound
sudo modprobe snd-hda-intel
sudo echo "options snd-hda-intel model=mbp3" >> /etc/modprobe.d/alsa-base.conf
, then restart alsa - i.e
sudo /sbin/alsa force-reload
Then reboot
for your reference:
http://ubuntuforums.org/showthread.php?t=205449
Brightness
The brightness button of macbook air works very slowly in Ubuntu 9.10.
You need to press it for a while to adjust the brightness of your LCD.
I also tried to directly install Ubuntu 9.10 on my macbook air, and I found that there was also no sound and the wireless driver was not installed by default. You can refer to:
http://www.ubuntugeek.com/fix-for-broadcom-4328-v3-wireless-problem-in-ubuntu-9-10-karmic.html
to solve your wireless problem.
The original post I used to solve my wireless problem is as follows:
This tutorial will explain how to fix Broadcom 4328 v3 wireless problem in ubuntu karmic
Try unloading the module (sudo modprobe -r wl) then reload the module (sudo modprobe wl). You should now connect, however it may freeze… the broadcom module is a PITA and I had consistent, yet random system lock ups.
The instructions below will compile the most current version of the bcmwl driver and replace the currently supplied version.
This method has the advantage that in the event there is a update, your newer file will simply be replaced during the upgrade. Keep in mind however that in the event there is a kernel update you will have to repeat the process as the update will overwrite your custom wl.ko.
Also keep in mind that since this a closed source binary “blob” YMMV.
Procedure to follow
First you need to download latest broadcom drivers from:
http://www.broadcom.com/docs/linux_sta/hybrid-portsrc-x86_32-v5.10.91.9.3.tar.gz
Make a directory and extract the files in the archive
mkdir bcmwl
tar xvf ‘hybrid-portsrc-x86_32-v5.10.91.9.3.tar (1).gz’ -C bcmwl
Compile the source
You will need to install the build-essential and kernel headers packages
sudo apt-get install build-essential kernel-header-`uname -r`
To Compile the driver
cd bcmwl
make clean
make
replace the current driver file with the one that you just compiled.
sudo mv ./wl.ko /lib/modules/`uname -r`/updates/dkms/wl.ko
Subscribe to:
Posts (Atom)