Most listened to music of the year

Saturday, January 2nd, 2010

According to last.fm, this is the final count of the bands I listened to the most this year.

  1. Nine Inch Nails (528 Plays) – Nine Inch Nails is and has been one of my favorite bands for about 13 years now. NIN has always been the goto band for me for when I don’t feel like listening to anything else. This year I finally got around to actually listening to Year Zero. I was not enthusiastic about this CD when it first came out, but after seeing them live at the Santa Barbara Bowl this year, I finally got around to listening to it and love it! I actually found that it made for good running music! On top of that, I rediscovered what has to be one of my favorite albums: The Fragile. This CD is up there with Dark Side of the Moon in terms of replayability.
  2. NOFX (431 Plays) - Another one of goto bands when I don’t feel like listening to anything else. NOFX has been another one of my favorite bands for about 11 years now and I’m still not tired of them. This year they release coaster which has been in regular rotation in my library. This summer in particular I have also been re-listening to a lot of their albums when I went on my runs.
  3. The Appleseed Cast (329 Plays) - The Appleseed Cast have been one of my favorite bands of recent times. This year they released Sagarmatha which I absolutely feel in love with. The first track “As The Little Things Go” has to be my favorite track of the year. I will hopefully get to see them live for the first time in 2010.
  4. Placebo (291 Plays) - Again, another one of my favorite bands that I started to around 9 years ago. This year they released “Battle for the Sun” and did it without their original drummer Steven Hewitt. Despite his absense, Placebo released this slightly popier sounding album, but still staying true to their original sound. I have yet to see this band live; this needs to change!
  5. Muse (203 Plays) - This year muse released “The Resistance”, but I’ve also been rediscovering their CDs such as “Origin of Symmetry” and “Absolution”. I also recently watched the movie “Southland Tales” (which I won’t go into here), but it featured the song “Blackout” off of Absolution that I really never listened to. Holy crap what a great track!
  6. Asobi Seksu (181 Plays) - This band is a Japanese/American Indie/Pop band that I admit is a guilty pleasure. This year I’ve been listening to their self-titled album and “Citrus” mostly. This year they came out with the CD “Hush,” but it hasn’t gotten as much playtime as the other two albums from me.
  7. Pixies (163 Plays) - I had my pixies phase around six years ago. I think now was the time to come back and check out my old favorites. Not much to say here really.
  8. Steve Aoki (148 Plays) - Introduced to me randomly by a friend in SLO in August, Steve Aoki has been a running favorite this year.  Steve Aoki kind of reminds me of Girl Talk which I probably listened to A LOT last year.
  9. The Protomen (142 Plays) - The concept of a rock opera based on the Mega Man video game series just cannot fail. I was a big fan of the first act, but when act II came out, I listened to both acts back to back. Both CDs have a unique feel to them; the first act is more inspired by the videogame series (with a hint of Ennio Morricone) while the second act follows up with a sound inspired by the 80s.  Someone needs to turn these albums into an anime!
  10. Pink Floyd (140 Plays) - Pink Floyd is not one of those bands where you pick and choose their greatest hits. Instead when you listen to Pink Floyd, you listen to them an entire album at a time. In particular I remember listening to The Wall, Animals, and Dark Side of the Moon this year.

Find the Largest Prime Factor

Sunday, August 2nd, 2009

I love programming competitions.  In the past two years I’ve participated in both my school’s programming competition and the ACM Southern California regional competition.  Recently I’ve been turned onto http://projecteuler.net which is a competition-like site that gives you a series of math questions which you need to solve by writing a program.  I saw this as a good opportunity to brush up on python, so today I’ve been trying my hand at a few of these problems.

Question #3 asks you to find the largest prime factor of a very large number.  My first instinct was to start at Sqrt(n) and work my way back until I find the first factor.  The problem here is that the first factor you find may not be the first PRIME factor.  Instead, my approach to this problem was to find all factors of the number between 2 and Sqrt(n) and put them in in a list.

Of all the numbers in the list, one of them is the largest prime factor, but which one?  To find out, I made an assumption that turned out to be right:  The composite factors have at least one prime factor that is already in the list.  If I can show that a given number has no factors in the list, then it is a prime factor.  Further, if I have a sorted list and start at the end, I can show that the number is the largest prime factor.

Anyway, here’s the code I used:

n = 600851475143 # Find the largest prime factor of this
div = [x for x in range(2,int(math.sqrt(n))) if n % x == 0] # Get all factors
i, j = 0, len(div) – 1
while j > i: # Determine which one of the factors is the largest prime
# This number is composite, go to the next largest factor
if div[j] % div[i] == 0: i,j = 0,j-1
# See if the next number at the beginning of the list divides the current number
else: i += 1
print div[j] # Print out the largest prime factor
n = 600851475143 # Find the largest prime factor of this
div = [x for x in range(2,int(math.sqrt(n))) if n % x == 0] # Get all factors
i, j = 0, len(div) - 1
while j > i: # Determine which one of the factors is the largest prime
# This number is composite, go to the next largest factor
if div[j] % div[i] == 0: i,j = 0,j-1
# See if the next number at the beginning of the list divides the current number
else: i += 1
print div[j] # Print out the largest prime factor

Fix for CodeIgniter White Screen on Bluehost

Tuesday, February 24th, 2009

This past weekend I spent writing an application using the CodeIgniter framework for my programming languages class.  Sunday night I finally got it working and it was time to move it to production on bluehost.  After I made created the database and made some configuration changes I checked it out and I got nothing.  It was a white page of nothing.  I checked my logs and found nothing.  Normally this wouldn’t be such an issue, but when you have nothing in your logs, then you don’t have much to work with.  I looked at the source of the blank page and found this: “<!– SHTML Wrapper – 500 Server Error –>.”  Still not a lot to work with.

Today I spent some time investing the issue and found out that a lot of people were having the issue, but I didn’t find any fixes.  Long story short the fix was to enable FastCGI PHP5 on Bluehost.  When I did that an error finally appeared on the screen! Apparently I misspelled my database name >_<.

Anyway, if you’re having the same issue, let me know if this fix worked for you.

PHP Frameworks

Friday, February 20th, 2009

I’ve been coding in PHP off and on for years now.  Each project I’ve done thus far has always been by hand.  Doing the architecture of your site by hand is the easiest way to introduce bugs and end up with sloppy code.   For the first time I’ve started a project where I used a framework in PHP.  My framework? Codeigniter.  I like it’s simplicity, MFC design and how it’s not like Rails.  I thought Rails was a bit too complicated and involved hacking the internal code way too much to get anything done, but that’s a whole other rant.

Anyway, the project I’m working on?  Just a twitter clone.  Why?  For the sake of learning, that’s all.  It’s actually for a project in school.  The idea is to implement this idea in something that I’m already familiar with (PHP) and then implement it again in another language I’m not familiar with at all.  After I’m doing with the first part I want to implement it in Python using the Django framework.  Python has always been one of those languages I’ve been meaning to learn.  In fact it seems I try to learn it every summer, but I just don’t seem to have the dedication to sit in doors learning it.

Regardless, I hope to use this knowledge in my professional life.  The last PHP project I worked on was stressful just because of some of the design decisisons I made (Doing a half-assed MVC implementation…didn’t do the best job of dividing up the view and controller).  However, I’ve learned from those mistakes and I might be taking up a new project at work where I’ll probably be using this framework.

Using SSL with Gmail and Gmail Notifier

Tuesday, August 19th, 2008

With the recent announcement at Defcon, Gmail users will soon be the target of session hijacking. The reason for this is that Gmail by default does not encrypt any traffic (except logins). This allows anyone on the local network to sniff for session ids passed between gmail and the user when you check your email.  With this session id, a hijacker can act authenticate themselves as you without the need for your username and password.

This has always been an issue for non-encrypted traffic, but it was announced at defcon that a tool has been released that automates this hack.  This was enough reason for Google to release an option to turn on SSL.  The problem here is that you still have to manually turn it on.

To turn on SSL go to “Settings” and at the bottom you’ll see an option called “Browser Connection.”  Choose the option “Always use https.”  Yay now we’re protected from session hijacking!

ssl.png
The problem I next noticed was that gmail notifier stopped working!  After doing some investigating, I found that you had to do some hex editing with gnotify.exe to get it to use SSL.

Before we do anything, close and make a backup copy of gnotify.exe just in case anything happens.  By default you can find this executable in C:\Program Files\Google\Gmail Notifier.  For hex editing I used an old favorite hex editor called “Hex Workshop” for Windows.  After you download/install it, open up gnotify.exe in Hex Workshop.  On the left you’ll see a bunch of hexidecimal characters and on the right you’ll see the ASCII equivalent.

To make the replaecment, we need to first find the area we want to modify.  To find the area, hit CTRL-F and let’s do a search for the string we want to modify: “http://”.  Under the “Type” drop-down choose “Text String.”  When you find “http://mail.google.com/mail/” go ahead and add a “s” after “http.”  You’ll see that whenever you type, it will overwrite whatever was in that field before.  Go ahead and type out the replaced characters until you end up with “https://mail.google.com/mail/”.

hex.png

Go ahead and save the modified executable and open it back up.  If it fails, you can always use the backup you made!  Otherwise, you should know have access to gmail over an encrypted connection!

I’m sure I’ll be writing a part II to this when I get home and my gmail notifier isn’t working there either.

Explosions in the Sky

Tuesday, July 22nd, 2008

How do we hear about new music? You might say the radio or MTV. Let’s be serious though, MTV doesn’t play music videos, not anymore at least. As far as the radio goes, I can only stand listening to the same 10 songs over and over again only so much. What about friends? Word of mouth is a great way to hear about new bands. If you know that one of your friends has similar music taste, you’re more inclined to listen to a new band per their recommendation. Now with the internet you have an additional resource to aid in discovering new music.

Last.fm is a site I’ve probably talked about before (whether on this blog or in person). It combines the last two ways of finding music: your friends and the internet. I’m discovered many bands such as Silversun Pickups and Mogwai based off of what my friends were listening to. One of the other reasons I love last.fm is how they recommend new bands. Not only do they let you see and read about bands who are similar to bands you already love, but they let you hear those bands too. I believe I was looking for artists similar to Mogwai when I stumbled upon “Explosions in the Sky” on the similar artist radio station. After one listen of “The Birth and Death of the Day” I was hooked.

You might say that I’m just going through a phase, which is true. I usually go through phases where I’ll listen to the same artist over and over again until I find the next one (Sigur Ros, Stars, Broken Social Scene were some of my most recent phases). Right now I’m on my Explosions in the Sky kick and I look forward to discovering other Post-Rock bands.

For all of you HTML hackers out there

Thursday, July 3rd, 2008

I’m working on a new project at work which involves the use of Microsoft SQL Server and DTS packages…something I’m not familiar with.  As always, if I don’t know something I google it.

One of the sites I came across was this one. You’ll see that there is a pop-under that is blocking the content.  See if you can use Firebug to get rid of the pop-under to see the rest of the content.

Hint: After you get rid of the pop-under, you still can’t see all of the content.  Check the div style properties!

Selecting Options in Select Drop-Downs using jQuery

Tuesday, June 10th, 2008

Say we want to pre-fill out a form with data retrieved from an XML file.  Once we parse the XML, we need to update the form.  If you know the jQuery library, using the val() and attr() methods are trivial for most inputs.  What about select drop-downs?  There’s no easy way to add the “selected” attribute to a drop-down.

As an example let’s say I have a drop-down of names.  I want to have the name “Nick” selected as the default value.  Using jQuery and XPATH, we can do this in a clean way:

$('select#name').find("option[@value=" + name + "]").attr("selected","selected");

The first part $('select#name') simply locates the select drop-down that we want (This is done in a fashion similar to CSS selectors).  The next part will find a child that is an option node and has the value of the name specified.  It will then assign the value “selected” to the attribute “selected.”  Simple as that!

Software Developers are Watching!

Sunday, May 25th, 2008

I made a couple tweets a couple days ago and to my surprise both of them got responses!  My first tweet was expressing my love for the Javascript library jQuery and the second was directed towards Firefox.  Turns out both the jQuery and Firefox group have twitter accounts are both listening!  Watch what you say on the interwebs!

CS Majors Need Something To Do!

Sunday, May 25th, 2008

In general, computer science majors arn’t the most social creatures.  There’s no particular hang out that you would go to to hang out with other computer science majors (In person at least).  This got me thinking about how other people meet other people.  In general you meet other people through parties, classes, events or other people.  Let’s cross off the first two on the list since I generally don’t specifically meet any other CS majors at parties and it’s summer, so class is not in session.  This leaves me with events and through other people;  These two in particular are how I meet a majority of my friends.

Last Friday (05/16/08) I organized a get together with my fellow students to go out for a beer in celebration of completing another  school year.  To my surprise people actually showed up and brought along some of their friends!  On top of that, the people who came actually had a good time and wanted to do it again!  Some already started talking about future events they had in mind.  To me this demonstrated a need for a central source of  events in Camarillo.  For those of you still in Camarillo, let’s face it, there isn’t really much to do here.  This is why it would be nice to establish a community of like-minded people to go hang out with.

I sit in front of a computer all day at work.  The last thing I want to do when I get home is to continue to sit in front of another computer.  I’d rather go outside and get active, hack on projects with friend, or simply enjoy a movie with others.  These sort of events will give us a chance to meet new people, a chance to exchange ideas, or collaborate with peers.  Already I met someone who was interested in collaborating on a project in python and showed me some stuff on recursive queries in MS-SQL.  Neat!  In general, I think this type of interaction is more important than interacting with a computer.

The obvious answer is to think of some events and send out invites!  The key I found is to just set a date to do something and people will show up.  Ideas I had in mind were LAN Parties (formal attire required?), simply going out for a beer (it seemd to have worked in the past!), movie nights (traditional and non-traditional), dinner parties, DevHouse (day-long hack-a-thon popularized in the bay area), and of course outdoor activities (camping, climbing, hiking).  So to all of you CS/IT majors in Camarillo/Ventura County, expect some invites to some events this summer!