Saturday, September 7, 2013

Enabling Indic transliteration on web pages

Enable typing in Indian languages in web pages using Pramukh IME. This javascript library is very easy to integrate into your website, and supports 20 Indian languages.

Also, it is open source; so you can add new languages, or change the keyboard layout for existing ones.

Tuesday, August 6, 2013

Rendering math in blogs

To render LaTeX-style mathematical formulae in blogs, use MathJax, as shown here. Once set up, you can do
  • \( <math text> \) for inline math
  • \[ <math text> \] for equations

Friday, August 2, 2013

LaTeX to HTML

To generate a HTML version of a TeX document:
  • First ensure that all metadata files are up-to-date (e.g. if you have references in the tex file, run latex; bibtex; latex; latex to ensure that the .bbl file is ok).
  • Run latex2html -split +1 -show_section_numbers -no_footnode myfile.tex. This will create a directory myfile containing myfile.html (among other things).
    • -split +1 causes all subsections within a section to be in a single page (-split 0 will cause the whole document to be in a single page)
    • -no_footnode causes footnotes to be included in the same page where they are referenced.
    • See man latex2html for more options.

Wednesday, July 3, 2013

Random reordering of lines in a file

To generate a random reordering or shuffling of lines in a file, use
shuf inp.txt > out.txt

Monday, June 24, 2013

Python tips

To compile a python script without executing it, do
python -m py_compile my_script.py
[Courtesy: stackoverflow]

Wednesday, June 5, 2013

Installing Python regex on Ubuntu 12.04

To install the alternative regular expression module regex (which has richer Unicode support than re) for Python:
  • Install python-dev from the Software Center.
  • Download the archive, extract, and run sudo python setup.py install.

Monday, June 3, 2013

Downloading a blog on blogspot

This http://blogname.blogspot.com/search?max-results=N lists the latest N posts from the blog. Instead of N, type the number of posts. If your blog has less than 1000 posts, you can save this page: http://blogname.blogspot.com/search?max-results=1000