Oct 192011
 

I fucking did it.

After, what, two years now?

I wanted to start learning iPhone programming. I had a Mac and installed Xcode. I acquired four different books on the subject. I decided, as a learning project, to create a simple app to calculate “mote pools” for my character in Exalted (don’t ask, just roll with it) and track changes in it over the course of a game session.

Almost right away I ran into a wall: how to take four user-determined numbers ranging from 1-5, programmatically determine the two with the highest values, and how to handle a case where two or more had the same value. For example, given: “3, 2, 2, 2”, how do you decide which two 2s to use?

While informative, I reached a point in each book where they just completely lost me, and none of them had an answer to my original problem. Over the course of months, I asked four different programmers I was lucky enough to meet how I might handle it. They all said the same thing: create a static array, plug in the numbers, sort it highest to lowest, and return the top two. That was all well and good but, while they all told me what to do, no one could tell me how to do it, and I didn’t know any of them well enough to make them sit down and show me how to code.

I tried, on multiple occasions, searching the Xcode documentation about NSArray, but it made my head spin because I didn’t know enough to even know what to look for. Eventually I gave up, but it’s stayed at the back of my mind and bugged me ever since. It should not have been that difficult.

Today during lunch I saw an offer on RayWenderlich.com, an iOS programming site I follow on RSS: sign up for their newsletter and get the first “epic-length tutorial” of a new series they’re running, by Matthijs Hollemans, for free. I did, but couldn’t get far in 45 minutes. Since I had the house to myself tonight, I got everything else out of the way when I got home and started working.

I got about halfway through, and had just barely finished the section on if-else statements, when the Eureka moment hit me: I didn’t need to do an array, and I didn’t have to try and compare four numbers at once. I could split them into two pairs, compare each separately, and store the highest one. If neither one was greater than the other, that meant they were equal, and I could arbitrarily take the first member of the pair and store it. Repeat for the second pair. I set the tutorial aside and spent the next two hours coding.

What follows is a mess. It’s ugly. It’s inelegant. I’m sure it could be done half a dozen ways in less than half the amount of code. It will make no sense to you unless you code. In retrospect, I should have figured it out a long time ago.

But it works, and I did it myself.

I’ll be buying the rest of those tutorials come payday.

By the way, WordPress sucks at displaying Rich Text Format.

Scary Code This Way…

Aug 102010
 

After plundering the fund I’d been building for next year’s iPad model, and adding the birthday check from my in-laws, I finally replaced my iPhone 3G (which was running dog-slow under iOS 4, previous post to the contrary) with a shiny new 32 GB JesusPhone 4.

There was much rejoicing, and I saw that it was good. Yay.

And on the 6th day, Aaron did look upon the iPhone and spake unto me, saying, “Why the hell is your camera lens all scratched up?!”

Oh shit.

Sure enough, the lens was nearly covered with scratches, yet the surrounding glass was unmarked. My heart sunk as I realized my shiny new toy was marred after less than a week, especially considering that the new camera was a big draw for me. I wracked my brain trying to figure out how it had gotten so scratched in so short a time. I never put it in a pocket with anything else. I hadn’t dropped it. I hadn’t rubbed the lens with anything other than soft cloth. While I had put it on flat surfaces with the lens down, I never scraped it across a desktop, and I’m pretty sure those desktops were clean. Regardless, the lens was still a mess.

I started taking a bunch of test pictures to see what effect it had had, and compared them to the couple of pics I had taken immediately after unboxing. Nearly every picture with any kind of direct lighting showed a hazy glow, and all of them were noticeably less sharp. I scoured the web looking for anyone else who had encountered the same problem, but there was very little reported so far. I sent a message to a friend who worked for AppleCare and asked what to do, but I didn’t get anything concrete back from him before we left for Pittsburgh. I was mildly depressed about it all weekend, because I was sure Apple would claim that because I had somehow damaged it, they wouldn’t cover it under AppleCare. I also didn’t want to lie and claim it was damaged out of the box.

The problem is the oh-so-sexy design Apple so proudly touted. On the 3G and 3GS, there is a very slight lip around the camera lens, and the backplate curves up at the corners, so the lens never rests directly against anything when placed on a flat surface. On the 4, the back is perfectly flat, with no lip to prevent lens contact.

Yesterday, after talking more to my Apple friend, I decided to just make an appointment at the store, take it in, and see what happened. I put on my sad panda face, marshaled my arguments as to why it wasn’t really my fault, and anxiously expected to be disappointed.

The tech, Justin, listened to my tale of woe, looked at the pictures, and examined the lens. He was also a bit shocked that it was so scratched up, agreed that the pictures didn’t look right, and declared that he would set me up with a new phone immediately. I’m pretty sure my jaw dropped open as all my prepared arguments evaporated.

While he set up the phone, I checked out his sweet tattoo. He had a band around his upper left forearm made entirely of Rebel Alliance logos in various sizes, resembling a chain of bubbles. I wish I had asked to take a pic of it. To test the camera of course.

When everything was done, he apologized that I had had an issue. I know Apple is probably being extra cuddly with iPhone 4 customers in the wake of Antennagate but, even before this, I’ve never had anything but a good experience with Apple’s support, either at the store or on the phone. Whether you love or hate their products or culture, they sure know how to make their customers happy.

The moral of this story? Get a damn case! This is one phone that absolutely needs one. The free case offered by Apple is all well and good, but they’re all on back order for weeks, depending on the model you choose. I also won a free StealthArmor case (tungsten) from TUAW.com that shipped today, so I’m holding out for that.

Until then, some tips:

  • Don’t put the phone in a pocket with any other object.
  • Set the phone down with the lens up. The front glass is much tougher than the lens cover.
  • Set the phone down on something softer than wood or metal. I’ve been using a blank sticky-note pad.
  • Don’t wipe the lens with rough cloth or paper towels.
Jun 212010
 

First of all, as many users are reporting, the pre-upgrade backup moved at a glacial pace; FAR slower than the non-upgrade backup I did just minutes before. After doing some research I hit upon a workaround: do a normal backup first (very important!), download the update, then cancel the installation. Go back and click Restore instead of Update. This will wipe the iPhone back to factory settings and restore it from your normal backup using the new OS version. Restoring this way is also pretty damn slow, but far faster than waiting for the upgrade backup to complete.

At long last the reboot completed and I was back in business. The phone does seem a bit more responsive than before but, since this is merely a 3G, it’s slight enough that it may just be wishful thinking on my part. Also, being a 3G, it’s lacking the major feature: multitasking. Surprisingly, it’s also lacking a minor feature: custom wallpaper on the home screen. Really, Apple? Is the horsepower of the 3GS and 4 really necessary to display a home screen background image, or was this just oversight?

Regardless, here are some of the first impressions and observations:

1. Folders: Since I wasn’t getting all the bells and whistles the newer hardware gets, this was a big one for me. I’ve managed to consolidate five screens of app icons down to 1 1/4. Now all my most commonly-used apps can all reside on the main screen in custom-named folders. Much rejoicing.

2. Camera: I still don’t have tap-to-focus, being a hardware item, but I was surprised to see that even the 3G gets the digital zoom slider. Considering the crap resolution of the camera, I don’t know how useful this will be but, hey, I can say I have it.

3. Maps: The GPS seems to lock noticeably faster and somewhat more accurately, even indoors.

4. iBooks: The first time I tried opening Winnie-the-Pooh I got an error message to the effect of “The book could not be opened because a required resource could not be located.” After the second attempt the book opened normally, but was very slow to respond for about 30 seconds while everything loaded in the background. Once all of that was completed, it ran very smoothly. The text is easy to read and the controls are intuitive, but I kept trying to pinch-zoom, which does nothing.

Adding PDF files to the phone is as easy as going to the Books tab in iTunes, and dragging the file from the Finder or desktop into that tab, then syncing the phone. Only a copy is created; the original is untouched and unmoved. After syncing, the PDF did not immediately appear on the bookshelf. After I went into the Store section and came back to the bookshelf, I now had a “Books|PDFs” button at the top of the screen. I’m not sure whether the delay was a bug, or if the app was still processing the PDF before displaying it, and I just hadn’t given it enough time.

I tested the PDF viewer with a 74MB color PDF of the Exalted core rulebook, containing two-column text, sidebars, and pictures. This book has been my litmus test for every iPhone PDF reader app I’ve tried. Nearly all of them choke on it, with the exception of GoodReader and now iBooks (sort of). As with “Winnie-the-Pooh”, it took quite awhile to finish processing the book and become responsive again. Eventually it settles down and displays everything correctly. I can pinch to zoom, and double-tapping in a text column zooms in to the width of that column, which was a pleasant surprise. Unfortunately, because of the limits of the processor and memory of the 3G, rendering each page takes an unacceptable amount of time, and I can’t imagine trying to read such a large, complex PDF on it. Even as I write this, it continues to get part way through rendering the text column before everything goes out of focus, then repeating. Smaller PDFs should be fine.

CORRECTION: Oddly, after I left iBooks then immediately went back into it and pulled up the PDF, it rendered much faster on every page, no matter how far into the book I went. Flipping pages, both manually and by using the “page scrubber” control at the bottom, still involved some horrible lag, however.

I’m sure as I continue using it I’ll discover more but, hopefully, this will all be moot in about a month when I can get the iPhone 4.

Feb 172010
 

For awhile I was enjoying a location-based app called Gowalla on my iPhone. Similar to FourSquare, it allows you to collect virtual “stamps” for creating “spots” in real-world locations, assigning them to categories, and dropping or picking up items in a scavenger hunt-style. You can then broadcast to your Gowalla friends, Facebook, or your Twitter feed when you check in at any of these spots.

It was (and is) a fun, clever idea. I enjoyed similar activities in the MMORPGs City of Heroes and World of Warcraft, which was known affectionately in CoH as “badge-whoring”. During the initial giddy rush of having a new shiny with juicy, colorful graphics, I annoyed my Facebook friends and Twitstream by posting my spots at every opportunity. Rather quickly, however, I began to think that posting my current whereabouts publicly may not be such a good idea. I turned off the Gowalla feed to Twitter within a week and, about a month after that, the Facebook feed. Currently, the only people who can see my latest Gowalla update (rare though they’ve become) are specific friends who are also on Gowalla. Other Gowalla users can see your latest checkins, if they search on the Gowalla.com site specifically for your name or email address, or by picking an existing spot and seeing all the users who have checked in there. Not 100% secure, but slightly more reasonable.

The point is, though these things can be fun, not only are you telling everyone where you’re at, you’re also telling them where you are not:

Home.

As reported by an article on TechCrunch today, a group of guys went way past my own vague sense of unease and created a site to warn people of the dangers of screaming, “Here I am!” to the entire world: Please Rob Me.com.

If you’re a FourSquare user (currently the only location-based app being tracked), and broadcast your location on Twitter, take a look at the site and the constantly updating list of currently empty homes. Now plug in your Twitter name. See how easy that was?

Granted, a potential robber would have to know where your house is to take advantage of the information, but if it’s someone who already knows you and is looking for an opportunity to help him- or herself to your stuff, you may as well hand them your keys and a bag to carry it in (paper or plastic?).

Please. Think before you give everyone the 411.

Feb 122010
 

The sudden advent of Google Buzz caught me off guard. Unlike Wave, I hadn’t heard any “buzz” (I’m so sorry, but how could I resist?) about this at all, and I usually keep up on the latest Next Great Thing.

After a bit of poking around at it I saw that it could very well be for individuals what Wave can be for groups. Rather than being excited, however, I found myself…weary. “Not another one!” I sighed.

I’m suffering from what I’ve just this very moment decided to call “Connection Fatigue”: having your attention divided by so many social network services (as opposed to actual social networks) that you exhaust yourself trying to keep up with all of them. Making a quick mental count of them, I’m up to about…um…ten accounts, including ones I barely use, or stopped using and just haven’t deleted them. That doesn’t include IM networks, either.

I can spend most of what might have been a productive day just bouncing from one to the other, writing posts, or reading and commenting on others’. When I’m not doing that, I’m surfing them to make sure I don’t miss anything. By the end of the day my already inherently-challenged attention is so fragmented that I can’t seem to focus on anything, and it feels like my mind has been reduced to colorful confetti and scattered across the world.

Confetti

In a typical week the computer is the second place I go to in the morning (after the bathroom, naturally) and the last place I’m at before bed. I’m in front of one nearly all day for work. I have all my social network services available on my iPhone in case I’m not at a computer. If I don’t check on things for awhile, I start getting antsy, and will find myself interrupting another activity to take a quick look. I am completely enmeshed.

Traveling to Aruba over Christmas revealed an interesting twist to this. Roaming wireless data service on the island cost about $10 per megabyte, and text messages were about $1.50 each. Once Aaron and I resumed breathing, after the sticker shock wore off, we quickly shut the phones down and put them in the safe. Most of the time we were out doing things, even if it was just lying on a beach, and only hooked up our laptops to (briefly) check on things in the evening. Otherwise, we were entirely off the grid, for the most part. The thing is, I didn’t miss it. Being disconnected because reaching the Internet was impossible, unfeasible, or just plain costly really didn’t bother me at all, and in most ways it was a relief to unplug. The only times I found myself reaching for the iPhone that wasn’t there was when I wanted to look up some fact that had been mentioned in a conversation. The problem arises when I have the Internet right at my fingertips, and refuse to access it constantly. I might miss something!

I’m not saying it’s all bad, of course. I’ve met a lot of great like-minded (and not so like-minded) people because of LiveJournal and, despite all the bitching many people do about it, Facebook has somehow become nearly indispensable for keeping up with folks and organizing activities. I resisted Facebook for a long time and only created an account in the first place so I could see some pictures that a friend had posted. When I wasn’t looking, it managed to creep in and put down solid roots, almost against my will.

Also, the fact that I have instant access to almost the entire sum of human knowledge, in my pocket no less, still fills me with a sense of awe when I stop to think about it. In fact, let me repeat that so it sinks in:

You have instant access to the entire sum of human knowledge and history. For anyone with a smartphone, you have that in your pocket. Does that not just blow you away when you consider it? In the thousands of years of civilization, such a thing simply did not exist until about  20 years ago.

Despite the good points, my original problem remains: I am overconnected and mentally suffering for it.

So here’s the plan: I am withdrawing all of my extraneous Internet presence, and pruning what remains. As I import old posts, I’m shutting down my blogs on Vox and Posterous. I’ll import LiveJournal, but I’m keeping the account open because I have good friends who still post there. I’m discarding everything I signed up for because it was new and shiny, but never found myself using: LinkedIn, rrripple, etc. The Facebook friends list will be stripped of folks I never communicate with, or are only on there because we went to the same school once (there goes the size of my Mafia Wars clan!). When I finish, I plan to be down to a few core services: Gmail, this blog, Facebook, Twitter, and Flickr for pictures. Even Flickr may be on the chopping block, depending on how much work I feel like doing to move all my pictures to this server. As for Buzz, well, that will be hard to avoid, since it’s right there in my Gmail window. Hopefully, doing all this will help defragment my life a bit.

By the way, the irony of using a social network service on the Internet to bitch about social network services on the Internet is not lost on me.

Feb 102010
 

After dinking around with both iWeb and the demo of RapidWeaver, I decided to scrap the site I’d created with iWeb and install a WordPress blog on my site instead. I like RapidWeaver better than iWeb, and I could integrate WordPress into it, but the demo only allows three pages, one visible post on a blog page, and four pictures in a gallery. I’m not gonna shell out $80+ just to experiment with something I may not keep up with, however. Suckage.

The purpose of all this was to pull everything into one place instead of being scattered all over the Internet. I don’t really want all my writing in the hands of others, subject to corporate consolidation, policy changes, feature changes, and so on. Having a hosted website still involves a third-party, but all they do is provide blank space and keep my data backed up; the content and format is completely under my control.

Right now, however, I seem to be spending more time tinkering with the method than consolidating the content. I actually feel kind of guilty for tinkering instead of producing, but it was kind of fun to install the blog software on my server by hand and do some troubleshooting when I managed to screw it up afterwards by altering my site structure.

What’s really holding me back is the daunting prospect of importing all of my posts and pics from LiveJournal, Vox, Posterous, and Flickr, then getting it all sorted out: making sure private posts remain that way, setting up galleries, etc. Just the thought of it tempts me to leave it all the way it is and stick to Facebook but, again, I’d still be subject to the whims of another social network.

It also feels like I’m fighting against the current. Most people have moved away from personal hosted sites and onto social networks. They’re already set up for you, easy to configure (for the most part), gather everyone together in one place, make it easy to connect with others, and provide all kinds of bells and whistles. The work is done for you; all you have to do is create content, while I’m here trying to build a hut on my empty little island.

I have this image of standing in my tree fort like Calvin, shouting across the empty landscape, “This is my island! You can’t come here unless I let you!”

I’m probably reading too much into this. Who really cares what I write or where? I’ll still update Facebook and (occasionally) Twitter.

%d bloggers like this: