Saturday, December 15, 2012

Getting PocketSphinx working

I read a lot of how-to's on how to get pocketsphinx functional on Ubuntu 10.04 but I always got stuck at some point.
These are the two failures I could never get around: 
1. Failed to open audio device(/dev/dsp): No such file or directory


2. ERROR: "acmod.c", line 88: Must specify -mdef or -hmm

After a lot of trying different things out, here are the steps that allowed me to get a raw file transcribed.

aptitude install python-pocketsphinx
aptitude install pocketsphinx-hmm-wsj1
aptitude install pocketsphinx-lm-wsj

The ps_test.py file will be located in /usr/share/doc/python-pocketsphinx/examples
Change the first line to
decoder = ps.Decoder(hmm="/usr/share/pocketsphinx/model/hmm/wsj1",
                    lm="/usr/share/pocketsphinx/model/lm/wsj/wlist5o.3e-7.vp.tg.lm.DMP",
                    dict="/usr/share/pocketsphinx/model/lm/wsj/wlist5o.dic",
                    fwdtree="yes",
                    fwdflat="yes",
                    bestpath="no")

Change line 2 to:
fh = open("test.raw", "rb")


And generate a test.raw file and put it in /usr/share/doc/python-pocketsphinx/examples

Running python ps_test.py will still generate an error but you should get a first transcription:


Decoded 35136 samples
THE DEMAND JUMPED OVER THE MILAN (000000000 -40091455)
P(FORWARD|GO) = -4.346504, 2
INFO: ngram_search.c(1046): lattice start node .0 end node .207
INFO: ps_lattice.c(1225): Normalizer P(O) = alpha(
:207:218) = -2837676
INFO: ps_lattice.c(1263): Joint P(O,S) = -2853722 P(S|O) = -16046
P(S|O) = -1.604786e+00
FORWARD is:
Traceback (most recent call last):
  File "ps_test.py", line 30, in
    print "FORWARD is:", forward.word, forward.sf, forward.fef, forward.lef, forward.prob
NameError: name 'forward' is not defined


My raw file had the phrase 'The man jumped over the moon'
It was transcribed to 'THE DEMAND JUMPED OVER THE MILAN'


Changing hmm to hub4opensrc.cd_continuous_8gau, lm to language_model.arpaformat.DMP and adding the word MOON to the dictionary got me to the following transcription: 'THE MEN JUMPED OVER THE MOON'

Not bad, IMHO

Monday, August 27, 2012

ttservctl fails to start with error 'Existing process'

If you try to start Tokyo Tyrant and it gives you the following error:

root@test-tools:/etc/init# ttservctl start
Starting the server of Tokyo Tyrant
Existing process: 1255

Then try the following

> rm /var/ttserver/pid

Saturday, August 25, 2012

AlpenCross 2012

Swen, Markus and I rode from Bludenz to Lago di Garda over 6 days. The mileage wasn't enormous (~350 km) but we climbed 12000 meters over that period, more than half of it off road.

We all had full suspension bikes (2 Canyons and one custom built) which I think were needed on some of the downhills. That said, we did see people  with only front shocks and one crazy dude on a bike with no shocks and riding some of the downhills after a couple of beers. So...hmmm......I would still stick with a full suspension bike.

For packing, we used this as a guideline (Warning: German link) A couple of things I would add:
  1. Second pair of gloves
  2. Camera case that attaches to the backpack shoulder strap
  3. Detergent for washing clothes by hand
 The only thing we left off were the sleeping bags.

Swen and Markus both carried at least 2 kilos more than what's on the list. It is possible but carrying that amount of stuff on your back for long periods day after day really takes its toll, not only on your shoulders but also on your ass. Even with 2 kilos less, I could hardly sit on the saddle during  the last 2 days of the tour.

For the GPS, Swen brought along his BikeGPS. In addition, Markus had a Garmin eTrex with the same routes loaded. Questions were resolved relatively quickly and I remember getting lost only twice. I was also carrying a large version of the route printed out and laminated, clipped to my handle bars, which give us a rough idea of where we were in the grander scheme of things. Thankfully, it was not needed but would've been necessary if our route needed to be altered.

There were three meetings to plan the tour (though I remember a lot of drinking and little planning at the first one. I think this one was still good to get a sense of what the tour was going to be like) On the second one, which was a month before the tour, we worked on the bikes, talked about packing, split up the tasks etc. This was kind of the 'this trip is happening' meeting. We met for the final time on the weekend before the tour started. There were bike checks, packing checks to ensure everyone was on the same page, making sure everyone had mountain rescue numbers for all the countries we were riding through and last organizational things (when/where to meet etc)

In addition, we planned for three full day rides of 70+km/2000+ m of climbing. In the end, all of us managed only one together (mostly because of me) but that ride went really well and it was clear that the three could manage the tour together, both from a fitness perspective and from a personality point of view (though all three of us had been friends for a while, this was the first time we'd all travelled together) Though one training sufficed, I would've preferred to have one more maybe two weeks before the tour.

I started training I would guess three months before, riding 30 km a few times a week, running 10k on the days when I was not riding, with a long 60 km/1500 m ride on the weekend (though the weekend ride happened only 6 times in total) At the end, i.e. the two weeks prior to the last week before the tour, I was riding 240 km per week (all flat) plus running between 20 and 30 km.  I felt in ok shape at the very end and it turned out to be more than enough. The physical problems I had during the tour were never fitness related. It was more different parts of my body hurting on the last days of the tour after spending so much time on the bike (which I did not have the time to train for)

We did the tour in the middle of the European summer (last week in July) and the towns we overnighted in were all primarily winter resorts. Hotels in these towns tended to have really good deals during the summer months, as they try to fill empty hotel rooms. Here are a couple that we stayed at that I would highly recommend:

Goldener Adler - Ischgul - A really nice hotel with a sauna. The room rate included a 5 course dinner plus a huge breakfast that they set up early for us.

Hotel Tanneheim - Another great hotel with big rooms, sauna, 4 course dinner included and they even did our laundry for free (which was good as my bike shorts were soaked with three days worth of sweat by the time we got here)

AlpHoliday Dolomiti - This was much more of a hotel for families with small kids but it had a sauna area that was good, offered a really tasty dinner, decent breakfast and comfortable rooms.

Sleep was generally not great during the tour for any of us. I thought I would crash hard every night but I didn't get a good night's sleep on any night, not even on the night after we finished the tour. There was just too much adrenaline flowing to manage a good bit of sleep. That being said, I never felt like I was sleep deprived

Everyday had too many highlights and so I'll pick one from each day:

Day 1 - Zeinisjoch to Ischgl: This was a nice downhill along a stream into town. It made up for the pain that was the ride up to Zeinijoch (whihch was 20% grade at points)

Day 2 - Ischgl to Heidelberger Hütte: This trail was an great ride. The scenery was gorgeous, there was little traffic (people or otherwise) and the ride was relaxing. Unfortutnately, the Fimberpass was waiting for us right afterwards

Day 3 - Schutzhutte Sesvenna to Schleis: We had live music during lunch at Schutzhutte Sesvenna and then a not too easy downhill in parts to Schleis. At the very end though, the road suddenly opened up into a wide green valley with mountains all around. It was totally surprising, and just brought a smile to my face.

Day 4 - Boscetta di Forcola to Bormio: Wow! It made the trek up to Stilfersjoch totally worth it. A lot of it is an old military road that looks like an old Roman road. There was no one on it, it was gently sloping and just amazing scenery. There was a bit in the middle that was seriously sketchy but....overall...wow!!!

Day 5 - Sant Appoliano to Dimaro: The trek up (after a totally unenjoyable uphill to Passo Gavio), and the trek down, even on day 5 was incredible! We were all really hurting but the amazement was still there.

Day 6 - Lake Garda: There was 2000 meters of climbing and descending before lunch, we got eaten by mosquitoes on the last climb (and I am not exaggerating when I say 'eaten') but the overwhelming memory of the last day is of jumping into Lake Garda at the end of the ride. It's among the best feelings I've ever had. I didn't feel tired, I just felt elated and this continued, maybe with less intensity, for a while.

A friend asked me afterwards if I'd ever do a tour like this again. There were days during the tour where I just wanted out. I almost quit after day 5 (but thankfully, Swen and Markus talked me out of it).  But overwhelmingly, I would absolutely do another tour like this.Riding trails which are only accessible on foot or on a bicycle was amazing. The zen aspect of riding was unexpected. My mind was just focused on the task at hand and nature. Everything else melted away.

Everything being said, our tour turned out quite close to perfect. We had no major accidents (everyone had cuts and bruises from falling at some point), the weather was damn good (except for 2 afternoons where is rained but quickly returned to full on sun) and no major bike problems (towards the end of day 4, there were some issues with gears not changing and brakes misbehaving but there were addressed as much as possible and riding wasn't too much influenced) That contributed the most to how I feel about the tour.

To anyone contemplating a tour, I would say go for it. I am not particularly athletic, not a hardcore downhiller (I walked my bike a lot on downhills that I felt were too extreme) and had never done anything close to so hardcore till this tour. Now, I'm hooked. As long as you're prepared, its doable (though not easily)


A slide show about the tour

Wednesday, February 15, 2012

Firefox crashed with Didn't find JVM under /opt/firefox/plugins

Try the following (with your paths)
export JAVA_HOME=/usr/lib/jvm/java-6-sun/jre/bin

Tuesday, October 11, 2011

Ubuntu 11.04 - Network Manager not Active

If you make changes via Network Manager that are not doing anything, try the following:

sudo vi /etc/NetworkManager/NetworkManager.conf

Change
managed=false

to
managed=true

Then
sudo /etc/init.d/network-manager restart

Monday, July 11, 2011

Pinata does not break...

Two years in a row, we have had the brilliant idea of having a pinata at our daughter's birthday party. Living in Germany, we thought it would be a treat for the kids to have such an experience (though neither I nor my wife is Mexican or Latin American or likes Tequila)

Last year, for our daughter's fifth birthday, my wife schlepped a pinata across the Atlantic from Texas. Needless to say, it did not break.

This year, we ordered one online (who knew one could order a pinata online in Germany) and again, the kids whacked at it for a good 30 minutes without it even showing a hit of a crack..



I hope the german kids aren't getting the wrong idea about a pinata, that it is something to hit and hit till nothing happens and an adult hs to pry it open to let the candy out.

Wednesday, July 06, 2011

Selenium clicking links from Safari/Opera not working

There have been lots and lots of solutions proposed for this problem. Let me add mine to the list.

Here is what I was facing: the following (very simple) link click
$link->selenium->click("//td[5]/a/img");

works perfectly in Firefox, IE and Google Chrome but results in no action in Safari or Opera. No error is generated but no change to the website occurs.

After pulling my hair out for two days, I noticed that at the bottom of the Firefox window, the link that results was displayed.


So I changed the command to
$link->selenium->open("main.php?action=adm_overview&lang=de");

And voila!...it was exactly the same as clicking on the link.

If Firefox dos not display the link (for instance, if it displays the Javascript that will be called), then try to use a tool like Webscarb to intercept the outgoing message.
  • Book reviews