0

Fancy page number in Latex

Posted by Derek Jing on 4:04 PM in
In the preambule:

\usepackage{fancyhdr}
\pagestyle{fancy}
\renewcommand{\headrulewidth}{0.0pt}
\fancyhead{}
\fancyfoot[CF]{\thesection - \thepage}

Then reset page number to `1' for each new section:

\newpage
\section{Introduction}
\pagenumbering{arabic}

0

Prevent splitting a word at the end of a line

Posted by Derek Jing on 5:22 AM in
Use \hbox{} or \mbox{}.

0

Convert images between two different formats

Posted by Derek Jing on 8:12 PM in ,
Choice #1: Use Linux ImageMagick tool

Use the convert command (a member of the ImageMagick suite of tools) to convert between image formats as well as
=> Resize an image
=> Blur an image
=> Crop an image
=> Despeckle an image
=> Dither an image
=> Draw on an image
=> Flip an image
=> Join an image
=> Re-sample, and much more.

Examples:

$ convert input.jpg output.png

$ convert -resize 50% input.jpg output.png

$ convert -size 360x85 xc:transparent -font Bookman-DemiItalic -pointsize 72 -draw "text 25,60 'nixCraft'" -channel RGBA -gaussian 0x6 -fill YellowGreen -stroke RosyBrown -draw "text 20,55 'nixCraft'" nixCraft.png

Choice #2: Use ps2pdf command

Sometimes we export image to high quality 'ps' format, then we can use `ps2pdf' command to convert it to high quality PDF format.

$ ps2pdf file.ps file.pdf

0

Fast calculate square root

Posted by Derek Jing on 4:44 PM in
Calculate sqrt(37) and tell me estimate of the error.

----------------------------
I did in this way:



Therefore, I say the answer is 6.08, and the error is within 0.08. In other word, sqrt{37}=6.09~6.16. Indeed, calculator shows the answer is 6.083.

0

Make loops using 50 strings

Posted by Derek Jing on 4:38 PM in
Another brain teaser question the Goldman Sachs interviewer asked me today.

Give you 50 strings, you randomly connect them end-by-end. What's the expectation of the number of loops that you may form?

0

Collection of quant interview questions

Posted by Derek Jing on 4:34 PM in ,
  1. cZCsa

  2. saddsa

Copyright © 2009 Derek's Technical Notes All rights reserved.