Monday, March 02, 2009

advances



convert



A little bit of C++ that I whipped up to convert to and from binary, since I didn't find anything too inspiring online:


string binary(int v, int bits) {

int p;

string s = "";

for (int i = bits; i >= 0; i--) {
p = pow(2,i);
if (v & (1 << i)) {
s += "1";
} else {
s += "0";
}
}

return s;
}



Convert a bitstream to a floating point number between 0 and 1. It's a smart little function
because it figures out the range from the length of the input string

float convert_bitstring_to_float(string s) {

float v = 0;

int len = s.length();

for (int i = 0; i < len; i++) {
cout << "i=" << i << " s[i]=" << s[i] << endl;
if (s[len-i-1] == '1') {
v += (1 << i);
}
}

return v / (pow(2,len));
}


history



latex




Whenever you use figures, always (and I mean ALWAYS EVER FOREVER ALWAYS) put \caption first, and \label second like this:


\begin{figure}[htp]
\centering
\includegraphics{image.eps}
\caption{Some Image}
\label{fig:some-image}
\end{figure}




Sunday, March 01, 2009

Look Around You - Computer Games

Look Around You - Music

record




recordmydesktop --on-the-fly-encoding --full-shots -fps 29.97 -width 720 -height 528 -x 20 -y 40

keyjnote -f -g 724x532 python-before-eggs.pdf

mencoder out.ogv -ovc libdv -oac pcm -vf scale=720:480 -o editme.dv

cinelerra (or After Effects, Adobe Premier, Final Cut Pro)

mencoder cinelerra.ogg -vf scale=640:480 -af volnorm=1:0.5 -ovc lavc -oac twolame -o final.avi



keyjnote




KeyJnote - is a program that displays PDF presentation slides with style. Smooth alpha-blended slide transitions are provided for the sake of eye candy, but in addition to this, KeyJnote offers some unique tools that are very useful for presentations.


screencast




How To Produce A Linux Screencast

1) Use "recordmydesktop"
2) Convert to raw .dv format (which is huge)
3) Edit in some program
4) Convert to something that YouTube or Vimeo likes



clojure



getting tail




Tail Recursion

Which I found by looking at:

Clojure

Which led to:

Getting started with Clojure

But what led me to all of this was:

Ruby's Most Underused Keyword (spoiler, it's "redo")



sf git




SourceForge gets Git. And there was great rejoicing.



10