If, like me, you sometimes have difficulty in doing basic maths sums in your head, then head along to GeeksAreSexy (oh yes we are 🙂 ) and have a look at their simple “is a multiple of” rules. And after that, why not mosy on down and have a look at 10 Easy Arthimetic tricks on ListVerse. If only these tips were taught in schools then I wouldn’t be so reliant on a calculator or computer….
Richy's Random Ramblings
Making the web has a couple of articles about how to make PHP scripts run faster and more efficiently. Checking the lists show I’m already doing quite a few of the items listed:
- Multiple arguments with echo (i.e. using “,” instead of “.”)
- I don’t currently do this, but it’s only 0.396% faster
- Reduce function calls (i.e. find out the size of an array before a loop, not in the “for statement”)
- I do do this, but not as much as I should – especially with a 54.095% difference!
- Avoid using variables if they aren’t needed and unset them once you’ve finished with them
- I try to do this, but there doesn’t appear (from the site) to be any speed penalties in not doing this.
- Use single quotes (instead of double quotes – ” )
- I’ve done this for ages as I knew PHP didn’t have to parse the string – but I didn’t know it was only a 0.696% speed difference.
- str_replace() vs ereg_replace() and preg_replace()
- I tend to use preg_replace instead of ereg_replace anyway, and I’m aware that using any sort of regular expressions is slow. Therefore I do try and use str_replace instead – after all, it’s a 59.224% saving in speed!
I’ve just completed a 5 day Microsoft course (and I bet many people that read this blog never ever expected me to say or speak those words!) entitled “MS2124ADOE: Fasttrack 2 C#.Net Part 1: Object Essentials and Re-orientation to C#”. Quite a mouthful!
Basically, the course is about Microsoft C Hash (or C Sharp as the USians like to call it) and a little bit of Microsoft’s .Net (which was basically Microsoft’s response to Java). I found it extremely simple to get my head around – maybe because I’ve done standard ANSI C programming nearly 10 years ago and I understand the concepts of Object Orientated Programming (OOP) as I spend the majority of my time in PHP code (ok, mainly PHP4 code which isn’t that OOP, but has a little bit).
The only bits I had slightly trouble understanding was Events and Delegates (as I’ve not needed to use anything like that before in PHP), but once I “mentally mapped” them to RISC OS’s callbacks, it was simple. It was quite strange that out of the six of us there (2 with PHP backgrounds, 1 with Java background, myself [mixed backgrounds] and 2 Microsoft Visual Basic programmers), it was the Visual Basic programmers which had the most trouble with the course.
Why did I go on the course? I got sent on it by my manager, and I’ve still got no idea why – we have a single application running on C#.Net which, admittedly, I currently “look after” – but it’s closed source (we don’t have any access to the source code and any changes I could make have been at the database layer) and we’re going to be replacing it with a PHP version before the end of the year… We were informed on the course that C# programmers do tend to earn the “big bucks” so whether my boss is trying to drop me a hint ;)…
It wasn’t a too bad course and it made a change to leave the house at a reasonable time (8am) instead of silly early (7am) – and, despite the fact the training centre was over double the distance away from my house than work is, I still got there faster! Now I’m just pondering whether to turn more to “the dark side” and get more Microsoft training and maybe even certified (either Microsoft certified or mentally certified – but those two do not have to be exclusive! 🙂 . The only downfall I can see is that it is likely that any future certificates are more likely to be signed by Steve “Monkey-boy I-f****king-hate-Google, where’s-the-chairs?” Ballmer than William “Damn good marketer” Gates III.
I’ve just been told off by my other half for laughing too much at a Human version of an inverted “Tetris” style game. Basically, shapes arrive and the Japanese contestants just have to make their body fit the holes. Sounds simple – until you see some of the shapes!
Source: Richard and Beth who found it from Gareth Saunders
Well, I’ve just placed my first order of business cards for myself via VistaPrint. I’m getting 500 business cards on 265g/m2 card with colour front, black/greyscale back and 7 days shipping for a total of £28.84 (the shipping alone was £9). I hope I manage to use them all and the business takes off!