March 2011
1 post
"Error #2044: Unhandled onError:. text" - Loading...
I was getting this error in a Flash file when loading Youtube videos with SWFLoader. But only in Firefox - not in Chrome or Internet Explorer. I added various event listeners for EventError and IOEventError to try to catch the error. I even added a security exception for youtube.com. None of this worked.
What I didn’t realise was the error was coming from Youtube itself, not my application...
November 2010
1 post
To hell with for loops
All these process an array, returning the processed:
var array_to_return;
for(var i=0;i<old_array.length;i++) {
array_to_return.push(processed old_array[i]);
}
return array_to_return;
and
var array_to_return;
for each(var i in old_array) {
array_to_return.push(processed i);
}
return array_to_return;
are not as nice as
return old_array.map(function (i) { return processed i;...
October 2010
3 posts
There is a place for the adjective and for the descriptive passage, but these...
– Alexander McCall Smith on Writing Concisely WSJ.com (via somethingchanged)
Problem with qemu-kvm: keyboard and mouse
qemu-kvm wasn’t detecting my mouse and keyboard during emulation for some reason. I’d click on the qemu window and nothing would happen. Even weirder, it was opening up in TTY8—that is, completely separate from Xorg.
Eventually, I found out the problem that some VMPlayer background daemon was still hanging around, somehow forcing qemu-kvm to TTY8 and stealing its mouse and...
1 tag
bash time saver: for loops
Just now I had a bunch a packages I wanted to install. I was going to do install package_1, then install package_2, etc etc. Instead:
for a in package_1 package_2; do install $a; done
Fairly simple, and I knew for each loops existed in bash—just never got around to making part of my console habit.
Edit: install {package_1,package_2} works as well, making sure there are no whitespaces.
June 2010
1 post
4 tags
Rebinding the Escape key in Vim: the k j approach
As using vim involves switching between command and insert mode a lot, you end up reaching for the Escape key often—too often for my fingers.
You change your Escape key for Caps Lock. I was using C-c for the Escape key, which is a default alternative in vim. C-[ appears to be a old time short-cut, too.
But they all suffer from the same problems: moving your fingers away from the home row,...
April 2010
2 posts
7 tags
Unicode and UTF-8 Explained
I spent some time reading this excellent but lengthy guide to Unicode and UTF-8 and playing with Unicode a little. Here’s a hopefully clearer and gently paced guide telling you what you need to know, especially if you’re working with a programming language that does not automatically handle Unicode (it’s a good overview for non-programmers, too).
Before Unicode Everything, as...
11 tags
Soft word wrap in VIM 7 (for prose mainly)
Soft word wrap seems like a black art judging by Google’s search results, especially as many of the solutions are for previous version of Vim. I finally came across the solution via vim’s homepage. And this solution automatically re-soft wraps the text when you insert some text in an existing line, thankfully. There are few more tweaks needed, however.
In Vim 7:
:set...
December 2009
2 posts
"mtp" mobile phone devices in linux
MTP, a Microsoft invention, sits on a lot mobile phones and other devices these days. It’s a protocol that makes the transfer of media better/more convenient somehow (whatever is wrong with plain filesystems, I really don’t know…) Wikipedia has a list of devices it infects.
This doesn’t work to well with Linux, as with most Microsoft protocols. libmtp does support some...
September 2009
3 posts
unit testing
Note to self: you don’t really understand your function until you unit test it.
There exist counterexamples to this, but in general, great things are...
– nomo zilla (via bikeshed)
Errors: Alsa, dmix, unable to open slave
If you’re getting error messages like this
ALSA lib pcm_dmix.c:864:(snd_pcm_dmix_open) unable to open slave
when you try to run Firefox in linux, or any other application for that matter, I may have the solution.
There’s plenty of fairly complicated stuff on the internet about that error. None of it helped me. My problem was actually mplayer.
I had it running in the background....
August 2009
1 post
rsync, mkstemp, fat32, No such file or directory
When you rsync to a fat32 device you encounter problems. Problems because fat32 is an awful, awful filesystem. If you can simply not use fat32, do so. If you’re forced to use it (Hello) then here’s how to get around it.
On to the error messages. The first one you may encounter is:
rsync: mkstemp “YOUR_DEST_DIR/.FILENAME” failed: No such file or directory (2)
This...
June 2009
1 post
Sociologists have long suspected that, for example, children of factory workers...
– Sensemaking: How intellectual pollution has crippled America’s children
May 2009
5 posts
Figures of Speech - Teach a Kid to Argue →
The article also convincingly argues that arguments based in traditional logic reduce not increase conflict.
Smith also gives us a more compelling portrait of the psychology of motivation...
– Club Troppo » Adam Smith 2.0: Emergent Public Goods, Intellectual Property and the Rhetoric of Remix
I’ve been thinking the same thing recently. All my daydreams of fame through creation always centre on me as the creator, and the acknowledgment of such by others.
I want to separate...
Meditation: Why Bother? →
An excellent peice against desire.
90 people get the swine flu and everybody wants to wear a mask. A million people...
– Reblogged from mllewang (via continuum)
April 2009
4 posts
I get angry when I hear that word “empire”; it reminds me of slavery...
– A Poet Called Benjamin Zephaniah
Read the whole thing.
So whenever you hear the cry “But what about ” you can reply what...
– Johann Hari: How to spot a lame, lame argument - Johann Hari, Commentators - The Independent
“So whenever you hear the cry “But what about?!”, you can reply: what about we ignore this crude attempt to change the subject, and focus on the subject in hand?”
Is homophobia associated with homosexual arousal?... →
I have been claiming this for fucking years.
One of the biggest wake-up calls of my career was when I saw a record contract....
– TRENT REZNOR - REZNOR URGES MUSICIANS TO DITCH LABELS
March 2009
19 posts
When I was a young man, I wanted to change the world.
I found it was...
– By Unknown Monk, 1100 A.D. (via John Erik Metcalf via brit) (via continuum)
Who Really Rules? (Aaron Swartz's Raw Thought) →
The real art, however, lies in the pitch. Sometimes Sonam pretends that he is a woman to lure a Chinese man into conversation but mostly he just taps into China’s online political subculture. “You have to start with personal stuff, then move on to social problems and political problems, then Tibet,” he said. “It’s no use just quoting the BBC or CNN. You have to analyse China’s problems and show...
The Cab Ride I’ll Never Forget | Zen Moments →
This is a beautiful story. You should read it.
Things I want to do #34
Bake a lot of biscuits. Start up a stall in a park somewhere. Create a big sign that reads: “The Truth. Gets some for free. Contains sugar. Not suitable for those allergic to nuts.” And offer the biscuits to anyone who approaches.
And then, after a while, when people start to become very suspicious of my offerings and generally choose not to take the biscuits, sit and contemplate...
Changing high level behaviour in foxes results in... →
Using the Socratic Method to teach children... →
Johann Hari: Peace in Ireland depends on ending... →
Excellent as ever, if a little depressing when one thinks of UK faith schools.
THE REVOLUTION WILL NOT BE TELEVISED →
This video about Hugo Chavez and Venezuela is the best thing I’ve watched in a very, very long time.
It details the CIA’s involvement in the military coup, the army and the populous’s role in that, the different in coverage between Western and Venezuelan TV, the different in coverage between publicly and privately owned TV in Venezuela, and much more.
It’s far more...
Andrade tested her theory by playing a lengthy and boring tape of a telephone...
– Bored? Try Doodling To Keep The Brain On Task : NPR
How To Measure Any Distance With The Pythagorean... →
I may starting learning maths using this site. This article has a great example where netflix’s recommendation system is explained in terms of the theorem.
Locus Online Features: Cory Doctorow: Why I... →
Full Disclosure: CSRF vulnerability in GMail... →
When logged in to gmail, if you visit an external and malicious site, that site can attempt to guess and change your gmail password.
According to ycominator news and this page, gmail aren’t going to fix this problem. They could fix it by preventing GET requests to the password changer, and/or by ensuring there’s a capcha between the user/attacker and password changer (although...
World News - Footage of Israeli Military Shooting... →
Missing space in ubuntu? I have 500mb of old kernel images, header files and modules…
The Real Reason for Microsoft's TomTom Lawsuit →
So:
Companies like Tomtom use FAT as a filesystem along with the Linux operating system. Microsoft — silently most of the time, except for in this case — get these companies to sign cross-licensing contracts to use FAT. But these deals violate the GPL, which the Linux kernel uses as a licence. So when these deals eventually become public the GPL lawyers will do MS’s dirty...
Oh man, GNU Typist is brilliant. After a day of using it, and loving it, my typing speed and accuracy has increased enormously. I am in love. And it’s for unix, and uses ncurses — suiting my masochistic elitism perfectly.
Over the past few months, I keep returning to an extraordinary essay written by...
– Johann Hari: The nightmare of Netanyahu returns - Johann Hari, Commentators - The Independent
February 2009
10 posts
Browser plugin detects and reports net-censorship... →
My God
preload has sped up linux — Firefox and Openoffice startup times at least — tremendously.
It kind of reminds me of this riff I heard by one of my favorite local comedians...
– HARDCORE ZEN
I’m not convinced desire is so bad, especially after reading some Iain M. Banks. I like the Culture’s hedonistic attitude, especially as it doesn’t seem to impinge on others. Ah, Sci-Fi.
But still, desire must form the genesis of much improvement in society. An...
Never Get Out Of The Boat!: The Beatles →
People talk about a return to Keynesianism, but that’s because of a systematic...
– Noam Chomsky (via azspot)
I’ve never read anything by Chomsky — despite the fact I’ve been meaning to for quite a while. He does seem a little overzealous at times, but his insights seem largely correct. If this article is anything like his books, I cannot wait to read one.
I...