Software Development

I educated custom application development in my University in Cardiff. We developed software using Java, C++, Pascal, Python, MySQL. I want to tell you a story about app development.

Back in October 2013, I took part in an event called Launch48 with my good friends Matthew Jones, Nathan Ahmad and Luke Berry.

The aim of the event was simple: Work with strangers that you’ve never met before for 48 hours straight to build a startup that’s going to make millions (umm yeah).

As stressful as the event may sound, it was actually pretty fun. Although the actual time working on stuff was probably about 20 hours when we included going home and eating within the time that we had – this made it even more of a manic weekend.

The idea that I worked on was called WannaBeASpaceman? and was pitched by Amie.

To sum up WannaBeASpaceman in a short sentence:

WannaBeASpaceman is a library of short videos for children who need help to answer the question, what do you want to be when you grow up?

After many beers, waters and slices of pizza we came up with a working prototype, a business plan, as well as a pitch of what WannaBeASpaceman was going to be (all in under 48 hours!)

You can see our final result here which is kindly hosted by Heroku.

Unfortunately, WannaBeASpaceMan didn’t take off (no pun intended) beyond the Launch48 event to make us all millionaires, but it was still a great weekend.

How to recover data loss of custom software projects

For the past 2 weeks, I’ve been working on a new application that contains quite a few custom elements. After finishing a huge chunk of the work, I decided to push the project to GitHub, as I usually do for all big projects.

custom software data loss

As I went to push the project up to GitHub, I noticed that there were some changes to the repository that had to be pulled first. As tired as I was, I went ahead and pulled these changes without actually realising that I was syncing my work with the incorrect repository! Then I headed off to bed for some well-needed sleep.

The next day I came on and freaked out to see that ALL of my work had gone – everything. I was like “hey man, has someone been on my laptop whilst I was sleeping and deleted everything?”. Then I began to investigate.

I opened my project in Finder and noticed that all Java files were in fact gone from the directory. However, I also noticed that the project folder structure was still intact. I then opened Sublime Text and noticed that all java files were inside the temporary file buffer, all code within them had gone, but they could be saved as empty files. I tried undoing changes, but unfortunately, there weren’t any to undo. I decided to delete the .git folder and re-initialise the repository to see what was going on* (big mistake – see later comments).

custom software development

I then browsed the repository on GitHub and noticed that something strange had happened – the repository had merged code with a previous project I was working on. I soon figured that I must have added the wrong repository URL when setting up the repository on my local machine.

After spending about an hour Googling for a solution, I came to accept that I had lost my work and that I would have to face my mistake and start my project again.

Just as I was about to give up hope, it hit me that Chrome stores cached versions of anything you access within the browser, so I decided to open the cache and see what I could find. I did this by typing the following into the Omnibox in Chrome:

chrome://cache/

To my surprise, I found cached versions of every single file/page I had created for the project! I saved those cache files and used extremely helpful tool to decode the raw binary versions of the cache files back into human-readable text.

Now that I had the Java back for each file within my project, I began to copy and paste each file back manually until I had a usable project again which navigated to multiple pages. I still had to code all of the java within the project again, but this was nothing more than setting up a few URL routes, which only took a few hours. A few hours is still a long time, but it certainly beats rewriting everything from scratch!

So, how could this issue been completely prevented? Well, here are a few tips I would suggest doing whilst working on a project:

  1. Backup. We’ve heard it a million times before, but we still don’t do it. You can do this by zipping your project every now and then, then archiving it safely on an external storage device or cloud service.
  2. Turn on the autosave feature in your text editor. My text editor of choice is Sublime text which supports automatic backups of your projects.
  3. Leave Google Chrome to cache files so you can recover data. This is what really saved my ass in this particular instance.
  4. Don’t re-initialise a git repository if something does mess up. You can always rollback to a previous commit to recover your work. This is something that I completely forgot about before deleting the .git folder!
  5. Always confirm that you’ve added the correct remote URL of a repository before pushing up your code. You can do this by typing the following command into your terminal:
git remote -v

This will list both, your fetch and push repository locations so you can confirm that they’re correct.

origin https://github.com/jjmpsp/xxx.git (fetch)
origin https://github.com/jjmpsp/xxx.git (push)

I hope you found the tips in this post useful and you can recover your project if it has been lost, for whatever the reason may be.

My Custom Software

The following is a list of software developed by me:

  1. Xbox 360 Game Identifier (Windows program)
Leave your feedback