HNHacker News
TopNewBestAskShowJobs

matttthompson

1,038 karma · joined July 29, 2009

submissionscomments
matttthompson··on Automatic Remote Image Loading In an iOS Table View Controller
By the looks of it, Parse is still downloading the image as the table view scrolls (that would be only reasonable). The behavior of not displaying until the table stops moving would appear to be a shortcoming of Parse not executing its operation using NSRunLoopCommonModes. AFNetworking gets this right.
matttthompson··on Automatic Remote Image Loading In an iOS Table View Controller
NSURLCache does disk caching in iOS 5 and up, but only for http (no https) requests. Use SDURLCache if you want more options there.
matttthompson··on The Lazy Man's URL Parsing
Just came across this clever solution yesterday, actually. Unfortunately, it doesn't work for URLs containing a username and password (e.g. http://username:password@example.com). Glad to have found URI.js, though--it's exactly what I was looking for.
matttthompson··on Induction: A Polyglot Database Client For Mac OS X
Oracle support would be very awesome (and hopefully very possible). I designed the protocols to be extremely simple; check the Postgres one for an example (~500 LOC)
matttthompson··on Induction: A Polyglot Database Client For Mac OS X
Yeah, that should do it :)

Induction is my first real project with ARC, so I'm figuring this out as I go along.

matttthompson··on Induction: A Polyglot Database Client For Mac OS X
You can specify the database as the path of the connection URL. I'll add a field for that ASAP.
matttthompson··on Induction: A Polyglot Database Client For Mac OS X
Sorry about that!

Binaries are up at https://github.com/Induction/Induction/downloads

Let me know what build errors you're getting. I would do well to document the requirements (Postgres, Redis)...

matttthompson··on Induction: A Polyglot Database Client For Mac OS X
Builds are available at https://github.com/Induction/Induction/downloads.
matttthompson··on Induction: A Polyglot Database Client For Mac OS X
Thanks! It's super alpha, but I hope to iterate quickly.
matttthompson··on Induction: A Polyglot Database Client For Mac OS X
d3.js embedded in a web view. That's a sister project I'm calling "Lies, Damned Lies", and will include a variety of canned charts to plug into.
matttthompson··on AFNetworking: A Delightful Networking Library for iOS and Mac OS X
Well, the most perceptible tuning AF does is turning on HTTP pipelining for image requests (which are off, by default). Other than that, it's just small steps to use HTTP correctly as much as possible. </admittedly vague cop-out>

I understand and respect your skepticism, since by using NSURLConnection, its performance is bound by the same thing most other libraries are (although ASI was wrapped the lower-level CFNetwork APIs, FWIW). It's the stuff around the network activity--the way the application interacts with the data that makes AF fast. I've gone out of my way to design a minimal API that is performant no matter how you (mis)use it.

But you're right: I'll have to get around to writing a benchmark app at some point :)

matttthompson··on AFNetworking: A Delightful Networking Library for iOS and Mac OS X
Hey, I'm the primary creator of AFNetworking.

- As I understand threading and run loop scheduling, the run loop will spin up as needed when an NSURLConnection attaches itself to it, and back down again when no more connections are active. The dedicated network thread is there only to manage that run loop.

- Regarding processing queues, like the JSON one, I thought it would be a good idea to isolate that from the global queue; it could always target another queue if needed. Also, unless I'm mistaken, those queues should be concurrent rather than serial.

- As for dispatching to the main thread, this only happens it after all of the work in the operation is done. This just seems like good default behavior. If you wanted to, you could very easily override this by manually setting the `completionBlock` yourself.

matttthompson··on AFNetworking: A Delightful Networking Library for iOS and Mac OS X
AFNetworking boasts really fast performance in the way that it makes concurrent requests and processes them asynchronously. That, in combination with careful tuning of the stock networking libraries makes.

There are no hard performance benchmarks, but you'll get a good sense of how fast it is if you download and run the example app--I've yet to see any apps match the table view image loading performance.

FWIW, people who have switched from ASI usually report an overall networking speedup of 2-3x.

matttthompson··on AFNetworking: A Delightful Networking Library for iOS and Mac OS X
Rather than building cacheing in, AFNetworking is designed to work with NSURLCache. I strongly recommend Peter Steinberger's [SDURLCache](https://github.com/steipete/SDURLCache) fork, which includes disk cacheing on iOS.
matttthompson··on Semantic Snakeoil
You know, as nerdy as it is, it's this sort of Aristotelian dichotomy between content and presentation that I really nerd out on. I'm reminded of an old SimpleBits staple where Dan Cederholm challenged us to find the most correct way to mark up breadcrumbs. But I digress...

I'm always glad to hear about more creative solutions to solving this dilemma. In my experience, since switching to Sass, I can't really think of a case where I had to sacrifice semantics for style, but perhaps that's an effect of being a designer who's wary of such things (letting the man who shovels sh*t decide how many elephants there should be in a parade, et wot).

Anyway, I don't think I share any normative urgency, (especially with something like W3C specifications). At the end of the day, I'm overjoyed that Sass saves me from 99% of semantics issues. For that other 1%, there's always the style attribute, no? ;)

matttthompson··on Semantic Snakeoil
"It’s currently impossible to be 100% semantic and still be useful."

I disagree.

As I understand it, in this argument, "usefulness" is defined as "is styled correctly with CSS". To this end, the author cites using `"class"="span6"` on elements, which are presentational, but not semantic.

This argument may have held more clout a few years ago, but tools like Sass have pretty much solved this problem of separation of content and presentation. Using a framework like Compass allows `"span6"`, for instance, to be expressed as a function on a semantic element, leaving your markup intact.

CSS frameworks, like Twitter Bootstrap, still stuffer from this conflation, but that's just a limitation of the tools. I make no claims to a prescriptive argument on the matter--go ahead and do whatever works--but I would be interested what the author would think about Sass, or Less.

matttthompson··on An introduction to Objective-C
Looking over it again, I don't think there's a single code example in there without an error. Did he even bother to try compiling this example before posting? What is it with dangerously bad Objective-C resources for beginners?
matttthompson··on IOS Boilerplate: A base template for iOS apps
Forgot JSONKit was in there—that is a solid piece of software. I've used it for all of my projects. My bad.
matttthompson··on IOS Boilerplate: A base template for iOS apps
Completely agree. This particular stack of technologies is quite unfortunate, in my opinion. I'd strongly warn against any iOS developer using any one of these libraries, let alone all of them as a foundation.
matttthompson··on IOS Boilerplate: A base template for iOS apps
Simple block-based API, significantly less lines of code to accomplish the same tasks, and smaller, more understandable codebase that uses Foundation classes (e.g. NSURLRequest, NSURLResponse, etc.), rather than re-inventing the wheel

And though I don't have the exact numbers, AFNetworking is really fast, maybe 2-3x over ASI in average cases, from my experience and what other users report.

Take a look at the examples in the README and compare that to how you'd do the same in ASI.

matttthompson··on IOS Boilerplate: A base template for iOS apps
A much easier way to add async HTTP and image requests would be to just use AFNetworking (https://github.com/gowalla/AFNetworking)

The rest of this I could really take or leave. Really wish there was something better than EGOPullToRefresh in wide use...

matttthompson··on IOS Developers, It's Time To Ditch ASIHTTPRequest
Yeah, I'm well-aware of that, too. But it was too tempting to do a NextStep-style vestigial prefix (Gowalla was previously named Alamofire, hence AF). Fingers crossed that Apple doesn't release "Apple Framework" anytime soon.
matttthompson··on IOS Developers, It's Time To Ditch ASIHTTPRequest
Point taken; sensational headline is sensational.

ASI is a respectable library, certainly. It's been around for a long time, and it does everything you could possibly conceive of. Problem is, for most people, it does too much, and as a result, doesn't do anything particularly well.

AFNetworking does 2 things really well: API requests and image loading. 80% of the time, this is all that's necessary. For when it isn't, AFNetworking is small, understandable, and encapsulates most information in familiar Foundation classes (eg. NSURLRequest), which makes it much easier to extend than ASI.

It's a ways off from having the maturity of ASI, but I see a lot of promise in AFNetworking's design, and I'll do what it takes to keep improving it. Keep a look out for a blog post and better documentation in the coming weeks.

matttthompson··on -- --- •-• ••• • -•-• --- -•• • •• -• •--- •- •••- •- ••• -•-• •-• •• •--• -
Heh, thanks for reminding me that my Mint installation moved :)
matttthompson··on Using jQuery and the &lt;ruby&gt; tag to annotate text with Morse Code
Started out as me playing with ruby tags, and that's sort of where things went horribly wrong.
matttthompson··on Chroma-Hash: a sexy, non-reversible, live visualization of password field input
Thanks for all of your feedback so far! I just posted a bit of explanation and a response on my blog: http://mattt.me/2009/07/chroma-hash-a-belated-introduction/
← PreviousPage 2 of 2