graham.reeds/

Clean again

April 10th, 2009 :: graham.reeds
Categories: Life ::Misc ::Programming ::Work

Just finished my first week back in work and though it wasn’t a full week, does give one some confidence once again.

However, the job isn’t my ideal one – working with mess that is classic VB (could be worse might be PHP) – but it is a job all the same.

0 comments.

Final day at work

March 26th, 2009 :: graham.reeds
Categories: Life ::Work

Today is my final day at work.

0 comments.

I am now a member of the great unwashed

February 26th, 2009 :: graham.reeds
Categories: Life ::Work

With effect of Friday the 27th of March I will be unemployed by reason of redundancy.

2 comments.

Economic downturn…

February 23rd, 2009 :: graham.reeds
Categories: Life ::Work

…has hit the Bear palace. There has been an order passed down from on high in the company heirarchy that there is to be a 15% reduction in head count – regardless of rank or role.

The fact that the office where we work lose money – as we don’t manufacture anything directly – won’t help our cause.

What would normally be a plus for us we are less than six months away from releasing the next generation of our controller hardware and while it won’t reignite the market place it will enable us to be in a better position when the global economy stablises and begins to grow.

Less than 5 days will determine whether we get to release this product or whether it will be mothballed perpetually.

0 comments.

The second worst game show on Earth

February 11th, 2009 :: graham.reeds
Categories: Leisure ::Life ::Misc ::Work

Being off for a week I’ve experienced the dubious pleasure of watching Golden Balls, the second worst game show on Earth – the worst being Deal or No Deal.

The premise for Golden Balls is similar to Deal or No Deal in so far as much as you don’t have much say in the proceedings.

There’s a large amount of balls, all of which are golden, in a large rotating drum. These have a monetary value attached to them from £10 to £2,5000. They have a Clamshell/catch affair so you can open them and read the value, but they won’t open at by accident. 12 of these balls are released and roll down into another spinning drum into which a lovely assistant puts 4 ‘killer’ balls.  These random balls are then released down chutes to each player. They then position them how they choose on a 2-tiered rack and then open the front tiered balls for the world to see. Only they can see what they have.

So no player interaction so far. Now the contestants get to ‘play’. The idea for the players to discuss what balls they have and bluff about what they have. After the bluffing they decide which person to drop. This bluffing is pointless. You have no way of telling whether they are lying or telling the truth. The only logically way is to total up the values on show and make your choice based on that. Obviously killers override all other values and must be removed.

So now you have 3 players. The remaining balls are returned to the spinning drum. An additional 2 value balls are added as well as a killer ball. So they now each have 5 balls instead of 4. Again they display the front 2 balls and try to bluff about what they have on the back shelf. You have a little more information than before – you know what balls were there before. However you don’t know who has them. The best you can do is save the player with the most and drop the player with the least.

Now you have the head-to-head. This is where the true intelligence of the players shines through. The remaining balls are closed and placed at random on a field. The contestants pick one ball to bin and one ball to win. The balls are opened to reveal what the contestants would of won – like that makes a difference. If you get a killer, the value is divided by 10. So if you have 10,000 on the board and get a killer your prize fund is now 1,000. Another killer would reduce it to 100.  So killers at the start doesn’t make much difference.

But where does the player intelligence (or lack thereof) come into this? The players were going with their feelings whether a ball felt right or not. Eh? It’s a featureless golden ball – it looks like every other ball on the table. How can it feel of anything?

Okay. Now fast forward to the they end game. You have a prize fund. It can be of any amount. You have to decide whether to split (S) or steal (K). Your opponent has the same choice. There are 4 possible patterns SS, SK, KS, KK. What are the outcomes (with you first):

Recognise this? It’s a bastardized version of the prisoners dilemma. However, this version of game theory it rewards for stealing.

The correct way of doing this is to tell the opponent you are going to steal and offer them a fixed value of less than 50%. Point out that they have no chance of winning any money unless they accept your offer. Tell them what they can buy with the money. If they point out you’d be getting more, point out that my winning is irrelevant. They will be getting zero or the amount you have offered. Always make it about them. And steal.

Nice guys finish last.

0 comments.

Functors

October 5th, 2008 :: graham.reeds
Categories: C++ ::Life ::Programming ::Work

NOTE: I found this in my drafts folder, from a long, long time ago, it’s a little dated but I will let it stand as some of the points are still valid.

At work I’ve inherited several legacy projects, one large with several smaller ones that support it. Making changes is pretty dangerous – I’ve been bitten a few times by a seemingly innocuous change that has only come to light during testing. The way I use the application as the developer and the way a service engineer uses the same application is different.

So I started writing unit-tests (UnitTest++ retrofitted to work with VC6) to test my assumptions and make sure that my changes don’t break things. A major problem is testing private functions. Some can be fixed by promoting private to protected, inheriting the class and then adding testing hooks in the class. Like:

// Example.h
class Example
{
bool ThisNeedsTesting();
};

// in TestExample.cpp
#include "Example.h"
class TestExample : public Example
{
public:
bool TestThisNeedsTesting() { return ThisNeedsTesting(); }
};

TEST( TestThisNeedsTesting )
{
TestExample tester;
CHECK( tester.TestThisNeedsTesting, true );
}

Others get refactored out the classes they reside in and get put into their own functor classes – the current project has validation that is needed in several subclasses. These were first on my list to be refactored – they became functors and as a bonus made it easier to test – just a call to their public () operator. Others were functions that performed several duties. These too were split into separate functions and then split into functors as they weren’t directly related to the class they were in – they just played a supporting role.

Then I started on the larger objects. These became strategies. These strategies each implemented states via enums. These are massive classes and are a testing and maintenance nightmare – and one of these is what needed changing. According to Gamma, et al, states have a main state with empty functions. Specific states are derived from these states like so:

// I've left out the public declarations to save space
class State
{
virtual void StateOne() { };
virtual void StateTwo() { };
};

class StateBored : public State
{
virtual void StateOne() { /* do stuff */ }
};

class StateHappy : public State
{
virtual void StateTwo() { /* do happy stuff */ }
};

This really aids maintenance, extending and unit-testing as well, but it is screaming out to be functors with just the () operator being overridden in each. Like this:

// I've left out the public declarations to save space
class State
{
virtual void operator() () { };
};

class StateBored : public State
{
virtual void operator() () { /* do boring stuff */ }
};

class StateHappy : public State
{
virtual void operator() () { /* do happy stuff */ }
};

I am also sure that I will be finding more functors as I continue. Which really reduces most coding to functions – like traditional C programming. Does anyone else find them reducing nearly everything to functors?

0 comments.

Back to the grind

November 12th, 2007 :: graham.reeds
Categories: Life ::Work

After a week of leisure with my new wife it’s back to the grind to earn the bread…

0 comments.

“Sod this, I’m going back to bed”

August 15th, 2007 :: graham.reeds
Categories: Life ::Work

said the stranger on the platform.

“I think I’ll join you” I thought. Then I corrected myself: “To my bed obviously”.

A cold, wet, constant drizzle on a Wednesday morning and the 7:08 train hadn’t arrived. Nor had the 7:43 or the 8:43. In fact no trains had been seen in either direction since I arrived and it is now 9:08. I have been drizzled on for 2 hours continuous, the rain is running off my coat onto my legs and I am thoroughly pissed off. I’m going home.

So I am now in, in a change of clothes and warmed up via a nice cup of coffee. What was the hold up? According to the National Rail website there is a “PA system fault. No announcements until further notice.” Well that’s helpful. Where’s the trains?

0 comments.

Rail Chaos (again)

August 6th, 2007 :: graham.reeds
Categories: Life ::Work

I’ve been meaning to post about this but every time I look for a link regarding it there is nothing to link to.

A lot of time in the mornings have been lost to upgrading of the signals between Billingham and Hartlepool on the coast line between Middlesbrough and Newcastle – the line which I travel on the way to work. Now I can expect delays due to the upgrades and I can understand that the work is long, arduous and they have to make sure they get it absolutely right.

But the delays haven’t been caused by work, they’ve been caused by thieves stealing the copper cable used for the signals. Today was the fifth time it has occurred in the space of a month. Apparently the cable has high resell value which is why the thieves target it. Now I guess you aren’t going to get a lot for a small section – you need at least one of the giant cotton real worth of cabling, which means you will have to do a lot of work to:

  1. Lift the cable out of the runs. Even dragging the cable out will mean the use of a winch or something.
  2. Move the cable somewhere. The amount of cable is substantial – remember it runs a couple of km between signals – and will weigh a lot.

Personally I would simply electrify the cable and rig it to an alarm system. As soon as the cable is cut they know the cable has been severed and have a rough idea where. A couple of security guards with night vision goggles, tasers and dogs can cover the few kilometres of track and corner the thieves until police arrive. The coverage would be easier due the limited places where the thieves can get a van to actually move the cable out.

So the question is: Why haven’t they?

0 comments.

Did you remember the milk?

July 31st, 2007 :: graham.reeds
Categories: Leisure ::Life ::Work

Recently (in the past couple of weeks) I’ve started using Remember The Milk as I have been seeing it on and off on LifeHacker. I went at it zealously at first (as I usually do with these things) and imported all my tasks from work and home. However now the rosy blush has ended and the cracks in the services is now appearing.

First is the inability to create sublists. There are things that need to be done on the house (oil squeaky door, etc.) and then there are my personal programming projects. Ideally they are my personal stuff so they would go in the personal folder. They are also separate from each other so they should get their own folder. You can create new folders but the limited real estate in the layout means that more than a couple of additional tabs you wander off into the realm of multi-row tabs which look horrible in any application. This situation would be solved by sublists but RTM doesn’t support this and the development team doesn’t seem to be forthcoming with dates/roadmaps.

The next major problem is the lack of dependencies. Simply you can’t have one task depend on another. The closest I have come to this is order by numbers. But that doesn’t solve the dates. Example: A bunch of features got put back to the release after next for the program I am working on. They all depend on some functionality that won’t be ready in time for the next release. So I need to put them back to after the release date of the next version. That means I have to shift the times individually because of the next problem.

Time-shifting isn’t supported. You can select multiple tasks, and set the same date for all, but you perform simple maths operations on them. You can’t select a bunch of tasks and say “+1 week” and have all the dates jump by a week from their due date. This seems to have partial, but incomplete, support.

Next problem is how priorities are handled but I can see how this is a tricky subject because people would have a different idea of how priorities are handled. In my book a high priority item with a completion date in September is less important than a low priority task with a completion date of tomorrow. However RTM displays high priority tasks before all others, so task priorities aren’t used.

Which brings me to my next gripe. The editing of a task is via a drop down list. Why not buttons? Most Web 2.0 (how I hate that term) apps have buttons that act like their desktop counterparts, so why not RTM?

One under developed feature is the email reminder. You can set a daily reminder of tasks due that day. The next day you get another email, but it doesn’t list any overdue tasks which are probably more important than the tasks due that day. Admittedly it’s open to debate which is more important, but overdue tasks should be listed along with the due tasks.

The final gripe I can think of, and one that a member of the RTM team commented on, is the syncing with Google Calendar. Now the idea of a calendar with your tasks on is sublime, but the implementation leaves a lot to be desired with RTM stating that it is a limitation with Google Calendar and out of their control.  The problem is that every day, even days you don’t have due tasks, have a big image of tick on it. Now a tick has the connotation that there were tasks but they are all complete. Also a glyph on everyday, even when you don’t have a tasks looks very cluttered. It would be nice to have only an image when there are tasks due and the image changing with the priority. I suggested an exclamation mark with colour of the priority, and overdue being the same with a clock behind the exclamation mark.

They are the gripes and some can be worked around, but the questions are: Do other task lists have these features and how can I get all my tasks from RTM to that app? Do any other todo lists have these features?

I know I shouldn’t complain because RTM is free, but I am willing to pay a small amount for a subscription to something that I found usable and user-friendly but at the moment if they started charging for usage, I wouldn’t be forthcoming with the green.

2 comments.

« Previous PageOlder » « NewerNext Page »