It’s been a while since I posted, so what has been keeping me busy?
Work, it’s getting easier – I think I am getting into the VB6 mindset, but I still hate VBA with a passion. When is the nice .NET extension becoming available? Is it already, and could Reporting Services save our souls (not to mention our sanity)?
Space is coming along very slowly. Any time I sit down to work on it I have to spend about an hour refreshing my mind on what I have done – and I only have about 40 mins to do it in.
Had my birthday: One of my presents was an iPod from Mrs Bear – which gave me a lovely opportunity to hate iTunes all over again. This time I accidently deleted my play list, there is no undelete and then it synced it – wiping it. I’ve installed iTunes 9 but I don’t hold out any hope for them fixing all the problems with it. Another present is an ant farm – so along with my Sea Monkeys you could say I have Surf’n'Turf.
Another side effect of my birthday was my the choice of venues for a meal. Since I’ve always wanted to eat there I picked Kaminaki and had some of the nicest fish I have ever eaten, and definately the nicest pitta bread ever. All this and despite the grumblings of some of my friends.
My employer of nearly 3 months is slowly moving to VB.NET. However a lot of their ‘legacy’ apps still need to be maintained and extended to support new methods, etc.
This involves VB6 and VBA. I was always in the position that VB6 was a mickey-mouse program for throwaway apps but not really suitable for real dev work – I was an elitist C++ programmer basically.
My view has shifted – you can really write large enterprise class apps in VB6. But one thing I can’t seem to shake off is the contempt the people who wrote VB6 IDE had for their users. Having used VC6 for a number of years you get used to certain things: Like if you start editing a file that isn’t checked out it will ask you if you want to start editing and then when checked out your caret is where you want it to be.
Not in VB6. You are informed that the file is locked. So you then have to right click on the file and manually check it out. But now the file closes itself and reopens with you looking at the top of the file.
Should I mention the 255 control limit? Who picked that as a number? (As an aside why is Excel 2003 limited to 1026 rows? Why 1026 and not 1024? Is that a typo?)
“Out of memory error”. I have 4gb in my machine. Why am I out of memory and why does that stop you from saving my last 15 minutes of careful debugging work? Why must you lose my break points?
And the mouse wheel doesn’t work.
This isn’t to say VC6 was all roses – far from it – but it makes you wonder if the VB6 team actually a) used it for anything b) gave a damn.
Life continues.
Slowly getting used to the way my new employer does things. It’s a little more strict than previous places but this is the largest organisation that I’ve worked for under one roof. Using VB after a break of 5 years is a real pain but apparently it is only going to be for a short time. There are plans to rewrite (why do I cringe when I hear that word?) the apps in VB.NET. Oh joy of joys. Between now and then I can try and wheedle my way into getting C# used. Meanwhile I am learning to swim again by being thrown in at the deep end. As a plus I don’t have to get up/leave so early and I get home an hour earlier too.
While this is going on I am still working on Space. Or rather trying to get Space to work on a local VM. There is little point in pushing forward with changes when the changes are so hard to implement, and the only way to test is on a live system. That’s just folly: If something breaks then we start to lose real money. Better to make a VM and play safely in there.
That means learning Linux. Which I have now installed a dozen times. Even the book on the subject doesn’t work the way it is supposed to. Fortunately I am savvy enough to figure out my way around where the book misses out one of the hyphens in –dport.
With learning comes confidence so I went and reinstalled selecting server as the install option and doing everything manually. However with Virtual PC as my VM I kept getting the ‘i8253 too high – resetting’ all the time which made working in Vim a nightmare. So I decided to give VirtualBox a try.
Oh my God! How fast is it compared to Virtual PC!?. It just rips along. The boot is a blur, the install of the OS is twice as quick and UI is feels more responsive. As a plus I haven’t seen the i8253 bug yet.
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.
March 26th, 2009 :: graham.reeds
Categories:
Life ::
Work
Today is my final day at work.
February 26th, 2009 :: graham.reeds
Categories:
Life ::
Work
With effect of Friday the 27th of March I will be unemployed by reason of redundancy.
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.
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):
- SS: You both walk away with 50% of the prize fund.
- SK: Your opponent walks away with all the prize.
- KS: You walk away with all the prize.
- KK: You both get nothing.
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.
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?
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…
Older »
Next Page »