Don’t Use jquery-latest.js!!!!!!!1

I’m guilty.

So guilty.

For years I have pointed pages to jquery-latest.js. Of course, I don’t think anyone would classify as a “production site.” I just want the latest damn version of code. I like to experiment with new features.

But I hate babysitting blogs, downloading point releases, and uploading them to my web server. So I used jquery-latest.js.

But now jQuery has taken this away. Sort of. jquery-latest.js is now frozen in time at version 1.11.1.

Well that’s no good. I can’t putter around on an old version for the rest of my life. But I hate babysitting blogs. And downloading point releases. And uploading them to my web server.

What’s a modern coder to do?

Scrape that s.

I made a two part solution. Part one scans the file structure on for files that look like jquery 2.x and returns the newest one it finds. It also sends a custom header so the browser reads it as JavaScript. I’m not going to give the URL here because I don’t want to be the next jquery-latest.js. But here’s the (PHP) code:

header( 'Content-Type: application/javascript' );
$contents = scandir( './' );
foreach ($contents as $file) {
if ($file !== '.' && $file !== '..') {
$ext = '';
$parts = explode('.', $file);
$ext = $parts[count($parts) - 1];
if ($ext == 'js') {
if ($parts[0] == 'jquery-2') {
include $file;

The second part is more complicated. It pulls in the jQuery Blog RSS feed, looks for a post about a new release, reads the version number, determines if it is newer than the version my server already has and if so pulls it down, then archives the older version. Here’s the PHP for that:

// run on cron.
// check jquery blog rss for updated version news
header('Content-Type: text/html; charset=UTF-8');
// what's the latest version we've got? (current?)
$ourVersion = '0';
$contents = scandir( './' );
foreach ($contents as $file) {
//if( strpos( $file,'.' ) !== 0 ) {
if ($file !== '.' && $file !== '..') {
$ext = '';
$parts = explode('.', $file);
$ext = $parts[count($parts) - 1];
if ($ext == 'js') {
if ($parts[0] == 'jquery-2') {
//include $file;
$ver = $file;
$ver = str_ireplace('jquery-', '', $ver);
$ver = str_ireplace('.min.js', '', $ver);
$ver = str_ireplace('.js', '', $ver);
$ourVersion = $ver;
echo 'ourVersion : ' . $ourVersion;
$rssString = file_get_contents('');
$xmle = simplexml_load_string($rssString);
$articles = $xmle->channel->item;
foreach ($articles as $article) {
$titleLength = strlen($article->title);
$check = trim(substr($article->title, (strlen($article->title) - 8)));
if (trim(substr($article->title, (strlen($article->title) - 8))) == 'Released') {
if (strstr($article->title, 'RC')) {
echo 'release candidate. BOO!';
if (stristr($article->title, 'beta')) {
echo 'beta. BOO!';
echo $article->title;
// find '2.'
$words = explode(' ', $article->title);
$ver = '0';
foreach ($words as $word) {
if (substr($word, 0, 2) == '2.') {
$ver = $word;
if (strlen($ver) == 3) {
$ver = $ver . '.0';
echo 'version : ' . $ver;
if ($ver > $ourVersion) {
echo $ver . ' is greater than ' . $ourVersion . '!';
$jqFilename = 'jquery-' . $ver . '.min.js';
$jqUrl = '' . $jqFilename;
echo $jqUrl;
$jqueryContents = file_get_contents($jqUrl);
file_put_contents($jqFilename, $jqueryContents);
// move old version
rename('jquery-' . $ourVersion . '.min.js', './jquery_archive/jquery-' . $ourVersion . '.min.js');
break 2;
} else {
echo $ver . ' is NOT greater than ' . $ourVersion . '!';
echo '----------';

And that’s that. My very own jquery-latest.js.

iOS 7 and the Death of the Button

If you were to log into the dashboard of this blog and look through the drafts — posts that I haven’t published yet — you’d find one from January 31, 2013 — about nine months ago — titled “Buttons Should Look Like Buttons.” And if you looked at the body of that draft post, you’d see a big blank space.

Well, buttons should look like buttons.

Firefox Buttons
Firefox Buttons

A great example of buttons failing to look like buttons — right next to buttons succeeding at looking like buttons — is Firefox. Let’s just focus on the reload button and the home button. When I am moving the mouse pointer on the screen, it’s very easy for me to tell where I have to click in order to trigger the home button. It looks like a button. It has clearly defined edges.

When I want to click the reload button, it’s very hard for me to tell where I have to click. I know the white area inside the black arrow/line/loop would almost certainly register. But what about the white space outside the arrow/line/loop? Can I click all the way out to the edge of the white area? Where is the border between the reload button and the button to the left of it (the menu dropdown)? Is there dead space between the reload button and the menu button? Do they butt up against each other?

It’s impossible to tell by looking.

Firefox is particularly infuriating because there are buttons with precisely defined edges immediately next to buttons with no button edges at all.

With iOS 7, Apple has done away with some clearly defined buttons. I believe that button borders are only gone in places where the button contained only text. In this respect, the button has been replaced — at least visually — by the equivalent of a hyperlink. And we’re all used to text hyperlinks.

I believe there’s one othe reason Apple can get away with that. Fingers are imprecise. And because we know that when we tap on a screen we don’t have single pixel precision, we know that there is compensation for imprecision. We are not anal about our precision, or lack thereof.

Looking ahead, I have seen screenshots of OS X Mavericks. It looks a lot like iOS 7. I am hoping Apple does not do away with button borders in the desktop OS, because when I use a mouse, I want clearly defined buttons.

Star Trek Into Darkness and Physical Media

I really liked Star Trek Into Darkness.

For some reason I had middling expectations going in. It didn’t do quite as well as its predecessor, 2009’s Star Trek, in North America. This informed my opinion. I really liked the 2009 film, and had expected a Pirates of the Caribbean style “box office take of each movie reflects audience appreciation of previous film in franchise” explosion. It didn’t happen. I concluded that Into Darkness must have had something wrong with it.

I saw the previews. It looked like the USS Enterprise got destroyed. My brain replayed a remembered or imagined fanboy’s voice: “How many times can you destroy the Enterprise?” Another question, too dark even for my inner dialogue to whisper: “Is this the film that ends the new Star Trek franchise?”

No, it’s not. Into Darkness is really good. I don’t know why more people didn’t go to see it. I need to watch it a couple more times, but currently I believe I like it better than the previous film. And I really liked the previous film!

Okay, time for side note/personal trivia/minutia that no one except me cares about. The previous film — 2009’s Star Trek — was the first movie I bought on Blu-ray. For years I had held out. I had decided that it wasn’t a big enough jump from DVD, and the next format I was going to adopt was digital download. I had already gone digital with music; I hadn’t bought a CD in years.

Then I bought a PS3. In 2009, when Sony released the Slim model. Suddenly I had a Blu-ray player. Then I saw Star Trek for sale at Walmart … and the Blu-ray was less expensive than the DVD.

My theory is that the some industry was trying to push consumers toward the bright Blu-ray future. Maybe it was the Blu-ray consortium. Maybe it was retailers. Maybe it was both. I went for it hook, line, and sinker.

Somehow I had never redeemed a digital copy of a movie. Today, I can’t remember what my reasoning for this was. After Christmas of 2012, sitting in my basement, I decided to redeem all of the digital copies I had previously ignored. Some had expired. Some I was able to redeem despite their expiration date having passed.

Several weeks later, my wife and I were going to watch The Bourne Legacy. I took the Blu-ray disc out of its case and pushed it into our Blu-ray player. No dice. It wouldn’t play. I took the disc out and looked at it, then put it away. I took the HDMI cable out of our Blu-ray player and put it into our Apple TV. We then watched the film with no issue. That was the moment I decided I don’t need media anymore.

Steam. Digital PC games. It’s great. There are no boxes to take up space. There are no discs to take up space. I rearranged the media center in our basement about a month ago, and now I have all these DVDs and Blu-rays with no place to put them. I already sold the majority of my Xbox 360, PS3, and Wii games — but I still own the games I purchased digitally. I’ll probably hold onto my 360 and PS3 because I have digital libraries. I can store those systems with very little footprint, and bring them out if I feel nostalgic. (This is a hypothetical future. I own several 360 and PS3 games that I haven’t finished yet.)

So I had made the decision to go digital only. Then Star Trek Into Darkness came out on iTunes before DVD and Blu-ray. And I missed this film — the first film I was really looking forward to that I missed because my wife was very pregnant and didn’t want to do much of anything (I still love you Julie). So I bought it. On iTunes.

So 2009’s Star Trek was the first film I purchased on Blu-ray, and 2013’s Star Trek Into Darkness was the first film I purchased digitally, on iTunes. They’re sci-fi movies set in the future.

Now I plan on buying or receiving as gifts two more Apple TVs — one for each remaining TV in our home. I wouldn’t mind if Apple announces a new model next month. I’ve got to sell off these DVDs, Blu-rays … and CDs? Digital — I’m in!

My PS4 Logo

Sony’s PS4 Logo (top) and My PS4 Logo (bottom)

Last night Sony announced the Playstation 4. At the event, the new controller was shown, a new Kinect-like camera peripheral was shown, games were shown. And the system’s logo was shown. And I don’t like it.

The “PS” part of the logo is identical to the same part of the PS3’s logo. This is fine. But when I look at the new PS4 logo, I honestly think that Sony had someone design the (current) PS3 logo three years ago, then had someone else design the “4” for the new system’s logo. It doesn’t fit.

The 4 doesn’t look futuristic the way the P, the S, and the 3 do. In fact, when I stare at it, I think of a wooden fence on a farm. The two lines crossing each other are inconsistent with the P in the logo, where no line intersects or meets another line.

So I fired up and came up with something I like better. I’ll admit that I got some inspiration from the 1980s-era WIVB logo.

The Next Gripe in College Football

College football fans complain.

For the past 14 years, they’ve complained about the BCS. They’ll still complain about the BCS for another year or two, but after the 2014 season, college football will have a playoff. (Specifically the FBS, but will the names Football Bowl Subdivision and Football Championship Division continue to make sense if the FBS has a playoff?)

So fans will have nothing left to complain about. Because the system will be perfect. Right?

Hold that thought.

This year, in the NFL, the NFC’s North division has three teams with ten or more wins. Pretty good. Green Bay went 11-5, and Minnesota and Chicago both finished 10-6. Minnesota went to the playoffs because it had a better division record than Chicago. (The second tiebreaker, after head to head, which Minnesota and Chicago split.) Fair enough.

Now let’s imagine that The NFC North has a championship game. Assuming the same math and tiebreakers that the NFL uses to determine playoff participants, Green Bay would play Minnesota.

Let’s imagine further that Green Bay beats Minnesota. Green Bay’s record improves to 12-5, still good enough to win the division. Minnesota’s record drops to 10-7, which happens to be percentage points behind’s Chicago’s 10-6 record.

Based on record, Chicago is now ahead of Minnesota, and takes the sixth playoff spot.

Doesn’t make any sense, right? Minnesota had a better division record than Chicago and should therefore go to the playoffs. And besides — why the heck is the NFC North playing a championship game? The NFL playoffs decide the Superbowl winner, and that’s what really matters.

Thankfully, this is a hypothetical scenario, and we don’t have to worry about it. But it’s going to be a real problem in the 2014 FBS season.

The SEC of 2012 was as close as you can come to the hypothetical NFC North laid out here, except there was no playoff to decide a national champion. Georgia finished ahead of Florida in the regular season, played Alabama in the SEC championship game, lost, then lost its spot in a NCS bowl to Florida. Bowls care about polls and ranks instead of tiebreakers. You say tomato, I say … tomato.

If a four team playoff had been in place for the season that just ended, the teams would have been Notre Dame, Alabama, Florida, and Oregon. What about Georgia? Left out in the cold by virtue of finishing ahead of Florida in the regular season? We can only assume that if Florida had finished ahead of Georgia in the SEC East (perhaps Florida lost to South Carolina and beat Georgia, and Georgia beat South Carolina), the Gators would have gone on to have a letdown performance against Alabama in the SEC Championship game, and Georgia — capable of going down to the wire against the eventual national chamption — might have beaten Louisville in the Sugar Bowl.

The fact is, unless a playoff has zero wild card teams, it is incompatible with conference championship games. If a playoff is to guarantee the participation of the two best teams, it needs a wild card. That means the conference championship games — some of which are only two years old — are already vestigial.

Some people will not warm to the playoff and will likely hold up the conference championships as an alternative. Some, like me, see the obvious benefits of a playoff to determine the national champion. Either way, the conference championships and the playoff conflict with each other. And that is the next gripe in college football.

November 2012 Humor

Harry Truman holds newspaper with headline "Teh Haloz Pwns Noobs"
Harry did his fair share of teabagging

Maybe I’m the only person who finds this funny. In high school and college I used to do stuff like this all the time — edit text in photographs and advertisements.

Halo 4 releases on the same day as the 2012 US Presidential Election. Both big events for me.

I preordered Halo 4, but honestly I haven’t had time to be excited about it because I’m too excited about the Presidental race. Hopefully after Obama wins tomorrow I’ll be able to commit ten or fifteen days to Halo 4. I’m sure Julie will be thrilled.

Windows 8 First Impressions

Last night at midnight (all time zones), Windows 8 became available. I downloaded the $39.99 Windows 8 Pro version.

I installed it on my Dell laptop. I’ve been running Windows 7 on this laptop since I got it. It does not have a touchscreen.

Every time I install Windows — and I do it every six months or so — I format the hard drive first. When I started up the Windows 8 installer (running from a USB stick), I backed out twice because I didn’t think I was going to be given the option to format first. Turns out the option is there. I think there’s a trend in all software to make crucial processes — like OS installation — less intimidating to novice users. Unfortunately this also gives advanced users the impression that high-level options are missing even when they’re not. This is a very small gripe, but one that’s really an improvement for the group of users I like to generically refer to “people like my dad.” I’ll get back to Dad.

Windows 8 is the first version of Windows to tightly integrate a user’s online Microsoft/ account. I appreciate this. Also, Apple’s been doing it for a while. One thing I don’t like about it is that in order to log into my computer, I need to use my password. For most people this probably wouldn’t be an issue, but I use a password manager (1Password) and therefore a long, cryptic, hard-to-remember, hell-even-hard-to-type-in password. That’s annoying, and I was not given the option to use a different (simpler) password to log into my machine. I’m still acclimating to the new OS, so I’m certain there’s a place to change my password. I hope that I will be able to have one password to log into my machine while maintaining my long and cryptic password for I will update this post when I find out.

[UPDATE] If your PC’s account is tied to your online Microsoft account, the two accounts will necessarily share the same password. Making your PC’s account a separate account allows for a different password, but stops synching. However, there’s a pretty good third option. You can create a PIN number for logging into your PC. I kind of wonder if this isn’t designed for people like me. I’d rather have an alphanumeric password, but a PIN is tolerable.

I like the look and feel of Windows 8. It leans heavily on the Metro visual style (I refuse to refer to it by its proper name, “Windows 8 Style.”), and that’s a good thing. I would describe Metro as ultra modern. Again, good.

A quirk of Windows 8 is that it’s kind of running two operating systems simultaneously. On one hand, it runs more or less Windows 7, with a desktop, a task bar, Windows Explorer (called something else now), etc. On the other hand, it’s got the Metro UI, which will run all Windows RT applications. I consider this analagous to a hypothetical future version of Mac OS X that also runs all iOS apps.

The first installer I ran after booting into Windows 8 was Google Chrome. I didn’t even launch IE to download the installer — I have a copy on another USB stick. It installed with no issue, and as Chrome does the first time it runs, it asked me to type in my credentials so that it would sync all my bookmarks and extensions. This proceeded as it has every time I’ve installed Chrome on any machine. The 1Password browser extension is quirky and doesn’t sync like other exensions, so I installed it as I always do. It didn’t work the first time I tried it, so I decided to reboot the machine.

When I got to the Metro Start Screen, I clicked on the Google Chrome tile. Chrome launched and … prompted me to type in my credentials so it could sync all my bookmarks and extensions — as if I had never run it before. But I had run it only moments earlier! I looked around the screen, and noticed that there was no taskbar. Also, there was no button to change the size of the Window.

This was the Metro version of the Chrome browser.

I summoned the Start Screen and clicked on the Desktop tile. From there I launched Chrome, which had the 1Password extension installed (working normally now). I switched between the two versions of Chrome, nearly identical, running simultaneously. It appears that Desktop mode uses one user profile, and Metro mode uses another.

This is where I come back to users like my dad. I can’t imagine explaining this scenario to my dad, let alone telling him how to resolve it. Some quick Googling indicates that you can force Chrome to always run in the desktop mode, but it requires a registry hack. Facepalm.

Maybe Google will update Chrome with a checkbox in the settings screen to force Desktop mode at all times. Maybe Microsoft will patch Windows 8 so that each application to be forced to run in Desktop mode. In fairness, maybe there are updates available to Windows 8 that I simply haven’t installed yet.

But this is a problem. In an hour of use I encountered an annoyance clearly directed at making the experience better for novice users, then encountered what could be a serious problem — and I don’t know how I would explain it to users like my dad.

I’m curious about how IE handles the Metro/Desktop issue, but I doubt that I will suggest my dad run IE full time.

I anticipate that Google will work out a resolution to this problem — and I feel comfortable using the word “problem” rather than “issue” — but Windows 8 has been available in its final form for several months and as a full-functional beta for over a year. Why hasn’t this been sorted out already? I will monitor updates to the OS and to Chrome, and update this post as appropriate.

My 1&1 Feedback

Today I called — yes called — 1&1 so I could cancel my hosting with them. A few hours later, I got an email asking for me to fill out a short survey about my experience. There was a box at the bottom asking for “any further comments or suggestions.” Here’s what I wrote:

Four points. First, I wanted to keep my domains with 1&1 but cancel my hosting. I called the 800 number over the weekend. I was told that sales is only available Monday through Friday, but that I could go to to cancel my hosting but keep my domains.

I went to to but there was no clear indication that the options presented to me would allow me to cancel my hosting but NOT CANCEL MY DOMAINS. You can imagine why I wouldn’t click buttons unless I was 100% certain that I would NOT BE CANCELLING MY DOMAINS. If the option is there, make it clearer. Probably redesign the entire workflow. If this option is not possible on the website, don’t let the weekend phone support tell customers that it is.

Second point. In order to cancel my hosting package, I had to give the phone rep my password over the phone. It is unconscionable that 1&1 operates this way in 2012. Most major companies NEVER ASK A CUSTOMER FOR HIS PASSWORD. Not over the phone, not in email, not ever. A phone rep should not need a customer’s password in order to cancel some or all of that customer’s package. This poor security practice has me wondering what other poor security practices 1&1 is guilty of. Frankly it makes me think that I should end all my business with 1&1. I haven’t decided, though, so please don’t kill my domains.

Third point. Why is STILL SO SLOW? Go create an account with Dreamhost. It doesn’t take 20 seconds for their panel to load up. It is nearly instantaneous! For as long as I can remember, 1&1’s admin panel has been slow.

Fourth point — Improve PHP support. A customer must jump through hoops to enable PHP 5.3, and when he does, memory restrictions make simple tasks such as writing a post in WordPress fail. This situtation is unacceptable, and this scenario is the reason I moved my hosting to Dreamhost.