Wednesday, June 17, 2009
Offline maps for G1/ HTC Dream/ android phone
So I got the HTC dream, which is excellent except for the fact that whenever I used the maps app, it started to download the maps using my 3G connection and without any plan ( I use prepaid card) it was surely costimg me a lot.
Solutoin : AndNav http://www.andnav.org/
Install andnav2 from the site using the instructions provided therein. Basically install "apps installer" app from google market. download the latest .apk file and install.
now for the maps: for some luckly places on earth, someone has already made the map tiles and those can be downloaded and you need to unpack them in the andnav2\tiles\mapnik folder on your sdcard ..and you will have a bunch of files in hierarchy like
0/0/0.png.andnav
for rest of us unlucky ones:
you need to use trekbuddy to create your own map tiles using the instructions available here
only one caveat :
all the instructions are fine and it should work as mentioned on the site. but in case you dont get the directory hierarchy in the atlases folder like 0/0 as it should be, even if you follow the instruction to the doit.
If so just before you click on "create the tile package", make sure you click on "clear " and then "add selection" in the tile content package box.
after that simply copy all the files to your sd card and you are good to go !
======================
added later
I have made a small one minute video of the tile creation.
Solutoin : AndNav http://www.andnav.org/
Install andnav2 from the site using the instructions provided therein. Basically install "apps installer" app from google market. download the latest .apk file and install.
now for the maps: for some luckly places on earth, someone has already made the map tiles and those can be downloaded and you need to unpack them in the andnav2\tiles\mapnik folder on your sdcard ..and you will have a bunch of files in hierarchy like
0/0/0.png.andnav
for rest of us unlucky ones:
you need to use trekbuddy to create your own map tiles using the instructions available here
only one caveat :
all the instructions are fine and it should work as mentioned on the site. but in case you dont get the directory hierarchy in the atlases folder like 0/0 as it should be, even if you follow the instruction to the doit.
If so just before you click on "create the tile package", make sure you click on "clear " and then "add selection" in the tile content package box.
after that simply copy all the files to your sd card and you are good to go !
======================
added later
I have made a small one minute video of the tile creation.
Thursday, June 04, 2009
Bhaat Kerela
For ages I have been wondering whats the english word for "bhaat kerela"
so here finally I have the answer
http://en.wikipedia.org/wiki/Momordica_dioica
Momordica dioica, commonly known as Teasle Gourd
so here finally I have the answer
http://en.wikipedia.org/wiki/Momordica_dioica
Momordica dioica, commonly known as Teasle Gourd
Thursday, January 22, 2009
mounting iso files in linux
mount -t iso9660 -o loop foo.iso foodir
on archlinux you may get the following error
mount: could not find any device /dev/loop#
so overcome that you need to do a
modprobe loop
Monday, December 15, 2008
append newline at end of files
Frequently when you download source code off the internet and try to compile, you end up getting a bunch of "warning: no newline at end of file" . to append a newline at the end of each *.c and *.h files use the following one liner.
ps: the space between the '{}' and '\;' at the end is required and there is no space in between "\;". else the follwing error occurs
find ./ \( -name "*.h" -o -name "*.cpp" \) -exec perl -i.bak -lpe 'print "\n" if eof' {} \;
ps: the space between the '{}' and '\;' at the end is required and there is no space in between "\;". else the follwing error occurs
find: missing argument to `-exec'
Monday, December 08, 2008
Sunglass
While this place has mostly computer related stuff, this time I just want to say if you are running a marathon and it is expected to be sunny, a sunglass helps a LOT. Not that I am a great runner or anything. But this time I was wearing one and in between at around 34 km or so, I took them off and boy the sun looked horrible and I can easily imagine it would be far more depressing without the sunglass. FWIW I shaved 1 hr and few minutes off my last years 7 hrs 15 mins time and I am sure the sunglass made some difference.
Monday, December 01, 2008
Resize an image using Imagemagick
you can just use convert to resize an image. Infact you can convert and resize in one go
convert infile.jpg -resize 10% outfile.png
convert infile.jpg -resize 10% outfile.png
Monday, November 10, 2008
"identify as" in opera
People who have used opera for some time know the usefullness of the "identify as" option. In the new versions it hard to find where its located , so here's how
right click on the webpage ->edit site preferences -> network
so basically it lets you set the preferences per website , which seems to be a useful feature , except for the fact that its hard to find.
right click on the webpage ->edit site preferences -> network
so basically it lets you set the preferences per website , which seems to be a useful feature , except for the fact that its hard to find.
Monday, November 03, 2008
Latex solution : IEEE etc requiring all fonts to be embedded
Here's an ugly solution which worked for me
( this is from here just copying it here again in case the original post get lost in an internet purge )
modify file
/usr/share/gs-afpl/8.14/lib/gs_pdfwr.ps
and change lines
/.standardfonts [
/Courier /Courier-Bold /Courier-Oblique /Courier-BoldOblique
/Helvetica /Helvetica-Bold /Helvetica-Oblique /Helvetica-BoldOblique
/Times-Roman /Times-Bold /Times-Italic /Times-BoldItalic
/Symbol /ZapfDingbats
] readonly def
into
/.standardfonts [
% /Courier /Courier-Bold /Courier-Oblique /Courier-BoldOblique
% /Helvetica /Helvetica-Bold /Helvetica-Oblique /Helvetica-BoldOblique
% /Times-Roman /Times-Bold /Times-Italic /Times-BoldItalic
% /Symbol /ZapfDingbats
] readonly def
=========
the command pdffonts shows the different fonts and whether they are embedded
sample output
pdffonts apdffile.pdf
name type emb sub uni object ID
------------------------------------ ----------------- --- --- --- ---------
Arial-BoldMT TrueType no no no 2295 0
Arial-ItalicMT TrueType no no no 2296 0
ArialMT TrueType no no no 2299 0
KGDDMC+Wingdings-Regular CID TrueType yes yes no 296 0
KGDEMN+SymbolMT CID TrueType yes yes yes 301 0
Arial-BoldItalicMT TrueType no no no 306 0
KGDPPM+TimesNewRomanPS-BoldMT TrueType yes yes no 307 0
KGECBC+TimesNewRomanPSMT TrueType yes yes no 310 0
KGECDD+BookmanOldStyle-Bold TrueType yes yes no 312 0
TimesNewRomanPS-BoldItalicMT TrueType no no no 314 0
TimesNewRomanPS-ItalicMT TrueType no no no 318 0
KGECAB+TimesNewRomanPSMT CID TrueType yes yes yes 320 0
KGDPOM+TimesNewRomanPS-BoldMT CID TrueType yes yes yes 327 0
( this is from here just copying it here again in case the original post get lost in an internet purge )
modify file
/usr/share/gs-afpl/8.14/lib/gs_pdfwr.ps
and change lines
/.standardfonts [
/Courier /Courier-Bold /Courier-Oblique /Courier-BoldOblique
/Helvetica /Helvetica-Bold /Helvetica-Oblique /Helvetica-BoldOblique
/Times-Roman /Times-Bold /Times-Italic /Times-BoldItalic
/Symbol /ZapfDingbats
] readonly def
into
/.standardfonts [
% /Courier /Courier-Bold /Courier-Oblique /Courier-BoldOblique
% /Helvetica /Helvetica-Bold /Helvetica-Oblique /Helvetica-BoldOblique
% /Times-Roman /Times-Bold /Times-Italic /Times-BoldItalic
% /Symbol /ZapfDingbats
] readonly def
=========
the command pdffonts shows the different fonts and whether they are embedded
sample output
pdffonts apdffile.pdf
name type emb sub uni object ID
------------------------------------ ----------------- --- --- --- ---------
Arial-BoldMT TrueType no no no 2295 0
Arial-ItalicMT TrueType no no no 2296 0
ArialMT TrueType no no no 2299 0
KGDDMC+Wingdings-Regular CID TrueType yes yes no 296 0
KGDEMN+SymbolMT CID TrueType yes yes yes 301 0
Arial-BoldItalicMT TrueType no no no 306 0
KGDPPM+TimesNewRomanPS-BoldMT TrueType yes yes no 307 0
KGECBC+TimesNewRomanPSMT TrueType yes yes no 310 0
KGECDD+BookmanOldStyle-Bold TrueType yes yes no 312 0
TimesNewRomanPS-BoldItalicMT TrueType no no no 314 0
TimesNewRomanPS-ItalicMT TrueType no no no 318 0
KGECAB+TimesNewRomanPSMT CID TrueType yes yes yes 320 0
KGDPOM+TimesNewRomanPS-BoldMT CID TrueType yes yes yes 327 0
Thursday, May 08, 2008
no page number in latex documents
The nopageno package provides a simple way to remove page numbers from both the opening pages and the normal pages of all classes of LaTeX documents. Other than adding the package to your document, no action is necessary. No package options are available.
Thursday, August 16, 2007
perl - modify numbers on each line
Recently had the expression
((a1 * b2 * c3) - (a1 * b3 * c2) - (a2 * b1 * c3) + (a3 * b1 * c2) + (a2 * b3 * c1) - (a3 * b2 * c1))
in which i needed to changed all a1, b2 etc to a[0], b[1] .. i.e to arrays and with subscripts starting from 0
the following did the trick
echo "the expression here" | perl -lpe 's/(\d)/$1-1/ge; s/(\d)/\[$1\]/g'
the two s/// are required cos first one with /ge the right hand side is evaluated as an expression and hence cannot put chars like '[' inside it
((a1 * b2 * c3) - (a1 * b3 * c2) - (a2 * b1 * c3) + (a3 * b1 * c2) + (a2 * b3 * c1) - (a3 * b2 * c1))
in which i needed to changed all a1, b2 etc to a[0], b[1] .. i.e to arrays and with subscripts starting from 0
the following did the trick
echo "the expression here" | perl -lpe 's/(\d)/$1-1/ge; s/(\d)/\[$1\]/g'
the two s/// are required cos first one with /ge the right hand side is evaluated as an expression and hence cannot put chars like '[' inside it
Thursday, September 28, 2006
rectangular emacs
Just now had the occasion to use the rectangular select/cut /paste
C-x r * where * is k for kill , y for yank(paste)
to select the rectangle you have to mark(C-space) one corner of the rectangle and then take the cursor to the opposite corner).
C-x r * where * is k for kill , y for yank(paste)
to select the rectangle you have to mark(C-space) one corner of the rectangle and then take the cursor to the opposite corner).
Monday, June 26, 2006
cross-compiler hell
cross-compiler are a pain in the ass .
kegel.com/crosstool is helpful in such cases
anyway if you ever build powerpc-eabi cross compiler and you get the error
powerpc-eabi-gcc hello.c -static
hello.c:(.text+0x24): undefined reference to `printf'
/opt/ppcsim/lib/gcc-lib/powerpc-eabi/3.2.1/libgcc.a(eabi.o): In function `__eabi':
use the -msim switch when compiling
dont ask me the logic behind it ..but I got it from
http://sources.redhat.com/ml/crossgcc/2002-09/msg00096.html
and it worked for me.
kegel.com/crosstool is helpful in such cases
anyway if you ever build powerpc-eabi cross compiler and you get the error
powerpc-eabi-gcc hello.c -static
hello.c:(.text+0x24): undefined reference to `printf'
/opt/ppcsim/lib/gcc-lib/powerpc-eabi/3.2.1/libgcc.a(eabi.o): In function `__eabi':
use the -msim switch when compiling
dont ask me the logic behind it ..but I got it from
http://sources.redhat.com/ml/crossgcc/2002-09/msg00096.html
and it worked for me.
Monday, May 29, 2006
wrapped text in tables
use package tabulary for wrapped text in tables
\begin{table}
\caption{capshon}
\begin{tabulary}{\textwidth}{lL}...
\hline
\hline
A & B \\hline
A & bbbbbbbbbbbbbbbbbbb\ X & ccccccccccccccccccccc\
\hline
\end{tabulary}...
\label{label}
\end{table}
--
for some odd reason, the label has to be where it is, when i triedto move it up below the caption i ended up with more than 100 errors
\begin{table}
\caption{capshon}
\begin{tabulary}{\textwidth}{lL}...
\hline
\hline
A & B \\hline
A & bbbbbbbbbbbbbbbbbbb\ X & ccccccccccccccccccccc\
\hline
\end{tabulary}...
\label{label}
\end{table}
--
for some odd reason, the label has to be where it is, when i triedto move it up below the caption i ended up with more than 100 errors
install new latex package
1.Download
2. move .sty file to ..textmf/tex/latex/package-name/
3. if no .sty file .run latex on the .ins file
4. type texhash
2. move .sty file to ..textmf/tex/latex/package-name/
3. if no .sty file .run latex on the .ins file
4. type texhash
Sunday, May 28, 2006
Tuesday, March 14, 2006
hyperref warnings : LaTeX
Package hyperref Warning: Token not allowed in a PDFDocEncoded string,
(hyperref) removing `\-command' on input line 46.
\texorpdfstring{LATEX text}{PDF text}
can be used to vary the text, depending on whether it is to be processed by LATEX or whether it will appear in the PDF bookmark. The above section heading could then be changed to
\subsubsection{An Example Heading\texorpdfstring{: $a^2+b^2=c^2$}{}}
In this case, the equation will be printed in the section heading within the document, but will not appear in the bookmark.
(hyperref) removing `\
\texorpdfstring{LATEX text}{PDF text}
can be used to vary the text, depending on whether it is to be processed by LATEX or whether it will appear in the PDF bookmark. The above section heading could then be changed to
\subsubsection{An Example Heading\texorpdfstring{: $a^2+b^2=c^2$}{}}
In this case, the equation will be printed in the section heading within the document, but will not appear in the bookmark.
Tuesday, March 07, 2006
Reset $. at EOF
When using perl $. variables, you may need to reset $. for each new file.
for example to add #!/usr/bin/perl to each .pl in the current dir do
perl -i -lpe 'print "#!/usr/bin/perl\n" if $. ==1 ; close ARGV if eof' *.pl
for example to add #!/usr/bin/perl to each .pl in the current dir do
perl -i -lpe 'print "#!/usr/bin/perl\n" if $. ==1 ; close ARGV if eof' *.pl
Monday, March 06, 2006
mget/mput with ftp
While uploading/downloading multiple files using mput and mget in ftp, you prolly have to type 'y' for each file transfer. If you find it annoying you can toggle it off/on by the 'prompt' command.
Wednesday, November 23, 2005
Adding to table of contents ( LaTeX)
Starred versions of the sectioning commands are not added to the table of contents by default, but they can be added using:
| \addcontentsline{file}{type}{text} |
- file
- This should be the extension of the file where the contents are written. So this will be toc for the table of contents, lof for the list of figures and lot for the list of tables.
- type
- This is the type of object you are adding to the contents. e.g. chapter, section, figure.
- text
- This is the text that should go in the contents.
For example, the bibliography is generated using a starred version of the \chapter command, so it doesn't get added to the table of contents. To add it to the table of contents, you can do
\addcontentsline{toc}{chapter}{\bibname}
The counter tocdepth controls the section level depth in the table of contents.
The report class file sets tocdepth to 2, which means that only the parts, chapters, sections and subsections will be entered into the table of contents. You can use \setcounter to change the value of tocdepth. For example, to also include the subsubsections, paragraphs and subparagraphs, do:
\setocounter{tocdepth}{5}
Subscribe to:
Posts (Atom)