District-level Nepal Map PHP API. Generates variable-sized map of Nepal with user defined colors for districts.
Source and example:
https://github.com/jwalanta/NepalMapAPI
Demo (with maphilight jQuery plugin):
http://diyaalo.com/nepalmapapi/
Thanx a lot to Jitendra for providing the GIS map of Nepal.
Saturday, March 19, 2011
Nepal Map API
Posted by
Jwalanta Shrestha
at
5:50 PM
1 comments
Tuesday, February 08, 2011
Javascript Deselect on Focus
Here's the scenario: you've got two text input, userid and email address. For email address field, I want to have the domain part pre-filled (say, @example.com). Now when the user enters the userid and jumps to email input, the browser selects the whole text as default behavior. But I want to append userid to the beginning and select only the userid part. Using jQuery, the usual code would be like this:
However, THIS DOESN'T WORK!!
To make this to work, you need to set the selectionStart and selectionEnd values after a while the inputbox is focused.
Posted by
Jwalanta Shrestha
at
6:09 PM
4
comments
Labels: deselect, focus, html, javascript, jquery
Wednesday, February 17, 2010
Converting Latex document to HTML / ODT / DOC
I do all my documents in Latex. Actually i usually use emacs org-mode first and later convert it to Latex, but when it comes to using bibtex, it's all latex. It works great and the output dvi/pdf files look so professional. However recently i had to submit the file in .doc format, and i had a real hard time finding good tools to do that.
There are no direct Latex to .doc converters, so the best bet is to go Latex -> HTML -> DOC. There are lots of Latex to HTML converters like latex2html, tth and hevea, but most of them either don't produce good HTML or mess with bibliography references. But after some research i found the best: TeX4ht
TeX4ht is available in ubuntu/debian repo, so to install
sudo apt-get install tex4htConversion is simple:
htlatex document(please note, there is no .tex suffix)
This will generate document.html, css and bunch of .png files.
Now to convert it to wordprocessor files (odt, doc..),
1. Open the html file with OpenOffice.org
2. File > Save as
3. Choose the format you want to save it in (odt, doc)
If you have images in the document, they will be linked instead of embedded in the document. To fix this: (source)
1. Edit > Links
2. Click "Break Link" for each image link
Posted by
Jwalanta Shrestha
at
6:58 AM
1 comments