Posts Tagged ‘code’

This is how programmers REALLY spend their time

Thursday, June 29th, 2017 | Programming

Many people imagine that software engineers spend most of their time writing code. Even in a perfect world, that would not be the case. A properly planned and designed system is always going to beat out a rushed and poorly designed one. But regardless, we are not in such a world. In reality, our time looks like this.

Atomic commits

Thursday, August 9th, 2012 | Limited, Programming

If you’re using version control (you are using version control, right?), the question sometimes comes up as to how often you should commit.

I’m a commit fanatic, I like to commit as soon as soon as I can, no matter how small the change. Other people prefer to wait a little and make large commits all at once. However often you choose to commit, you should make sure it falls within the constraint of being atomic.

This means that each commit is one single, complete change. That is to say that you shouldn’t commit multiple changes at once, nor should you commit a change that is only half done. This is scope in this for different approaches of course “one single, complete change” could be part of a several step refactor as long as the changes stand on their own, so could committing the refactor at once if it is all part of the same unit of work. But the important thing either way is to try and stick to atomic commits.

Think of it like an ACID transaction. Presumably you’re system works before you make the commit and it should work after too. It should contain just one feature so that if you want to roll that specific feature back, you can roll back that one commit without rolling anything else back.

With Git, where people may want to take out of sequence commits, this becomes especially important. People may want to take one of your changes, but not the other, so making sure two changes are in two separate commits is very important. Generally, if your descriptive commit comment (you are writing descriptive comments, right?) contains the word and, you probably need to re-think your commit.

SocietasPro v0.2

Wednesday, November 23rd, 2011 | Foundation

We’re pleased to announce the second iteration of SocietasPro is now available to download! As we mentioned in our last release, we were hoping to have this iteration out by the end of the month and we’ll pleased to see we’re well within that deadline.

What has changed in this release:

  • So many bug fixes they aren’t even worth listing 😉
  • Ability to order pages
  • Ability to filter audit trails
  • Magic getters added to objects
  • Added Bug Scanner to pick up on coding errors
  • Audit trail now translates
  • Restructured the file and directory layout
  • Added Klingon translation
  • Implementing namespaces into coding framework
  • Implementing stackable error messages
  • Partial saving is now done even when there are errors
  • Improved handling of database errors
  • Added submenus to each controller
  • Custom columns for the members system
  • Adding group name option
  • Admin module has a fresh new look
  • Expanding the control panel

Here are some screenshots too:

SocietasPro v0.1

Sunday, November 13th, 2011 | Foundation

This is a process report on the community group management application, SocietasPro, which we announced last month.

The first iteration of the application is now complete. The developers among you can download it from GitHub. That doesn’t mean that it’s in any way complete. but as it is being developed it an iterative development cycle we want to get something out as soon as possible.

We’re hoping to have version v0.2 out by the end of the month which, all being well, will be the first version we can install and open up to gather general feedback from.

We’ve also got a shiny new logo…

Poker Stats Library

Tuesday, August 16th, 2011 | Tech

A few weeks ago, I wrote some tools which would help me out in getting to grips with poker, which in general I fail at.

It annoyed me because it should be fairly simple for someone like myself to get my head around the poker maths (well, it is, pot odds are easy), so even despite the lack of social understanding the life of a computer scientist brings, I should at least be able to achieve a level of averageness in the game. I clearly have failed to do this, and so I decided a bit of work on my basic strategy was needed.

As a result, I built an interactive tool which would teach me what starting hands I should play, similar to the concept of Basic Strategy in blackjack. It presents you with two cards and you have to say what position you can play them from, if any. It will then tell you if you are correct or not, if not it will ask you to try again and if so, it will move on to the next hand.

I also wrote a tool which allows you to select the cards you have, and using the same formulas it will tell you what position that hand is worth playing from. I’ve thrown in a few other simple odds calculations in there as well.

Of course, these won’t make you a great poker play by themselves, but it should provide a good basis to learn from.

Given the tools would otherwise just disappear into the depths of my hard drive somewhere, I’ve decided to publish the code on Github. Should you have any interest, you can download the source from the Github repository. It’s all written in PHP and should run out of the box.

Btw, the images below are screenshots, but the way they have been scaled down looks rubbish. They make more sense when you open them…