Sorry, the page you requested was not found. Really.
The page you are looking for might have been removed, had its name changed, or is temporarily unavailable.
Thursday, 22 October 2009
-
Troy and B.S. expertise go hand in hand
I am inspired by this wise xkcd comic strip.Troy's Heuristic for English Language Survival: "In regards to literary criticism, smoothly executed B.S. may be considered sufficiently indistinguishable from the real deal -- at least for the purpose of finishing that darn essay in the wee hours of the morning."
(To an extent, this is the humanities equivalent of POGE.)
Thursday, 03 September 2009
-
Probability Sampling
The homework today for AP Statistics was to toss a coin a hundred times and then record the result. Hmm ... what busy work (for a computer).#!/usr/bin/perl -w
# Usage: ./$0 $sample_size $event_name $probability [$event_name$probability ..]
use strict;
my @tmp = @ARGV;
die "Not enough arguments" if scalar(@tmp) < 3;
my $total = shift @tmp;
my %events= @tmp;
my $sum = 0;
for (values %events) {
$sum += $_;
}
die "Sum of probabilities $sum != 1" unless $sum == 1;
my @keys = sort keys(%events);
for(my $count = 1; $count <= $total; $count++) {
my $result = rand;
my $lower = 0;
my $name = undef;
foreach (@keys) {
my $upper = $lower +$events{$_};
if($lower <= $result && $result < $upper) {
$name = $_;
last;
}
else {
$lower = $upper;
}
}
die "Out of range" unless defined $name;
print "${count}: ${name}\n";
}
exit 0;
In all:./randsamp 100 heads 0.5 tails 0.5
The Perl script can work with a variable number of arguments, assuming that the first denotes the sample size and the rest are pairs of event names and probabilities. Of course, the sum of the probabilities must exactly equal 1 or else the scriptdies.
Remember to adjust the shebang line to point to the path of your Perl installation.
Saturday, 23 May 2009
-
It seems that the performance improvements in Ubuntu 9.04 paid off, especially with the new ext4 filesystem.
15 seconds from a cold start on my full installation - here is the bootchart to prove it:
Friday, 22 May 2009
-
Troy vs. Not Troy

This should be self-explanatory. A few days ago, I took a random glimpse at peoples' status messages, and the dichotomy could not be ignored.
QN, at least your misfortune will be humorously immortalized.
Saturday, 09 May 2009
-
Wikipedia Milestone: 3000 Edits

The 3000th edit, I admit, is not a particularly momentous one.
It should have come much earlier, but my Wikipedia involvement has continuously fallen due to real-life commitments...oh well...
Thursday, 30 April 2009
-
APUSH Review Lecture Series
Recorded by QN
Edited by A.Ou- 21 April 2009 (Day #2, Robinson)
- 23 April 2009 (Day #4, Robinson)
- 27 April 2009 (Day #5, Dickey)
- 28 April 2009 (Day #6, Robinson)
- 29 April 2009 (Day #7, Dickey)

To be suitable for online distribution, raw recordings were edited as follows:
N.B. How to install SoX with MP3 support in GNU/Linux# Normalize volume (in addition, slow down tempo by 10% with Robinson for clarity)
sox -S $input tmp.wav pad 2 tempo 0.9 norm -3
# Encode at average bitrate of 32kbps
lame --abr 32 tmp.wav $output
Wednesday, 29 April 2009
-
HowTo: SoX Installation
HowTo: Compiling SoX with read/write MP3 support in Ubuntu
SoX describes itself as the "Swiss Army knife of sound processing programs," a well-deserved title given the amount of functionality outlined in thesox(1)man page - one can say it's the command-line version of Audacity.
Due to patent issues and the typical legal mess, SoX binaries are distributed without MP3 support to avoid licensing fees (I would prefer an unencumered open format such as Ogg Vorbis, but MP3 remains too common to ignore). SoX can be given MP3 support, however, be recompiling it to use a third-party library such as LAME.
Instructions here are specific to Ubuntu (8.10+) but may be adapted for Debian or any other distro that uses APT.- Install packages required for the build environment (ensure that 'multiverse' and 'restricted' repositories are enabled in /etc/apt/sources.list).
Note that, in Ubuntu 7.10 and 8.04, LAME development libraries are provided byliblame-devinstead oflibmp3lame-dev.sudo apt-get install build-essentials fakeroot libmp3lame-dev
sudo apt-get build-dep sox - Retrieve and unpack SoX sources into a clean directory.
mkdir sox
cd sox
apt-get source sox
dpkg-source -x sox_*.dsc
cd sox-*.*.* - Remove the '--disable-lame' compiler flag; either use sed to automate the task or manually edit sox-*.*.*/debian/rules with a text editor.
sed -i~ 's/--disable-lame//g' debian/rules - Build the package.
dpkg-buildpackage -b
You should be able to seechecking lame/lame.h usability... yes
echoed in the terminal, although it is recommended you redirect stdout to a log file because the messages will likely escape the scrollback buffer before there is a chance to pause and read.
checking lame/lame.h presence... yes
checking for lame/lame.h... yes
checking for lame_init in -lmp3lame... yes
<snip>
LAME MP3 writer................... yes - The build will provide all SoX-related packages, but only certain local ones are needed to replace the repository versions.
cd ..
sudo dpkg -i sox_*.deb libsox-fmt-mp3_*.deb
sox -hshould give something likeSUPPORTED FILE FORMATS: 8svx aif aifc aiff aiffc al alsa ao au auto avi avr caf cdda cdr cvs cvsd dat dvms fap ffmpeg flac fssd gsm hcom ima ircam la lpc lpc10 lu m3u m4a mat mat4 mat5 maud mp2 mp3 mp4 mpg nist nul null ogg oss ossdsp paf pls prc pvf raw s1 s2 s3 s4 sb sd2 sds sf sl smp snd sndfile sndt sou sph sw txw u1 u2 u3 u4 ub ul uw vms voc vorbis vox w64 wav wavpcm wmv wve xa xi
Support for extra formats can be obtained through thelibsox-fmt-allpackage.HowTo: Recompiling the latest SoX sources
I found myself desiring the "norm" effect, but, unfortunately, the feature was introduced in version 14.1.0, while the 8.10 repository is stuck at 14.0.1. In these cases, it becomes necessary to recompile the latest sources.- Download and unpack the latest stable SoX sources for GNU/Linux (currently 14.2.0). For expediency, wget is used here, but a regular web browser suffices.
wget http://superb-west.dl.sourceforge.net/sourceforge/sox/sox-14.2.0.tar.gz
tar -xvzf sox-14.2.0.tar.gz - Set up the build environment.
sudo apt-get install build-essentials fakeroot checkinstall libmp3lame-dev
sudo apt-get build-dep sox
Note thatlibmp3lame-devis necessary for MP3 support through LAME, which is not automatically included among the SoX build dependencies due to MP3 patent/licensing issues.
For Ubuntu 7.10 and 8.04, LAME development headers and libraries are provided byliblame-devinstead. - Compiling involves the same standard procedure...
cd sox-14.2.0
./configure
make - Due to some strange linking situation in which shared libraries were not detected correctly, the links need to be repaired after installing or SoX will not run. (This took me a while to figure out.)
sudo make install
# Add /usr/local/lib to end of the include paths
sed -i~ '$s/$/& \/usr\/local\/lib/' /etc/ld.so.conf
sudo /sbin/ldconfig - For easier uninstallation, checkinstall can create a deb package so APT can keep track of the installed files.
sudo checkinstall
Note that SoX is produced as a single package, rather than as multiple packages by repository conventions.
- Install packages required for the build environment (ensure that 'multiverse' and 'restricted' repositories are enabled in /etc/apt/sources.list).
Monday, 27 April 2009
Sunday, 26 April 2009
-
Elucidating Addie Bundren
For those of you in Mr. P's Language and Compositions class: if you find the mess of plain text from the email difficult to annotate, I have typeset the essay "Elucidating Addie Bundren in As I Lay Dying" by Morna Flaum with LaTeX.
Download: PDF | LaTeX source
Saturday, 25 April 2009
-
Teh Stoopid, it eviscerates
In observing wide range of opinions that people have expressed on the Internet, I have come to notice that one particular rule can be formulated from the chaos:As long as one is able to imagine the most hilarious/ridiculous/nonsensical position a person can possibly take on a certain issue, chances are that someone else on the Internet absolutely believes it.
I just had the random curiosity to search "pollution is good," and, a couple hyperlinks later, I found old NPR story about a think tank called the "Competitive Enterprise Institute" that says...wait for it...not only is global warming not real, raising atmospheric CO2 levels is actually a good thing.
What a catchy tagline for their ads: "They call it pollution. We call it life."
Since a little girl blowing on a dandelion is technically producing CO2, and little girls are (mostly) harmless, it must logically follow that CO2 is harmless.
It reminds me of a Youtube comment (where else?) I once read, arguing we should pump more greenhouse gases into the air because the Northwest is way too darn cold.
Interestingly, but not surprisingly, they have disallowed ratings on their Youtube videos.
- browse entries:
- older »
Don't worry - your calendar is here… to see it in action just click "Save"
above and refresh the page.

