Archive for 'iphone'

Building POST data manually

July 20th, 2009 – 7:50 pm
Filed as: code, iphone

After spending quite a while trying to figure this out I’m posting it as a reminder in future

POST http://example.com/upload.php HTTP/1.1
User-Agent: Photo Uploader (foobar/1.0.0)
Content-Type: multipart/form-data; boundary=AaB03x
Content-Length: xxxx

–AaB03x
Content-Disposition: form-data; name=”foo”
Content-Type: text/plain; charset=utf-8

12345
–AaB03x
Content-Disposition: form-data; name=”Filename”
Content-Type: text/plain; charset=utf-8

image1.jpg
–AaB03x
Content-Disposition: form-data; name=”MimeType”
Content-Type: text/plain; charset=utf-8

image/jpeg
–AaB03x
Content-Disposition: form-data; name=”ImageData”;
filename=”image1.jpg”
Content-Type: image/jpeg
Content-Transfer-Encoding: binary

–AaB03x–

addthis_url = ‘http%3A%2F%2Fwww.c3b.co.uk%2F%3Fp%3D70′;
[...]

Calculation errors with the scientific calculator on the iPhone 3G

July 22nd, 2008 – 2:33 pm
Filed as: iphone, math

I was playing around with the scientific calculator on my iPhone last night (don’t ask me why becuase I don’t really know) and found a repeatable error with a particular calculation, the cubed root of 64.
We all know that the cubed root of 64 is 4 (at least anyone likely to read my blog knows [...]