Sunday, 15 September 2013

New Google+ Web Site Page

More Social Media With Google+

The Care Homes Directory has now created a new Care and Nursing home related Google+ page were we will be releasing our news articles and any promotional or related content.

We feel this will complement our other social media accounts on Facebook, Twitter and Reddit and we hope people might find it a useful resource.

You can view our other social media accounts by following this link to our social media page promoting our accounts.


Red square with a G and the plus sign on it.
Google+

Workstation OS Upgrades

From Maya To Olivia

Recently we upgraded our workstation operating systems from Mint 13 (Maya) to Mint 15 (Olivia) and the initial impression is positive and there are noticeable improvements.

We switched to Cinnamon from Unity which was one of the reasons for our initial switch from Ubuntu and I tend to find that I can just get on with work when using Cinnamon over Unity.


The logo for Linux Mint
Linux Mint


Upgrade Method

For our upgrade we used the apt method of editing our /etc/apt/sources.list file and replacing the correct release names and although this is not the recommended method I have always upgrade like this and its worked.

We also use rsync to backup any files needed on the workstation so if something goes wrong we can restore the system from that source.

You can also use dpkg to dump a list of programs installed on the system so you can restore them if you need to the command to get the package listing is,
root@chic:~# dpkg --get-selections > workstation_package_list.txt

The upgrade for our workstation went through like a breeze we went from 13 to 14 without a hitch then from 14 to 15 after a few hours we had our fully upgraded system.


Impressions

Everything looked similar to the previous version although fonts and theme do look slightly different  from the previous version, I am not so keen on the font.

Hot corners got enabled again for some reason unknown so I had to disable them as I cannot stand them my mouse tends to move here and there and when I select the menu I sometimes just go to the top left corner.

I have also got double entries inside my preferences in the menu for some reason although I am very rarely in there so this is not a problem for me just a niggle. I used to tweak my systems and compile my own kernels but now I just want my system to work and Mint does that for me which in turn allows me to get on with my work.

One thing that did stop working was our eclipse ADT (Android Development Tools) install which we use for our Android development but reinstalling was simple and it is all working now I am also not sure what went wrong there.

Virtual box works fine although VMWare player will not work due to kernel module problems but I do not use this for work so again its not a problem.


Conclusion

We like Linux Mint and will continue to use it for our main workstations for the foreseeable future and hope to see it flourish.

Saturday, 14 September 2013

Release Road Map

The Care Homes Directory Roadmap

Our new road map for our planned releases has been published to this page on our company blog we hope to follow our road map and also improving the road map itself.

We have not included release dates because our development cycle is rolling so we release as we go when ready. It is a slight twist on agile development and we covered it slightly in this article and also this one.

To view our road map please follow this link.

Atlas picture of England including roads overlay
Road Map

Care Homes Subreddit

Going Social Again

The Care Homes Directory has now created a new sub Reddit for care and nursing homes discussions we will also be using the channel to inform members of any news articles which are relevant to the topic and new website related features and releases.

We hope any care providers and or agencies will join us and make use of this resource anyone is welcome to participate in our new community and we hope to see you there.

Care Homes Sub Reddit


Thursday, 12 September 2013

Quick Look at PHP Traits

Traits in PHP

With the release of PHP 5.4.0 including support for traits we though it would be good to start taking advantage of this new feature. We will also be modifying some of our older classes to use traits.

Our first trait was a simple single method one which is called FormErrorParser($form) which takes a string as an argument and parses any error tokens contained inside the HTML markup.

It is a very simple function and a specific problem domain so we felt using a trait to provide this function across classes which are otherwise unrelated was the correct approach to use.

An oval with a blue background and php written in black centred inside the oval
PHP 5.4.0

Defining a Trait

To define a trait in PHP is very simple and similar to how you would write a class, for our example the calling class must define the $this->formErrors array which is a simple array containing a key value pair ('{TOKEN}' => '{ERROR_STRING}') which the parser transverses,


/**
* Form Error Parser
* Provides functionality for parsing form errors, its a simple parser which replaces error tokens (%nameError%) with the corresponding error string.
* @package Traits\FormErrorParser
* @version 1.0.0
* @author C.Elsen
* @copyright © 2000-2013 Chic Computer Consultants Ltd, All Rights Reserved.
* @date: 2013-09-11
*/
trait FormErrorParser {
    /**
    * Parse Form Errors
    * Parser replaces form error tokens with the error string.
    * @param string $form The form to parse.
    * @return string Returns the form with the error tokens replaced.
    */
    protected function parseFormErrors ($form) {
        if (count($this->formErrors) > 0) {
            foreach ($this->formErrors as $k => $v) {
                $form = str_replace('%' . $k . 'Error%', $v, $form);
            }
        }
        $form = preg_replace('/%.*Error%/i', '', $form);
        return $form;
    }
}

From the above you can see this is a simple usage but we feel a good example of how traits can help with specific fine grained functions.


Using a Trait

To insert a trait into a class you call the use keyword along with the name of the trait to use so to use the FormErrorParser trait you would so something like this,
use FormErrorParser

protected function doSomthingWithAForm() {
    if (empty($_POST['something'])) {
        $this->formErrors['example'] = 'This is an example error string';
    }
}

For the HTML side of things you can add an error token to you form markup so that it can be replaced by the appropriate error message.
<input type="text" id="something" name="something">%exampleError%

Conclusion

Having another tool in the toolbox is never a bad thing and traits look like they will allow you to share functionality between classes with no other relationship this should allow for greater code reuse and in turn improve development.

The Care Homes Directory is currently in the process of redesigning our enhanced listings sign up form in an attempt to simplify it and also switch over to Google Wallet from Google Checkout.

Our initial use of Google Wallet is positive and we feel that it is an improvement over Checkout and has a simpler API and better support for digital good and especially subscriptions.

We will be writing a future article regarding the release of this new improved website feature and we hope to make our site as simple as possible.