Pages

Sunday, January 29, 2012

strstr (JavaScript)

So I ran across this post and I was curious if I could write my own strstr function without using any library calls, just arrays, but in javascript. 15 minutes later and voila it works! Here it is:
function strstr(haystack, needle) {
    var i = 0,
        tempLength = 0,
        temp = [];
    for (;;) {
        if (haystack[i] === undefined || needle == null) {
            return "No match";
        }
        //if the char doesn't match then reset
        else if (haystack[i] !== needle[tempLength]) {
            temp = [];
            tempLength = 0;
        }
        //the char matches so let's store it.
        else if (haystack[i] === needle[tempLength]) {
            temp[tempLength] = haystack[i];
            if (needle[tempLength + 1] === undefined) {
                return temp;
            }
            tempLength++;
        }
        i++;
    }
};

Wednesday, January 25, 2012

Tuesday, January 24, 2012

Operation Know Who You're Voting For: Mitt Romney

Here is an article detailing the release of Mr. Romney's tax records. Romney is the epitome of what Occupy Wall Street is against, someone who's made all of his money by scouring for failing companies, breaking them up, and then dumping them. There are legitimate tax loopholes for moves like this that put the financial burden for benefits to workers on the government and not the people who bought the company in distress. Alas his effective tax rate for 2010 was 13.4%. I paid more relative tax to my income last year! This guy purports to be a working class man who understands the trials of the middle class, yet he's making off of the demise of the working class. Romney's ability to pay such a low percentage of tax is also through the capital gains tax which maxes out at 15%.

Update: The New York Times has released a nice breakdown of Romney's tax forms here. In his 203 page joint tax return he reports $110,000 out of $20.9 million as employment income. He's actually in the top .006 percent and it's pretty clear that these people have the will and the means to find every tax loophole possible.

Monday, January 16, 2012

SOPA / PIPA

If you guys don't know much about SOPA or PIPA please watch this video. Apparently congress has stopped pushing for SOPA at the moment but be vigilant they will be back. Also this could be a move to be able to pass PIPA without much resistance.


Go here to do something about it.

Monday, January 9, 2012

Beirut - My Night With The Prostitute (transcribed)

Hello people. So I've heard that transcribing songs is one of the best things a person can do to develop their ear. It's also supposed to help a great deal with soloing. Thus here is my first transcription. I chose the main riff of this song because I thought it sounded fun and it was also pretty easy to be able to hear each individual note.

(Click on the image to enlarge it.)

Thursday, January 5, 2012

Operation Know Who You're Voting For: Rick Santorum

"No one has ever died because they didn't have health care." - Rick Santorum (here)

Wednesday, January 4, 2012

Operation Know Who You're Voting For: Rick Santorum


This guy (Rick Santorum) is a total ass. Rick Santorum doesn't even know the argument. Gay people have a choice, really? You (Rick Santorum) also have a choice to educate yourself on the issue at hand instead of spouting off your thoughts like they're fact.