Author: johnro

  • 2012 NBA Player Rankings

    I have listed NBA’s top ranking players. You can find the original list here. I have only listed these rankings since the source didn’t have a page that listed all 500. Enjoy.

    (more…)

  • PHP: sqlsrv problems with UTF-8 values? Set your CharacterSet option!

    Are you banging your head trying to figure out how to convert a seemingly invalid UTF-8 value into a valid one? You might be surprised to know that the problem isn’t how PHP interprets the characters, but rather a database connection issue. If the UTF-8 value in question looks valid in the database but does not look right when displayed on a web page, that could mean your database connection settings are not set correctly.
    (more…)

  • PHP: Importing an SQL file via PHP script

    Trying to import an SQL file using PHP? Most people will tell you that using PHP function shell_exec to run the MySQL client is your best bet, but what if you simply can’t do it that way? The solution is quite simple, actually, and doesn’t require programming skills beyond the basic file parsing and query executing.
    (more…)

  • The Hate on Blake Griffin

    Blake Griffin has grabbed a lot of attention as of late. I personally used to like the guy during his rookie season until I started seeing him for what he really is: a hypocrite. He is loved by many, mostly by those in LA, but hated by other players and league fans of opposing teams. Some are not even sure why they hate him, but they know they just do.
    (more…)

  • Sorting your photo collection by date the PHP way

    Ever wanted to sort your photo collection in the order by date taken? Can’t find the right program that will do it for you? I decided that I had a large enough collection myself to warrant organizing, but I could not find a program that can organize it the way I want it. I have always wanted the photos to be sorted by the date taken and grouped by the year, so I decided to create a short script for myself.
    (more…)

  • Number One Reason to Go With a Mac

    Mac OS X vs Windows. This subject is talked to death on a daily basis, but what really sets them apart? Given that the only way to buy a Mac is to pay a premium to Apple as opposed to Windows being offered by multiple providers, one can see why Windows has the majority of the market. Even so, if you follow the trend these days, you will notice the Mac OS is eating away little chunks of the market month by month, with 10% being within sight. But why should you buy an expensive Mac over a Windows PC? Aside from the usual list of pros and cons, one major factor is overlooked by many: its resell value.
    (more…)

  • NBA Lockout for Dummies: the Owners Can’t Lose

    Fans can cry, the players can argue, but in the end, the owners will be the victors. The NBPA and NBA can negotiate all they want, but the owners will eventually get what they want. Why? Because the NBA franchise is not their daytime job, but rather an investment. For the players, playing in the NBA is what brings in the dough. They can threaten to play overseas, start their own league, or do whatever they can to try and make the owners feel uncomfortable, but in reality they need the NBA more than the NBA needs them.
    (more…)

  • How to fix your unresponsive iPhone 4 home button without opening it up

    Do you have an iPhone 4 with an unresponsive home button? It’s quite frustrating isn’t it? It was for me, but after struggling with it using various fix methods over the last few months, I no longer have the problem. Rather than taking your iPhone apart to replace your home button, try this simple solution first and see if it fixes your problem.
    (more…)

  • SQL Server: Selecting multiple rows into a single row with multiple columns

    I ran into a problem writing a query today, and took the time to find the solution, so I thought I should share this with anyone who has the same problem. This solution should only work for SQL Server version 2005 and above.
    (more…)

  • Data scraping: how to prevent

    Data scraping is common these days with so many data driven web applications out there. Regardless of the legality and ethics of the subject, it just sucks to know that there may be people out there who might hammer at your site to “take” all your hard work for their selfish use. That being said, it’s almost impossible to prevent people from taking your data, especially if your data is easily accessible by the public.

    You’re probably here because you’re suspicious of possible data scraping activities happening in your website. While there are preventive measures you can take to keep the scrapers out, there are always holes for the smart ones to get through and eventually take the data they want. What we want to do is make it very difficult for the average scraper to hack away the data.
    (more…)