Browsed by
Category: Uncategorized

How to End Procrastination

How to End Procrastination

What makes you procrastinate? How do you get motivated? What should you do?

I personally like the explanation provided by Temporal Motivation Theory (TMT)… Google it! But, here’s my take for now. Say you want to write a blog post/report/paper, go to the gym, etc… TMT says (and to be fair, I’m rewording an already stripped down version of the theory) that for one of these tasks

Read More Read More

Computer Science Research in a Nutshell

Computer Science Research in a Nutshell

Curious about what computer science research is? So was I.

When I first started as a research student, it would have been helpful to have had a clear and simple yet authoritative essay (or blog post) on what computer science research is and what it is that computer science researchers do. Some guidelines that would clearly tell me what was expected of me and what carrots were on offer. So, over time I developed my own (overly clinical) understanding of computer science research.

What is computer science research?

From a practical standpoint, a piece of computer science research is an academic paper or book in which a researcher(s) makes claims about algorithms, hardware, software, frameworks, models, and other things of that nature. Moreover, in my readings, I have only come across three salient types of claims:

  • X is novel
  • You should care about X because…
  • X is better than Y, Z…

where X, Y, Z… are specific algorithms, software…

All of the technical details, references, definitions, jargon, implementations and diagrams are provided only to support these claims. Anything that doesn’t support one of these claims is just waffle.

What do computer science researchers do?

Simply put, I see research in computer science as an optimisation problem:

maximise your rewards by emitting research behaviours

There are only a few behaviours available to a researcher: talking about your research, producing research artefacts (like books and papers) and submitting them to conferences and journals. A researcher will emit, assess, modify and re-emit these behaviours so as to maximise his rewards: self-fulfilment, acclamation by your peers and renumeration through employment, grants and commercialisation.

From what I could tell, that’s it in a nutshell!

Debugging International Bugs

Debugging International Bugs

I wrote a pdf generation library for my Android app because the built in one would embed uncompressed images into pdf documents, giving me gargantuan file sizes! My library embedded compressed images, and it worked like a charm. That is until a man from Norway sent me an email yelling “your app outputs blank pages!” When I received it, I immediately checked the app — lo and behold, my version worked just fine… that was not a good sign!

My app’s name is Report and Run, and I started working on it as a side project for my father. Basically, he would inspect job sites and send photos ad hoc in emails and text messages from his phone, or he would return to his office to put his findings into a proper report. I wrote an Android app that took his photos, comments and annotations and outputted them in a nicely formatted pdf report. He could send this report from his phone on-site, which saved him time. I also released the app on the play store so that anyone from anywhere could use it, which is where things get interesting.

So, I had user from Norway, and his pages were blank. I requested as much information as possible about the problem, and I was lucky because he sent me a lot of screenshots and a sample report. However, that still left the question: how could mine work and his not?

  • I checked his pdf in multiple pdf viewers; they all showed blank pages.
  • I checked his report to see if there were images were inside it; there were.
  • I checked to see if text was inside his report; there was.
  • I checked to see if characters like ‘Ø’ would break my pdf generator; they did not (even though I only supported basic latin characters at that point).
  • I recreated his report on my phone with images I extracted from his pdf… and mine still worked!

The difficulty with this bug was that the output was buried inside of a file format that was not meant to be inspected in its raw format. Thankfully, there is a tool called PDFXplorer that let’s you examine the document tree inside of a pdf document. With this tool, I compared my version and his version line by line to see why his was blank and mine was not. It wasn’t long before I spotted the difference: commas.

I learnt something new from this bug. In Norway and some other countries, a comma is used to mark a decimal place. So, for example, in Australia, we write “2.5” whilst in Norway they would write “2,5”. My pdf generator was using the default locale, and pdf viewers were getting commas where they expected periods. To test my theory, I switched my phone to Norwegian, and it broke, thank goodness! Once I knew what was wrong I managed to fix the bug in less than a minute.The bug fix looked like this

String buggyText = String.format(“%0.2f”);//works in some countries
String goodText = String.format(Locale.US, “%0.2f”);//works everywhere

I emailed him an update, and I updated the play store as well. There were two main takeaways. First, vocal users are very important. If this user had not taken the time to get in touch with me, I would have never known of the bug, and other potential users would have just deleted the app. Second, information is key. If the user had not sent me a sample report, I would not have been able to verify that there was a bug, and if the user had not sent me screen shots, I would not have been able to reproduce his report in my phone which ultimately led to squashing the bug!

First things first

First things first

My name is Jason, and I am a programmer. I started with computers at a young age, went to university to learn more, and now I am learning and doing at the same time on my own.

This blog will be a repository of the insights that I gain in the course of coding and making things. I hope that they may be of value to other coders and also to future clients and employers as a way to evaluate me for their projects.

That being said, I strongly believe that creating a clear digestible written explanation of a complex topic leaves you not only more capable of explaining that topic but better informed about it and your grasp of it. So, I hope that the act of making this blog will also make me a better coder and thinker.

With all of that in mind, I look forward to writing new posts regularly.