diary

iOS Tinkering

Posted in diary on March 15th, 2012 by ben – Be the first to comment

The project I finished last week was a proof of concept native iPad application. Given that I’m normally a web-based developer, this was a decent deviation from my normal routine. I want to jot down some impressions for others that may be considering a crossover.

For context, I’ve been developing server-side web applications for over 18 years, using technologies ranging from Perl CGI to Cold Fusion, ASP, Lotus Domino, but most recently, J2EE and Ruby. This means my brain defaults to patterns where there is no state, garbage is reliably collected (conceptually at the end of each hit), and memory is essentially infinite.

I did a couple weeks with iOS when the iPad first came out, almost 2 years ago, and remember struggling with explicit retain/release, stateful screen transitions, and visual app layout.

  • iOS5 has Automatic Reference Counting (ARC), so it feels like a garbage collecting environment. Very fluid. Since it’s just a demo, full legacy compatibility isn’t an issue.
  • Why aren’t there published stats on iOS version adoption? The only thing google returns is a study from last October, shortly after the ios5 release. If a new app wants to decide the effort to spend on diminishing returns, those stats are critical.
  • Test on the device! I was dealing with large bitonal tiff images, which while only 60k on file size, expand to 8M of raw UIImage data. By the way, Instruments doesn’t report on the data allocated by images – you have to study the raw allocations and correlate them.
  • Stackoverflow is a lifesaver. I will scan google’s results and click first on anything form that site, especially for all the idioms that are top-of-mind to daily practitioners, but not immediately accessible to those of us that are getting up to speed.
  • XCode has come a long way in 2 years. There are some nice integrations between the textual coding and storyboards.
  • The power user keystrokes in Xcode snuck up on me. Initially it felt like my only option was point and click around the UI, but I finally found ^6 to navigate the methods of a class, and Command-Shift-O for opening any file using mixtures of its name. The 3 finger swipe up gesture to toggle between .h and .m is brilliant. Now I can believe it to be an efficient IDE. Different, but good.
  • If there was any debate about Mercurial vs Git, the fact that Xcode now has native git support should tip the scales. That said, I’ve had funny hanging behaviors, and I end up checking in things from Tower, my preferred GUI for git.

What’s next? I renewed my personal iOS credentials and am transitioning my wife’s custom ipad-optimized web-based point of sale system to a native app. The route this time is more incremental, making heavy use of UIWebView to use the existing web screens, but using native view controllers for screen transitions. This way, I’ll be able to redo functionality one screen at a time.

 

Standing Up

Posted in diary, telecommute on March 11th, 2012 by ben – 2 Comments

I have converted to a standup workstation. To be clear, this is a motorized, height adjustable desk, used mostly in the standing standing position.

I won’t make this about why you should try a standing workstation, but I’ll share my motivations and lessons learned, on the chance that it may inform your own debate.

Why did I do it?

  • Posture.
    • My sitting posture is terrible, based on decades of bad habits. At a desk, I rarely sit in the “proper” position. I’m either heavily reclined (often twisted with my feet up on the desk), or heavily forward, forearms completely on the desk. I’ve never used a keyboard tray.
    • My family is seeing the benefits of regular visits to a Rolfing structural integration specialist. A tenet of of that practice is the alignment and balance of our musculature. We are more balanced standing than sitting, so constant sitting works against the alignment.
  • Walking. When I’m on the phone, I can’t seem to sit still, and I’ll pace back and forth for the entire call. It’s easier to make that transition, as well as adding walking to thinking interludes.
  • Activity. As I’ve been trying to become more active to reverse my slow weight gain over the last 20 years, the extra 50 cal/hour is a nice bonus.
  • True, there are plenty of articles about the hazards of sitting all day. Those weren’t huge motivators, other than they point out the other aspects above

What effects have I seen?

  • I move more. Rather than adjusting between different sitting tilts, I can rock on my feet, side to side, front to back, stand on one leg, etc. It feels good.
  • I sit to take breaks. Yes, it’s tiring to be on your feet for long stretches. But it makes so much sense to reverse the “best practice” of “stand and stretch every hour” with “take the weight off every hour.”
  • Related to that, in terms of practicing focus, it’s easier to tie the break to the activity of sitting, and the break is over when the position changes. It’s a good mental hack.

How did I do it?

  • I started with boxes on a side of my desk, such that I could move my laptop easily between a standing and sitting configuration. I didn’t deal with integrating the 2nd monitor during this experimental stage.
  • I gradually increased the duration of the standing sessions until I was going nearly the whole day.
  • As I did this, I became convinced that a pure standing station was unsustainable, so I shifted my sights on motorized, elevating desks.
  • I learned that the screen positions relative to desktop/keyboard height is different standing and sitting. This informed my decision to add adjustable monitor arms to the mix. (The Ergotron dual arms are a beauty to use; I wish everything were made this solid)
  • I bought my first pair of Crocs, at the recommendation of a (standing workstation using) friend as the best padding for foot fatigue.
  • I ended up buying a desk from Conset (via Jaymil). They have a wide selection, and are less industrial looking than the venerable GeekDesk. (Apparently, I’m not the only one attracted to this, because there was an almost 4 week backorder for all US distributors)
 What about a treadmill (aka walkstation)? I haven’t ruled out the possibility, but I’m hesitant for a few reasons:
  • Again, a variety of positions is key, and moving a treadmill out of the way would be annoying
  • I read that consumer treadmills aren’t rated for a duty cycle of such continuous and slow operation. Replacing motors sounds like a bother
  • Noise – the constant hum would be annoying.
Other considerations (you’re still reading?)
  • My desk accessories are most mostly unchanged from my previous post. Part of this transition though is a continued drive to minimize clutter on the desktop, so I continue to refine the wiring and other required bits.
  • In the raised position, the desk has some jiggle. This is amplified to the monitor arms, so the there’s wiggle of the screens, depending on my typing vigorousness. I need to move the desk off the carpet and straight onto the concrete floor, and I think this will be minimized.
  • There was some debate about not putting it in the corner (with my back to the door). It’s very bad feng shui (which I don’t put any stock in), although I strongly sympathize with our lizard brain’s desire to avoid the surprise attacks. But as a telecommuter, I don’t have any enemies near by.

Focus

Posted in diary, opinion on December 14th, 2011 by ben – 1 Comment

Today is a transition point for me: I officially start a new role tomorrow (same company, different division). What’s key about this  new role is how it fits into my growing awareness of the importance of focus, and how the lack of focus has been a source of stress and unhappiness.

I used to describe myself as a vicious multitasker. I was proud of how many threads I could juggle, with its corresponding appearance of throughput. “Hey, I’ve got 3 instant message conversations going, a voice call, and an active code debug session running.” Those days are gone.

Time and attention are finite resources for all of us, and while time marches on, the only thing we have ultimate control of is what gets our attention. There are constant forces seeking to fragment our attention:

  • Multiple projects. When you’ve got multiple active projects assigned by management, you need to keep up appearances that you’re working on all of them. You push each project forward a bit, never sitting down down and making major progress on a single one. In computer terms, it’s called “thrashing”
  • Lack of priorities. Multiple projects are made worse when they are all equally important. Many folks won’t admit that there’s a difference between projects being critical and the fact that one of them has to take precedence. The individual is forced to set their own priorities, and 2 individuals may choose differently, which creates conflict.
  • Meetings. Since people have different schedules, the “necessary” coordination meetings get scheduled throughout the day. Given multiple projects, you can’t find uninterrupted blocks of time to focus on the doing of the project.
My answer to those forces, after lengthy attempts to influence fixes, was just to change jobs. I hope to be able to write more about the projects and how I was able to do more on them, thanks to a structure of focus.

If I were a better note keeper, I’d have a ton of links and quotes on the subject. Here are a few:

For kicks, I’ll throw in a picture that made me chuckle. It may not look it, but I was totally having fun, in part because I was focused. This was taken the Minnesota Orchestra Fantasy Camp, where amateur musicians got to perform along side the professionals. I was obviously just counting rests at this point, but, wow, I was in the zone.

Couch to 5k complete

Posted in diary on October 29th, 2011 by ben – Be the first to comment

Couch to 5k is a 9 week running schedule to take you from being a couch potato to being able to run a 5k. I finished it yesterday, with 3 runs this week, a total of 11.5 miles, at about a 9min/mile pace. I wanted to put some notes about the experience out there, for others that may contemplate it.

I used to be one of the folks that said “I’m not made for running.” As counterpoint to that, see this academic paper from Harvard (PDF) that covers the physiological aspects of the human body that supports long distance running, or watch the TED video on the same subject. None of us are such mutants as to buck that evolutionary trend.

Granted, this was at least the 3rd time I had started the program. Earlier attempts were cancelled due to shin pain in the 4-5th week. This time, I was careful to follow the program diligently (don’t try to skip days or breaks), and I was also conscious to avoid running in a heel-strike manner.

One of the most unexpected experiences from the program was that by week 3, I was actually looking forward to the next run. I had assumed I’d have 9 weeks of will power battles to get off my butt, but it quickly became a desirable diversion from work.

By halfway through the program I was noticeably more energized later into the day for other activities, even on non-running days. Before c25k, I had a theoretical understanding of the effects of exercise on energy levels, now it’s concrete. I no longer see exercise as taking time away from other activities, it’s actually time neutral when accounting for increased productivity in other parts of the day.

Although I run alone, I had a good support network. A good friend is a maniac marathoner, and he is very supportive of all the incremental progress. Several Facebook friends are vocal about their running achievements. Knowing both my sister and sister-in-law have completed the program also drove to me to join their good company.

While my primary motivation in running is a convenient form of cardiovascular exercise, as I’m starting there’s a related goal for weight loss. I’m keeping things simple there: the running burns additional calories, and I’m coupling it with reduced caloric intake. With those two strategies, I’m at a pace of almost 2lbs/week. I’m using Lose It!, a calorie counter app, just for better awareness of which foods come with more or less energy.

I had a one week hiatus before week 9. I ended week 8, and had 3-4 days of extreme lower back and flank pain. I could sit OK, but standing straight or walking more than 100 feet was grueling. Fortunately, there is Cheryl Larson, a Rolfing and structural integration practitioner in Duluth. She identified the pain source as coming from my kidneys that had dropped out of place, a side effect of my body adjusting to the weight loss, rather than the running. She worked on my lower abdominal area for one session, loosened everything up, and put the kidneys back the right spots, and I was good to go. (I’m so thankful she had a session open up in the same week – she is in demand enough that her schedule is booked out almost 2 solid months. Perhaps we should stop referring family and friends to her…)

I have not entered any races. Heading into the winter season, there just aren’t many around. I’m not ruling out the possibility, but it’s not a motivating factor. If I find myself slipping out of the habit, I may have to pick one simply to have a training goal.

To relate this all the to the blog title, as a software developer that’s enamored with iterative development that focuses on the “the next most valuable feature,” the c25k schedule was intuitive. The first week’s “value” is focused simply on getting you out there, having early success of “Hey, I did a run!” (even if the majority of the time is spent in the walking intervals), to the mid schedule of having enough endurance to run a majority of the time, to the final weeks of simply running for greater and greater durations.

That about covers my experience and insights. Obviously, I’d highly recommend this program to friends that want a way to start into an exercise program. There just aren’t that many excuses not to!

Eating the dog food

Posted in diary on January 2nd, 2009 by ben – Be the first to comment

I reached a milestone today with my GTD project: it became usable enough that I can use it to track what I’m working on for its development.  In programmer’s parlance, that’s eating my own dogfood.  Granted, the food tastes pretty bland and requires extra chewing, but it’s edible.

A lot of personal projects are born out of the desire to “scratch an itch,” and this is no exception.  I’ll probably write more in the future about other itches, but for now, I’ll talk a bit about how this scratches my multitasking itch.

I am a vicious multitasker.  Some folks call it a blessing, others a curse.  I believe it’s driven by my desire to constantly be doing something that I will rarely allow myself to sit and be idle if my current task is waiting on something.  Things like long compiles, people typing slowly into an instant messaging window, or waiting for the microwave to heat my coffee will all cause me to take a tangent to something “more productive.”

That said, I acknowledge:

  1. There’s no such thing as multitasking.  Just really fast switching of attention.
  2. Going off on a tangent to fill an idle time slice often gives that tangent more time than it deserves.  Things like scanning the news headlines turns into reading at least 1 long article.
  3. Returning to a task takes a non-zero amount of time to re-acclimate to the details.  The longer you’re away from the task, the longer it takes to re-acclimate.

My “itches” around this issue fall into a few areas

  1. Explicit task focus.  The system should try to keep attention on the current task, and not allow the focus to be lost with a simple alt-tab to another app
  2. Minimize distractions.  When working on a task, keep unrelated things out of sight.  This is related to what I was talking about the other day, about data vs. task.  Most systems try to put as much data on the screen at a time to make it easier to move between items.  But that’s because they don’t know what your current task actually is.
  3. Accommodate interruptions.  When interruptions occur, explicitly acknowledge them, and try to help save the state of the task that is getting interrupted.  

The first thing this system does is exert the task focus.  I requires you to pick a piece of work, and you can get out of that work with either a “done”, “put away,” or an “interruption.”  Every screen reminds you of what you said you’d do.

It’s been a fun week of vacation.  As I told my co-workers, it’s not like I wasn’t going to be in front of a computer on my vacation, it’s just I’d be in front of a different computer.  I’ve also been using this as a chance to explore Grails, and I’m pretty impressed.

Starting Grails

Posted in diary on November 27th, 2008 by ben – Be the first to comment

I started my first Grails project today, using the basic project in NetBeans.  I was going to start with vanilla Groovy, but learning thick client Java seemed like more work than going whole hog into Grails.

I’ve said for some time, I’m scared to try Groovy/Grails, since I’ll probably get angry at all the time spent doing plumbing work rather than real code.  I’m on track for that to be true.  Some of the things it does by default are just scary – the scaffold pages for list/view/edit are pretty.  

The prototype I’m working on goes beyond a basic CRUD app, but I could see how this framework closes a RAD gap for the java world.

Google has been my friend – almost any question I come up with has been answered in a blog post or email message.  I haven’t acquired a book yet, although I probably should.  A series of articles at IBM developerWorks has also been a good start

Some vagaries I’m stumbling on

  • When does hot deploy work or not?  Some changes are immediately viewable (and my Bootstrap method has been refreshed), and others require restarting the app.
  • Why doesn’t code completion work in BootStrap.groovy  (Netbeans 6.5)