ear-fung.us I’m a programmer. I’m also pro-grammar.

15Feb/101

Mouse Path – Graphical Representation

Here's a pictoral representation of my mouse path from Friday, Feb. 12, 2010.

It's not completely accurate seeing that I work with two monitors and this little app only supports the primary screen. so that's why you see a lot of horizontal movement near the right side of the image: it's me moving my mouse to my secondary monitor. The large black dots are where the mouse was not moving for a period of time.

Check out the cross-platform java applet here.

11Feb/101

Code Snippet: Extract A Value From A Querystring in AS3

I found myself in need of extracting a given value from a query string that was inside an XML attribute. Searching for something like this, I couldn't find anything on par with PHP's parse_str() so I got the string out of the XML and wrote this handy function:

function getQueryStringVar(queryStr:String, targetVar:String):String
{
	var pairs = queryStr.split("&");
	for(var i:String in pairs)
	{
		var splitStr = pairs[i].split("=");
		if(splitStr[0] == targetVar)return splitStr[1];
	}
	return "";
}

Usage is easy. Just send it your query string as the first parameter (make sure there's not a "?" at the beginning) and key you want to know the value of.

// myVal is set to "example"
var myVal:String = getQueryStringVar("val1=test&val2=example", "val2");

Let me know if you find this function useful or if you improve upon it.

4Feb/101

Things People Say When I Write with My Left Hand

This pretty much sums it up:

[via]

3Feb/100

The Cartoon That Shaped My Childhood

I had a VHS tape of the program Donald in Mathmagic Land that I can remember watching all the time as a child. It's a wonder if you've never heard of it since it was one of the most popular educational films ever made by Disney.

This little 27 minute cartoon introduced me to topics such as music theory, the golden ratio, geometry, and I feel most importantly: the concept of infinity.

Thanks to the wonder of the internet, you can now watch the program in its entirety on youtube, but I've conveniently embedded it here for you to watch!

Mathematics is the alphabet with which God has written the universe.

-Galileo Galilei

29Jan/102

Mohawk vs. Fauxhawk

Scott's ribbing got me all riled up. So here's an informational post on the differences between a mohawk and a fauxhawk haircut/style.

Mo·hawk

Etymology: of Algonquian origin; akin to Narragansett or Massachusett Mohowawog Mohawk, literally, cannibal
Date: 1634

3 : a hairstyle with a narrow center strip of usually upright hair and the sides of the head shaved

Here are some examples of a mohawk haircut fresh from the tubes of the Internet:

Since "fauxhawk" isn't really a word, it's not in the Merriam-Webster online dictionary, we must look to urbandictionary.com.

fauxhawk: A full head of hair combed into the middle to fabricate the look of a mohawk.

As you can clearly see, fauxhawks don't have a defined line from where the short and long hair meet. It's basically just combed straight up into the shape of a mohawk. Fauxhawks are generally associated with pop-culture and general douchebaggery. Mohawks are generally associated with anti-pop-culture.

And for my final exhibit: a photo of me. I have a mohawk, not a fauxhawk.

If you're going to do something, do it all out. fauxhawks are a cop-out for people who don't want to make the commitment of shaving the sides of their head.

27Jan/103

Changing The Way I Collect Music

I've amassed a lot of digital music over the years. Lots of times I'd download the entire album even if I just wanted one song... 'cause, you know... there might be some other good music on the album.

Sorry to say, that this wasn't the case in 70%-80% of the music I downloaded. I've always been a pretty fanatical completionist (are you an incrementalist or a completionist?) so I'd keep the bad songs around with the good ones, "because then I have the whole album," or "I might like that sometime in the future."

No More!

You may know about my obsessive iTunes star ratings, so I know what songs I don't really like. However, I'm not going to blindly delete all my 1 and 2-star rated songs. I'm going to delete songs as I come across them during my normal listening schedule for each day. I don't expect to delete any more than 4 or 5 songs a day from my 4,000 song, 20 GB music library.

Do you think I'm going about this the right way? Am I stupid for deleting songs in this age of extremely cheap storage mediums? Let me know. The deleting begins today.

First song to bite the dust and see the inside of my trash bin? "Full Moon" by The Black Ghosts.

7Jan/104

My Latest Creation

HopsAs some of you may already know, I've started brewing my own beer at home ("homebrewing" creates "homebrew"). I've made some 2.5 gallon batches here and there including an American Light Ale, an Oatmeal Stout, and a few other misc brews. Then I decided to invest in some better equipment. Don't get me wrong, Mr. Beer is a great kit to start out with, but I felt the quality of the beer I could create was being held back by some of the more simplistic equipment and ingredients that you get with Mr. Beer.

I now have a problem: I have a bunch of glass bottles with different styles of beer in them. The majority of these bottles are unlabeled. Luckily, I have two different color bottle caps that I've used, but that's really the only differentiation between the bottles at the moment.

I've decided that whenever I create a new batch of beer, I'm going to create a custom label for it. just like commercial micro-breweries do. I'll print out the labels on my inkjet printer on plain paper, cut them up, and adhere them to the bottles using Elmers' Spray Adhesive (the stuff schoolkids use to tack things to display boards for presentations). With the type of spray glue I'm using, it shouldn't be too hard to remove the labels once the bottle is empty. I understand that the inkjet printer won't produce the best and most lasting results, but it'll do for now.

So, I proudly unveil my first-ever label. It's for my latest batch which I'm calling "Bitter Old Lady IPA" (India Pale Ale).

I'll be printing, cutting, and adhering the labels tonight. Who knows... if this turns out to be way more of a hassle than its worth this may also be my last label!

Bitter Old Lady IPA

And here is the label on a few test bottles:

6Jan/100

Collaborative Songwriting

My friend Jon loves to play the guitar. So the other day he started sending me a few audio files of songs he recorded (small clips).

So what do I do with the files? What any sane person would do: bring 'em into Garage Band and record the lead guitar part with nothing other than my vocal chords.

Here's two songs we collaborated on. I hope you enjoy them.

Dream Theater: The Count of Tuscany

Audio clip: Adobe Flash Player (version 9 or above) is required to play this audio clip. Download the latest version here. You also need to have JavaScript enabled in your browser.

Muse: Hysteria

Audio clip: Adobe Flash Player (version 9 or above) is required to play this audio clip. Download the latest version here. You also need to have JavaScript enabled in your browser.

Yeah... they're not that good... mostly because of my horrible hackjob on the vocals, but it was fun :)