subscribe via RSS
I recently discovered that ikea is really scraping-friendly – they have their categories and products belonging to a category all linked very clean, and the product pages themselves include, as json, the complete product data necessary to display a product somewhere else ( say, on an iPad ). They also feature the assembly instructions linked as pdf and more fun stuff. Just open any product page and browse the source, you will discover a field named "jProductData" which is just what you want.
For the datamodel, I used ohm with redis, which takes about no time to setup and works as advertised.
If you are curious, the source is available at github.
TL:DR; CFHTTPMessage combines duplicate headers to a single string value containing all headers comma seperated. Thank you.
I am currently developing a Proxy app that visualizes requests and gives you the ability to plug-and-play like filter and modify requests, which makes it a quite powerful tool for debugging web applications, mobile apps and so on.
Of course, this tool is built using Cocoa and Core Foundation. Interesting enough, Core Foundation brings a Type called "CFHTTPMessage", which handles a lot of low-level message parsing and processing, and is really handy and quite easy to use.
There is one drawback: CFHTTPMessage is not designed to handle both the order in which the headers arrived in a message and duplicate header fields. The first point is somewhat irrelevant, as the HTTP1.1 standard points out that servers are not supposed to depend on any order in the clients – it's really only a minor issue. The latter point is complicated. HTTP relies on duplicate headers a lot, consider this HTTP request ( Real life!! )
POST /wp-admin/admin-ajax.php HTTP/1.1
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_0) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.112 Safari/535.1
Cookie: wordpress_logged_in_xxxxxx; httponly; expires=Tue
There are quite some duplicates here. So the clever guys at Cupertino just forgot to handle duplicate headers at all? No, not really. But they just didn't document what they are doing with it, which isn't that clever at all, but fortunately, the sources are available here. So after a bit of digging, I found out that duplicates are simply appended to a former header with same key, which sucks – the delimiter used is a simple comma, which is quite regularly found in header values, which makes splitting an art for itself.
A mess is not a technical debt. A mess is just a mess.
You should really read this article clarifying that, well, a mess has nothing to do with code debt.
Xcode 4.1 comes with a nice tool called Network Link Conditioner, which is basically a GUI to configure certain settings of your network to make it behave like a "Lossy Edge Connection" or something similar. Why would anyone want to do this? In a nutshell, a bunch of bugs in iOS apps are only visible in such environments and hard to catch in office settings with perfect connections. So, to work around that perfect connection, this tool has been invented
Apple-like, it looks great and ... doesn't work ( which is not that Apple-like at all ). At least on my brand-new Early 2011 MBP, it just crashes. So I got curious and ask some friends to double-check it, and bingo, they had similar issues on the comparable i7-equipped machines.
Back at home, I fired the tool on my ancient 2009 iMac, and voila, it works just fine. So.. what the hell is going on there?
[update] I tested the network link conditioner on my new i5-iMac, not a problem there.
[update] It seems Nick Pannuto found a solution for the problem, which you can find filed under the Apple Radar with the id 11013262. Thanks!
That is worth linking to just for this highlight
Look at your average web application's lib directory. I wouldn't be suprised to see a hundred JAR files there, all just for a simple search database or shopping site which even PHP would do in 10k LOC. And should you be adventurous, try to build it yourself. A world of fun! Setting up a Linux system from scratch, without any step-by-step instructions, is easier. Trust me, I have done both. Be sure you know how to spell "dependency hell" forwards and backwards before you begin.
Here you go: Why all C-like languages except one suck.. ( CC, btw ).