Limiting CPU Usage of a Program in Windows
22 January 2009 at 12:16 pm | In Windows | Leave a CommentTags: CPU, Limit, Process, Windows
If you have a single-core CPU, you might have noticed that certain programs will hog the whole processor and won’t let you do anything else. Everything starts to bog down until you can’t do anything but wait for the one program to finish.
Or, you might have a computer that overheats whenever you do something CPU-intensive, like video or audio encoding.
So how do you deal with these nuisances? There’s two ways to do it.
The first is to set the priority of the program’s main process to a lower value. Unfortunately, I’ve never had much success doing this because most programs ignore the priority and end up sucking up all the CPU anyway. If you really want to try it, check out this post for some info. (It talks about speeding up, but it applies exactly the same to slowing a process down).
The second (and better) way is to use a program that limits the program’s CPU usage. One program that I find very handy is Battle Encoder Shirase, or BES. It allows you to selectively limit a process’ CPU usage. Once you’ve downloaded it, start it up and choose the Target… button. This brings up a list of processes that are currently running. Choose the one that is eating up the CPU and click Limit this. Then hit Yes to start limiting it. Most things are self-explanatory, and the website has good instructions on how to set it up, so I won’t go into any further details.
Of course, you can use these same techniques with a dual- or quad- or whatever-core system too. I just find them a little less necessary.
Kanagen 0.0.2: Japanese kana generator for Mac, Linux, and Windows
12 January 2009 at 2:56 pm | In Japanese, Kanagen, Linux, Mac OS X, Python | 6 CommentsTags: generator, hiragana, Japanese, kana, katakana, language learning, Linux, OS X, program, Python, romaji, Windows
Kanagen 0.0.2 is now out and works under Mac OS X 10.5 (Leopard), many Linux/BSD variants, as well as Windows XP/Vista. Simply download the ZIP file below and follow the instructions in the README.txt to get started! If you are unfamiliar with Kanagen, its a program I wrote to help study Japanese characters. It generates random strings of hiragana, katakana, and romaji so that you can learn the syllabaries and also practice writing characters.
Mirror 1: http://www.mediafire.com/download.php?yyx4gncmwjw
Mirror 2: http://www.filefactory.com/file/a019agh/n/kanagen-0_0_2_zip
Changelog:
- Cleaned up code so its easier to read and maintain
- English-localized strings separated into a new module for easier localization
- Clear screen routine now works on Windows (not much else works in Windows, though)
How to view Japanese characters on the Linux virtual terminal
11 January 2009 at 11:26 pm | In Japanese, Linux, Ubuntu | 1 CommentTags: console, framebuffer, Japanese, jfbterm, Linux, Ubuntu, virtual terminal
Although it’s no problem to view Japanese/Unicode characters on an X11 console like xterm or Konsole, it can be difficult to view them in the Linux virtual terminal. That’s where JFBTERM comes into view. It provides Japanese and other special character output using the framebuffer.
Ubuntu provides a prebuilt package in the repositories; to install it execute
sudo apt-get install jfbterm
It is also helpful to install a good font for it to use:
sudo apt-get install unifont
Now, provided that you have a working framebuffer, you can start it by running jfbterm.
If you receive an error about /dev/fb0 not present, you need to enable a framebuffer. In Ubuntu, modify the current kernel line in /boot/grub/menu.lst to include vesafb. For example, my section in menu.lst reads something like:
title Ubuntu 8.10, kernel 2.6.27-9
kernel /boot/vmlinuz-2.6.27-9 root=/dev/hda1 ro vesafb:mtrr,ywrap vga=0x318
initrd /boot/initrd.img-2.6.27-9
quiet
After making the modification, reboot the system and try running jfbterm again.
Once you have jfbterm running, you can run commands like usual, and now should be able to see Japanese characters properly.
Kanagen GUI Mockup
11 January 2009 at 12:37 am | In Japanese, Kanagen, Linux, Python | Leave a CommentTags: generator, Glade, GTK, GUI, Japanese, kana, Linux, mockup, Python
Kanagen: Japanese kana generator written in Python
10 January 2009 at 5:54 pm | In Japanese, Kanagen, Linux, Python | Leave a CommentTags: alphabet, generator, hiragana, Japanese, katakana, language learning, Linux, program, Python, romaji
Update: Kanagen 0.0.2 is now out! Please use it and let me know what you think.
Today I finished the first revision (0.0.1) of my program Kanagen. Kanagen is a learning tool to help students learn the Japanese syllabaries. It functions by generating random strings of hiragana or katakana characters, which must be translated into romaji, or vice versa (romaji to kana characters).
It features selectable string length, character selection (so you can choose which part of the alphabet to practice), and the ability to print the text in horizontal rows (like most Japanese websites) or in vertical columns (like Japanese books and newspapers).
Currently it features a text-only interface with menus, but if there is enough interest I would be happy to make a graphical version. I would also like to add additional features such as reading in the user’s input of the romaji transliteration, and perhaps even handwriting recognition so that it would be possible to detect kana drawn with the mouse or a tablet.
I wrote it in Python, and tested it only on Linux. It should work as long as you have a relatively recent version of Python and have Japanese character support installed. To use it, download the two files from one of the mirrors below and run it using python kanagen.py
Please let me know what you think! I appreciate any comments, suggestions, and criticism. I’m sure that there is a lot of room for improvement, since this is after all my first full program written in Python!
Note for Linux console users: If you wish to run this program on the virtual terminal (Alt-F1, Alt-F2, etc.) you must use a program like jfbterm for the Japanese characters to display successfully. Check out my guide to setting up Japanese character support on the console for more information.
Download Links:
Please use Kanagen 0.0.2 instead!
How to Boot Ubuntu 8.10/9.04 Live CD from a USB Drive (Non-persistent)
3 January 2009 at 4:53 pm | In Linux, Ubuntu | 2 CommentsTags: 8.10, Guide, install, installation, Intrepid Ibex, Linux, pen drive, thumb drive, Ubuntu, USB
Note: the following instructions are for booting the Ubuntu or Kubuntu Live CD from a USB drive. For instructions on how to boot the alternate installer from a USB drive, please read my post here.
Here’s how you can run the Ubuntu 8.10/9.04 Live CD without burning it to a CD. This is great if you have a computer with a broken CD-ROM, or if you don’t want to waste a good CD-R. Follow the simple steps below and you shouldn’t have any problems. I’ve tested this with Ubuntu 8.10 and 9.04, as well as gNewSense 2.2.
1. Grab the Ubuntu or Kubuntu Live CD image.
2. Format the USB drive to FAT16:
Windows: Open My Computer, right-click on the USB drive, and click Format. Under File System, choose FAT. Then click Start.
Linux: Open a terminal and type:
sudo mkdosfs -F 16 /dev/sdc1
(where /dev/sdc1 is the device node of your USB drive).
3. Install syslinux to make the drive bootable:
Windows: Download the latest version of syslinux here (at the bottom), unzip it somewhere like C:\SYSLINUX. Then open a command prompt (Start->Run->cmd), and type:
cd C:\SYSLINUX\win32
syslinux -s -m F:
(where F: is your USB drive letter).
Linux: Install syslinux from your distro’s repositories, then open a terminal and type:
sudo syslinux /dev/sdc1
Note: If you have trouble later when you try to boot the USB drive, try this step again using syslinux -s /dev/sdc1.
3. (Linux users only) Mount the USB drive. For example,
sudo mkdir /media/flash
sudo mount /dev/sdc1 /media/flash
4. Extract the contents of the ISO image downloaded in step 1 to the USB drive:
Windows: Use a tool such as 7zip to extract the ISO to a folder on your hard drive, such as C:\UBUNTU. Then open a command prompt and type the following:
xcopy /e /h /k C:\UBUNTU\*.* F:
Linux: Open a terminal and type the following (assuming you downloaded the Ubuntu 9.04 ISO to your home directory):
cd
sudo mkdir /media/ubuntu
sudo mount -o loop ubuntu-9.04-desktop-i386.iso /media/ubuntu
sudo cp -aT /media/ubuntu /media/flash
5. Rename the isolinux directory to syslinux, and rename the isolinux.cfg file (which is inside the isolinux directory) to syslinux.cfg:
Windows: Open My Computer, double-click on the USB drive, and rename the folder isolinux to syslinux. Then double-click on the syslinux folder and rename the file isolinux.cfg to syslinux.cfg.
Linux: Open a terminal and type:
cd /media/flash
sudo mv isolinux syslinux
cd syslinux
sudo mv isolinux.cfg syslinux.cfg
6. Boot from the USB drive and use Ubuntu! If at this step you encounter any difficulties booting from the USB drive, try installing a new Master Boot Record (MBR):
Windows: I don’t know of an easy way to install a new mbr in Windows. I believe syslinux includes an mbr which might be usable for this purpose. If anyone knows how, please let me know!
Linux: Install the mbr package from your distro’s repositories, then open a terminal and type:
install-mbr /dev/sdc
where /dev/sdc is your USB drive’s device node.
Now try booting from the USB drive again. If you encounter the prompt MBR FA:, then type A and then 1. This will boot from the first partition of the USB drive.
Blog at WordPress.com. | Theme: Pool by Borja Fernandez.
Entries and comments feeds.

