This past weekend I traveled to Atlanta, GA to attend Cocoa Camp, an “un-conference” for Mac and iOS development, held at the Atlanta Contemporary Art Center. Intended to be an overnight trip, I flew from BWI to ATL on Friday morning and returned Saturday evening.

Content

I felt the content was a heterogenous mix of design-versus-coding, and beginner-to-intermediate. There were even a few general development-career-focused sessions.

Design

I’ll start with the positive. The design-related sessions were top-notch. I always enjoy hearing about others’ processes for designing their applications, especially when they talk about designing the UI first, then the architecture to match. Stephen Martin’s (@stephenmartin) presentation was particularly good. If I could pick one thing he said to pass on to any other Cocoa developer (Mac OS or iOS), it’s this: Interface Builder is not a design tool. Second would be (paraphrasing) “iteration, iteration, iteration.”

I gave a presentation at a NIAID developer meeting along these lines (design ahead of a single line of code) and even mentioned how much better my own design/development process was when I decided “Interface Builder is not a design tool,” and learned to sketch first, iterate out the trouble spots, move on to at least basic architecture, and only then move on to coding.

Technical

Regarding the technical sessions, I’ll be honest: I felt I got a lot more out of the design sessions. The technical sessions were a mixed bag, which is fine (some of what I had no interest in were quite popular to others), but the ones I was interested in were almost entirely beginner-level.

I had high hopes for the “Scalable Data Access using Operation Queues” session. I missed the first few minutes of the session but what I did catch was more like a basic introduction to NSOperation/NSOperationQueue. The session did not last long, but it was well-delivered (so I hope Greg Martin does not take this the wrong way).

The problem was the title. It led me to believe I’d see some awesome, modern data access (as in files-on-disk or database access) wizardry. The Q&A session afterward was insightful, and had I not been on the verge of heat stroke standing in the hottest room there, I might have contributed to the “how much is too much in an NSOperationQueue” discussion.

Perhaps the Cocoa Camp organizers can prevent this in the future by requesting a summary and making sure the titles are a little more precise before posting the session information. Even better, they could post the summaries themselves (which were not included on the schedule).

Career

Because there were no other design or technical sessions that were relevant to me late in the day, I attended Ryan Taylor’s session titled “Refactoring Yourself As A Developer.” I thought much of Ryan’s presentation was full of great suggestions, but again, it seemed to be aimed at younger developers just starting out in their career.

The first half was a gratifying laundry list of good practices I had already been employing myself (yay – I’m a “good” developer!), whereas the second half sounded to my experienced ears more like a career day speech to high school interns. That’s not meant as snark – again, I had no problem with the mixed-bag approach, even within the same session, as there were plenty of young (or older beginner) folks there.

Twitterfall

The Twitterfall Wall

I thought the use of Twitterfall to track Twitter mentions of @cocoacamp and the #cocoacamp tag was a nice touch, though I wouldn’t be brave enough to leave my laptop perched atop a stack of stuff with that many people walking around. It was nice, however, to see others’ comments. I made a thoughtful contribution myself. Josh Johnson (@jnjosh), a Twitter friend, was there as well. It was great to meet him in person. I seem to be collecting friends from the Raleigh/Durham area, but I probably shouldn’t have taken Josh and Sal Conigliaro (@salconigliaro) out of their boxes so as to retain their value.

Criticism

I’ll say it: the conference had two glaring problems – traveling sound and insufferably hot air.

Sound Travels

The art center is one of those a nicely-remodeled factories done in the exposed-ductwork-brick-and-beam industrial style. It’s meant to be a contemporary art gallery. The pictures on the Cocoa Camp web site show how well the space works for that purpose. What they don’t show is how poorly it works for the amplified voices of multiple presenters echoing throughout the building. This made it very difficult to concentrate on the presenter of the session you were actually attending. I had the impression this was the first time the event organizers had used that particular venue – I can’t imagine them willingly choosing it a second time, especially if you also consider the air conditioning issue.

A Bunch of Hot Air

There was a whole lot of hot air being blown around the center. That’s not my commentary on the presenters, but a literal statement. From the moment I walked into the center, I noticed it was a tad uncomfortable. I hesitate to use the word “stuffy” because it didn’t get bad until the majority of the conference-goers showed up. Atlanta is a warm place by my standards, but every building I was in prior to the art center was nicely air conditioned.

Perhaps more frustrating than anything is that the AC would come on, blow a tantalizingly cool breeze for what seemed like exactly three nanoseconds, then shut down. It got so bad in the presentation areas I was forced to move back into the main part and strain even harder to single out the presenter I wanted to pay attention to. I’m not sure if I was exactly the first, but I was certainly one of the first to post a complaint. Shortly thereafter, I want to the people out front – one of whom was an employee of the art center – and gently suggested mine wasn’t the only dripping brow.

I must say (quite proudly) that my knack for innovation does not stop at software development. I foggily brainstormed for some sort of solution that would allow me some relief so I could better concentrate in the sessions. I remembered I had several Ziploc baggies with me, one of which contained my travel toiletries that was mostly empty. I dumped its contents into another and grabbed a fist-full of ice from the drink coolers. MacGyver would’ve been proud of my anti-goddamned-heat-stroke ice bag, which I kept on my thigh, held with my wrist in my lap. Now that’s an urban survival tactic!

In their favor I’ll say this: the art center employees finally recognized the problem and cranked the AC (steady-on) for the last two hours or so of the conference. The needle in my head gradually backed away from the red area and down around mid-yellow. Read on to find out why it never quite got to green.

Suggestions

So, if any of the Cocoa Camp organizers are reading this, I humbly request future events be held in a place that provides better sound isolation and that pays better attention to climate control. Those two problems plagued the event. Less pressing but still important is reviewing (and posting) a presenter’s summary – a title can be misleading and such a thing is far easier to catch if a summary is available.

Food, Family & Fun

Max Lager's

Max Lager's

Visiting Atlanta gave me a nice opportunity to visit with my dad for a bit. He lives an hour South of Atlanta with his second wife and drove up to have drinks and a bit to eat. I’m normally a wine person (as my profile prioritizes) but I never pass up a local brew pub.

Max Lager’s was, as luck would have it, right next door to Hyatt Place Atlanta, where I stayed. Possibly the coolest manly name ever (or the saddest alcoholic’s name ever – “My name is Max Lager and I’m an alcoholic.”), I quite enjoyed the 8% ABV Max Abbey brew. A lot.

Later Friday evening, at the JCT Kitchen & Bar, I met up with Sal Conigliaro. I first met Sal at WWDC 2009 and he did not forget I owed him a few drinks. At JCT, “A Small Orange” sponsored a pre-conference meetup and we were told to mention “A Small Orange” to get free drinks. After a few of the deliciously-free drinks, I discovered it was great fun to confuse people by handing them the small container of orange wedges kept at the bar for drinks. In all, it was a fun night.

No Sick Leave; Leave Sick

On a less fortunate note, I found I was becoming ill Saturday (the day of the conference). I suspect it had to do with the crazed sick woman at BWI. I woke up feeling fine (no hangover – I’m a professional, damn it), just with raw-feeling sinuses I initially contributed to dry hotel air. My condition quickly deteriorated. During my trip over to the center, I noticed things were getting steadily worse. During the first session, I felt like the other shoe dropped and I’d pass out of heat exhaustion.

Sleepy & Sick at ATL

Sleepy & Sick at ATL

The air conditioning issue I mentioned didn’t help matters (but I’m not suggesting it was that hot in actuality). I was feeling miserably hot and generally unwell. By the end of the day, I was queasy, my sinuses and throat were fairly raw, and my late nights and early awakenings had me feeling exhausted.

My flight back was miserable (save for a nice conversation with a delightful woman named Liz) and by the time I got home, my chest was feeling tight. I spent Sunday recovering and conquering the galaxy in Spore’s space age level (it’s fun to return to now and again). Miracle of miracles – I feel relatively good today. A bit of rawness and tightness of the chest remains, but I’m feeling pretty good.

Conclusion

So that was my Cocoa Camp experience. I have no idea if it will be received as enticement or warning, but there you have it. My judgement? It’s worth the trip and it’s remarkably affordable, but there is definitely room for improvement. I’d go again (but with emergency DayQuil and a liquid cooling system just in case).

 

I’ve been reading about John Stewart’s and Stephen Colbert’s Rally to Restore Sanity vs. March to Keep Fear Alive. The way Stewart sold it is from the angle of “they shout loud but we have shit to do” (to paraphrase). I wanted to expand on that because it touches on a post I made more than a year ago.

In August of ’09, I responded to Barney Frank’s bitch-slapping of an idiot at a town hall meeting. He compared her intelligence to that of a dining room table, if I recall. I said it then and I’ll say it again: Well done.

In my response, I said:

These people … have no problem whatsoever lobbing strong, hateful missiles to promote their views. Why the hell shouldn’t we respond just as strongly?

The point I was trying to get across, now that I’ve had a year to think about it (and John Stewart’s recent weigh-in on the matter) is this: Thoughtful people tend to think that most others are thoughtful and won’t be swayed by the loud, crazy, bigoted morons of the world. This concern is an error. Since shouting idiots (those whose arguments are based on bigotry, ignorance, and how loudly they can shout) are shouting only to incite other idiots to join them, the only way to win is to shout loudly as well. It’s not the reasonable-minded people we have to worry about. It’s the high conversion rate of less-than-reasonable people into even more shouting bigots.

So I say this: Shout reason. Shout loud. If for no other purpose than to drown out the siren call of the insane bigots that seek to take control and force their views upon their fellow citizens and the world at large.

Matt and I have decided we’ll be there. Hope to see some of you there too.

 

I was looking for a better “popular posts” plug-in for WordPress yesterday, so I tried one in particular (no, I won’t name it). Shortly after installing it, I was auto-spammed by the author using my own address as the sender. I became annoyed. Jackassery ensued.

Now most of us will agree that’s pretty spammy and not at all the sort of interaction one would expect from installing freeware. As a result, I immediately uninstalled the plug-in and e-mailed the author (I had to look up his contact information since it wasn’t in his e-mail). I explained how disappointing it was to be spammed and how using my own address as the sender to bypass basic spam detection was consciously spammy (especially since the plug-in must have read the information from my WordPress configuration without asking). I said I won’t be using any of his plug-ins in the future based on this action.

His response, while veiled in reasonable tone, was based on a less-than-convincing argument:

Joshua, thanks for your feedback. I’m sorry that something I’ve contributed dozens of hours to and let you download for free, to use for free and without registration offended you.

Okay, so we’re going to completely side-step the clearly-stated issue and plead the “I Died for Your Sins (and Your Blog)” case. I get it – the author is an asshat. As both a consumer and author of freeware, I fully understand and applaud the effort and generosity behind freeware. I give good ratings for good software and I recommend it to my peers if the topic comes up.

But that doesn’t give you the right to spam me intentionally, nor is it any kind of defense for your actions whatsoever.

I cannot remember a single instance where I was spammed for downloading freeware without having given my address first, nor have I ever even asked anyone for their information in exchange for downloading my own. I think it’s wrong (and a little slimy) to do so.

… and dozens of hours for the WordPress plug-in equivalent of “Yet Another Beginner’s Recipe App”? You’re doing it wrong.

 

I posted some source code (JLNAutoSizingTokenField) in response to a StackOverflow question. It’s another NSTokenField subclass that auto-sizes itself after editing and provides a method to flag it for autosizing.

The purpose of its -setNeedsSizeToFit: method is to get around the OP’s problem of the token sizes being different than the string sizes set with -setObjectValue:. Though the OP is using a different class (for vertical resizing), this approach can be easily adapted to the vertically-resizing class he mentions.

Download the source here.

 

Since my Twitter complaint about gdb under Xcode suddenly refusing to let me examine symbols, I’ve gotten a lot of search hits on my site for the “unable to access variable xcode” key phrase for my post titled “Unrolled Loops, the Debugger, & YOU“. I figured I’d share a more complete post on the subject of buggered debuggers for the most common causes.

The Symptoms

You might see an “unable to access variable” message when using “po” (“print object”) in the debugger console or by hovering over a symbol. Some objects may show nil ( 0×0 ) if you print them or hover over them as well. Even an array might show as non-nil but with zero elements. You might see other messages (which have slipped my mind) as well, but in general Xcode’s helpful GUI debugging elements and even gdb’s console suddenly become most decidedly unhelpful.

The Cause

The cause is simple: either there are no debugging symbols in your app at the time of debugging or you’ve optimized something somewhere in such a way that the symbols are either gone or don’t make sense.

Possible Cures

There’s no universal checkbox that’ll fix this problem for everyone, but there are a limited number of things to check.

Release Mode

By far the most common cause is you’re trying to debug a release build (whose debugging symbols are stripped down to nothing or close to). The resolution for this should be obvious, but in case it’s not, switch to debug, rebuild, then try debugging again.

Project/Target Info Settings

In Xcode 3, project and target build information is complex (I have it on good authority that it’s going to get a bit simpler soonish). There are project- and target-level settings per configuration (as in “Debug” or “Release”). Make sure at all levels under “Debug” configuration that the following conditions are met:

  • “Strip Debug Symbols During Copy” is unchecked.
  • “Generate Debug Symbols” is checked.
  • “Optimization Level” is set to “None [-O0]“.
  • “Use Separate Strip” is unchecked.
  • “Additional Strip Flags” has nothing set (I don’t think this matters if strip isn’t run).

Basically you want all debug symbols, no optimization, and no stripping (your beta code isn’t mature, and minors shouldn’t be strippers anyway).

Per-File Compiler Flags

This is what bit me. If you “Get Info” on an individual file (like Foo.m) and switch to the Build tab, you’ll notice the largish text box wherein you can place “Additional Compiler Flags for Target…”. Make sure there are no flags here that have anything to do with optimization. In my case, I chose “-O3 -funroll-loops” and this was my problem. Xcode 3 gives you no way to set these per configuration (ie, only use these flags in Release mode). This option was causing loop debugging to become loopy based on how the concept of “loop unrolling” (or unwinding) works.

Conclusion

So … I hope that helps. Feel free to add any other conditions (or corrections) via comments.

 

Today I griped about yet another headhunter sending career spam (blasting anyone who remotely matches a keyword search with jobs that have nothing to do with their qualifications, accompanied by a request to send them your resume if you actually match the qualifications). Real (relevant) job offers are invited; career spam results in your domain being blacklisted. I mentioned that my blacklist auto-response contains more instances of “asshat” than the word “the.” Someone challenged me to post it. I’ve met that challenge. Your move.

Asshat Blacklist Autoresponse Template

 

A quick vignette of a passing interaction at work.

I snagged my finger on a sharp edge and yelled, “Ouch! Sonofabitch!”

A biologist coworker – sounding perhaps too eager – said, “What’s wrong? Are you bleeding?”

What I said: “No, I’m alright.”

What I thought: Stay back! There’s no blood! Damned vulture biologists! Always trying to make multiple-assed monkeys with the blood of the unsuspecting!

Yeah … I should really keep my thoughts on the inside.

 

I’ve just completed a 16-hour (off and on) “what the fuck?!” session with Xcode (3 and 4). Specifically, when debugging a specific class, gdb kept telling me, “Unable to access variable…” any time I’d “po” a variable or hover over the symbol in the editor. I blamed plenty of different possible culprits.

I didn’t remember having changed any of the target’s settings, but I tried playing with various combinations of compiler, debugging symbol levels, etc. to no avail. Because I’ve been testing Xcode 4 heavily, I then assumed the problem had something to do with having 3 and 4 installed alongside each other. To test this, I tried simply reinstalling 3. No luck. Uninstalled 4 and 3, reinstalled 3. Still no luck.

Frustrated beyond all fucking reason, I started stepping through every single call that lead up to the problem area. An interesting pattern emerged. Everything worked fine (po and hover-over-symbol) until I’d get inside a loop in certain files. Now it took awhile for me to notice this because of its apparent intermittence. Then it hit me. Those were files I … er … optimized.

Long story short: the “unroll loops” compiler flag and the debugger don’t get along very well.

I had forgotten that for some of the “loopier” classes I’d set this complier flag and gained measurable performance increases. I did this by clicking the file, then hitting Cmd-I for the file’s info. Under the build tab, I added this:

-funroll-loops

So once I removed this, magically the debugger (and Xcode’s editor) began providing helpful information once again. As I said on Twitter, it’s quite a stupid thing to lose two days over.

(sigh)

Update: For other causes and cures for debugger problems, see my post titled “Buggered Debugger“.

© 2011 Joshua NozziJoshua Nozzi is a Cocoa developer for hire.Suffusion theme by Sayontan Sinha