Artistic picture taken by a 4 year old

As I was working today, me Eye-Fi app downloaded some pictures that my son was taking in the other room. I saw one of them and was quite impressed by the composure of the picture. While I’m sure my son had no idea what he was doing, I thought it was cool.

IMG 3680

Failure to check return Location Manager values

Last night I downloaded the Bing for iPad app and it looks quite interesting. However, I ran into a problem that shows a failure for the developers to properly handle an error condition. I told it to use my current location and it said I was over 500 miles away from my home. The location was where I was a few weeks ago. I switched to the Maps app and that app said it was unable to determine the location. A quick device reset fixed everything including Bing, but the fact that Bing didn’t know where I was got me thinking about what caused it. (My WiFi router is registered with Skyhook, so my iPad will always return my house’s location when it asks for the location if I’m home.)

I’ve worked a lot with CLLocationManager and have found some quirks with it. First, sometimes it never returns a value, so developers must set a timer and alert the user. This, however, was not the problem in the Bing app. When the app requests the location, it does something like:

    self.manager.desiredAccuracy = kCLLocationAccuracyThreeKilometers;

which means it only needs to be accurate within 3 km. As the CLLocationManager updates its location using:

- (void)locationManager:(CLLocationManager *)inManager
 didUpdateToLocation:(CLLocation *)newLocation
 fromLocation:(CLLocation *)oldLocation
{
 	if (newLocation.horizontalAccuracy >= 0.0 &&
          newLocation.horizontalAccuracy <= 10000.0)
	{
	}
}

it needs to check the horizontalAccuracy to make sure it is positive and within the desired range. I believe that the Bing app isn’t properly checking this and just taking the value that is immediately returned. Since CLLocationManager caches the last location for efficiency, it is instantly returned. This is the wrong thing to do without checking the result.

Confused AppleTV

This evening I went to watch a show on my AppleTV as I’ve done every night in the last week. I used my iPad to select the show and when I hit play nothing happened. I used ezDesktop to look at my Media Center and saw that iTunes was running fine. There were 2 possibilities; the AppleTV was confused or the Mac Mini needed a reboot. I browsed the shows on my iPad via the Videos app and started a show without problems which lead to only one possibility.

After a quick reboot of the AppleTV using the only method I could find (yanking the power plug), it came back and was able to watch the show.

Why did the AppleTV become confused? Why isn’t there a way to reboot the box without getting off the couch? I have no idea.

Experimenting with WordPress Caching

In the last few days, I’ve read about caching WordPress blogs to improve performance. I’ve played with this in the past, but always gave up as it wasn’t something I needed, at least not yet. However, I took another stab at it and installed W3 Total Cache to see how much good it would do.

The plugin is amazingly easy to setup and seems to work well. However, one thing that kind of annoys me is that new blog posts don’t update the home page. Of coure, I can turn off caching of the home page, but that kind of defeats the purpose of a cache. As a happy medium, I turned down the caching to 300 seconds (5 minutes). If I ever get Fireballed, I’ll change things around and hope for the best. (For those out of the “know”, fireballed means getting linked to by John Gruber’s Daring Fireball site. Basically if you get linked from there, your site is going to get pounded with hits.)

WordPress SSL Admin and Twitter Tools

For a long time, I’ve used WordPress for my blog hosted on my own server or virtual server. This has allowed me to experiment with plugins and play around with various settings. As I’ve been doing a lot of posting from my iPad using the WordPress for iOS app, I realized that the posting link was over a non-secure link, so my admin password was passing in the clear over the Internet. I set out to secure the admin portion of my blog. I read an article over on WordPress’s site.

The actual securing it wasn’t that difficult. I already had an SSL certificate from StartSSL which works well and the price of free is good. In addition their certificates use a subject alternative name which lets me secure blog.gruby.com as well as gruby.com if I choose to use that in the future.

After a few posts, I realized I had a problem. I use the Twitter Tools plugin to tweet each time I post. The URL in each tweet had https in it and I didn’t need to put excess load on my server encrypting public pages. So I went about figuring out how to create my own WordPress plugin to remove the https and replace it with http. I’m not a php expert nor a WordPress plugin expert, but I came up with a plugin that appears to work.

This plugin is free to use and maybe it will help someone.

<?php
/*
Plugin Name: Twitter URL changer - https to http
Plugin URI: 
Description: Changes https to http in URLs sent to twitter.
 This can be caused by using SSL to protect admin pages.
 No need to use SSL on the main site.
Author: Scott Gruby
Author URI: https://blog.gruby.com
Version: 1.0
Disclaimer: Use at your own risk. No warranty expressed or
implied is provided.
*/
if (!defined('PLUGINDIR')) {
	define('PLUGINDIR','wp-content/plugins');
}

function gruby_https_remover($url) {
	$new_url = str_replace("https://","http://", $url);
	return $new_url;
}

add_filter('tweet_blog_post_url', 'gruby_https_remover');

The rise of the casual gamer

I’ve always been intrigued with video games, but was never very good at them. I had a PlayStation that I bought at a clearance sale, then bought a refurbished PlayStation 2, and now have a Wii that a client bought for me. Video games hold my attention for a little bit, but I grow tired of them quickly, probably because I have to turn on the TV and go into another room to play. I believe (as do some tech experts) that console gaming is going to be relegated to the hard core gamer and that smartphones and tablets will be more than sufficient for the casual gamer.

In fact, I think that smartphones and tablets (e.g. iPad) is making people that really aren’t gamers into people that are playing more and more games. If you look at the types of games available for iPhone and iPad, there is a huge range with some of the more addictive ones such as Angry Birds requiring very little skill to play. I think that one of the problems with game consoles is that some games require far too much time to master and have too many controls (look at the number of buttons on a PlayStation controller).

I have a bunch of games on my iPad and really enjoy playing them; I think that Angry Birds informed me that I had already passed 5 hours of playing! Ouch, that’s a lot of wasted time! My manager told me that she has probably passed 80 hours playing it on airplanes (that seems a bit much to me, but what do I know). In addition to the simplicity of the games (in terms of mastering), the very low cost makes it a no brainer for people to pick up the games.

Is it bad for more people to play games on these devices? If it helps pass the time and relaxes people, I don’t think it can hurt. If it becomes so addictive that they play them while walking across a street then, yes, there is a problem.

Review: MacBook Pro 15″ (Early 2011)

As someone that deals with computers all day long, I need to upgrade my hardware periodically as the applications get more complicated and my productivity starts to decrease. I try to get a new machine about every 2.5 years. My previous machine was a 15″ MacBook Pro right after the unibody redesign. The machine performed quite well and my SSD upgrade last year kept it going. There was nothing really wrong with the machine, but the new version of Xcode and the increased complexity of my projects began to cause me some frustration waiting for builds to complete.

When I started my new job, I wasn’t issued a new machine and didn’t ask for one as I wanted to wait for the next revision of MacBook Pros. When the new machines got announced, I put in my request and it was approved (slightly different from what I wanted, but still an impressive machine). I ended up with a 15″ MacBook Pro, 2.2 GHz Quad Core i7 processor, 8 GB RAM, 256 GB SSD, high density, matte screen.

Since I had an SSD in my last machine, the big changes for me were the faster processor (2.8 GHz Core 2 Duo vs. 2.2 GHz Quad Core i7) and more memory (6 GB vs 8 GB). The first thing I did when I got the new machine and set it up was to compile one of my projects. The project was taking 45 seconds to 1 minute to compile. On this machine, the compile took about 15 seconds! Sweet!

What more can I really say? Compared to my old machine, this thing screams, but I’m sure I’ll say it is slow in no time at all!

I haven’t had a chance to give it the full laptop treatment (take it on a trip and see how the battery performs), but my first impressions are quite positive. I don’t really measure app launching as some people do as I don’t launch apps all day long; the compile time is the number one performance boost that makes me glad that I got a new machine.

Pros

  • It’s fast. There is no doubt about it, this machine can outperform a lot of desktop machines.
  • Thunderbolt/DisplayPort can do audio out to an HDMI adapter which means I have one less connector to connect when I “dock” my machine.
  • Built in SD card reader eliminates the need for me to dig out a reader when I need to configure my Eye-Fi card (I don’t transfer photos using the card, just over WiFi.

Cons

  • It’s expensive. The price tag on this thing is something around $3000 which is a lot of money. However, if it was my own money, I would have gotten a similar machine as it is a tool that helps me earn money.
  • The high density display is a bit hard to read.
  • I’m undecided on the matte display; I’ve had glossy displays before and they work fine.

Summary
My “review” isn’t like the detailed reviews that Macworld publishes, but sometimes people just need a yes/no on buying something. I’ve been a fan of the MacBook Pro line for a number of years and this machine definitely doesn’t disappoint. However, when I get new machines, I like to get them immediately after Apple announces something significant and this upgrade with the Quad Core i7 is definitely one of those times. Luckily the major upgrades seem to coincide with when I want to upgrade.

For professional users, you can’t go wrong with a 15″ MacBook Pro, The size is right for the infrequent traveling I do, but is more than adequate for use as a desktop machine. I won’t get another desktop machine as the portability is worth so much to me even if I don’t use it all that often.

EyeTV and AppleTV Integration

When the second generation AppleTV was released, I was intrigued by it, but even the low $99 price tag didn’t get me to bite as I couldn’t quite justify it. Now that we’re trying out Netflix (our viewing will increase this summer when most shows are in re-runs), the AppleTV became more interesting and then the enhanced AirPlay on the iPad pretty much sealed the deal for me getting one. I almost ordered one, but hesitated and then MacMall had an eBay special for $80 for one (+$6 California sales tax), so I bit.

So besides watching Netflix on it and streaming movies I create on my iPad with it, what else could I do with it? I already have a Mac Mini setup as a media center handling broadcast TV recordings on my EyeTV. Viewing shows with the EyeTV is fine, but I wanted to use the Remote app on the iPad as it looked cool (did I need a better reason?). I started hacking away at a system to export the videos and import them into iTunes on the fly. Since the export takes a long time, I needed to export the videos in the middle of the night after ETVComskip ran to strip out the commercials.

I came up with the following AppleScript to do the exports of the shows that were recorded in the last day.

set destFolder to "Macintosh HD:Users:mediacenter:Movies:EyeTV Encoded:"
set currentDate to (current date) - 1 * days
set currentSeconds to seconds of currentDate
tell application "EyeTV"
	set recordCount to count recordings
	if recordCount is greater than 0 then
		repeat with myCounter from 1 to count recordings
			set theRecording to item myCounter of recordings
			if busy of theRecording is false then
				set startDate to actual start of theRecording
				if (startDate > currentDate) then
					set thisTitle1 to title of theRecording
					set thisTitle2 to unique ID of theRecording
					set AppleScript's text item delimiters to ":"
					set theTextItems to text items of thisTitle1
					set AppleScript's text item delimiters to "-"
					set thisTitle1 to theTextItems as string
					set AppleScript's text item delimiters to {""}
					set thisTitle to thisTitle1 & " " & thisTitle2
					export from theRecording to file (destFolder & thisTitle & ".m4v") as AppleTV replacing no
				end if
			end if
		end repeat
	end if
end tell

Next I setup a cronjob like this:

15 0 * * *  /Library/Application\ Support/ETVComskip/\
MarkCommercials.app/Contents/MacOS/MarkCommercials\
 all > /dev/null 2>&1
15 2 * * * open /Users/mediacenter/Desktop/Export\
ToAppleTV.app
15 20 * * * rm -rf ~/Movies/EyeTV\ Encoded/*

The first line runs the commercial skipping, the second runs the AppleScript that I’ve saved as an app. The third line removes all the exported videos as they’re no longer needed.

I’ve been using this for about a week now and it’s working quite well. I can control the shows from my iPad, but my wife thinks I’m just doing it because I’m a geek (and I say, so?).

The only issues with this is that I can’t delete the shows with my AppleTV and as of now, I’m keeping the backup copies on the EyeTV. So I have to manually delete the watched shows from iTunes as well as EyeTV. Once I get more confident, I’ll modify the AppleScript to delete the shows from the EyeTV after exporting and then I can write another script that removes the shows from iTunes after they have been watched; this is a little risky as I’m not sure if I can tell if it has been completely watched or partly watched. I wouldn’t want to prematurely delete the shows.

While this isn’t for the novice, I think it’s pretty cool and if I can centralize all my media watching to the AppleTV, I’ll be pretty happy. The Remote app on the iPad is very slick and beats any standard remote.

Review: Ram Mount iPhone car mount

When I decided to ditch my GPS unit to use my iPhone, I needed a way to secure my iPhone in my car or a rental car so I started to look for options. On the MacBreak Weekly podcast, Andy Ihnatko raved about the mounting systems from Ram Mount. Since Andy reviews a lot of products and seems pretty critical of some poorly made ones, I figured he might know what he’s talking about. I decided to give the

The wrong way to use a Smart Cover

One of the coolest aspects of the iPad 2, believe it or not, is the Smart Cover. I like the idea of having a built in stand and have used it a number of times. However, it seemed a bit unstable to me and I thought it was very un-Apple to do that. So I watched the Smart Cover video on Apple’s site again and realized my mistake. I thought that when the cover was “rolled up” the micro fiber side was on the inside of the triangle so that the plastic side of the cover was towards the surface. Well, that isn’t the case; the proper way to fold up the Smart Cover is to have the micro fiber towards the surface where the iPad is resting.

I feel a bit dumb about not seeing this, but having the micro fiber “out” just seems wrong. Oh well, when opening the Smart Cover and making it into a stand, take a look at the video on Apple’s website if you have any questions about the stand working right.