TheDaddy.orgwww.thedaddy.org/defaulten-gbCopyright 2012 TheDaddy.orgThu, 23 Feb 2012 10:26:20 +0000NINA - http://nina.thedaddy.org**Hello and welcome to TDDO!** Well my friends, I am delighted to say that after 9 years of the 9-5 life I have now struck out into the world without a safety net. TDDO is now a fully fledged web design business! I've already snaffled some pretty big clients including the BBC, Astra Zeneca and Quiq Solutions along with helping some smaller businesses make the most of their own corner of cyberspace so the future is looking bright. But where would TDDO be without one or two 'home brewed' projects on the go? On the list are a couple of mobile application ideas, a social networking tool, an e-commerce venture, big improvements to my web framework and a whole load more blogging. Watch this space! Meanwhile if you find yourself in need of a top quality web solution then please feel free to contact me. I'm always happy to hear about new challenges and discuss new opportunities.Thu, 02 Feb 2012 12:24:43 +0000Enhancements For PHP http://www.thedaddy.org/default/indexI've used a wide variety of programming languages in my time and have found that for web design PHP is everything I need to make a top-notch application. It has a fantastic OO implementation, has a great community building all sorts of wild and wonderful extensions and frameworks and it has the flexibility I need to do my job. However nothing's ever perfect and there are some core adjustments that I'd love to see find their way into version 6: **Namespacing String and Array Functions** To me the most irritating thing about PHP is the set of string and array functions. They are all in the root namespace and are completely inconsistent in the order with which you must supply the arguments. Sometimes you must provide the subject string/array first (as in [[http://www.php.net/manual/en/function.strpos.php|strpos]]) and sometimes last (as in [[http://www.php.net/manual/en/function.str-replace.php|str_replace]]), with no apparent method to the madness. This means that even after using PHP for the best part of a decade I still need a cheat sheet on my desk to remind me how to use them. What I would like to see is the function called on the subject string/array like the following: --strpos($haystack, $needle)-- becomes --$haystack->strpos($needle)-- --str_replace($search, $replace, $subject)-- becomes --$subject->str_replace($search, $replace)-- You get the idea **Awareness of Parent Classes from Subclass Static Functions** Now bear with me on this one. If I have class B that extends class A and class B has a static method called --staticMethod-- then I am able to call --A::staticMethod()-- but the code within --staticMethod-- has no idea that it was called in relation to class A rather than class B. Now this may seem like a rather obscure bit of quirkery but I have half a dozen applications that would be greatly improved by it. The following example demonstrates the issue as I encountered it with the ORM of my PHP framework [[http://www.nina.thedaddy.org|NINA]]. In order to find a record by its ID in the model --User-- I have to use the code: --User::retrieveByPk(new User(), $id)-- --retrieveByPk-- is a core ORM method in a class that is extended by all models. Now look at that first argument. The only reason I have to pass in a fresh instance of the model is that it is the only way to let the static --retrieveByPk-- method know what model (and hence what database table) we're talking about. If --retrieveByPk-- had awareness that it was being called in relation to the User model class then the call could simply be: --User::retrieveByPk($id)-- **Camel Casing** I think in good code all functions should be camel-cased and all variables should be underscored. Makes for much nicer reading. But maybe that's just me ;-)The Future of Spaceflight http://www.thedaddy.org/default/indexWith the sad demise of the space shuttle last year we are entering a very interesting period in the era of human spaceflight. Admittedly the shuttle was much more expensive and much less safe or servicable than originally intended but nevertheless it redefined the accessibility of space for scientific and commercial purposes. Despite only launching 135 missions) over 30 years (a far cry from the original intention of twice a week!) it was the most versatile spacecraft ever built. It was responsible for the deployment and servicing of Hubble and many other satellites and orbiting scientific instruments. It built the bulk of the ISS, it assisted greatly with crew deployment to Mir and the ISS, conducted a number of classified military missions and inspired my all-time favourite James Bond movie, Moonraker! For now the Russian Soyuz is the only craft in the world engaged in human spaceflight. This was for a long time the most reliable spacecraft ever but with two launch failures last year serious doubt has been cast upon it future. Thankfully the failures were both unmanned missions but one of them was a resupply mission for the ISS and the subsequent grounding of the rockets left the space station dangerously low on supplies and came close to necessitating its evacuation. However future is looking bright thanks to big developments in the private sector. SpaceX has been contracted by NASA to begin ISS resupply missions this year with its new Falcon 9 rocket and Dragon capsule leading towards manned missions beginning in 2014. Virgin Galactic is racing towards the first commercial sub-orbital flights of the first ever fully reusable spacecraft and has already signed a deal with NASA for the transport of scientific payloads. These are far from the only craft in development - the shuttle-like Dream Chaser being developed by SpaceDev, the reusable New Shepard capsule from Blue Origin, the Cygnus and several others. All these along with NASA's own Orion Multi Purpose Crew Vehicle, the 'phoenix rising from the ashes' of the cancelled Constellation program mean that space is going to become ever more exciting over the next few years :)Buddhism for Atheists http://www.thedaddy.org/default/indexFirstly I want to say that although I no longer consider myself to be a Buddhist, I still have the greatest respect for Buddhism and still go to classes at my local centre from time to time. I find these greatly helpful in living a happy life because they simply give practical ways of living a more peaceful life as a happy, relaxed and patient person. Who wouldn't want that? They don't push any of the supernatural reincarnation/enlightenment side of things at you and you are free to take as much or as little from their teachings without the judgement you get from several other major religions. Still though, I wanted to go over some of Buddhism's main teachings, and how they can all be taken from atheistic angle and be very beneficial to everyone no matter what you believe. **Reincarnation** What is this beyond living well, having children, passing on the best parts of you to them and leaving the world happy that your legacy will live on. My son is almost three months old and already I find it amazing to look at him and know that he is quite literally half me. When I am gone he and our descendants will carry on, keeping me alive in a very real way. **Karma** Lets face it, if we've done bad things, no matter how much we may deny it to others or pretend we don't care there is a little seed of unsettled guilt placed in our heads. Equally when we do good things, we get a corresponding seed of happy satisfaction. Now I know that when my head is in a happy place I make better decisions, I cope better with tough situations and generally have a more balanced life. However when my head is unsettled I am less calm, more likely to act rashly and can end up creating problems for myself. To me, this is all that karma is about. It's as if my own head is making sure that good actions are rewarded and bad actions are punished. No supernatural forces are needed to ensure that we know right from wrong. **Enlightenment** This is the Buddhist biggie. Train your mind, leave attachment behind and you attain the complete peace of enlightenment, transcending the mortal world. Now of course there can be no atheist equivalent to eternal peace in another plane of reality but perfect happiness and peace of mind area absolutely attainable by anyone. Stay mindful of your emotional state, don't sweat the small stuff and try to maintain perspective on the twists and turns of life and you'll be well on the way. As for transcending the mortal life to a place of complete peace that's easy. If I live a long happy life surrounded by family and friends and watching my son grow up to have a family of his own I know that when my time comes I will leave with a happy and peaceful heart. To me that ticks the box quite happily!