Friday, November 28, 2008

Cool 5310 app: English - Spanish dictionary

One useful thing my 5310 can be is an English Spanish dictionary. This saves me the bother of carrying around a paper dictionary or always having to play the "say a lot of words when it would be better to say just word" game. I have a couple of dictionaries I have downloaded for free online.

One dictionary is the Mobile Translator Me dictionary (the link shown when starting this program, eamobile.tk, is now owned by a squatter).

This dictionary has a nice interface; after hitting "5" twice to get past the two splash screens, it's a simple matter of choosing "Spanish->English" or "English->Spanish" then typing in, using the phone's predictive text features (it's identical to writing a text), the word I want to be translated. When talking to a friend who didn't know the word "Stewardess" in English at a cafe earlier this week, this dictionary correctly translated "stewardess" as "azafata".

However, its dictionary is limited. When translating "to melt" (as in, melting butter for popcorn), it translated it as "fusión", which really means "fusion" in Mexican Spanish. I had to use the KODi dictionary to correctly translate this word.

Another English Spanish dictionary I have is the KODi English Spanish dictionary. This program is pretty small, has an extensive dictionary, and opens quickly. Unlike any other dictionaries I have in my cell phone, it lets me words next to the word I'm looking up in the dictionary.

Unfortunately, the interface is a bit quirky; I can't use predictive text input to input words in to this dictionary, and, more annoying, if I hit the button which means "delete the letter I just mistyped" in this dictionary, it immediately exists the application, forcing me to restart it.

The third dictionary I have is one the official specs for my Nokia tell me shouldn't work in my phone: A huge 3-megabyte dictionary, complete with a lot of regional slang. The application works fine, even if it takes two or three seconds longer to load than the other compact dictionaries.

The slang isn't accurate slang for the Mexico City/Puebla area (the two naughty words they use for a female's reproductive organ aren't in the dictionary), but, then again, my ex-girlfriend who was from a small town about 200 miles from here didn't have those words in her vocabulary either, so I don't expect a dictionary to be up-to-date with those kinds of words. For words I would actually want to use in a normal conversation, it looks to be a good dictionary. It's biggest annoyance is that it's one-way; it translates from English to Spanish (which is what I normally need to do when talking to someone), but not from Spanish to English.

One annoyance all three dictionaries have is that they don't tell me the gender of a given noun; for a word like "té" where the gender isn't clear, I just have to give the word a male gender and hope it's a "boy-word" in Spanish. A verb conjugation tool would be nice too, come to think of it.

So, between these three dictionaries now in my cell phone (all three are free downloads), I don't need to lug around a big dictionary any more.

Sunday, November 23, 2008

More on the Nokia 5310 XpressMusic

Having just posted a full review of the Nokia 5310, I would like to make some additional comments and even give you guys a free goody (I like giving out free goodies).

But, first, I promised in my last blog to post some scripts I use to convert HTML pages in to a form my phone can use.

The example script I will post allows me to convert books available in HTML format at Baen books in to a form that can easily be read in my mobile phone. For example, here is my script that splits up one of my favorite books there, Wizard's Bane (which was, indeed, my favorite book right after I graduated from high school), can be split up in to a form that can easily be read with the 5310's limited HTML browser using the following line noise script:


# First we make lots of small files
for a in 0671878468__*htm ; do cat $a | gawk 'BEGIN{RS="<p onmouseover="} {gsub(/\<a (id|name)=\"[^a]+a\>/,"");sub(/^\"PNo\([0-9]+\)\"/,"<p");sub(/\<\>/,"");print}' | egrep -v '^<a' | perl -e '$b=1;$c=sprintf("3d",$b);open(F,"> '$a'_${c}_.html");while(<>){if(/^<p>/){$a++}if($a > 50){$a=0;close F;$b++;$c=sprintf("3d",$b);open(F,"> '$a'_${c}_.html");}print F $_}'; done

# Then we make the naming more sensible
for a in *html ; do mv $a $( echo $a | awk -F_ 'NF == 6 {print "0" $4 "-" $5 ".htm"} NF == 5 {print $3 "-" $4 ".htm"}' | sed 's/.htm//' ); done


Here, the Shell/Perl script in the first part splits up the files in to smaller files; with each file being 50 paragraphs long (the "a > 50" part of the Perl script). The second part takes the filenames and gives them sensible names like 01-001.htm ("Chapter one, part one").

I have used this and similar scripts to put a number of ebooks in my phone, such as a few Baen books, the Bible, and Huxley's "Brave New World" (which my roommate downstairs is doing a book report on right now).

Another thing I'm working on is a theme. The name of this theme is "Pink Planet", and it's a pink version of a Dark Planet mobile theme I downloaded online. You can find my work on this theme here (to give credit where it's due, my progress bar is the progress bar from an iPhone copycat theme that I changed to be purple instead of smoke gray).

Like customizing *NIX desktops in the mid-1990s, a lot of editing by hand of text files is needed to work on the theme properly (you can also use Nokia's theme editor called "carbibde.ui" to edit the themes, but it's more efficient to just use The Gimp to edit images and a text editor to edit the .xml files by hand).

Nokia ".nth" themes are ".zip" files with a different suffix (Phil Katz's legacy is that his ".zip" file format is the standard way to compress and make multiple files available as a single file). To edit the theme, just change the suffix from ".nth" to ".zip", extract the files in a directory, then recreate the .zip file after making your changes. Also make sure all of the files aren't in subdirectories, or Nokia's theme loader won't be able to find the theme.

Anyway, I will post more blogs about some more cool things this small phone--which is about the size of a Snickers candy car (or an iPod nano)--can do later on this week.

Tuesday, November 18, 2008

Review: Nokia 5310 Xpress music

About a month ago, when the peso went down in value but the prices in Mexico hadn't gone up yet to compensate, I got a Nokia Xpressmusic 5310 cell phone to replace my old cell phones that have been slowly falling apart for a while now.

This is a cell phone I have had my eye on for a while. My goal was to get a cell phone that has clear voice quality and that is a quality MP3 player.

The 5310 does well in terms of voice; the voice quality is clear--one family member with hearing problems who had problems with my low-cost LG phone had no problems hearing me talk on my 5310. The only time I recall someone complaining about not clearly hearing me was one time when I was talking to my former neighbor, but she's been having problems with her cell phone so the problem might have been at her end. Even then we were able to communicate without problem after I closed the door and talked very loudly in to the phone.

The 5310 is a very good music player. It has a standard 3.5mm headphone jack; this phone doesn't need any weird adapters for me to listen to music with my favorite headphones. The audio is quite loud when using earbuds, but not always as loud as I would like when listening with low-cost standard headphones which I need to wear while running (earbuds fall out of my ears). This, however, is only a problem when the gym plays music loudly for their dancing and stationary bicycle classes in the evening; in the afternoon, when it's quieter, or when I run at the local park, the music is loud enough.

The one annoyance is that the music player crashes about once every day or two or so. This usually happens when I try to play a new song when playing another song. What happens is that the screen turns white, the telephone is unresponsive for a few seconds, then it reboots the OS. Within 20 seconds, the phone is fine again. Annoying, but not a deal breaker.

This is using version 5.3 of the OS for this phone; The most current version of the OS is 7.1. However, my phone is a TelCel (the largest cell phone carrier in Mexico) branded 5310 and TelCel hasn't updated the OS to the most current version. 7.1, which may or may not fix this issue, also has support for 16gb mini-SD cards.

The cell phone also has a lot of other goodies. It has a basic 2 megapixel camera which is nice for taking snapshots for putting on my personal web pages. The camera is no Nikon SLR, but can take decent pictures. For example, this picture of me and my former neighbor, who I saw a movie with on my birthday, was taken with the camera in my phone:



It also has a stopwatch, with a fairly large time display, which is useful when running without a treadmill to control my pace, and an "egg timer", which is useful for taking my pulse or cooking pasta. In addition, it has the ability to play J2ME video games, a basic HTML viewer, and even Opera Mini.

I can't use Opera Mini, since TelCel charges nearly 50 dollars a month for slow non-3G WAP internet access (TelCel may offer 3G, but my phone doesn't support 3G; just WAP), which is too much, especially since I now have internet at home. But, what I can use is the crude HTML browser for reading books and other documents offline (using the 4gb memory card I have in the phone).

The 5310 uses a slightly older revision of the S40 operating system (S40 5th edition, instead of the newer 6th edition with a webkit-based browser), and the HTML browser is, at best, very crude. It is very slow opening documents more than 15k in size or so, and has limited image and javascript support.

What I have done to be able to read ebooks and other documents online is write up some *NIX scripts for splitting up HTML pages and stripping unnecessary tags from these pages; by making the pages short simple text with the occasional image and little or no java script, I can make the pages readable in my cell phone. I have been enjoying some books from Baen's free library and use the phone to read daily Catholic mass readings in English (so I can fully understand them) while at Spanish-language mass.

In my next blog entry, I will show some of the *NIX scripts I use to split up and make the HTML readable with this cell phone's crude HTML reader.

Thursday, November 13, 2008

How to get mplayer to make mp4 audio streams mp3s

After 30 minutes of struggling with mplayer's pathetic documentation, I finally figured out the secret recipe to convert a file from mp4 (or, probably, any other format mpalyer can grok such as flv, etc) in to mp3 format:

mencoder -of rawaudio file.mp4 -o file.mp3 -oac mp3lame -ovc copy

It would have been nice if mplayer's documentation made this clearer (when I think of "raw audio", I think of a headerless PCM stream of audio, which is a pain to deal with)