100 Gigs of MP3s

It finally happened after I added the new Anniversary album, I have over 100 Gigs of music in my iTunes!

I’m very strict when it comes to my music. Minimum 192 kbps. I’ve made posts before about how to create good mp3 files through iTunes.

I’m just excited to break the 100 gig mark. My iPhone only holds 16 gig, but it’s nice to know I can listen to music for over 45 days and never hear the same song twice!

Excess, what’s that!

php sprintf + sql like

Sometimes I do my best programming when I’m tired. Don’t ask me why, I just do. It’s a skill I picked up in college.

Being tired and producing good code wasn’t the case last night. I was trying to use the sprintf PHP function with a SQL “Like” statement. I made some dumb mistakes that tripped me up for a while. Hopefully someone out there will find this post and help them not make the problems I made, sleepy or not!

Normally the LIKE is used in mysql like this:
SELECT name FROM users WHERE name LIKE 'J%';

That would get all names including: Josh, Jason, Jimi, etc.
In a SQL Like statement the % is a wild card, so the command is to match everything starting with “J”

Now when you use the sprintf() function it looks kind like this:
$query = sprintf("SELECT name FROM users WHERE name='%s'", $searchString);
The %s will be replaced with the value of $searchString

Trying to combined them is where I had some problems….

At first I tried to do something like this:
$query = sprintf("SELECT name FROM users WHERE name LIKE'%s'", $searchString);
didnt return what I was looking for at all, it had no wild cards in it!

Then I tried this:
$query = sprintf("SELECT name FROM users WHERE name LIKE'%s%'", $searchString);
didnt work either, this time it threw errors

But this worked great
$query =
sprintf("SELECT name FROM users WHERE name LIKE '%s'", $searchString . "%");

So the moral of the story is, if you want to use a SQL Like statement, appent the wildcard for the Like statement to the string to be inserted by the sprintf funtion.

My Media Center Died, Time For A New One

I have blogged about it before, I have a HTPC (home theatre pc) running in my living room, hooked to my TV. I started off with MythTV, but settled on Window Media Center 2005.

When I first built the Media Center machine, I had basic cable, with no DVR, so I let the media center handle all of that. Now I have Verizon FIOS with HD, and one of their HD DVR Boxes, and I rarely use my media center pc, but its always nice to be able to flip the input over to it and watch youtube and browse the web. I also like the fact that I can download all sorts of movies and tv from the darkside of the web and watch them on the tv. That was a huge plus.

For a while now, the Media Center has been acting funny. I built it on a shoe string budget with some questionable parts I had laying around, so I didn’t expect it to live forever. The other day it stopped working all together.

Today I took it apart to see what the problem was. After some investigation, I found the cheap power supply was dead, and it took the mother board/processor with it. FAIL!

Well, here I am at a cross roads. Before it was a matter of software, now I need new hardware. What do you think I should build or buy?

The main things I’m looking for in a HTPC

  • Ability to browse the web
  • Watch Videos I download form the internet, mostly divX files
  • Small form factor
  • Doesn’t really look like a computer
  • Blu-ray is a bonus

Should I build another Window xp MCE machine, Windows Vista Ultimate, mac Mini, apple TV, myth TV? I don’t even know where to start.

I’ll blog my research as I go. Lets see what you think I should do.

Win My iPhone! REALLY!

If you know me, you know I love my iPhone. I have had it for a year now, and it’s the best portable device that I have ever owned.

Last week Apple announced that they were going to launch a new iPhone on July 11, 2008. I am going to buy one of these new iPhones. Simple math tell us that if I own an iPhone and buy the iPhone 3G, I will have 2 iPhones, that is why I am giving away my iPhone.

Give away your iPhone? Thats right. my iPhone that I love can become yours. It works great, and has been in a hard protective case since that day I got it. It has served me well.

How to enter of the give away:

  1. Join twitter.com if you don’t already have an account
    (twitter is a free micro-blogging site you can update via txt message. I cant get enough of it!)
  2. Follow me on twitter.com, my profile is at http://twitter.com/JoshHighland

Thats it!

on July 11th, after I receive my iPhone 3G, I will randomly pick one of the people following me on twitter as the winner of the contest.

The only catch is I have to have at least 1500 1000 followers on twitter, so tell your friends to follow me. If I don’t have over 1500 1000 followers on July 15th, I will give away a $50 AMERICAN CASH DOLLARS .

also, let it be known that unlocked iPhones sell for more then $300 on ebay! what are you waiting for, follow me on twitter.com today!

If you have any questions, my email address is:
JoshHighland at gmail dot com