Thursday, 31 October 2013

Compiling HTK on 64-bit Linux

Compiling HTK on 64-bit Linux distribution some times is kind of problematic.
Basically you can choose to compile in 32-bit mode or 64-bit mode.
If you opt to get 32-bit binaries, then install these packages (if they are not already installed):
'libc6-dev-i386' and 'libx11-dev:i386' (remember to add 'i386' to ensure you're using 32-bit version of it)
Once you've these packages, then make and install as usual.
In case you're planning to compile and get 64-bit binaries, then ensure that these packages are installed:
'libc6-dev-i386' and 'libx11-dev'
Then edit the configure.ac file and remove all '-m32' flags.
Once done, make and install as usual.

Monday, 28 October 2013

How to add JAR library to the Android project in Android Studio?

Some times trivial things like adding a lib references becomes a big pain! Adding jar lib to an Android project in Android Studio on Mac was very problematic for me and of course, many other guys!
After checking different web sites and reading through a bunch of questions in stackoverflow, I managed to get it working.
The steps are:
Create a lib folder in your project folder (the inner one) and copy your jar file there.
Edit the build.gradle file (the inner one) and add: compile files ('lib/ks2.jar')
Close the project and open a terminal and go to the folder of your project. There you'll find a file named gradlew, change that to be executable (chmod +x gradlew), then execute it: ./gradlew clean
It would take a while to finish and you should see a 'BUILD SUCCESSFUL' message upon completion. Once done, open the project, and you're done!

Thursday, 10 October 2013

LaTeX: Make Bibliography appear in "Table of Contents"

Normally in report/book classes of documents, Bibliography will not appear in "Table of Contents", there are many workarounds for that; the easiest would be using the "tocbibind" package in preamble...

Saturday, 5 October 2013

Restart Ubuntu Desktop

Linux core is very stable, but that does not necessarily means that Ubuntu desktop is stable as well!
Many times Unity (Ubuntu's shell interface for GNOME) becomes totally unresponsive (at least for me!), since the core is stable and it is running, you can easily restart the desktop (without even having your running programs closed). If the desktop is totally unresponsive, then press Alt+Ctrl+F1 (to F6) to bring the console window. There you can run unity by (remember to detach the process by adding & disown, also redirect the output and error &> /dev/null. After it, simply hit Alr+Ctrl+F7 (or F8) to come back to the graphical desktop.
An alternative way is to restart compiz (since unity is a plugin of it): compiz --replace and if you're running from Alt+Ctrl+F1 terminal, then specify the display: compiz --display :0 --replace. You still need to add & disown.

Monday, 13 May 2013

Simple Events in Python

Having C# background and moving newly to Python, I was trying to find the easiest way to have some kind events in my Python classes and found this post very simple and useful.

All you need is to add this 'EventHook' class to your code and add events and event handlers to your code, exactly the same way as you did for your C# code.

Wednesday, 24 April 2013

HTK on Windows

Compiling HTK on Windows using Visual Studio 2000 was a little bit tricky, it required Perl interpreter and so forth. However, now it is even more painful in post Visual Studio 2000 era.
There are few alternatives to VC++ compiler like Cygwin (as noted here). Still not that trivial for lazy people. You can find the binaries of HTK tools for Windows from CUED site (but I'm not sure why they did not put the links in their main download page).
A list is available here:
http://htk.eng.cam.ac.uk/ftp/software/

And to be more specific, you can download v3.3 binaries from this link.

A personal suggestion, never run HTK on Windows!


Saturday, 9 February 2013

Focus method equivalent

In Windows Forms Application, when you wanted to set the focus to a specific control (e.g. a TextBox), you just needed to call its .Focus() method. The Objective C way of doing it on MonoMac and Xamarin.Mac world is to call: