Ryan Booker
About Archive Replies Photos Search Stats Also on Micro.blog
  • One of the best development tips I can give you is to not leave an omega-3 capsule in your computer bag for two weeks.

    → 9:39 AM, Apr 19
  • I finally got around to moving my site from Tumblr to Wordpress. It seemed like the thing to do. Perhaps I’ll write more, and perhaps not. We’ll see…

    → 3:16 PM, Apr 15
  • How I learned to stop worrying and love the bomb

    Recently, Brandon Williams posted Algebraic Structure and Protocols, a great article describing and building semigroups, monoids and groups using Swift protocols. It’s an interesting article and I encourage you to read it (and his other articles). In fact, I’ll wait while you do…

    As with most such articles there are some simple examples, however I find the leap from ok, I see what that is, to oooooh, I see what this thing does! somewhat confounding.

    In other words, how do I spot this pattern and use the technique in my own code?

    I aired this small grievance, wondering if mconcat([1,2,3,4]) was just a fancy way to replace reduce([1,2,3,4], 0, +)1 in my code? In response, Nick Partridge said yes, but related the following real example from his work:

    I am measuring outdoor advertising views. I have many different Collectors of this metric for various types of signage with a type like: Trip -> ViewCount. e.g. A collector of views for buses seen along the trip or a collector of views for billboards. These are all independent things that I need to collate.

    This example was a penny drop moment for me. The Collector type is a monoid!

    Given a specific trip, the idea is to calculate the view counts for different types of signage and collate them in some way. It doesn’t really matter what way. Maybe we’re adding them all together for a total, maybe we’re returning a list of counts, or a dictionary of types and counts. It doesn’t matter. We’re taking a list of Collectors and a Trip to process, and returning some collation of the data.

    We can process this manually, of course. We can take our list of Collectors, pass the Trip to each, get the results, then collate them however we want.

    But if we recognise this as a monoid, we realise that a lot of that code is already written, it’s the same code that processes all our other monoids. A tiny abstraction that is common to a lot of things. We already know how to collate things. We give their type a collation operator and an identity, then mconcat them.

    In other words, we can mconcat our Collectors and produce a new composite Collector that does the collating for us. We can pass our Trip to that new Collector and obtain our result directly. For example, instead of something like:

    let collectors = [collector1, collector2]
    var result: Int
    for collector in collectors {
        result = result + collector(trip)
    }
    

    we can take a small step to this:

    let collectors = [collector1, collector2]
    collectors.map { collector in collector(trip) }.reduce(0, +)
    

    but once we’ve defined a monoid extension for Collector, we can:

    let collate = mconcat([collector1, collector2])
    collate(trip)
    

    We have abstracted away the idea of how we’re going to collate our data and instead ask for collated results directly. How to define this monoid is actually covered in Exercise 6 of Brandon’s article.

    Semigroups, monoids and groups while perhaps alien, are in fact useful and common. They’re names for patterns we encounter frequently and now recognise. Maybe you’re like me and have just realised you’re working on something monoidal right now.

    → 3:18 PM, Feb 19
  • A year already. Thanks again, Steve.

    → 11:10 AM, Oct 5
  • Gas Manager

    I’ve finally released my new gas management program for iPhone & iPod touch. Gas Manager helps you choose and blend custom gas mixes for diving. It includes partial pressure blending (with fudge factors), top off and best mix, as well as MOD, END and EAD calculations.

    Check it out!

    → 9:39 AM, Feb 12
  • RIP Hitch.

    That which can be asserted without evidence, can be dismissed without evidence.
    → 9:17 AM, Dec 19
  • gcc on Lion

    If you’re using rvm or anything else that specifically wants gcc on Lion. Install Xcode as usual, but also do this:

    1. Download Apple’s gcc: http://www.opensource.apple.com/tarballs/gcc/gcc-5666.3.tar.gz
    2. Build it http://www.opensource.apple.com/source/gcc/

    From within the source directory:

    mkdir -p build/obj build/dst build/sym
    gnumake install RC_OS=macos RC_ARCHS="i386 x86_64"
    TARGETS="i386 x86_64" SRCROOT=`pwd`
    OBJROOT=`pwd`/build/obj DSTROOT=`pwd`/build/dst
    SYMROOT=`pwd`/build/sym
    sudo ditto build/dst /
    ln -s /usr/bin/gcc-4.2 /usr/local/bin/gcc
    
    → 4:38 PM, Nov 11
  • The Thresher Shark Research And Conservation Project, Quest Magazine

    An article I wrote (with fellow GUE diver Nathalie Udo) about our experience with TSRCP in the Philippines has finally been published in the latest issue (12.3) of GUE’s Quest Magazine (available with GUE membership).

    → 8:28 AM, Oct 30
  • Points of Interest added to crashcard

    Crashcard’s map view now features “Points of Interest” showing where nearby towing services, public transport, taxis, repairers, hospitals etc are. Tapping on a POI shows you the address and allows you place a call where available.

    Available now on the app store.

    → 10:22 AM, Oct 29
  • Thanks Steve.

    → 11:06 AM, Oct 6
  • Who with the Wot now?

    UPDATE: Wot was retired.

    A little Dropbox syncing, notes app I wrote for myself is now available for everyone else.

    → 7:50 PM, Dec 18
  • Tumbocalypse

    No sooner had I flicked the switch moving the site than there was a 36 hour outage. The experiment persists for now, but I’ll be keeping a close eye on things.

    Yesterday afternoon, during planned maintenance that was not intended to interrupt service, an issue arose that took down a critical database cluster. This brought down our entire network while our engineers worked feverishly to restore these databases and bring your blogs back online.
    → 3:17 PM, Dec 7
  • Safeguard with crashcard

    Finally, crashcard is available in the App Store.

    Unfortunately, car accidents do happen. CRASHCARD guides you through the collection of important information during these stressful times, granting peace of mind and simplifying insurance claims.
    → 10:00 PM, Nov 19
  • The Thresher Shark Research & Conservation Project

    In 2011 I’ll be returning to The Thresher Shark Research & Conservation Project for a six month stint as Science Officer. Helping out on an important scientific and community project with some of the greatest people I’ve had the pleasure to meet and work with.

    I spent the best three months of my life there in 2009. Diving every day, researching sharks and mantas, and helping a small island community—through the research and its application to conservation and within the local dive tourism industry, but also directly within the community, where the project provides jobs, helped construct housing and where TSRCP volunteers teach marine biology and conservation at the local school.

    Life on the island was confronting at first. About 2 km square consisting of a couple of small villages and a few dive resorts (largely foreign owned, but where the island community gets 80% of its income), there is no permanent electricity and no fresh water. The island is powered by petrol generators prone to breakdown and drinking water is imported daily. A simple, largely subsistence lifestyle. I grew to love the island and its people.

    History

    TSRCP was started in 2005 by research scientists Simon P. Oliver and Alison J. Beckett to create a baseline of Monad Shoal in the Philippines—primarily concerned with Pelagic Thresher Shark (Alopias pelagicus) cleaning activity as well as the shoal’s coral coverage and general health.

    Monad Shoal is about 8 km east of the southern beach of Malapascua Island in the Visayan Sea—an open water seamount with a relatively square dive profile around 21–24m that plunges to 250m, presenting a unique opportunity to observe and record these rarely studied oceanic sharks.

    Both threshers and Manta Rays (Manta birostris) frequent the site, as well as a myriad of other pelagic and reef fish. Particularly the various species of cleaner fish that draw the oceanic wildlife to the shoal.

    TSRCP is a significant source of environmental, ecological and behavioural research for Pelagic Thresher Sharks, providing research, education and conservation locally, regionally and internationally.

    GUE Relationship

    Through volunteer divers (including myself) TSRCP became aware of Global Underwater Explorers, a non-profit diver training agency focussed on research, conservation and exploration, whose training methods and techniques are uniquely suited to scientific research diving. In 2009 TSRCP became a GUE affiliated project and now provides all volunteer divers with basic training aimed at perfecting the buoyancy, trim and propulsion techniques necessary for a successful research diver.

    Join Us

    I encourage any divers out there to volunteer with the The Thresher Shark Research & Conservation Project. My three months there were amazing—peaceful, eye opening and life changing. The most fulfilling ‘work’ I’ve ever done. I can’t wait to be back in 2011.

    → 2:59 PM, Jul 2
  • Air Depth Crash Bug

    UPDATE: Air Depth is no longer available. Check out Gas Manager on the App Store.

    UPDATE: Air Depth 1.3.1 is available. No more crashing on iOS3.x. Thanks for your patience.


    Version 1.3 of Air Depth contained a crash bug related to an iOS4 framework. I’ve already submitted 1.3.1 to fix the issue. 1.3 was approved in 12 hours, so I hope 1.3.1 is approved within a similar time frame.

    The issue manifests on iOS versions less than 4. iOS 4 is released on 21 July. However, 1.3.1 will fix the issue for all prior iOS versions if you don’t intend upgrading to iOS 4.

    Sorry for any inconvenience.

    → 9:00 PM, Jun 19
  • Followup on App Store Pricing and Developer Payments

    I received a message from Apple today, in response to an earlier post. I’ve reproduced it bellow:

    Hello

    Your assumptions on UK VAT are correct; the iTunes Store sales prices in the United Kingdom are VAT (Value Added Tax) inclusive, as are any other goods sold in the UK. This is required by law, not by Apple policy. You can refer to the government tax website www.hmrc.gov.uk for an understanding of VAT laws. Every customer in the UK expects that VAT is included in their price, so this is not unusual for them.

    To the contrary, USA customers are used to seeing sales taxes added at the time of checkout, and not included in the sales price of an item. This is how the iTunes Store reflects taxes—the same way customers are accustomed to seeing it as they would in any other store in the USA.

    This is address in the FAQs on iTunes Connect, as well as explained in detail to anyone who emails iTStax@apple.com.

    Kind regards, [redacted] iTunes Royalty Accounting

    → 4:52 PM, Dec 12
  • On App Store Pricing and Developer Payments

    UPDATE: A reply from Apple


    I had a rather long and messy discussion with Garret Murray on twitter today, after he expressed some concerns regarding apparent discrepancies in App Store developer payments. I think the confusion can be put down to two issues:

    1. Apple is less than transparent
    2. There is a minor misunderstanding with regard to sales taxes

    On Transparency

    The only official word is that developers receive 70% of App Store profits. Without any further details, many developers make the reasonable assumption that this equates to 70% of sales. After all, Apple made a big deal of covering all the costs for us. Unfortunately, a quick look at your monthly financial statements scuttles this idea.

    Tier 2 pricing is $1.99 USD in the US, and £1.19 in the UK. So, we might expect the following payments in our financial statements:

    $1.99 * 0.7 = $1.40
    £1.19 * 0.7 = £0.83
    

    What we find is a UK payment of only £0.72. Bastards.

    On Sales Taxes

    Sales taxes are applied to the price of goods and services. They are collected by the seller and remitted directly to the government, having no relationship with the seller’s income tax obligations.

    There are two ways to apply sales taxes. They can be included in the list price or applied at the register. For example, Europe and Australia include the tax, but some states in the US apply it at the point of sale. However applied, when considering profit margins and pricing the seller only cares about the base price. That is, the price not including sales taxes. How the final sale price is displayed is a semantic issue and the result of local laws.

    So What Happened?

    My educated guess is that Apple withheld sales tax (VAT of 15%) from the UK payment. A quick calculation confirms this as a definite possibility, assuming tier prices already include any applicable sales taxes. That is, the tier price in this case is 115% of the base price.

    Base Price  = Price * 100/115
                = £1.19 * 100/115
                = £1.03
    £1.03 * 0.7 = £0.72
    

    This satisfied me. However, Garrett wondered if Apple is reducing the price in other regions to absorb the sales taxes. I doubt it, but we really don’t know and that’s the biggest issue. There doesn’t appear to be any information available on exactly how tier prices were converted from USD.

    My guess? When the tiers were priced, Apple used the current exchange rate to convert $USD to £ then added 15%. Of course, without word from the mother ship, we have absolutely no way of verifying this. If Garrett’s right, the tiered pricing model is fundamentally broken; charging different relative prices in each region.

    Clear as mud

    Personally, I think Apple should release details of the pricing model and include a specific break down of developer payments in our monthly financial statements. However, I don’t expect to find a story dissimilar to what I’ve described above.

    → 5:00 PM, May 5
  • Busy Bee

    Things are busy here at the moment. Firstly, I have a new scuba diving app in progress for iPhone OS. With the back end work done and wrapped in a nice set of unit tests, I’m finishing off the interface, which requires a lot more thought than either Air Depth or Depth Gauge.

    Secondly, I’m working on a large rails app for a friend’s business, which is keeping me busy and hopefully fed for a while.

    On a marginally related note, if anyone has a line on some research or film related diving work, paid or volunteer, let me know. I’d like to do some grunt work underwater for someone.

    → 6:00 PM, Apr 16
  • Depth Gauge Now With More Air Depth

    UPDATE: Air Depth and Depth Gauge are no longer available. Check out Gas Manager on the App Store.


    I’ve submitted a new version of Depth Gauge to the App Store. Other than being recompiled for OS 2.x backward compatibility, this update brings an enhanced version of Air Depth EAD calculator. The Depth slider’s range is now tied to the MOD of the gas.

    Version 1.1 of Air Depth has also been submitted. Other than recompilation for backward compatibility, this is a cosmetic update.

    → 4:00 PM, Mar 22
  • Backward Compatibility

    UPDATE: Air Depth and Depth Gauge are no longer available. Check out Gas Manager on the App Store.


    A little research by Arstechnica revealed that a significant portion of the iPhone community—around 45%—have not yet upgraded to iPhone OS 2.2.1. In light of that, the next release of both Air Depth and Depth Gauge will be compatible with all versions of iPhone OS 2.x.

    → 11:18 PM, Mar 17
  • Get Dropbox

    Just a quick note, I’ve been using a great little app called Dropbox to sync documents etc between multiple computers. It’s seamless and works on all major platforms. If you sign up with this link we’ll both get extra free space.

    → 5:00 PM, Mar 3
  • Finally

    UPDATE: Depth Gauge is no longer available. Check out Gas Manager on the App Store.


    Air Depth and Depth Gauge 1.0.1 have finally gone live on the App Store. The biggest change is that both now share a lot of code (in preparation for Depth Gauge 1.1), however the visible changes are:

    1. The Nitrogen slider’s visibility is controlled by a new setting: “Show Nitrogen %”.
    2. New gas icons replace the labels to the left of each slider.
    3. Localización española.

    Depth Gauge 1.1 is almost ready for publishing. I’m just waiting on one last piece of localised text and for the resurrection of my MackBook Pro. The big change for 1.1 is the inclusion of Air Depth, allowing you to use both tools from the one application. The free version of Air Depth will of course still exist and could be considered a lite version of Depth Gauge.

    → 10:00 AM, Feb 26
  • WARNING: MacFUSE, Disk for iPhone

    UPDATE: I have my MBP back and working. The Logic Board was fried. I suspect this was a remarkable coincidence and I have since started using Disk for iPhone again. It is working perfectly. However, I can’t claim with any degree of certainty whether or not it had anything to do with my MBP’s sudden demise.


    A friendly warning. I wanted something to mount my iPhone via the USB cable. I found Disk for iPhone, a MacFUSE file system.

    Of course, this could be a remarkable coincidence; it seems odd that this would happen; but my MackBook Pro is now a brick. So stick to Air Sharing until I have more information.

    → 1:00 AM, Feb 25
  • Inconsistency Upsets Me

    UPDATE: Air Depth and Depth Gauge are no longer available. Check out Gas Manager on the App Store.

    UPDATE: I’ve seeded new versions of each app.


    So today version 1.0.1 of Depth Gauge was rejected by Apple. Why? Because it contains a disabled slider control. A control disabled on purpose and for good reason. A control included and displayed to the user for good reason.

    According to the rejection letter, Depth Gauge was rejected for two reasons. Firstly, it doesn’t do what it claims in the release notes. This is, of course, utterly wrong. It does exactly what it claims.

    Secondly, apparently you aren’t allowed to disable or automatically update slider controls. Say what? No, the HIG doesn’t mention that. No, no other documents I can find mention that. Oh and the SDK explicitly supports both things. Which you’d expect, seeing as they’re useful features particularly in the way I’m using the controls.

    By far the worst aspect of this is that version 1.0.1 has been in the queue for about three weeks, for only cosmetic changes. That’s right. This functionality was in the original version. It has already been approved.

    So what’s a poor boy to do? Send a nicely worded, if mildly abrasive, email to Apple and in the meantime, try to come up with a work around that doesn’t confuse users.

    → 12:00 PM, Feb 21
  • Depth Gauge and Air Depth 1.0.1 in the Pipe

    UPDATE: Depth Gauge is no longer available. Check out Gas Manager on the App Store.


    New versions of Depth Gauge and Air Depth are in the publishing queue at the iPhone App Store.

    New in this version:

    1. The Nitrogen slider’s visibility is controlled by a new setting: “Show Nitrogen %”.
    2. When visible, the Nitrogen slider is completely disabled and faded.
    3. New gas icons replace the labels to the left of each slider.
    4. Localización española
    → 3:42 PM, Feb 11
← Newer Posts Page 9 of 10 Older Posts →
  • RSS
  • JSON Feed