Author Archive: Don Meyer

Interesting Websites May-2013

This is a collection of interesting and useful websites for iOS development, as well as some more general technical stuff.


General

Apiary

If you deal with REST APIs, this is some pretty neat stuff:

    http://apiary.io

Quandl

Tons of numerical datasets. Not sure what I’m going to do with this, but I feel like I should come up with something:

    http://www.quandl.com

Xcode Tools

XCode Package Manager

An easy way to manage adding packages that modify and improve Xcode.

    http://mneorr.github.io/Alcatraz/

Snippet Editing

This is a nice tool to let you edit your Xcode snippets.

    http://cocoaholic.com/snippet_edit/

Appledoc

If you are looking to document some Objective-C classes or frameworks you’ve created, this is a very easy way to generate documentation that looks like Apple’s. This tool can also create documents that will integrate nicely with Xcode as well.

    http://gentlebytes.com/appledoc/

Objective-C

Objective-C Features

Wondering when a certain feature was available in Objective-C? Wonder no more!

    http://developer.apple.com/library/ios/#releasenotes/ObjectiveC/ObjCAvailabilityIndex/index.html

Classes, Frameworks, and Libraries

Networking

This makes networking so much easier it has to be see to be believed. There are many large and serious iOS apps and products that make use of this class!

    https://github.com/AFNetworking/AFNetworking

Core Data

    https://github.com/magicalpanda/MagicalRecord

Handy Classes

This is a collection of very handy-looking classes for iOS development.

    http://sstoolk.it

Sliding side-panels

    https://github.com/ktatroe/sidepanel-ios

JKFiltering

Filter arrays with blocks

    https://github.com/jklaiho/JKLFiltering

Numeric Entry

    https://github.com/benzado/HSNumericField

iPad Mini

The iPad mini is an experiment – wifi only and just 16G, so not planned to replace my “big” iPad.

May put the Nook into the museum though (or limited to use on the beach where sun makes LCDs a poor choice).

The mini is thinner and lighter than the Nook and just slightly larger width and height. And iBooks is way nicer than the somewhat limited Nook software.

The new Lightning connector is very slick – easy to connect and feels a little less fragile than the complicated 30-pin connector of yore. Yes, it’s a pain to have to (slowly) transition all of my cables and devices, but the 30-pin connector had a good run.

The display is certainly less crisp than the Retina display on my full-size iPad, but it’s not bad, just not as good. If you’ve never spent time using a Retina iPad, it will look great, as the dpi is actually better than that of the non-Retina iPads.

Cross-Compiling for BeagleBone Using a Linux VM on the Mac

BeagleBone Cross Compiling using OSX on the Mac (using Linux)

Although it may seem more complicated, I decided the best way to cross-compile from my Mac would be to do it from a Linux system.

I would of course love to have my BeagleBone cross-development environment running directly on OSX, but that’s an effort for another day – my goal here was to be able to cross-compile for the BeagleBone.

Yes, in theory this should be possible on a Mac since it’s Unix-based, but it appears to me that may be more pain. More pain than just setting up an Ubuntu system using VMWare Fusion anyway. This is quite easy these days – both VMWare and Parallels make it almost effortless. There are many many resources on how to do this, so I’m not going to cover that here.

With Ubuntu 12.04 running happily in a VMWare VM on my MacBook Pro, away I went.

So to just cross-compile, it doesn’t appear that you really need the OpenEmbedded and Angstrom kernel stuff, so I went with just the Angstrom pre-built toolchain available at:
http://www.angstrom-distribution.org/toolchains/

I used angstrom-2011.03-i686-linux-armv7a-linux-gnueabi-toolchain.tar.bz2
This is the 32-bit version, which matches my Ubuntu VM setup. There is a 64-bit version there as well, if you are running a 64-bit version of Linux on your host system.

Step-by-Step

On the Cross-development Host

Extract the pre-built angstrom toolchain:

    $ cd /
    $ sudo tar -xf <path to the angstrom toolchain>

Which creates the new directories /usr/local/angstrom and /var/lib/opkg.

Run the environment setup script, which puts the new tools in the path as well as sets up several other environment variables:

    $ . /usr/local/angstrom/arm/environment-setup

Create a simple “Hello, world” program using whatever editor you prefer. I named mine “hello.c”.

    #include <stdio.h>

    int main()
    {
        printf( "Hello, worldn" );
    }

And finally, do a test build.

    $ arm-angstrom-linux-gnueabi-gcc hello.c -o hello

This should result in an executable file named hello. (This is a Csource file, so I used gcc, but you can also change the gcc at the end of the command to g++ to compile C++ source code.

On the BeagleBone

If you transfer the executable binary output file hello to your BeagleBone (e.g. via FTP), you should be able to run it and see the text “Hello, world” printed out in the BeagleBone terminal.

    $ ./hello
    Hello, world

Resources

This guide is based on bits of information gleaned from a variety of sources, including:

Linux To Go
electrons on radio
Trey Weaver’s Blog
gpio.kaltpost.de

Thanks to everyone who has blogged about their experiences with the BeagleBone!

Writing a BeagleBone SD Card Image From the Mac Revisited

Since I last dealt with writing an SD card image to update the BeagleBone software, some things have changed. So, here’s an updated guide to the process.

Download the Image

The latest images are available here: http://beagleboard.org/latest-images

The one I downloaded was named: Angstrom-Cloud9-IDE-GNOME-eglibc-ipk-v2012.05-beaglebone-2012.11.22.img.xz

Uncompress the Image

The latest BeagleBone images are not compressed in a format that tar or unzip can deal with. Fortunately there is a free application The Unarchiver that can. It’s available here: The Unrchiver.

Run this application on the .xz image file to get a (much larger) file that ends in .img. This is the file you’ll write to the SD card.

Unmount the SD Card

To write the image to the SD card, it first needs to be unmounted.

    $ diskutil unmount /volumes/YourCardNameHere

Find the Device Name

This step is critical.

Using the wrong device name can destroy the data on your computer’s hard drive, so be very very sure to get the device name correct in the following steps!

This can be found in a couple of ways. You can use the “Disk Utility” application, or the command line diskutil or df commands.

Diskutil

From the command line:

    $ diskutil list

df

    $ df

This may show you the partition, something like disk7s2. You want to entire SD card, not any partitions so drop the s2 part.

Write the Image

Then, write the image to your SD card. Note that the diskXXX should be the actual disk device assigned when the SD card is connected, and Angstrom-XXX should be the name of the actual card image you downloaded and extracted previously.

Again be sure to use the right device name for the SD card in this step!

Don’t be surprised if this takes a while – on my system it took about 37 minutes, and there are no “in progress” indications of any sort, so be patient! (note that this time is more a function of how big the image is – ~3.4G – and the speed of your micro-SD card then how fast your computer is)

    $  dd if=Angstrom-XXX.img of=/dev/diskXXX bs=4096

If you aren’t logged in as root, you may need to use sudo, in which case the command is:

    $  sudo dd if=Angstrom-XXX.img of=/dev/diskXXX bs=4096

The Dish and My Non-Love of Ads

So Andrew Sullivan of The Dish is taking his blog independent, and using a no-ad pay model. This has been getting a lot of buzz on the internet.

After taking a look at his existing blog and finding it interesting, I paid my $19.99 for a year. Hopefully I’ll enjoy the blog!

Why did I take this rather impulsive leap and support a blog I haven’t ever really read?
Simple – I hate the ad model. Repeat after me “If you don’t pay for it, you’re not the customer, you are the product.”

I’m putting my money where my mouth is by supporting blogs like this, iTunes, Netflix etc.
(This is also why Hulu can go pound sand – I’ll only watch ads in TV shows – especially ones I pay for – only if there is no alternative. Long live Netflix & iTunes!)

Once you start to get your entertainment without ads, it’s hard to go back.

It really bugs me that even though the New York Times has a pay model, you still get ads on the web. Why not have an option to eliminate them for a higher cost? I don’t get it. I understand that printing and selectively delivering two versions of a printed newspaper isn’t practical. But online? It’s a Simple Matter of Software. Could be done easily.

My time has value. I’ll gladly pay what something is worth to watch, listen, or read it.

Apple TV, iTunes, Netflix and the end of DVDs

Our Apple TV gets a huge amount of use for both content-purchased-from-iTunes as well as Netflix.

We still buy DVDs, but less and less. The iTunes stuff is so much easier – no loading the disc, sitting through the FBI warning (or, in the worst case, needing to skip trailers for other shows). And then navigating the sometimes annoying menu structure while the theme sing plays in an endless loop.
And did I mention the occasionally spoiler-ish nature of some of the images they use in menus and such?

Just navigate to the show on iTunes and hit play. Ahhhh.

I have zero interest in anything that involves commercials at this point, so Hulu is right out. (Once you get used to a zero-commercial life, it’s jarring to go back!)

From iTunes, most stuff is $1.99 for SD and $2.99 for HD. If you buy season passes, this can be reduced a little, or for some shows in some cases by quite a bit.

I’ll admit I tend to trade off the concerns of DRM for the utter convenience of digital media. No swapping discs in the DVD player, no waiting through the FBI warnings etc.
If the price is even close I’ll go with iTunes over DVDs.

One other advantage of the digital versions is that I’m ready to go should I want to watch shows on an iPad while traveling.

The ability to lend DVDs was a big issue for me for a while, but I find that I lend them out less and less, so it’s become a smaller factor. And after moving to an apartment, having less physical stuff is attractive as well. Unbelievable how many boxes of DVDs we moved! And are having to find room for.

Roadster Mods

I will say this about the handsfree phone – MINI did an amazing job with the noise canceling. My wife was on the highway, top down, windows up, windscreen in place, and I could hear her just fine. Sounded like a little running water in the background, but that was it. Super impressed by that capability.

Here’s my list of mods for the new Roadster, in general priority order:

  • Invisishield on the nose (done)
  • MINI license plate frames (done)
  • CravenSpeed Platypus front plate mount (done)
  • Short antenna (done) (MINI version but might have done CravenSpeed if I’d though about it more)
  • ScanGuage (done)
  • CravenSpeed mounts for GPS and ScanGuage (enroute)
  • Suspension, discussed ad nauseum in other threads. Summary: JCW Suspension if I can wait, Koni FSD, 19mm rear sway, and perhaps camber plates and control arm bushings if I cannot.
  • JCW Tune (not something you need of course!)

Items above have 95% probability, below are pure wishlist

  • JCW Aero kit side skirts
  • JCW Brakes

I had the strut brace on my JCW and did like the look for sure, although I didn’t drive the car such that I really noticed it. That might happen too in a moment of weakness.

The Roadster Arrives!

Our new Roadster is finally tucked away in our garage!

Here it is at the MINI of St. Louis dealership waiting for us to drive it home.

IMG 2407

We took delivery a few hours ago. Everything at MINI of St. Louis went very smoothly. Our MA Karen and the rest of the team there really made it a great experience.

We basically just drove it home, so not a lot of first impressions.

I enjoyed driving it, but need some daylight, and a chance to get everything adjusted to take it out and really see how it feels. Also trying to stay within the break-in period limits makes it hard to really get a good feel for the acceleration and braking.

Even with windows up and windscreen in place, my ears were getting a bit cold on the highway (~49 degrees F). Conversation was quite practical under those conditions though. And the heated seats work great as they have in our previous MINIs – another area where the MINI is a great contrast to our utilitarian (work) Prius.

The car looks great and I’m really anxious to get it out in the sun and really take a good look at it, and get some serious pictures. They’re predicting rain for us tomorrow, so it might be Wednesday before that happens. It will give me time to play with MINI Connected, get the phones paired up and so on.

My 370Z was a great car, but it felt so right to be back in the MINI fold again!

My first challenge is figuring out the correct tire pressure. Dealer delivered it at ~32psi. Door sticker and manual say 41psi. Mentioned it to my MA and the response she relayed from ? said that 41 is maximum and they recommend 32-35.

Roughly 25% lower than door sticker seems awfully low to me… I set it to 39psi and will see how it feels.

…time passes…

Just took a quick spin with 39psi. Rode a bit rougher of course. Not excessive but rougher. Need more time to really tell though.

FYI, the tires are: Continental ContiProContact SSR 205/45R17 84V

MINI Roadster – Random Thoughts

Some random thoughts about our MINI Roadster, which is due to arrive in a few days!

Our local dealer just got their “demo” Roadster in, and I had to swing by and take a look.

A few random thoughts came to mind. Maybe because that’s all I’m thinking about until ours arrives next week!

  • The seats fold forward. I understand why – they can’t make custom non-folding seats for the Roadster’s volume, but it does seem funny.
  • I’m disproportionately excited at the thought of having an actual useful trunk on a car again! (sorry – “boot”) See attached pic. Our recent fleet has been a Prius (hatch), 370Z (hatch), and a MINI Convertible (trunk, but not super useful…).
    The ability to open the pass-through door between the seats and reach into the boot (got it right that time!) is going to be really really handy, especially on road trips. And then to be able to stow valuables (iPad etc.) back there and lock it without making that obvious to potential miscreants when stopping for fuel and food – terrific.
  • I’m surprised by how much I liked the look of the front and rear compared to the JCW aero kit. As in, in some ways I like the normal look better than the JCW. Not by much, and in other ways I like the JCW better, but my net conclusion is that I’m ok not having it. (and not just saying that because I didn’t order it)
  • The JCW aero kit side skirts are another matter – man, I like those. If it’s possible to just buy those and have them installed, I see some (more) money flowing from my pocket into MINIs in the near future.

BeagleBone FTP Server

BeagleBone FTP Server

The BeagleBone has multiple text editors available onboard, including vi and vim. I can stumble around (badly) in vi. Using Vim is a little prettier, but not much – I’m really much more of a modal-editor guy. On the Mac, I use BBEdit when I’m not using XCode for iPhone and iPad development.

So my goal is to be able to easily edit on my Mac. BBEdit has a very slick ability to edit files via FTP, so that’s my next step.

Oddly, the BeagleBone doesn’t have an FTP server available in the default distribution. (or if it does, I couldn’t find it)

One skill I know I need to brush up on is acquiring, building, and installing packages in Linux. Since I wanted a quick-and-dirty FTP server running without too much fuss, I naturally looked to Python.

Python is a terrific “scripting” language, and my go-to tool for a lot of tasks.

There is a very nice FTP Server library available: pyftpdlib.

I grabbed this using wget, then did the unzip/untar dance:

    gunzip pyftp*
    tar -xf pyftp*.tar

Installation was simple. The setup python program failed, so I just manually moved the pyftpdlib directory into /usr/lib/python2.7/.

Last but not least, I whipped up a small Python program by modifying the quickstart and demo examples just a bit:

    # FTP server

    from pyftpdlib import ftpserver
    authorizer = ftpserver.DummyAuthorizer()
    authorizer.add_user("root", "12345", "/home/root", perm="elradfmw")
    handler = ftpserver.FTPHandler
    handler.authorizer = authorizer
    address = ("", 21)
    ftpd = ftpserver.FTPServer(address, handler)
    ftpd.serve_forever()

Take that code, stuff it into a file with a .py extension (e.g. ftpserver.py), and invoke it:

    python ftpserver.py

And there you go – FTP access to the home directory of user root.

Now, is this what you’d use to server files to the world at large? Maybe – it looks like a very complete implementation, although I’m no FTP expert.
But it’s perfect for my local development purposes.

The only thing that would be nice is to have it auto-start. That’s pretty easy to do as well, at least in the simple case.

The directory /etc/init.d contains scripts that are executed upon system startup. We place a very simple shell script there, which I called ftpserver:

    #!/bin/sh
    python /home/root/ftpserver.py

This will run the Python FTP server program (which in this case is located in the root account’s home directory – it could be located elsewhere of course).
Once you create this script, don’t forget to make it executable by doing chmod +x ftpserver.

Although this works, our script should really be more compliant and let us stop and restart the server. I plan to address that soon!