Safer (Soft) Deletion in Django

The Problem The default behaviour in Django is to cascade deletes, such that when a record is deleted any records that are associated with this record (via a foreign key) are also deleted. This preserves referential integrity within the database which is what we want. Where this can be problematic though is that one careless or mistaken deletion in the admin can cause any number of related records to also be deleted, with no neat way to undo the operation … Continued

Porting Apple’s Core Data Books Sample Project to RubyMotion

In this post we’re going to reconstruct the Apple sample project Core Data Books, building it step by step from scratch using RubyMotion. This will take us through: Use of NSFetchedResultsController to manage a collection of objects to be displayed in a table view, Providing undo and redo functionality via the device shake gesture, Use of a nested context to isolate changes made in an add operation. The app presents a table view of books following the master-detail pattern; tapping … Continued

Simpler Core Data with RubyMotion and CDQ

Core Data can be one of the more intimidating Apple frameworks to work with, in part because it doesn’t quite have the polish that many of the other frameworks have but also because when you’re dealing with users’ data it is worth treading carefully: imagining correcting a poorly-executed migration on thousands of remote devices should be enough to persuade anyone of that! Luckily, RubyMotion and Core Data Query can make Core Data a lot more familiar and manageable, particularly if … Continued

Exposing Private Methods Cleanly When Testing iOS Apps

When unit testing iOS apps you will want to be able to test the internal methods of your classes in your test suite but from the outside the non-public methods won’t be readily accessible. One way around this could be to make the method public; this would allow you to test it and wouldn’t break your app but now you’ve added clutter to your interface which over time could add up to a significant problem, particularly if you (or a … Continued

Recovering from Burnout

Previously when I thought of burnout I thought only of incredibly long work hours and lives out of balance, with little sleep, no exercise and so on. While on a visit to Japan earlier this year I was talking to a Big Issue seller while I waited for a friend at a train station near one of the more upmarket areas of Tokyo. He was telling me about the people who buy regularly from him and there emerged a disturbing … Continued

How to Launch a $30k iOS App using Amazon Rankings as a Guide

If you’re familiar with AppSumo and its founder Noah Kagan you will know that one of the tricks Noah and his team use to come up with so many products and business ideas is that they look at what’s already popular, what’s already selling, as part of their research. One way to do this is to take a look at a site like Amazon and browse their rankings to see what people in your (or almost any) country are buying. … Continued

Worksheet: Offering Retainer-based Services for Recurring Revenue

Problem: You’re a freelancer or an employee and you would like to have your own clients. However, the time involved and lack of certainty in finding new clients each month is wearing you down. You would like to take the one-off services you are offering now and turn them into subscription services that your clients will pay for each month, thus giving you some recurring revenue. Aim: By the end of this worksheet you should have identified: The skills you have … Continued

Don’t Put Your Life On Hold

For those who don’t get committed to their current problem, the subconscious goofs off on other things and doesn’t produce the big result. So the way to manage yourself is that when you have a real important problem you don’t let anything else get the center of your attention — you keep your thoughts on the problem. Keep your subconscious starved so it has to work on your problem, so you can sleep peacefully and get the answer in the … Continued

Starting a Business? Don’t Follow Your Passion

Scott Adams, creator of the popular Dilbert cartoon has two key pieces of advice for those of us who would like to start our own business and make a success of it: Don’t set goals, create systems instead. Do not follow your passion. Should you follow your passion or not? This is a very interesting one as it’s one of those issues that the successful entrepreneurs of the world are divided on, with each side believing that their answer is … Continued