On my desk sits a 21" iMac which is plugged into a 27" Apple Cinema Display. The iMac is a great machine, but the audio quality is better coming out of the Cinema Display — larger screen, probably better speakers.

So when I'm playing music I always select the sound output to come from the Cinema Display. You can Option+click the Volume icon on the menu bar and select either "Display Audio" or "LED Cinema Display", both mean the same thing. If I want to use the iMac speakers I select "Internal Speakers".

But what if I want to use both? Madness right? After looking around I found that you can create a "Multi-Output" device using the Audio MIDI Setup app.

So after doing that I created a multi-output device called "Both Screens" with output going to the built-in iMac speakers as well as the Cinema Display.

The only downside is that you have to control the volume from the app doing the playback, e.g. iTunes. Whatever volume you had the selected display at is what's used so you may want to swap back to it, set the right volume and then swap back.

Dual monitor sound output. Hell yes.

Posted
AuthorPaulo Fierro

CocoaPods

I'm really glad I took the time to learn and use CocoaPods on this latest project. Such a massive time saver for iOS devs. No more adding linker flags, copying bundles and keeping external frameworks up-to-date manually.

I simply write a Podfile (similar to a Gemfile if you come from the Ruby world), and run "pod install." If a library I'm using has been updated I run "pod update". If a library I want to use isn't available, you can easily submit it to their list of specs on Github.

Great stuff.

Spark Inspector

Its like a Web Inspector for iOS apps. Modify your UI's properties and see the changes live in the Simulator or on your iOS device. you can also see your views in a 3D extruded mode to get a better grasp over how your UI is being laid out.

There's also a notification monitor to see notifications and their payloads as they are fired with the added ability to go back and resend them. Not used this much yet but it looks snazzy.

Crashlytics

I like TestFlight for distributing builds though I will be using Hockey on our next internal app because I've heard great things.

However I no longer ship the TestFlight SDK in our apps because I find the crash monitoring in Crashlytics to be far superior. You can group similar crashes and mark them closed once you've fixed the issue. You also get so many more useful details like available disk space, how many users are affected, etc so I would recommend you give it a shot. I'm a fan.

We're in the business of building things that makes our lives easier and these tools make the development easier.

Posted
AuthorPaulo Fierro

Lately Niqui has been having some issues with her iPhone 5's lock button. It works now and then, but you have to press it 6-7 times before it actually locks the screen which is quite annoying.

You can set phone to Auto-Lock after a minute but sometimes you want to lock the screen at a particular point in time.

Enter LockMe.

LockMe is a tiny app that simply locks the screen and quits. It uses an undocumented function called GSEventLockDevice which does just that. Its part of the private GraphicsServices framework so the app can't be submitted to the App Store, but it does the job until she can get her phone fixed.

There's a few ways to use private frameworks but I found the simplest route was to load it dynamically at runtime. The meat of the app is just ten lines of code.

That's pretty cool if you ask me.

So if you or someone you know has the same issue, grab the app from our GitHub repository, build it for them and be a hero :)

Posted
AuthorPaulo Fierro

I'm currently working on an internal iOS app and while I was working on putting together the About screen I ran into an issue where unicode characters in a UILabel were being displayed as emoji by iOS. While this is kind of awesome, its not really what I was going for.

So my code:

label.text = @"Made with ❤ by jadehopper ltd.";

results in:

To disable the emoji character we have to tell iOS to use the variant of this character. In order to do this we change the label text to:

label.text = @"Made with ❤\U0000FE0E by jadehopper ltd.";

which results in:

Posted
AuthorPaulo Fierro

When Niqui and I moved over to Grand Cayman last summer we realised that one of the things that we had been completely spoiled with while living in Brighton was the great tech-community and the amazing people that live and work there — some of which we are lucky enough to call friends.

Soon after moving over, Garth Humphreys invited me to a couple Facebook groups which allowed me to (virtually) meet other people in our industry living on our tiny island. Recently we'd been chatting with some friends at BB&P, a local agency, who were also looking to get the local community together and they kindly invited us to use their space.

So earlier this month we had our first get together so we could meet in meatspace. Our first meetup was a great success and everyone that turned up was keen for more of them.

And so we have interactive.ky — a meetup for designers & developers living in the Cayman Islands. Our next one is next Wednesday, April 3 and you're more than welcome to come join us.

Earlier today Ingrid Riley wrote a lovely piece on our group over on Silicon Caribe.

Posted
AuthorPaulo Fierro

This weekend marks the 25th Taste of Cayman — a food and wine festival put on by the Cayman Islands Tourism Association (CITA).

This year you can buy the tickets online on their site built by Netclues. However, the purchase process is entirely insecure. Taking customers' credit card details in this manner is both irresponsible and unprofessional and it also violates the Payment Card Industry's (PCI) Data Security Standard requirements to protect cardholder data (point #4). I'm no lawyer but I believe if the card details were to fall into the wrong hands they would also be financially liable.

I tweeted at CITA and Netclues but they didn't reply.

When we help clients build anything, be it a site or an app it falls on us as the designers and developers to educate and inform them about issues like this. I am appalled that the people in charge of developing this site would roll out a payment solution without something as basic as an SSL certificate in place — trying to visit the tickets page over HTTPS results in a 404 error (page not found).

If a relatively inexpensive SSL certificate is not installed then I do wonder how much care and attention has been put in place behind the scenes to store credit card details in a safe and secure manner. 

Its 2013 — we should know better. We should expect better.

In any case, we are looking forward to attending the event but purchased our tickets the old-fashioned way.

In person.

Posted
AuthorPaulo Fierro

I was using Charles earlier to monitor some HTTP requests and noticed that every few seconds a request would show up trying to ping 127.0.0.1 (localhost) on port 7682. This was odd so I did a quick search and found that I had actually tweeted about this approximately 112 days ago — and had completely forgotten.

So if you see this, simply disable the Adobe Edge Inspect extension in Chrome in the Extensions settings.

Let's see if I remember this time.

Posted
AuthorPaulo Fierro

I am a big fan of Sinatra and have been writing a few apps using this lightweight Ruby framework. Deploying them on Heroku is a breeze and painless but I always seem to forget a step so this is more of a note for future me.

I wrote a template that sets up a very basic Sinatra app that outputs JSON — perfect for when I need to set up a basic API for an iOS app. There's no database, so DataMapper is nowhere to be found and there's no tests either, just extreme simplicity.

Assumptions:

  1. you already have a Heroku account and have the Heroku Toolbelt installed
  2. you are on a Mac, though I'm sure its not too dissimilar for Windows folk
  3. You have the Bundler and Shotgun gems already installed

So with that out of the way,

  1. Download the template, and unzip it into your new apps' folder
  2. Navigate to the folder in Terminal and then run bundle install
  3. Check that everything is working by running shotgun. Then fire up a browser and navigate to http://127.0.0.1:9393
  4. Next we need to create the local git repository: git init
  5. Now we add all of the files: git add .
  6. Then we commit them: `git commit -m 'first commit'

Now we're ready to create the app on Heroku. For this example lets call it "myapp".

  1. In the Terminal create the app (the default stack nowadays is Cedar which is what we want): heroku apps:create myapp
  2. Because the git repository already exists, the Heroku toolbelt should have set up a remote for us, but lets double check: git remote -v
  3. Double check that the remotes look like heroku git@heroku.com:myapp.git for both fetch and push
  4. Deploy! git push heroku master

Now if you navigate to http://myapp.herokuapp.com you should see some successful JSON output.

Now go build your app!

Posted
AuthorPaulo Fierro

First a little back story.

The other day my mom called me up saying that her 11" MacBook Air was out of space and running slow wondering what we could do about it. Knowing that OS X runs pretty terribly without some free space I figured I'd run some of the Onyx cleanup scripts, check out where the space was being used up with Daisy Disk and get rid of some of the crap.

Onyx cleared a few gigs, and Daisy Disk said that iPhoto was the main culprit — the library being nearly 80GB,  67% of the total space on the disk.

Firing up iPhoto I created a Smart Album to see how much space videos were taking up.

The Smart Album conditions

Turns out there was nearly 10GB in videos, so I selected all of the items in the Movies album and exported them to an external disk. After removing these from the library, emptying the iPhoto trash and the actual Trash the disk had about 15GB free.

Success!

Not so fast

Of course not. After handing the laptop back my mom complained that iPhoto was running really sluggish. I got it back, checked it out and it was unusable. Scrolling had a 5-6 second lag and the UI responsiveness was generally pretty terrible.

My guess is that removing those videos screwed up the library somehow, so I opened up iPhoto holding down CMD+OPT to get the repair menu up and ran each item on the list (repairing permissions, rebuilding thumbnails, reindexing photos, repairing the library). Many, many hours later everything was still terrible so I decided to start from scratch.

My mom's iPhoto library is fairly large — nearly 15,000 photos. Initially I thought her 11" may not be able to handle that many photos so I figured exporting all of the photos and only importing the ones from the last two years would be a way of seeing if that was the case.

I left the laptop overnight exporting the 15,000 photos, backed up the library and deleted the original. Now I just had to find the photos taken within the last two years.

What should be easy...

Once again foiled. All of the exported photos had date of creation and modification set to yesterday. The sub-folders were all album names and not really indicative of when the photos were taken. I peeked inside the iPhoto library package contents to the Original and Modified folders where the photos live but found duplicates, terrible names and general cruft so I figured the actual exported photos had to be salvaged somehow.

Then I remembered EXIF data. Every photo you take contains metadata about what camera was used to take it, the model, ISO, exposure time, etc. One of those fields is the date it was taken. So if I could figure out how to read the date taken I could write a script to "fix" the photos.

ExifTool to the rescue!

With ExifTool in hand I went off to Automator and wrote some Ruby that would loop through a set of folders and change the date modified to the date the photo was taken as dictated by its EXIF data. It looked like so (download it here):

I tested this on a folder and it worked! I could follow along what was going on in Console.app and all was good.

Then I ran it on the main folder and encountered an interesting bug:

Run Shell Script failed - too many arguments.

Automator was passing in the path names to all of the photos to Ruby as arguments, but someone could only handle 4096 of these. Well below the 15,000 items I wanted to process.

Having spent enough time on this already I decided to be lazy and just run it a few times. Due to the logging to the Console I could see how far it had got and simply resume it from there with a next batch. There's also a bug where photos with single quotes or ampersands had to be renamed to be processed, which I could have fixed but again, lazy.

Now only the modified date was supposed to be changed, but I guess OS X doesn't allow a creation date to be later than its modified date so they both changed as a bonus.

Now for some Spotlight magic...

Now that the photos finally had their dates back I could make a simple search for files that were JPEGs and created in the last two years.

Importing these into a new iPhoto library took a while but once it was done scrolling was fluid and the app was generally responsive. Great! So I backed up this library and decided to try importing the rest of the photos.

A few hours later all of the photos were back in iPhoto and the app was still scrolling smoothly. What the fuck?

My guess is that removing the videos screwed up the original library in a way that iPhoto itself couldn't fix. Maybe deleting the video files themselves from the disk would have been better — leaving orphans in the iPhoto library. I have no idea.

In any case it was a learning experience and yet again proof that Automator is truly a hidden gem that I don't use enough.

You can download the Automator app (open it in Automator to edit it if you like), but remember you must have ExifTool installed first.

Posted
AuthorPaulo Fierro

I've been shooting some video with the GoPro Hero 3 Black which can do 1080p at 60fps which looks lovely.

In VLC.

Yup, in OS X 10.8.2 playing back 1080p video at 60fps on my MacBook Pro results in so much stuttering its unusable. Trying to edit it in Final Cut Pro X is basically impossible or will drive you crazy in the process.

You get lovely warning messages like this:

Thanks, Final Cut!

Thanks, Final Cut!

As VLC handles it fine I know my laptop has more than enough fire power to play it back, so it must be a QuickTime issue (Final Cut uses QuickTime to decode video as far as I know). According to multiple discussions on the Apple support forums its possibly related to a GPU driver issue and will hopefully be resolved in 10.8.3.

I hope so...

Posted
AuthorPaulo Fierro

At the end of November last year we had our good friend Chris Ross come over and visit us. His visit had a caveat, he had to do the PADI e-Learning course online first so we could go diving while he was here.

On the flip side, we would learn how to kitesurf — I for one had no idea you could actually do that on the island... So we took a few lessons and kind of got there but not really. Turns out learning to dive is much, much, much easier.

In any case, I've now had five lessons and found that was enough to go out and try some riding on my own, slowly building up confidence and lets call it technique.

This first video is the drive to Barkers Beach, sped up 20x, shot with a GoPro Hero 3 Black attached to the windshield with a suction-cup mount.

Next up is some shots taken while riding using CamRig's Universal Strut Mount and a standard board mount.

As its the "windy season" I look forward to getting better, and maybe even learning how to turn without stopping.

Posted
AuthorPaulo Fierro

A late afternoon dive off Coconut Villas while Mark was visiting, led as always by Stephen.

Posted
AuthorPaulo Fierro

For my birthday Niqui got me this dive mask from Liquid Image. Its a nice mask and the video taken with it is great but the four rechargeable AAA batteries power it for about 90 minutes. Most of our dives are an hour or less so that's not a problem, and the mask comes with a battery recharger – however while charging the batteries the camera forgets the date.

You have to set the date each and every time. Its a minor thing but it annoys me so I don't do it. For some reason the default date is set to Monday, January 8, 2035 – a strange choice.

So because I'm lazy and don't change the date on the camera every time, when I eventually drag the video files into Final Cut I get crap like this:

Having some events with the right date and some in the future makes organising video for projects a nightmare. So after googling around I found that I could use the touch command in the Terminal to change the creation date. If I do this on each file before importing it into Final Cut I avoid the problem. So the command is basically:

touch -t yyyymmddHHMM <PATH_TO_FILE>

Still, doing this on multiple files is a massive pain so I toyed with the idea of writing a script for it. I have used Automator in the past and figured doing things like selecting items using the Finder's File Selection dialog is easier than using a command line script so that's what I did and you can see the "recipe" below.

It accepts a string which is the date you want the file to have been created, you select the files and you're done. It keeps the original time too, which may not be something you want but I don't really care about the time. As long as the files have the right date and are sequenced correctly its good enough for me.

You can download the application here. You can also open it up with Automator and modify it as you see fit.

While doing this I learned Automator actually has support for variables – who knew? Its a powerful tool and I don't think I use it enough.

Posted
AuthorPaulo Fierro

So iOS6 is now officially released so we can talk about it. We've been using it since WWDC in June and in general there's so much to like in this release. The one thing that is still lacking is mapping data.

Having used the beta while we were in California I know first hand how great the maps can be. Turn by turn navigation when driving from San Francisco to Las Vegas worked well and the maps were pretty detailed showing local businesses, restaurants, etc. Once you leave the US however, the mapping data is substantially worse, with the exception of a few 3D flyovers.

There's been a lot of noise on Twitter and people holding out on buying a new phone or upgrading until this is fixed. The good news is that this is all on the backend so Apple can roll out improvements behind the scenes and most likely not require us to do anything.

Most of the complaints I've seen however still have some data visible to them. Maybe not all that accurate, but something.

However here on Grand Cayman the Maps app has gone from useful to completely useless. On the left is a screenshot of iOS5 that has roads and place marks – directions work too. On the right is iOS6 that shows a place mark for the airport and otherwise a lot of sand. Directions do not work.

They replaced our roads with sand. Thankfully we got to keep the airport.

The satellite view isn't as bad, but quite cloudy and the more you zoom out the more the clouds appear.

Satellite view

There is also something weird that happens to the shape of the island around the middle right.

Strange shape morph

This appears to be because they draw the outline based on existing data. As you get closer you get to that location in satellite view you can see a bad stitch job between what I assume are two different data providers. The image on the right is basically black and white.

Weird stitch job

In any case, I look forward to the day when the maps here are as gorgeous as they are in San Francisco. No doubt the Maps team in Cupertino are quite busy and we're not very high on the list of priorities but hopefully we'll see something soon.

Update: Haha! My buddy Peeks just let me know that the image I submitted to "The Amazing iOS6 Maps" Tumblr made it onto Wired.com :)

Update #2: And TechnoBuffalo. And CNET. And Jest. And Broadband Reports. And Droid Life. And Huffington Post.

Posted
AuthorPaulo Fierro

Back in 2003-2004 when I was still studying in Oslo I decided to write my own blogging "platform" as a way of getting of practicing my then-newfound Perl hacking skills. I wrote the admin interface in Flash, they talked to each other using this library called AMF::Perl which, though awesome, never made it passed version 0.15.

Fast forward to a week and a half ago when my host media temple upgraded the PHP install. Unannounced and unbeknownst to me they also upgraded their Perl installation which broke my site. The code is 8 years old, I'm not surprised - if you're interested it was the library that talks to the database that does something which has since been deprecated. I haven't written any Perl in at least 5 years so I'm not sure how to fix it. My interest in digging down and fixing a third party library is zero.

So after hearing so much about Squarespace on nearly every podcast I listen to I decided to give it a shot and here we are. Hopefully I'll be able to transfer over the old posts (at least some of them) but we'll see.

In any case, so far Squarespace seems great. And the best part is I no longer have to maintain it.

Win.

Posted
AuthorPaulo Fierro

So we are in San Francisco for WWDC and want to avoid roaming costs. Our inital plan of using HolidayPhone failed as they forgot to add credit to our SIMs.

After much back and forth I finally got data working on our AT&T GoPhone (Pay As You Go plan). The people at the store assured us this would not work and is not possible, but they're wrong. We paid $10 for the $2 per day unlimited plan SIM. Unfortunately this plan no longer supports a data add-on so you have to upgrade it. There's a $25 per month plan with minutes and texts and a $50 per month one with unlimited everything. I don't care about the minutes or texts, but you may want to compare the two.

  1. To upgrade it, first you have to add money to your account. You can do this in store or online, I went to myprepaidrefill.com.
  2. Click on Login
  3. You probably don't have a password, so click on the forgotten password link for Pay As You Go
  4. Enter in your phone number and you'll get a text with the password. Now login.
  5. Click on Add Features, select Refill and add $25. You can look at the Data Packages section but you'll see a warning triangle. Hovering over it will tell you that a data plan is not supported on the Unlimited $2 per day plan.
  6. Once you've added money to the account, log out. Unfortunately you can't upgrade your plan on the site (or I couldn't find it) but you can go through an automated voice system by calling 1-800-901-9878. You want to upgrade to the $25 plan and this happens instantly. Trying to do so without enough money in the account doesn't work which is why we added funds first.
  7. Once that's done, log back in and you should see that your plan's changed. Now you can go back to Add Features, select Data Packages and select one. I went with $5 for 50MB just to test that this works.
  8. On your iPhone, hop on a wifi network visit unlockit.co.nz, go to Custom APN and select United States and "AT&T PAYG". Don't select plan "AT&T" - it didn't work for me. Then click "Create Profile" and it will install itself on the phone.

Now disconnect from the wifi and hopefull you'll have data working. It does cost a little bit ($10 for the SIM, $25 for the upgrade and then $5 or more for data) but its worth it.

Note: On the AT&T site you'll notice oddities like not being able to paste in your credit card number, you can set the State to "Foreign" when entering in your address but the Country can't be changed from "United States". It doesn't support non-US postal codes either so in my case I had to enter "BN13W" instead of "BN1 3WB" but it still works.

If you want to avoid the hassle you can go with T-Mobile, but then you're stuck with Edge unless you're near the Moscone center where they are apparently testing out 4G.

Posted
AuthorPaulo Fierro