Archive for the ‘code’ Category
MVC framework for PHP
I had a lot of trouble a while ago working with the MVC frameworks from other providers, they all seemed a bit too complex.
So … I made my own one.
Take a look I would love to know what you think?
MVC Framework for PHP
I am going t licence this under creative commons, so please feel free to play with this as much as you like.
Tips and Tricks to help you get started with the LAMP stack
Recently I have been getting into PHP, linux, mysql … .the works. It been a pretty good experience. However after discussing it with some friends I found that we all had the same paintfull experiences getting started. In the interestes of making the world a better place here are 5 tips that will help to get you going.
- Install your development environment into a virtual box
Getting the Dev environment is tricky and takes time. If you install it into a virtual box then you can share it with others easily and you take a snapshot (and revert if you muck it up) - Use xampp
Don’t waste time mucking about installing Apache, PHP, and MySQL seperatly then try to configure them. Instead use XAMPP which comes pre configured for a developers use. - When your ready to deploy to live – read the Xampp docs
They are really good and give you a big head start, its also loads easier to follow some of the examples that are described. If you are feeling really brave you could even script it. - Create unit test cases with phpunit
This software is simply awsome, and I have to thank sebastian for bring such a great tool into the world. This is very easy to get going, but watch out for pathing issues. - Create functional tests with selinium
Installing selinium is like falling off a log, and its a really hard core test automation tool. Sebastian has also written a cool article on how to get going with selinium and php unit
Enjoy !
0COMMENTS
Developer test – How to interview a developer – Part 1
Have you interviewed any developers for your team?
If you have you will know how incredibly difficult it is to find good people and how insanely difficult it is to find great people. I used to use the traditional method, of asking a few questions about their experiences and asked them to describe how they would break down a complex problem etc … however I found that this method did not always get the people I wanted.
Whilst working with the liberate platform I used the “Show your name on the screen test”. This worked really well I was amazed at how manny people could not do this
<table><tr><td> </td></tr></table>
document.tables.cells(0,0).write("Simon Elliott");
When I came to test OpenTV A good friend of mine developed a very very simple technical test. The candidate had to look at a single 10 fine function and spot the bugs … easy. There were only three, a syntax bug, adding a value instead of a pointer when looping and an incorrect centinal on a loop.
With a rudimentary understabnding of the language anyone could get the answer.
However while these tests were great at finding bad developers,
they were not so good at finding great developers.
My new tests are, better they test language fundamentals, ability to communicate, how to problem solve the works …
“Imagine that you have made a Clock class, and you are writing the functions to draw the big hand and the little hand. You already have member functions to draw the clock face, and to draw the hands all you need to do is write 2 functions
get_big_hand_rotation ( hours, mins)
and
get_little_hand_rotation ( hours, mins)
What would the code for these functions be?“
This test is great, the candidate gets to think his way out of a problem, the things to look for are
- Is the candidate professional in approach, i.e. do they qualify the question with you, do they take care to understand what you want from them.
- Is the code that they make good?
- How quickly do they do the test?
- Are they good communicators?
- Does the candidate teach you something?
Here is a some code that does this … but the important thing is how the candidate answers the question.
class Clock {
public static void main(String argc[]){
System.out.println("Welcome to Clock");
int hour = new Integer(argc[0]);
int minet = new Integer(argc[1]);
System.out.println(” big hand rotation = ” + get_big_hand_rotation( hour, minet ));
System.out.println(” little hand rotation = ” + get_little_hand_rotation( hour, minet ));
}
private static float get_big_hand_rotation( int hour, int minet ){
return minet * 6;
}
private static int get_little_hand_rotation( int hour, int minet ){
return ((hour * 60) + minet) / 2;
}
}
0COMMENTS
What the heck is cloud computing?
This is my definition of what cloud computing is …
To define the cloud computing … it is
“Any feature that is delivered over the Internet where both the developer and user of the feature is abstracted from the infrastructure that provides it”
The early adopters of the internet almost exclusively used it for chat (mainly for swapping home made starwars scripts)
“The cloud” is the architecture notation of “a cloud” to represent the Internet. The use of the name is a nerdy in joke amongst web architects. In technical meetings over the past 5 years the answer to the question “where does [insert nameless feature] come from” has been “the cloud”.
People who don’t understand computers are in the majority and the cloud takes away all the pain of nerdy computer boffin nonsence such as flexibility, encapsulation, cost reduction, backup, DR, scalability, etc … When you put it on the cloud It becomes someone elses problem.
Remember Steve B’s famous Key note speach “Developers, Developers, Developers”.
This is why kids make facebook apps instead of java or .NET programs. when you develop against the cloud, its alot easier.
2COMMENTS
If strong AI theory is true …..
The theorists that support Strong AI believe that a system is intelligent within its own function, i.e. a thermostat is aware of being a thermostat.
Take the human brain …. Its millions of nodes (neurons) are connected by communication lines (axons), the mind, the knowledge and the ability to reason is created by the storage of patterns across these connections.
A brain that only had a two nodes would have a complexity of 1 as that is the maximum number of patterns that could be stored.
A brain that had 3 nodes would be able to store 4 patterns,
A brain that has 4 nodes could store is … loads
My theory is that the number of computers on the internet is approaching the number of nodes in a single brain, and if the theories about strong AI are true then we could be seeing the birth of a sentient new life form!
cool.
I wonder if it will start to try and defend its main communication lines …
0COMMENTS
Drawing for the security team
Okay so, im not the best at this in the world but I can kinda draw a little. Any hoo, the honorable security team at my company have decided that they must reinforce their message with some cartoons. I hope you like this.

0COMMENTS
Essential reading list for the architect
This is the message in it hardcore engineering form.
Lots of small changes on the inside make a positive effect to the public impression
http://www.refactoring.com/
Enjoy doing it and apply it to a team, structure process and control, shared goals
http://www.extremeprogramming.org/
Clean, simple and disciplined.
http://en.wikipedia.org/wiki/The_C_Programming_Language_(book)
Use technology to work together
http://subversion.tigris.org/
You operate in a political world, it is only victory if everyone wins
http://www.chinapage.com/sunzi-e.html
Use convention over regulation
http://rubyonrails.org/
A good experience comes from both form and function
http://en.wikipedia.org/wiki/Helvetica
0COMMENTS
Justifying ROI on a wiki.
How to help your boss make a decision to buy a wiki or
Which line do the curly braces go on?
We used to have a big problem with quality, simply put we spent most of our time fixing bugs on old code rather than innovating new products, the problem was code standards.
My team was in 3 countries and we had 3 different sets of coding standards, any collaborations were plagued by technical differences in the code. I wanted to merge the codebase for the main products from all three countries and there for had to get the team to agree to a new set of standards.
I took the traditional approach, got one dev team to make a word document, distribute to all the parties etc … we held meetings to discuss feedback, had reviews and revisions of the document.
After about 3 months we managed to get agreement, and some people started using the new standard ….
However within another 6 months there had been so much change that the standard was out of date, and only a few were following it. Obviously my management team and I tried using the stick, but it just made everyone hate the standard even more. The code was not getting any better and the programmers were still behaving as little teams, rather than as a whole.
So, I copied and pasted the coding standards into our “trac” wiki, which is a free product. I told every one that they must follow the standards, but I also told everyone that anyone could change them. If there was any disagreement then I would make the decision. Over the next couple of months they deleted about ½ the standards, then they had a big row about a whether the curly braces were on the same line.
The end result was that all the developers subscribed to changes of the standards and took an active interest in a) whether they were good and b) how best to follow them.
The difference between wiki and the old “document and versioning” approach was that it allowed standards compliance responsibility to be devolved to a level in the product development team where something could be done about it. I was freed from the mindless task of telling developers to implement the standards, the code was significantly better, there were less bugs and the whole company started making the same products faster.
The investment in installing the wiki (1 day) me adding the standards ( 1 day) the huge row about the curly braces (a lot) was far far out weighed by the reduction in testing and fixing time and the increased revenue by having a better quality product that consumers loved.
About two years after that we started using the wiki for far more important things such as interface specifications, functional specs and architecture documentation.
0COMMENTS
TV is Dead Long live the Stream!
Have any of you tried to use the internet in the UK around 20:00 in the evening?
Did you notice that the under 20 demographic dont discuss TV shows any more?
What do you think people are using the iPhone 3G’s to do ?
If you work for an ISP you may have access to the bandwidth usage metrics, and if you have seen them (as I have) you will notice that people are seriously into the iPlayer. The basic consumer TV behavior of settling into a TV programme is still there but the method of programme selection and distribution is totally different.
If you work for a telco and you dont manage to get your existing TV audience into the new streaming delivery then you will loose it to your competitors. As someone who has spent the last 15 years working in TV I dearly want this to not be true, but the tide has changed?
0COMMENTS
Marketing your products in a down turn
Remember how I said that the profile of tenders was going to change because of the downturn?
The bell curve of opportunity value compared to frequency of deals will be squished, out in two directions.

Lets take a look a just a single company.

A large company has to speculate to accumulate. This is reflected in the internal purchasing mechanisms of the company. Roughly speaking there are sign off boundaries, the most influential people at each of these boundary levels are indicated in the above diagram. Even though a VP may have to sign off a purchase of 300k it will probably be a couple of directors at a lower level who make the real decision.

The down turn will reduce costs and therefore the whole curve will be smaller. However operations must still go on. You will see that the directors now control most of the spending rather than the VP’s. Because directors are still intouch with the delivery and are younger you have to change your marketing.
- make it more funky – remember your playing to the google generation
- make it about delivery
- dont dress your sales materials in the old school terminology – i.e. have a summary instead an exec summary
0COMMENTS