Archive

Archive for June, 2010

Uninstall Ubuntu from dual boot Windows 7

June 24, 2010 Leave a comment

Recently I installed Ubuntu 9.10 on a 2-monitor machine stored with windows7, but Ubuntu seems to have some problem with graphic card on this 2-monitor machine. Somehow, I cannot find a good driver for it, so decide to uninstall Ubuntu 9.10 from this dual boot Windows7. I realized that there might be 2 problems: 1) GRUB and MBR, 2) how to resize the Windows partition after Ubuntu uninstalled? I found a very easy-to-follow instruction video on Youtube.com; it works perfectly in my situation, so hopefully it works for you too!

Uninstall Ubuntu From Dual Boot Vista WITHOUT An Installation CD by yng63un [link]

The software to use is EasyBCD which can be downloaded for free.

Categories: Tutorials Tags: , , , ,

Using LaTeX in Inkscape

June 22, 2010 3 comments

If you want to type equations, Greeks, mathematical symbols, LaTeX in Inkscape, this post will show you how to do so. I will just use the extension called “Tex Text” (or “Textext”…I’m not sure). In order to install the extension, we need to instal some extra tools. There are many websites explain how to install the extension to Inkscape, but some links are dead and not updated to recent, so I decide to make this simple tutorial by referencing some of the existing links. Here are the summary:

  1. You have to have LaTeX and Inkscape in your system first. For me, I use Inkscape 0.47 and it works great!
  2. Install pstoedit by typing on the terminal: sudo apt-get install pstoedit
  3. Install pdf2svg. You can get it from Ubuntu repository or manually install it.
  4. Install Tex Text extension:
    1. download Tex Text package–I use version 0.4.4 (textext-0.4.4.tar.gz)–from [3]
    2. Unpack the archived file and you will see 3 files: 1) LICENSE.txt, 2) textext.py and 3) textext.inx
    3. The original textext.py will produce some warning when run it, so we will need to edit the code to suppress the warnings. To suppress the DeprecationWarning popup, add the red lines to textext.py (near line 54): (Thanks to cortiver [1])import sys, os, glob, traceback, platform
      sys.path.append(‘/usr/share/inkscape/extensions’)
      sys.path.append(r’c:/Program Files/Inkscape/share/extensions’)
      sys.path.append(os.path.dirname(__file__)

      # Suppress the DeprecationWarning when importing md5
      import warnings
      warnings.simplefilter(“ignore”, DeprecationWarning)

      import inkex
      import os, sys, tempfile, traceback, glob, re, copy, md5
      from lxml import etree

    4. After editing the file, now we will copy the files (textext.py and textext.inx) to the extension folder:
      1. If you want all the users to be able to use this feature: /usr/share/inkscape/extensions
        sudo cp ~/Downloads/textext* /usr/share/inkscape/extensions
      2. If you are the only one who will need the feature: ~/.config/inkscape/extensions
        sudo cp ~/Downloads/textext* ~/.config/inkscape/extensions
    5. If you have any problem with some permission problems, please try the followings (thanks to anjames [1]):
      sudo chown root:root /usr/share/inkscape/extensions/textext*
      sudo chmod a+rX /usr/share/inkscape/extensions/textext*
  5. Now restart your Inkscape, and ENJOY!

Now…how to use it?

For example, please refer to [2]. you may try the followings:

  1. Go to Extensions>Tex Text you will see 3 parts: 1) preamble file, 2) scale factor and 3) text
  2. In text, just type
    $\phi^2=\nu_i+5$ Hi there!
    And press OK
  3. You should see something like
    \phi^2=\nu_i+5 Hi there!
    on the Inkscape canvas. That’s it!

[1] http://ubuntuforums.org/archive/index.php/t-1001635.html
[2] http://eugenwintersberger.vox.com/library/post/use-inkscape-with-latex.html
[3] http://pav.iki.fi/software/textext/

Derivation of Inference and Parameter Estimation Algorithm for Latent Dirichlet Allocation (LDA)

June 15, 2010 11 comments

As you may know that Latent Dirichlet Allocation (LDA) [1] is like a backbone in text/image annotation these days. As of today (June 16, 2010) there were 2045 papers cited the LDA paper. That might be a good indicator of how important to understand this LDA paper thoroughly. In my personal opinion, I found that this paper contains a lot of interesting things, for example, modeling using graphical models, inference and parameter learning using variational approximation like mean-field variational approximation which can be very useful when reading other papers extended from the original LDA paper.

The original paper explains the concept and how to set up the framework clearly, so I wold suggest the reader to read the part from the original paper. However, for a new kid in town for this topic, there might be some difficulties to understand how to derive the formula in the paper. Therefore my tutorial paper solely focuses on how to mathematically derive the algorithm in the paper. Hence, the best way to use this tutorial paper is to accompany with the original paper. Hope my paper can be useful and enjoyable.

You can download the pdf file here.

[1] David M. Blei, Andrew Y. Ng, and Michael I. Jordan. Latent dirichlet allocation. J. Mach. Learn.
Res., 3:9931022, 2003.

[Solved] Cannot boot into Windows 7 after installing/updating Ubuntu 10.04

June 15, 2010 1 comment

Recently I got a new Dell desktop installed with Windows7, but I love Ubuntu enough to make my machine dual boot (Windows 7 and Ubuntu 9.10) with GRUB. Everything had been worked out for me until I updated from Ubuntu 9.10 to 10.04 recently. After the critical update, I cannot boot into Windows 7 from GRUB menu, so I can only work with Linux…what should I do to be able to boot into windows 7 again?

Here is one easy solution to the problem.

0) Before running anything it is good to backup your important data and information. Also it is a good idea to see the boot information first: http://bootinfoscript.sourceforge.net/. However, I don’t think this is necessary though.

1) Use Windows7 setup CD to repair windows partition by using the command “BootRec.exe“. Here are the procedure adapted from website “http://support.microsoft.com/kb/927392”

  1. Put the Windows Vista or Windows 7 installation disc in the disc drive, and then start the computer.
  2. Press a key when you are prompted.
  3. Select a language, a time, a currency, a keyboard or an input method, and then click Next.
  4. Click Repair your computer.
  5. Click the operating system that you want to repair, and then click Next.
  6. In the System Recovery Options dialog box, click Command Prompt.
  7. In the command prompt type Bootrec.exe /FixBoot press ENTER
  8. In the command prompt type Bootrec.exe /FixMbr press ENTER
  9. Restart your computer

At this step, I noticed that my computer booted to Windows7 directly without loading the GRUB menu. Please don’t worry because your Ubuntu partition is still there, but perhaps GRUB menu was overwritten by windows recovery that I did in the previous step. That’s fine…since in the next step we will reinstall GRUB.

2) Reinstall GRUB: Please refer to “Reinstall Ubuntu after Installing Windows” which gives much better details that I do. The procedure is summarized as follows:

  1. Insert the Ubuntu installation CD (mine was 10.04) into your machine and boot from it
  2. Run Ubuntu from the CD without installing it
  3. Mount your Ubuntu partition from Places menu
  4. Check if you are using GRUB or GRUB2
  5. Check if the partition is correct or not
  6. Install GRUB or GRUB2 into your /dev/sda
  7. Restart your computer

After this step, you should be able to see GRUB menu when booting, and both Windows and Ubuntu should work fine from the menu.

If this does not work for you please read this post which contains a lot of useful tools to solve the problem. In fact, I tried this approach too, but that did not solve my problem.

Categories: Tutorials Tags: , ,