iOS Development Concerns

I had occasion to list all of the struggles I’ve been having with iOS lately. Maybe this will draw some advice.

RubyMotion development in general. The ruby layer isn’t a big deal, but Cocoa is huge, as is the iOS platform in general. Most reference material is written assuming you’re using all the XCode shortcuts, so it can be a challenge to track down information on doing things the hard way.

Application architecture. There are no complete real-world iOS projects on Github; what examples do exist are toy applications, with limited scope meant to illustrate a specific feature.

Database management. I’ve picked up that I should be using Core Data. It took a while to get straight, but I’ve got something that seems to be working okay for the time being. Are there issues that will come back to bite us later?

Data synchronization. I spent a lot of time thinking about how do this in a sane way. At the moment, new records are sent incrementally to the server, and a full-download is performed to ensure the client has a consistent state. I expect this to change. I have an interface that will hopefully isolate most of the application from changes in the syncing strategy, but there are still major features to be implemented, e.g. some records will be editable, and there aren’t actually multiple clients making concurrent changes yet.

API Versioning. Probably one of the next things that needs to be cleared up. Getting a version number in should be straightforward, but unlike database versioning, I haven’t forced a test case, and even then there aren’t old clients hanging around trying to access an old api that needs to be maintained. (of course I’m not testing DB jumps of more than one version either)

Custom views everywhere. It feels like I need half a dozen custom views for every screen, making every screen a long slog, filling in elements piece by piece. State and events have to move up and down the view hierarchy, and it seems like I’m defining glue methods at all the intermediate levels. Autolayout seems really verbose, but unspecified dimensions are unspecified, and who knows what they’ll do in the future.

Layout updates. There is a current issue where the certain cells don’t update their size when the finishes downloading. Might be something simple, but I know I’ve spent time on it before.

Image sizing. I took in an image a certain resolution, scale 2, and couldn’t get out a modified image at the same resolution and scale 2. I found a combination that drew to the screen in the desired size, so it may not be worth spending any more time on.

Leave the first comment

SQRL: Solving the Login Problem at Software Craftsmanship McHenry County

“Secure, Quick, Reliable Login” is a proposed technique to replace username/password login, as well as third party logins providers. SQRL (pronounced “squirrel”) provides an extremely user-friendly day-to-day workflow – the user simply scans a QR code on the page using a dedicated application, verifies that it refers to the correct site, and is then logged into the site. Other client options include clicking or tapping a link to run a local plugin or application.

SQRL uses sound and proven cryptography to provide a user-centric, fully decentralized system with an extremely easy day-to-day workflow. The only secret information is held by the user, which provides no place for third party tracking and insulates users from data breaches at service providers. A little bit of complexity creeps back in to the protocol for reclaiming a compromised ID, but this should be a extremely uncommon occurrence.

Comments Off

Git Q&A at ChicagoRuby

This has two main features. It starts with a brief conceptual overview of how Git works, and then uses that as a basis to talk about a couple of common questions. The presentation was mostly visual support, so the answers aren’t always in the slide deck.

This is the same as the FVCP presentation from the past week; a speaker dropped out and I happened to have this ready.

Comments Off

Git Q&A at Fox Valley Computing Professionals

This has two main features. It starts with a brief conceptual overview of how Git works, and then uses that as a basis to talk about a couple of common questions. The presentation was mostly visual support, so the answers aren’t always in the slide deck.

Comments Off

National Day of Calendar Hacking

I went solo for National Day of Civic Hacking. I attempted to run an unofficial event at the Elgin Technology Center but I put off the marketing and partnerships too long. Summer seems to be tough for suburban groups – several of the meetups go on hiatus.

Project 1: Elgin Area Chamber calendar

This may have been a little bit of stretch for civic hacking, but having to browse to the Elgin Area Chamber events page every week to see if there were any events that fit into may schedule was kind of a pain. So I built a program that scrapes the chamber events page and produces an iCalendar file which allows you to download elgin chamber events or subscribe to elgin chamber events

This took about half of Saturday.

Project 2: Farmers Market calendar

I had been wondering if tracking local farmer’s markets would be an appropriate activity. My fears were put to rest when I saw that an official challenge to hack farmer’s markets had been posted.

I originally wanted to do something with Disk Clock‘s week view, but the USDA Farmer’s Market Directory API didn’t have any affordances for cross-origin requests – presumably the javascript examples were only tested on their own site.

Since I’d just been working with iCalendar, I decided to try and rework the chamber project into a market feed. I actuality, I was able to reuse very little of the code – a little on the iCalendar side, but the API parsing was completely different, and since it’s a dynamic search I needed to present a form and immediately generate the calendar file – the chamber calendar is a singular artifact, so I was able to generate it once a day and upload to S3.

Farmer's Market Calendar

The information in the API isn’t as complete as the information available on the main site, and even produces invalid JSON with a trailing comma. But that was an easy fix, so now you can go get a Farmers Market Calendar for your area and never forget your local market again.

Comments Off

Classes Are Premature Optimization: Prototypes in Javascript at Fox Valley Computing Professionals

This talk is a mash up of two others:

The hard crunchy shell claims that Classes are premature optimization, forcing the programmer to freeze method implementations and often memory layouts during the design stage in order to make things easier for the compiler writer. Classes are also accidental complexity forcing the programmer to deal with rules and limits unrelated to the problem domain, and sometimes expend extra effort working around the class system. This talk will gaze into the soul of object oriented programming to see why classes might not always be beneficial (though they often are). We’ll look at alternate visions from the hard core classlessness of Self to the modern renaissance of Javascript.

The soft, melt-in-your-mouth center is an intro to the prototypal objects implemented in Javascript. Javascript objects are basically maps from strings to values, with a few extras, like dot indexing and prototypes. Prototypes are a way of relating objects so that one, the prototype, can provide default values for another.

Finally, we crunch out with a review of patterns for the proper application of classless patterns.

FVCP had a speaker drop out on the day of a meetup, and I was able to combine two previous talks to make sure members got some good content.

Comments Off

An Exercise in Extreme Modularity at ChicagoRuby

I have a rails project which is composed of gems. One of those gems is a rails app which depends on the others.

This was an on-the-spot lightning talk put together with only a few minutes preparation.

Comments Off

Paths, Properties, Paint: HTML5 Canvas and the Pervasive Pixel Painting Protocol at HTML5 Milwaukee

Sometimes, stacking divs and fiddling with CSS just doesn’t cut it. The canvas tag gives us an escape hatch – an infamous blank rectangle. Unlike applets and Flash, canvas is orchestrated by the same javascript you already use to run your web site. Canvas is a strange beast however; while it gives us a “blank canvas” perfect for painting and blending effects, the API is largely vector based, which makes it easy to do shapes and outlines that can be smoothly transformed.

We’ll take a deep dive into the way canvas “thinks” – the drawing model that you’ll need to bend it to your will. This same drawing model reappears in a number of other systems. Along the way we’ll also take a short peek into computing history to see how this hybrid vector/raster model came about.

Comments Off

Jump to Errors in Ruby Koans with VIM

I attended a Ruby Koans hack night the other day. Since I already know most of Ruby, I decided to see if I could get VIM’s make quickfix support running on the koans – the program prints a file and line, so at best it will just work and at worst I’ll have to get into writing an output parser.

Quickfix Mode

Quickfix mode (:help quickfix) is a feature of VIM designed for grabbing compiler output and stepping through the errors and warnings. VIM parses it into a list of file, line, message. It can jump you to the file in question, and has facilities to step back and forth through the list. Quickfix mode is also used by vimgrep and the Ack plugin to allow you to step through search results – which is where I spend no small part of my time.

WIth the ack plugin:

:Ack mystery_method

The plugin auto-opens the quickfix window. You can use :copen to do it yourself. Once you’ve got a list of search results (visible or hidden), you can step through the list with :cn[next] and :cp[revious]. I do this so much that I bound C-n to :cn

nnoremap <leader>a :Ack 
nnoremap <C-n> :cn<cr>


The :make command runs the make program, make by default, and puts you into quickfix if there is anything that looks like a file-line pair. The make program is defined by the vim setting makeprg. I don’t do the koans very often, so I just set it at runtime.

" wrong
:set makeprg=rake

Unfortunately, this simple version doesn’t quite work. The koans helpfully provide text coloring, which is great for terminal use, but VIM sucks the control codes into the filename and gets confused when it can’t find the file. I initially hacked the rakefile to remove the offending codes, but with a moment’s reflection I realized that the koans might just have an option to deal with this. A little code inspection turned up the NO_COLOR environment variable.

There is just one more complication: you need a space between an env variable and the command, but spaces separate settings passed to the :set command. So, we’ll have to escape the spaces.

" right
:set makeprg=NO_COLOR=true\ rake

Now just :make and VIM should jump you straight to the first line that needs your attention. The koans only report one error at a time, so you’ll need to :make after every change – this might be a good time for a runtime keybinding.

Comments Off

Intro to Ruby at Elgin Technology Center

Ruby is a dynamic, object-oriented programming language with lots of cool stuff. It has attracted a community of creative, fun-loving, passionate people, who have generated a great quantity of conferences, videos, web sites, tools, companies, and hot job market to boot.

Comments Off