Contact Info

(for those who care)

Instant Gratification   



Tue, 17 Jul 2007

How does JavaScript Suck?

Let me count the ways:

>>> 1 ? "yes" : "no"
"yes"

>>> 0 ? "yes" : "no"
"no"

>>> "1" ? "yes" : "no"
"yes"

>>> "0" ? "yes" : "no"
"yes"

>>> Number("1") ? "yes" : "no"
"yes"

>>> Number("0") ? "yes" : "no"
"no"

>>> Number("true") ? "yes" : "no"
"no"

function DoWhatIMean( pString )
{
   if ( typeof pString === 'string' )
   {
      return pString.toLowerCase() == "true" ?
         true : Number(pString) ? true : false
   }
   else
   {
      return Number(pString) ? true : false
   }
}

>>> DoWhatIMean( "true" ) ? "yes" : "no"
"yes"

>>> DoWhatIMean( "false" ) ? "yes" : "no"
"no"

Welcome to 2007.

Note, I even originally had two rookie mistakes in “DoWhatIMean” - did not “*.toLowerCase()” it, and also did not check to see if it was a string first. Ugh.

13:25 CST | category / entries
permanent link | comments?

Thu, 05 Jul 2007

The Nexus of Etude (by Carulli)

I’ve been taking guitar lessons since about March ‘06, and had my first guitar since January ‘06. It’s been a long road, but reasonably fruitful and productive. Here is the journey of me playing a Study (Etude) by Fernando Carulli, with a slight detour to the land of midi and sheet music.

First you start with Frederick M. Noad’s Solo Guitar I, a thorough and excellent introduction to learning guitar and eventually you get to Etude.

Here is the song transcribed into Lilypond notation, and it’s corresponding output (available in both PNG and PDF).

Lilypond will also let you export to midi, here’s what the song sounds like when a computer plays it: in MIDI, and mp3 formats.

Now you can see me actually perform the song with both of my guitars. The first guitar is the one I found in the Mercado de Balderas in Mexico, D.F. It’s kindof a darker brown guitar with light trim, made of cedar, very lightweight, and has been a great guitar for me to learn on. Only after more than a year of practice have I been able to play ~better than~ the guitar (ie: where the guitar has been holding me back).

Or just listen to the song on the old guitar.

Next is the performance with my new guitar. I got it for my birthday last year when we went to Paracho, Mexico (self-proclaimed Guitar Capital of the World). It’s a bit lighter in color, but a much heavier wood- made of palo-escrito, or “Mexican Rosewood”. It has a richer tone, and plays a lot louder than my first guitar.

Or just listen to the song on the new guitar.

There are mistakes in both of them, and they represent the best of ~9-10 takes (each), but should be enough so you can hear the difference between the two guitars, and see the process that someone has to go through in order to entertain you with even the simplest of songs. One thing that learning to play the guitar has taught me is to appreciate so much more the effort that goes into making music, especially when playing live.

22:26 CST | category / entries
permanent link | comments?

Like what you just read? Subscribe to a syndicated feed of my weblog, brought to you by the wonders of RSS.



Thanks for Visiting!