Tuesday, 29 April 2014

HabitRPG

Three weeks ago I talked about the fitness app Zombies, Run! and this week I'm turning to a website that I've been using a lot lately. The site is called HabitRPG: it's a productivity app with role-playing elements that make it way more fun to use than other apps in this field.

The tasks screen is split into four columns: habits, dailies, to dos, and rewards. You might add bad habits that you want to cut down on (which will cause you to lose hp) and good habits that you want to do more of (which will cause you to gain exp and gold). Dailies are things that you should do once a day and will turn grey when they are ticked off.

My main use for the app is the next category: to dos. It's simple to keep my list of things that I need to do all in one place that I can access from anywhere. If there's something that I know I should do, but don't feel like doing right away, then I add it to this list.



The best part, however, is the rewards section. Here, when you acquire enough gold, you can buy new weapons, armour, and (inevitably) hats for your character. While it might not seem like a spectacular reward, I've actually found myself just a few gold pieces away from a particularly impressive sword and then actively looked for something to tick off of one of my lists!

The nice thing about this app is that it's free to use with the option to purchase gems to remove ads and speed up aspects of the game. If you think you should be more productive but need a little encouragement, this is a great app to use.

Friday, 18 April 2014

FlipTiles

There's a bit of a craze at the moment (if you can call it that) about a web game called 2048. Since it was hosted on GitHub in a public repository there have been almost five thousand forks with hundreds of people making their own derivations.

I really liked the elegance and simplicity of the design so I decided to make something from scratch but in the same sort of style. This is what I came up with.


It's a simple puzzle with a three-by-three grid of tiles that are white on one side and grey on the other. When you click a tile it flips it along with the adjacent tiles, and the objective is to get the whole grid to be grey.

I had to get to know the transform and transition elements of CSS in order to do this and that turned into a whole lot of fun trying to get the same effect across different browsers. Still, I'm quite happy with the effect and I'm quite proud of the HTML and CSS that I wrote for it.

The JavaScript, however, is a different story. I struggled to get the jQuery and JS to play nicely together and, if you take a look at the code, you'll see I sometimes resort to doing something the long way in JS because I simply couldn't get the jQ to work. I don't think it's terrible, but I think that highlights an area for me to look at in more depth.

Enjoy the frustration!

Tuesday, 15 April 2014

Coursera and Lifelong Learning

During my undergraduate course at Oxford, I worked very hard on a broad range of, well, basically, Chemistry. After all, it was what I had applied to study.

The thing is that the syllabus is tight and unyielding and almost all of the course is filled with core material -- you have to wait until the penultimate term before your final exams before you get any choice in what you study. As a result I've become very good at working in nine week sprints (the length of our terms) on a ton of work (the only amount the tutors know) without having to decide for myself what I want to follow.

Until this year, I was worried that I had lost the joy and love of learning that had propelled me through school, but then two things happened. Firstly I found the workload was lower this year and that has left me more time to pursue my own interests. Secondly, I discovered Coursera.

While looking for a good introduction to algorithms I found this website and it instantly captured my imagination. There are hundreds of courses in a wide range of subjects and you get to choose whichever ones you like!

The teaching is done through a mixture of bite-size video lectures, often with interactive quiz questions to make sure you're not falling asleep in class. Other assessments are done by a dubious system of peer-evaluation or, as appropriate, auto-graders.

The best thing is that it doesn't matter what you pick or whether you drop out after a week after deciding it's not for you. I've spent the last five weeks keeping up with a set of lectures on the Beethoven Piano Sonatas. It's been four years since I've studied music in-depth and it's amazing how the enjoyment has come rushing back.

I don't want to stop learning once I leave university, and I think this is an excellent way to keep going.

Friday, 11 April 2014

Planets of the Solar System

This week the focus of my miniproject has been out of this world! You can find it here or by clicking on the picture below.


I was heavily inspired by a Codecademy project which aims to introduce beginners to programming by giving them a template to style with CSS. In that exercise I got Earth to orbit the sun and generally make things look pretty.

For my miniproject I took it seven steps further by adding the rest of the planets of our solar system. Their relative size and distance from each other are based on the actual sizes and separations. Further, the relative time they take to orbit the sun is correct (where 10 seconds corresponds to a single year on Earth).

This week I was mostly trying to see if I could get the input buttons and dynamic resizing to work. When you click the minus button it subtracts one planet from the system and the size of the other planets (and their orbits) are recalculated to keep the screen looking full. Similarly, when you click the plus button, it adds a planet back into the system and shrinks the sizes and orbits down to make room.

I don't think this miniproject looks as suave as the last one -- the interface components are blocky and the whole thing feels angular (despite the roundness of the planets). I'm happy that I got the animation and the resizing to work, though that still feels like a bit of a hack -- you'll see what I mean if you look at the JavaScript!

In other news, I've moved the hosting to GitHub after learning how GitHub Pages work on a remarkable Udacity project. It was relatively easy to set up and I think it looks ever so slightly more mature than a Codebit. 

Probably. 

(Maybe.)

Tuesday, 8 April 2014

Zombies, Run!


My all time favourite app is Zombies, Run! by Six to Start. It's a fitness app that encourages exercise by immersing the user in a second-person narrative.

You are Runner Five, a silent protagonist with a mysterious past, who has been airdropped into a small refuge of survivors of the zombie apocalypse. It's not surprising that the sound of rattling breath and groaning coming through your headphones is a powerful motivator to keep running!

After arriving at the township you are sent on various missions to collect supplies for the survivors and even lead packs of zombies away from the town whilst the gate is under repair. During these missions you are in contact with various characters from the township who all have their own complicated lives and agendas.

Six to Start clearly have their main strength in the storytelling and narrative part of the app -- the interface can be a bit buggy and syncing your runs with their server, ZombieLink, involves more madness than method. Still, it has proved popular enough to warrant a second season of missions and reports say that they are currently working on a third.

I highly recommend this app for anyone who would like to go running but never feels that motivated enough to just get out there and do it. For beginners who want to train up a bit first, there is a 'couch to 5km' app by the same people called Zombies, Run! 5k Training. I've played through the whole of that and it was well worth the money.

Stay safe out there.

Friday, 4 April 2014

Roman Numerals

I'm actually quite proud to say that this is my first self-directed web programming project. Here's the result.


If you click on the picture, or follow this link, you'll go to the Codebit itself on Codecademy. You'll find that you can type a number in the first box and the second box will automatically update to show the associated numeral as you type! It might not seem like much, but I was so happy when I figured out how to do that.

Further, if you're living dangerously, you can type a valid numeral in the second box and the first will update to show you the associated number in base 10. Mindblowing.

I used HTML and CSS to specify the layout and colours and fields, then I wrote two JavaScript functions: the first to convert from an integer to a numeral, the second to do it the other way round. I then used jQuery to keep track of changes to the two input fields and, on detection, to update the other one.

The main thing I've taken away from this is that layout is hard. I'm going to have to take a good look at some more HTML and CSS tutorials before I attempt another mini-project. I know that you only learn by doing these things, but it would be nice to know which ways are good practice and which aren't.

Tuesday, 1 April 2014

About Me

Maybe it's time I told you a little about myself. My name is Charlie Hornsby and I've been going by the username chornsby for a fair while (see GitHub etc). I live in England, enjoy music and videogames, and I seem to be running out of shirts that haven't come from Qwertee. Seriously, for me, that site has revolutionised clothes shopping...

I'm currently studying chemistry at the University of Oxford and I'm in my final year. This means I'm in the process of writing up a thesis on the project work that I've completed this year. My area of research is in computational chemistry and has involved writing a program in Python to estimate how well molecules stick together.

It's really been this year, or academic year I should say, that I've got into programming. Partly it was the nature of my project, but mostly I've been driven by my sense of scientific enquiry and enjoyment of learning. It's especially nice to be learning skills and techniques that aren't being examined, for a change.

Just over two years ago I started dating my girlfriend who lives in Finland, and you can tell it must be serious because I'm intending to move out there an live with her while she finishes her university course in translation. I'm hoping to find work there, though I'm aware of the many challenges that face me. This is quite an important (and exciting!) part of my life, so I might write more about it another time.