How to overload the back button of a UITableViewController

Finally a technical post!

I was doing an iPhone assignment the other day where I am creating a simple FTP directory listing app. The problem was that I could change views during an FTP call (asynchronous) by hitting the back button, but the request would continue and then break my app with an “EXC_BAD_ACCESS” error. So I wanted to be able to run code on that back button press to stop FTP request.

However, this is not a simple thing to find out how to do! Some people on StackOverflow suggested putting in a custom back button with a selector pointing to a function, but the new button didn’t look as nice as the default one and lost the naming features. But then I came across this which suggests to use viewWillDisappear. I kill the FTP connection in this function (if its currently running) and now everything is peachy!

- (void)viewWillDisappear:(BOOL)animated {
NSArray *viewControllers = self.navigationController.viewControllers;
if ([viewControllers indexOfObject:self] == NSNotFound) {
if (self.activityIndicator.hidden == NO){
[self stopReceiveWithStatus:@"Cancelled"];

NSLog(@"View controller was popped");


App Review: Mental Calculation2 Minus

I have often been told that I exceed at math, especially when it comes to mental calculations. I was excited, then, to be able to approach my mathematical Achilles’ heel: subtraction. For whatever reason, addition has always made more sense. Although in all fairness, I don’t think many would say that they prefer subtraction, so much that they add by subtracting a negative value.

It is with this background that I approached Mental Calculation2 Minus (free), the latest in a series of math tools created by tatsuya itoh.

The app is relatively simple in layout and design, simply choose the number of questions you want to answer and then how many digits in the minuend and the subtrahend (I had to Google that, I do numbers not words!). This gives a range of 20-100 questions and 1-1 to 99-99.

Mental Calculation2 Minus gameplay

The gameplay involves a rapid-fire style questioning system, but with a catch: the next equation is somewhat visible behind the current. This information is not much help when you are trying to figure out 75-38, but it can certainly help to increase speed when solving 7-5.

The rounds are timed, and lend themselves well to online leaderboards. Fortunately Itoh has one for each combination and they are already hotly contested. I am proud of my current stance of 15.45 seconds for 20 questions, putting me at 9 of 222 players.

As this is a free app, it is not surprising that there is minor advertising. However, this is limited to a small bar on the bottom of the home screen which links to the developer’s page in the App store.

For anyone looking to brush up on there subtractions, or people looking for something in the vain of the math portion of Brain Age on DS,  Mental Calculation2 Minus (free) is an easy recommendation.

What Computer Engineers should know about Socially Responsible Engineering

Note: This opinion piece was written for Engineering 7102: The Engineering Profession. It was proof-read by my other group members: Adam Sheppard, Grant O’Brien and James Power.

Professional-looking hackerSome say that the atomic bomb brought about the idea of socially-responsible science. We believe that the increasing importance of computers requires focusing our attention on socially responsible engineering. Moore’s Law dictates that computing power doubles every 18 months and was accurate for much of the 20th century. Even with Moore’s Law becoming a thing of the past [1], our increasing dependence on digital devices leaves us in a vulnerable state. Current-day engineers (and computer engineers in particular) need to heed the call of ensuring that these magnificent and marvelous machines are not used for evil. There are computers in cars, computers in shoes, computers in our pockets; all of which are owned by many people in modern society. There has never been a time when the work of computer engineers has been more closely engrained into society.

Continue reading

Batman: Arkham City Reflection

***Spoiler Free***

I’ve had Batman: AC collecting dust on my shelf since Christmas. I’ve had lots of opportunities to start playing the game, but never got around to it. To preface my reflections: I’ve played Arkham Asylum as well as seen Chris Nolan’s recent trilogy of movies, but I have not read any of the comics or really remember the older movies or TV show(s).

As I am currently between school and work, I’ve had a fair bit of time for video games, but in 12 days I managed to spend only ~4 hours playing Batman: AC. I had even moved on to playing Assassin’s Creed: Revelations, before resolving that I really should give Batman a fair shake. Call me a sucker for a good story, but I was completely lost and underwhelmed by the events of this game. Besides the fact that I was often confused by the sequence of events, I don’t think the game did a sufficiently good job of setting up the foundation story. Maybe the fact that I’m not really familiar with the large supporting cast of bad guys didn’t help.

Continue reading

A Birthday Gift For The Ages

When I was a kid, I was always disappointed that some relatives wouldn’t give me money as a gift in lieu of itchy sweaters and pants that would fit my sister (who is half my size).

As it turns out, however, I am now one of those people also. One who doesn’t like to give money as a gift (although I would give money before a gift card, those things are evil ingenious).

So after a request for money from a family member who is purchasing an expensive gadget, I wanted to do something different.

Continue reading

More polls than I could ever offer

For the unaware, there are places on the internet where you can do lots of polls.

One such place is

You don’t need a Reddit account to do the polls; just click on the title and you will be well on your way to scratching that sample itch.

I will note that not all samples are created equally, these are most/all created and maintained by individuals. Some people do post the results after a few days, but that’s not always the case. They also don’t necessarily have sensible answer options, but most of the polls are well-formed.. I will also note that, while there is lots of interesting and thought-provoking content on Reddit, there can be mature content (even in polls). Viewer discretion is advised.

I plan to link to the occasional survey from Reddit, and will consider putting my future ones on there also. But don’t worry, I’ll still provide a link to it here also!