Conceptric

The Everything Topic.

  1. I run several remote Subversion repositories and connect using SSH over the Internet. Having local version control for those times I don’t have an ADSL connection was the main reason I looked at Git.

    There’s a good TextMate bundle to support Git, but to be honest I’ve mostly used the command-line.

    Weaknesses.

    Vendor branching is possible, but awkward. I frequently use vendor drops of WordPress, SimpleTest and a number of other libraries. There may be a good way of doing this, but I haven’t found it online… yet.

    I miss the svn:externals functionality, especially in applications that use a lot of plugins: WordPress in particular. Subversion allows me to define particular tagged versions of these to be pulled from their repositories during deployment without needing to bother controlling them myself.

    Strengths.

    Branch merging when trying out new ideas is a dream. I created a new branch, refactored huge sections of the codebase, and merged it all back together flawlessly. With Subversion this would have been a lot slower and more problematic. Git’s simply great for those investigatory spikes.

    The verdict for Git.

    I’ve yet to seriously try Git to interface with my remote Subversion repositories, using the ‘git svn’ series of commands. Having local copies of these, whilst still being able to use remote Subversion would be very useful. I’ve found using remote Subversion repositories easy, but trying to push a Git repository to Subversion is not so easy. I’m also going to try deploying from a Git repository using Capistrano in the near future.

    It strikes me that Git is best at programmer related activities and weakest in those of interest to administrators deploying applications. I shall certainly continue to use it, but alongside Subversion.

    Categorised in:

    No comments.

  2. CodeIgniter is billed as being a lightweight PHP MVC framework. Now I’m not a big fan of PHP, despite using WordPress and Drupal, but I intend to run this application on a Synology NAS, so PHP is the only game in town.

    Changing the Architecture.

    I’m not a keen on the idea of dumping all my code in the web server root directory, so I tested the framework flexibility by rearranged the application structure a little.

    	-rw-r--r--   1 Capfile
    	drwxr-xr-x  14 application
    	drwxr-xr-x   3 config
    	drwxr-xr-x  13 system
    	drwxr-xr-x   5 public
    

    Once these locations were updated in the application configuration files it all worked perfectly. The reasons for doing this sort of thing have been documented elsewhere, and I agreed with them from this security standpoint, however this structure also fits better with Capistrano deployment.

    A positive first impression.

    The Views deal with the presentation logic, and I like the fact that embedding PHP within the HTML is the default, instead of a complex templating system. It’s not the cleanest approach, but I prefer to have full control over my HTML.

    As for the Controllers, the implementation is quite intuitive and you can build a friendly set of URLs with a little help from mod_rewrite and the URI class.

    The form validation is a great feature that I found easy to implement within the Controllers and Views. I’ve centralised my validation rules in the global configuration file suggested in the documentation, but haven’t got the automatic rule group feature to work yet.

    The Model class is used to represent a single database table. I’m used to mapping tables with a Class in this way, but normally each instance would represent a row of data. CodeIgniter Models implement the Singleton design pattern, only one instance per class, from which the Database class methods can be called.

    The Database class provides the data access layer and a good set of robust methods which return an array of stdClass instances representing the resulting data rows. These arrays are then forwarded to the View, where the instance variables can be directly accessed. This is quick and easy, but not very OOP.

    Implementation reservations.

    I believe that the Model should be capable of running as a stand-alone application, once equipped with any interface, even the command-line. It’s this level of autonomy that results from the MVC design pattern: substitute a different Controller and View and it’ll still work the same way on a different platform.

    Controllers reacting to events, whilst Views shouldn’t have direct, mutable access to instance variables. The Model should encapsulate both the data and the business logic, not something that can be effectively achieved with Singletons alone. Indeed CodeIgniter blurs this distinction by making Models optional and allowing data manipulation directly in the Controllers.

    I’ve implemented my preferred approach by providing my own classes to replace the stdClass. They don’t extend the CodeIgniter Model class, but are instantiated within those that do, encapsulating data and business logic; including Object–relational data mapping and CRUD functionality.

    It works well, but I’m concerned that by introducing a more rigourous approach I’m losing some of the advantages of the framework. May be I would be better to take CodeIgniter at face value, as a flexible, if a little dirty, rapid development environment that works.

    Categorised in:

    No comments.

  3. The point to keep in mind is that the business process comes first. After all, businesses were here long before the IT department was born. How do you expect to add technology into the equation without understanding you own business domain?

    Define your business.

    When developing business processes try to keep everything as simple as possible. Simple processes are likely to be followed: complex ones won’t. This is definitely true of written procedures, but human employees have the ability to sift through the junk and ignore it; you may not like that but it’s true.

    Computers on the other hand don’t share this aptitude. Your software developers may try to ensure the software follows your monolithic procedures, but the conflicts ignored by human employees will have to be resolved; a long and expensive process.

    A systematic approach to this analysis can help, especially with the inevitable documentation, take a look at business process modeling and the OMG notation.

    Well implemented processes will be familiar to your staff and any software based on them equally so, saving a fortune on training.

    What is success?

    Now you’ve got a minimalist set of effective processes, you’re in a position to consider how the application of software and hardware systems might improve or expand your business, and bear in mind that it might not.

    What will success would look like? It too needs to be defined as simply as possible if you’re going to recognise it. Frequently at the start of projects everyone is so excited that this step is lost. It is either overlooked or results in a requirements document so complex nobody can be bothered to read it.

    Ask yourself how many other business purchases you would make without actually considering what you’re expecting to have delivered. Would you be happy if you were hoping for a photocopier and ended up with a filing cabinet?

    Get involved.

    Most organisations expect their involvement to end once they’ve specified their requirements. The developer will go away, build the software, and deliver it perfect and on schedule. OK, maybe that’s an exaggeration, but placing your staff in the development team is not an optional extra.

    They’re likely to spend substantial time working closely with the developers, it’ll be worth it, you’re likely to get a better system. Most will be involved in user testing, but the customer representative is a key role representing the business interests within the team. Customers are not project managers, they are focused on the benefits to the business and its operational goals.

    Primarily involve people that actually undertake the work this system is meant to enhance, and those that will continue to use it. There’s a huge temptation for senior management to attempt to fulfil this role, but they usually know next to nothing about the processes in question, so resist it. There is a vital role for senior sponsorship, but it’s not in the development team.

    Resulting software will be intuitive, and the computer literate will be able to understand it based on their knowledge of their current job, and of course your procedures.

    The pay back.

    Get the basics right — develop good business processes, define success, and build an effective team — and your project has a much better chance of delivering satisfaction, on time, and to budget.

    Categorised in:

    No comments.

  4. I’ve played with the iPhone, the best handheld device interface I’ve come across by a large margin, and it would probably be my device of choice at the moment. However, there’s still a lot of functionality missing before such a device could oust both my mobile phone and laptop.

    Here’s the near future dream; they can get a lot wilder.

    I’m working on my latest project on the train, in a tunnel, whilst I travel to a meeting with a client. I reach a critical part where I need to see the big picture, so I find transfer the output to an LCD display in a coffee bar at the station.

    It’s not going smoothly, and I decide I could use some help, so I call a few colleagues and arrange a conference in 15 minutes time. Once we’re all virtually present, it’s early remember, I’d show them the problem by sharing my display output via the network. Each using our own devices we work together, version controlled and still conferencing, until we crack the problem.

    I thank everyone and leave for the Client’s office. Once there I transfer the presentation of the key project details to a large TV in the conference room and send a hardcopy to the printer in the office.

    Oh… and all seamlessly without wires. Of course, this is a picture of the utopia of perfect interoperability and security, but what are the chances?

    Interoperability.

    The device layer interface is a key feature, with transparent support a wide selection of drivers and protocols, I don’t want to have to get involved. As many devices aren’t wireless enabled at the moment, have poor device driver support, or use proprietary communication protocols, this is a real challenge.

    Getting input.

    Input is probably still the good old keyboard and pointing device, of which there are several approaches for those who don’t mind carrying extra kit.

    • Fabric keyboards that can be folded away, like the Just Mobile RoKy².
    • Projected light keyboards like the I-Tech Virtual Laser Keyboard are compact and lightweight.
    • The pointing is easier, a wide range of Bluetooth mice and other devices already exist.

    And for those that do?

    • Traditional mobile phone keyboard. I hate this, I’m too old to be any good and have an aversion to developing arthritis in my thumbs.
    • Touch screen keyboards, the Apple iPhone is the best implementation I’ve come across.
    • Stylus on touch screen for handwriting recognition as used by Palm.
    • Or just being able to use any input device I find lying around, wireless of course.

    There are other options like voice recognition, cameras, and detecting eye movements which could find wider use in the future. I’d like a direct mental link, so I can just think what I want to do, but I’d probably end up with a nasty brain wiping piece of malware!

    Displaying output.

    Displaying output raises important issues surrounding the usability of the actual user interface, after all, I’m proposing to go from working on a typical PDA size display to a 40 inch TV! I want to make the best use of the visible area on any given device, whilst avoiding 4 inch high characters.

    The experience of designing for different web browsers, screen resolutions, and colour maps could be leveraged for this new platform. CSS can be targeted at different media types and such an approach could be adopted throughout the new system.

    Staying mobile.

    Power management is vital for extended mobile operation and I’d like to be able to work normally for several days at least.

    This may be achieved by longer battery life or a totally different energy storage or generation technology. Fuel cells, solar panels or even nuclear power could be used; though even I’d be a bit concerned about carrying around a nuclear reactor. What if the fuel cell ran on a range of organic feed stocks, just like I do? I could recharge my computer at the same time as myself in any restaurant.

    Wireless recharging could be an option, maybe inductive charging such as WildCharge pad. I’d prefer my device to selectively recharge at any opportunity, and from any source, so that I don’t have to be in any particular place or make any conscious decision. The device could decide to top-up from a nearby power cable, the sun as I walk around, or even using the heat of a warm day. Again, I don’t want to know it’s happening or how.

    How long?

    Much of the software architecture and implementation technologies already exist to make my dream device a reality, the real work is in perfecting the hardware at a cost that makes loss or damage acceptable; it’s portable remember. At the current rate of development I suspect I won’t have to wait too long for the device itself. But the legacy issues for hardware interoperability?

    Ultimately it’s my guess that computing and the Internet will become indivisible; not sticking my neck out too much since for many of us it already is. If some of the wilder concepts of ubiquitous computing come to pass I won’t need a single device anyway, I’ll just pick up computing resources whenever I need them from the environment surrounding me.

    Categorised in:

    No comments.

  5. Deploying even my simplest web applications was a complicated matter:

    1. Log in as a privileged user.
    2. Create the domain deployment directory.
    3. Export the application code from Subversion.
    4. Update the file ownership and privileges.

    For Wordpress I also had to export code for each theme or plug—in to the required locations. So I decided to improve the situation. I’ve changed the way my Wordpress sites are handled in Subversion; haven’t moved to Git yet like the rest of the world, and I am using Capistrano to manage the deployment.

    Capistrano is a Ruby based remote task manager, the most commonly used tasks being for web application deployment. Obviously the original target was Ruby on Rails, but many people use it for PHP. It uses Secure Shell (SSH) as the preferred method for logging into remote servers; all communication is then encrypted.

    What follows isn’t a full set of instructions on deploying PHP with Capistrano, HostingRails.com provide a useful piece and you should look at the Capistrano manual, these are my thoughts. May be something more detailed might come later… but no promises.

    Managing the source code.

    The Subversion repository for each blog project uses a vendor branch of the Wordpress source code and svn:externals properties to import the required themes and plug—ins from their respective repositories.

    Wordpress updates are integrated into the vendor branch and then into any of my projects without disturbing any custom code changes. For merging changes I can strongly recommend using the svn_load_dirs.pl script, it allows you to maintain file history and makes the whole process easier.

    And now deploy.

    I currently have my main Subversion and Web servers on the same machine, leaving me with the option to use the local file:// protocol to retrieve the application files. I wanted to make my deployment script more universal so that I could use it for the production and development platforms.

    The obvious choice was the svn+ssh:// protocol I normally use, but in addition to SSH, I use public key authorisation with passphrases for all of my servers. A frequent problem was that Capistrano didn’t like asking for passphrases for remote machines.

    Since the repository and deployment machines are one in the same, I can use SSH forwarding to provide a recursive tunnel by defining the following in the deploy.rb script.

    set :user, "me" 
    ssh_options[:forward_agent] = true
    

    The variable user tells Capistrano which user has SSH access and the forward_agent option allows the same SSH credentials for the tunnel to the Subversion server. Now , if your svn user is different from the ssh user you’ll need to add another couple of things:

    set :svn_user, username
    set :repository, "--username #{svn_user} svn+ssh://hostname/repository/#{application}/trunk"
    

    These variables enabled me to use the default deployment tasks for my application, there’s no need to override them, just use the before_ and after_ hooks to define additional functionality.

    The result.

    I have two WordPress blogs deployed on my server using Capistrano and Subversion for remote control, including custom themes and third—party plugins. I’ve already redeployed to incorporate changes and everything has worked perfectly.

    Next… Drupal?

    Categorised in:

    No comments.

  6. OK… as I mentioned in my previous article, I’d had a change of heart on the approach for the Northamptonshire Bird Club website.

    Redefining the Architecture.

    I decided to start again by defining the information architecture for the site based on a proper discussion with the Club committee. The first few meetings on this topic just weren’t as well focused as they should have been; mostly my fault for not knowing what I wanted from them; but this time I tried targeting those features that the membership would really value. Each of the features that emerged seemed to fall into logical sections of the information architecture:

    • About the Club — including notices, events and membership contacts.
    • Content on Birding — after all it’s the main focus of the Club.
    • Social groups within the Club divided by specific interest.

    These overall sections were used as containers for the more specific features, and these formed the basis for implementation.

    I’ve tried an online tool called WriteMaps for developing and sharing the architecture of this site. I haven’t decided whether it’s the best way to approach the job yet, but here’s the link to the detailed sitemap.

    Implementing the Design.

    The original site used custom taxonomy — tagging — to enforce the architecture, with multiple sections of the site sharing the same content types. As I mentioned, this made it very confusing for the Club editors, which was reflected in the site presentation.

    Installing new modules.

    I needed to add several new modules to support the new content. There are several ways of doing this; this alone is a substantial topic; but the simplest is to download the module directory containing the code into the modules directory of your Drupal installation.

    Content types.

    For this redesign I decided that each of the features should have a dedicated content type so that users only need select the right one, there’s help text as you can see, and it’ll end up in the right place on the website. No more messing about with tags!

    The new create content menu

    A great tool for this is the Content Construction Kit (CCK) module. It makes implementing new content types very easy; no PHP required; and there are a wide range of modules that provide additional data fields. I’ve used several to provide dates, images and even GoogleMaps, take a look at the full list of compatible modules on the Drupal website.

    Once the CCK module is installed, all the changes you want to make can be managed from the Content types section of Content Management.

    The content type management menu

    Providing access.

    All these new content types need to have access control set–up before you can go any further. This is done in Access control, under User Management in the administration section of Drupal.

    The user management menu

    You should find both create and edit options to set under node module for the new content types.

    The node access control options

    Once these are set the content types should appear on the appropriate create content menus.

    Setting up the paths.

    But you’ll want to set the URLs to reflect the new architecture before deploying.

    I use Pathauto to provide aliases for my content that better reflect the structure of the website and present friendly URLs. You can do this manually, but if you can’t rely on your users to do this consistently I would recommend using Pathauto.

    The Pathauto settings are under Site Configuration, and it’s the Node paths you want to set–up for your new content.

    Overview of the options for the Pathauto module

    These, combined with the individual content types, provide the structure for the website. For example I wanted the bird guide to appear within the birding section of the site architecture with individual entries beneath this, so I set the pattern to birding/birdguide/[title].htm.

    Examples of node path settings

    Time for a View.

    The Views module provides the ability to present node data in a range of different formats. With the module installed your views can be managed from the Administer views section found under Site building.

    Example of the Views administration options

    Here you can define new views for each of the content types and define a URL from which the specific view can be accessed in the browser. In the image above you can seen that I wanted the bird guide list to appear as the default in the bird guide, and gave it the URL birding/birdguide. These views can generate lists, tables and customised sorting, in addition to the more standard web page presentations.

    …And a menu.

    Finally we’re going to want a menu from which all our good work can be accessed. The menus and blocks in Drupal can all be found in the Site building section.

    The sequence is simple, first create a new menu for the features you’ve implemented, under the Menus section, using the URLs of the views;

    Example of the birding section menu

    and then go to the Blocks section and put the new menu where you want it to appear on the website.

    Placing the menus in left sidebar on the website

    That should be it! Your new functionality has been added.

    Conclusions?

    Having established this workflow, I implemented each of the identified features one at a time, ensuring it was working and acceptable before moving on to the next.

    I believe, and feedback suggests my users agree, that this approach to building a Drupal website is far more successful than a taxonomy based one. I still use taxonomy, but it now provides addition information for particular types of content rather than forming the basis for site architecture.

    As for Drupal itself, it’s relatively easy to use, even without significant PHP knowledge, and the large community provides a huge range of contributed modules and support. This makes it a powerful way to develop feature rich, multi–user websites very quickly.

    On the downside, I’ve found providing users with an easy way to upload and insert images very difficult. There are serious problems with using the popular TinyMCE WYSIWYG editor and IMCE file handling together; individually they work OK, but together… I need to look at this again.

    I would definitely recommend trying Drupal out if you need a CMS, for an image rich website; such as a gallery; I’d try Flickr or, for ultimate control, hand coded XHTML.

    Categorised in:

    No comments.

  7. What are the components of a blog post?

    • The title of the post.
    • The name of the author.
    • The date on which the post was published.
    • An excerpt from the content.
    • The post body itself.
    • The tags associated with the post.
    • The categories into which the post has been placed.

    I’m sure that there are more, but this is as far as I got… so the big question is how do I mark this lot up in order to extract even more meaning?

    The two text fields, both being content; the excerpt and post body; don’t necessarily need any container since they’re build from paragraphs. However using <div> would give me a lot more control over the CSS, but is this adding unnecessary mark-up?

    I thought about creating an unordered list out of the post metadata; author, date, tags and categories. It’s all very well describing the whole lot using the ‘metadata’ label, but that’s not very helpful because they don’t belong together.

    I figure that the tags and categories are easy since they’re obviously lists, and unordered ones at that. But the title, author and date are a different matter. Including them to a list is definitely adding extra mark—up, so I haven’t.

    This is definitely an ongoing problem.

    Categorised in:

    No comments.

  8. I’ve come up with a brilliant idea to reuse my old Mac mini. I’m going to convert it into a server on my local network for development and hosting our personal web projects.

    OK… not very original, but the key point is that I want to be able to use the wireless networking, stick it anywhere, and not have to worry about peripherals. A very mobile server.

    I already work with remote servers over public networks, and rarely use anything but the command line. For this project I wanted to be able to use the Mac desktop. This seemed the perfect excuse to play with VNC. Additionally, I frequently use SSH and PKI for encryption and authentication respectively, but not VNC.

    The Plan.

    It seemed to me that there were several parts to the problem, with only one of which I’m familiar.

    1. Configure a VNC Client on the local machine.
    2. Configure a VNC Server on the remote machine behind a firewall.
    3. Enable SSH communication through the firewall.
    4. Lock it all up using an SSH tunnel through the firewall so the Server and Client could talk.

    Now to work!

    The Client.

    I settled on Chicken of the VNC (COTVNC), a open source project providing a VNC Client for Mac OS-X. Great, that’s just what I want and it gets good reviews, but I guess most other clients out there would work too.

    Once installed COTVNC takes almost no configuration, that all comes later in the SSH and Server.

    Connection set-up dialogue for Chicken of the VNC

    You might be able to see that I set up two connections; one for an unsecured connection, so that I could see if the security measures locked me out later; and this one for the secured connection, that’s why the host is the local machine.

    The Server.

    First I tried Apple Remote Desktop (ARD), but found it a little slow, but more importantly I couldn’t find a way to close the two ports in the firewall that the service automatically opened. While I’m diligently using SSH tunnelling to avoid compromising the security of my machine, these two ports are sitting there waiting for attack!

    Time to try a different approach. I chose to disable the ARD service, closing the firewall again and installed a third party VNC server. The one I selected was Vine Server from Redstone Software. The reason? Nothing better that I’d read good things about it in blogs and on message boards, it’s available for Mac OS-X, and it’s free.

    What is in the box for Vine Server on Mac OS-X

    For Mac OS-X it downloads as a disk image containing the Server and a Viewer. I just wanted the Server as I’m using COTVNC, so a drag toward the Applications folder and a double click later I’m ready to configure things.

    Vine server can be run in two different modes; as a System Server that starts automatically whenever the Mac starts up; or as a Desktop Server that can be run like any other application. Since I want to run my Mac mini as a remote headless — no keyboard, mouse or monitor — server, I only configured the System Server.

    Settings dialogue for Vine System Server

    Not especially difficult, but the eagle‒eyed out there might have spotted that I didn’t enable the “Require Remote Login” option; in fact I did the first time and bang went any connection. I reasoned that I’m using SSH tunnelling, so the Server won’t realise that the connection IS via SSH and block it.

    Set the System Server running, checking that it starts up again after a restart, and that’s the Server done.

    The Secure Protocol.

    Actually, this was pretty easy. Go to System Preferences > Sharing and enable the Remote Login service.

    Settings to enable the Remote Login service on Mac OS-X

    Make sure that the other services are disabled, unless you have a particular use for them; I’ll be enabling the Web Sharing service later. This should ensure that the firewall is closed on all ports except the one used for SSH — port 22.

    The Tunnel.

    The idea of the SSH tunnel was to forward any communications sent between port 5900 — the default VNC port — on the local machine and the remote machine, through an encrypted SSH connection.

    Now there are lots of utilities to help you manage your SSH world, but I tend to use SSH-Agent and the command line. I primarily use SSH-Agent to manage authentication, but it does have the ability to construct tunnels.

    Set-up dialogue for SSH tunnels in SSH-Agent

    If you’ve got PKI set up, you won’t even need to enter any passwords in order to establish the connection.

    The Result.

    Once your tunnel is connected, you can start up COTVNC, or equivalent, and log‒in!

    An image of the desktop on the remote machine

    Everything appears to work and I find Vine Server much more responsive than the Apple free offering.

    By the way, I tried logging in with the unsecured connection and was kicked out.

    Categorised in:

    No comments.

  9. I’m writing on the 30 day trial of MarsEdit, the blog editing tool for the Mac. Given that this is my second post of the day — very rare, I know — you might have gathered that I like it.

    I’ve always edited my online content remotely, I have a local copy and can work off–line. I use TextMate for most of my development work and I’ve been using it for blogging too.

    OK… I was reluctant to change. I like having full control over mark–up and haven’t been impressed by a WYSIWYG editor yet, for Web use at least. Untried, I ranked MarsEdit amongst them.

    I must apologise to the developers. It’s a great and flexible tool. Hope I’ll be doing a little more blogging!

    Categorised in:

    One comment — it’s a start.

  10. Virtualization is definitely a big trend in computing and I’m growing to love it.

    On the Web.

    My production server environment is virtualized by the Xen hypervisor; providing a more flexible and cost effective solution.

    I like the freedom of complete root access but, given my relatively low traffic volumes, the cost of a dedicated server would be prohibitive. However, Xen provides me with my own little chunk of hardware resources that no other user’s going to break for me.

    The great thing is that these resources can be altered very quickly to respond to changes in my requirements; great scalability in a changeable world.

    On the Desktop.

    I’m also making extensive use of virtualization on my desktop using VMWare Fusion. I’m a Mac user, but one of the attractions of the VMWare product is the interchangeability of any virtual machine (VM) between platforms.

    VMWare Fusion.

    VMWare have been in the business of Virtualization of a while now, and have a powerful range of products. Whilst many of these are targeted at the enterprise environment, Fusion is definitely a consumer product; in a good way; and the benefits to me so far…

    • Surprisingly seamless Windows XP including Office, in my experience a much better product than the sadly neglected Mac version. Fusion has a ‘Unity’ mode, which places these applications, running in a Windows environment, right on my Mac desktop.
    • I’ve tried different Linux flavours for the desktop and server, and I haven’t needed multiple machines. A great asset when you like to dabble but don’t have much free space; small house you see; and want to keep the bills down.
    • I’ve tried a whole range of software products without the usual worry of messing up my regular working platform, if it all goes wrong I just delete the VM and start again. If I might want to return to this set‒up again, I can take a snapshot of the current installation, or copy the VM file to a backup location so I don’t have to start from scratch each time.
    • Finally, I’ve build VMs of the production server for deployment testing. I know that they’re not identical, but they’ve been good enough to iron out problems in build and deployment scripts before unleashing them on the production server itself.

    A virtual network.

    Fusion has a built‒in DHCP server to provide IP addresses, or they can be assigned by an external network using the bridged network option.

    After exploring these options I discovered that I could build a virtual development network right on my laptop and make it as private as I want. Oh, yes, you can fix the IPs the server hands out, making it much easier to edit that hosts file.

    The NAT option can access the outside world, to install updates for example, by sharing the host connection. However it’s protected from external access. My physical home network uses NAT via an ADSL router, but this is a great option if you’re likely to take your laptop network out on the road and I use it for the majority of my installations.

    If you’re even more worried about unauthorised access to your latest development project, you can use the host‒only option; access only from the host machine or other local VMs using this network set‒up.

    With all the VMs using the same network option, they can all see and access one another. So now I can write my code on the host Mac, test deployment to a virtual CentOS Linux server, and check how it looks on Windows. It’s self contained, I can flip between machines and it’s all totally mobile.

    Categorised in:

    No comments.

  11. I’ve heard and read the recommendation to always avoid doing speculative work for free. In most cases this advice refers to website graphic design, and is intended to avoid wasted effort and pilfered designs.

    I’ve always found that the experimentation the most effective way to investigate new ideas, whether methodologies or technology. Frequently, these experiments — prototypes if you prefer — are also the best demonstration of innovative ideas to everyone else.

    This conflicts with the avoidance of working for nothing. All this leads me to conclude that the correct approach depends on personality and the application.

    Read more of The right approach for me

    Categorised in:

    No comments.

  12. I don’t feel I’ve got the programming experience I’d like for my future plans. So, I’ve got one of those personal project — the type that you never seem to get round to — in mind to provide me with a good workout.

    Which programming platform to use for the server-side application? Whilst I have to admit that I’m not the greatest fan of PHP, it’s definitely the best option. Why? Because I need to run this application locally on a minimal server and PHP is available wherever you find Apache, and the skills should have some commercial value.

    I’ve recently read a great deal about agile development, TDD and employing software design patterns. As part of this project I’d like to apply some of what I’ve learned.

    A test framework.

    Now I’m going to need a testing framework, and I’ve gone for SimpleTest. This framework not only provides unit testing, but the ability to create tests for web pages. I prefer to run my test suites from the command line, which is relatively easy to arrange with the TextReporter object. I’ve combined the whole thing with Apache Ant to automate most of the tasks in the project, including deployment.

    Unfortunately, it appears that SimpleTest doesn’t play particularly well with PHP5, although they’re in the process of making the transition.

    I’ve encountered the mass of error messages generated as the result of E_STRICT. This is easily solved by using a customised php.ini file as an option at the command prompt when executing the test code. Once this is done you can see the actual test messages!

    A more significant problem is that the Mock object code cannot be called as static class methods in the way the documentation suggests. A little snooping through the code leads me to think that it’s due to PHP4 without the static keyword in the method headers required by PHP5. I don’t have a work-round for this, and I don’t want to have to alter all this code. I hope they address this as the transition to PHP5 continues, but at the moment my code is simple enough for me to write my own mocks.

    When all is said and done, if you know how to use any of the xUnit test frameworks, SimpleTest is very easy to set-up and use.

    Driving with tests.

    Simple the tests may be, but using them to steer the direction of your coding effort takes a different mindset. The hardest part is learning which questions to ask when developing your tests. Asking the right questions about functionality will result in clean, precise code.

    There’s always a temptation add just a little more functionality, but resist it. The point is to remain in control of the code at all times. When it’s not working, it must be because you’ve added new tests describing new functionality. The code should never contain functionality that hasn’t been demanded by a test. Good refactoring can produce beautiful code without breaking the tests — still in control.

    I think I’m getting the hang of it in relatively simple cases, but there’s much more to learn. I’ve found it a very liberating way to develop software, whilst remaining in total control — you are using version control?

    Patterns in the code

    Whilst there are loads of MVC based frameworks out there, I want to know how it works first hand. This topic is worth an article of it’s own, and that’s what I’ll give it.

    There’s a good chance that the core application model will need to implement a facade pattern, but lets not make any assumptions.

    Categorised in:

    No comments.

  13. I’ve just spent some time customising a few icons on my desktop. After a while it occurred to me that I could have been doing something productive instead. But what’s productive and what’s not?

    My partner, Clare, works for a medium sized company that has grown significantly over the last few years. A couple of days ago, she was complaining about the way everything on her computer is now so tightly controlled you can’t even personalise the desktop background. The working environment has become utterly uniform with a one size fits none approach.

    To my mind, an employee’s existence is not driven to enhance the business that pays their salary. Whilst most staff display a professional pride, at the heart of it their lives are about enjoying themselves. Spending much of that life at work, it’s understandable that they want a workplace that’s comfortable, inspiring and enjoyable to be around; minimal aggravation and maximum enrichment.

    So why do most companies persist in equating success with the creation of a sterile working environment?

    Business isn’t just about making happier, better people, it’s about making profit. It’s ability to do that is proportional to the productivity and creativity of its staff. In turn they’ve been repeatedly shown to be more cost effective if they’re happy and motivated.

    Creating the icons was a random creative act. I realised later that this initiated a number of useful insights relating to several business focused activities. Thinking back, it isn’t the first time this has been the case, just the first time I noticed.

    Computer systems are endemic in the business today, and they have their part to play in enriching the workplace.

    Encouraging general creativity in employees can invigorate business innovation, essential in a rapidly changing world. Letting them express themselves, through background images of friends, family or their own graphic creations for example, will certainly help them feel less like a cog in the machine. These small concessions might lead to your most profitable product.

    Categorised in:

    No comments.

  14. I love reading, and this Christmas resulted in a pile of new books — courtesy of the Amazon wish-list. I’ve been inspired to rethink my approach to development by two titles from this collection.

    The first is “The Art of Agile Development” by James Shore and Shane Warden. I’ve been introduced to agile development methods in one of my Open University courses, but this is the first detailed description of the practices adopted by agile teams.

    The second tome is “Transcending CSS” by Andy Clarke, which I must confess I was unsure about when I asked for it. I needn’t have worried, this is the best web design book I’ve yet read. I’ve learned a lot about the finer points of CSS positioning and Andy’s semantic approach to mark-up gels well with my interest in the XML in general.

    The most exciting common factor concerns the topic of prototyping. It seems to me that approaching the whole application — from the persistence to presentation — with feature targeted development and frequent, early prototyping makes good sense. If nothing else this agile approach fills me with enthusiasm, and that may be half the battle.

    Read more of Inspirational reading

    Categorised in:

    No comments.

  15. After reading PC Pro magazine issues 159 and 160, I was surprised to find them recommending Webfusion for those wishing to become a web host themselves. My disbelief was due to my own experiences.

    I wouldn’t argue with their observations on this providers reliability, but the main problem with Webfusion, or their parent Pipex, arises when you need any technical support. I short, there isn’t much and that isn’t very knowledgeable; possibly unless you’re a national magazine.

    I contacted Webfusion about a problem that arose with my VPS; six weeks later and after much email, I moved to Memset without the matter being resolved. And as for Pipex, I’m still waiting for an answer to my questions about my broadband package after nearly a month.

    Pipex services are low cost, reliable and performance is generally good; which would be great if their accounting and technical support was less dreadful. If your needs are mission critical this makes Pipex the biggest potential problem your business might have. The risk is yours, but it’s not one I’m willing to take any more.

    Categorised in:

    One comment — it’s a start.

  16. I’ve been working on a website for the Northamptonshire Bird Club which nominated committee members could easily manage themselves. I decided that a Content Management System would be be best way to achieve this, and being a fan of open source I finally settled on Drupal. I liked the modular approach to the software and I hope this will provide me with the scope to alter the website functionality as the Club’s needs changed.

    The scope for customization in both the information architecture and presentation is huge in these systems, and I have to admit I was pretty shaky on where to start. I read blog posts and watched video tutorials, most of which were excellent, but I have often found that personal experimentation is the best way to find things out.

    I started be using taxonomy to link content together. I customized the default content types to present a range of taxonomy terms from which the users could select to define the nature of the document. I’ve found that this leads to a patch association and presentation which is pretty hard for inexperienced users to follow. Basically, it’s a bit of a mess!

    I’ve subsequently installed the Content Construction Kit (CCK) module and I’m impressed with its flexibility. I don’t think it’ll handle some of the more complex content types that I’ve in mind, but these would be best implemented as separate modules anyway.

    The CCK module allowed me to define customized content for each type of blog post, article, or sighting report that the Club needs. What’s more it creates an input form for each, allowing members to simply select the form they need and fill in the blanks. Much easier to control and far less confusing.

    I’ve also discovered the Views module, and I’m hopeful that this will provide a far better way of ordering the website architecture than the old taxonomy driven solution. This module should allow me to really leverage the new content types I’ve defined and produce just about any content presentation I want.

    I’ll post how I get on, but right now I’ve got a video tutorial on Drupal CCK and Views to watch.

    Categorised in:

    3 comments.

  17. I went over to the Apple Centre in Solihull, that’s in the UK, to pick up my newly repaired MacBook Pro this Monday. I thought I’d wait a bit before posting the results to make sure that the fix actually worked.

    I can’t fault the service I received from the Apple Centre, but the quality of Apple’s online and telephone support is appalling.

    I went round and round the automated telephone system chasing the status of my repair until I felt like I was about the have a brain haemorrhage. I’d already tried the online service only to find that it had no more idea about the status of my laptop than I did! Fortunately, I got a call from Solihull to tell me the laptop was ready just as a was beginning to wonder if I’d ever see it again.

    It turns out that is was a failure of the new LED display, and to their credit Apple duly replaced the whole clamshell unit containing the screen. The fix seems to have worked, but my confidence in the design’s longevity has definitely been shaken. This blow is particularly keen due to the fact that the repair would’ve cost nearly £400 if the laptop wasn’t under warranty.

    The long term question is now whether I should consider taking out the AppleCare extended warranty. It’s a lot of money, £279 for two extra years, but if the equipment is this unreliable…?

    Categorised in:

    No comments.

  18. Back in the System 6 era, Apple Macs were niche products; well made, often expensive and largely found in academic circles. I always felt the problem was that Apple had a clearly superior product, but were just plain rubbish at marketing themselves. Wow, times sure change!

    My first Apple was back in the days of System 6 and a the Mac Plus, a combination that comprehensively beat the pants off the Windows offering of the day. Apple hardware was better build and more reliable that the generic PC equivalent and the software was more polished and usable. But that Apple was never any good at mass marketing, and the resulting niche market lead to lower volumes with higher costs.

    Apple have always had a knack for well executed, innovative design. Their hardware and operating system software has always been inseparable, making their developers jobs a little easier and leading to more complete products; a deliberate move.

    In addition, the Apple of today is a more efficient and focused corporate entity with effective marketing at its core. Look at the way they’ve trained people like Pavlov and his dogs; the website goes down and the Web is full of rumour about fabulous new devices.

    But I guess this must come at a price and that is the old business models, where products were released when they were ready. Microsoft has long been marked as an example of the worst excesses of technology corporations, but is Apple much different any longer? I personally don’t think so, and not just because my bad MacBook Pro experience.

    To be fair, the bigger your market share the greater the probability the people will talk about your failures. Yet we’re all hungry for the next big thing. No wonder technology companies now frequently practice early prototyping, fixing the problems in after-sales. It’s a tricky tightrope between reputation and lost market share.

    In short, the mass marketing Apple has joined Microsoft in the big time and is bound by the same rules. Why should we expect a different result?

    Categorised in:

    No comments.

  19. I’m an Apple user that recently I splashed out on a 15 inch, 2.2 GHz MacBook Pro. So why am I having to write this on my old Mac mini?

    The day came and I received my MacBook Pro; beautifully presented in carefully designed and executed packaging. I opened it up and was immediately impressed by build quality that put my past laptops, Dell and Toshiba, to shame. The new LED screen was the very impressive, almost as good as my external Dell 2007WFP.

    Before you get the impression that I’m one of those people that get over excited by anything with an Apple on it, I should point out that the MacBook Pro is not without faults. It lacks a few USB ports, could do with more battery life, gets too hot for my liking; though I’ve never felt in physical danger; and as a result the fan can get a little loud.

    However, in use everything was going as well as I had hoped. All my favourite applications worked well and I am a convert to virtualisation, with both Windows XP and CentOS Linux running at the first attempt.

    But less than three months later and I’m using my good old Mac mini again. The display suddenly dimmed and started to flicker. The local Genius bar, 30 miles away, think that either the backlight or display logic board has failed and are going to replace them under warranty. They were helpful and very apologetic, but have had it for six days now and I’ve not heard anything.

    It’s pretty disappointing for what I previously considered a quality brand. I’ll be posting how well Apple handle the problem, both this repair and the ongoing MacBook performance.

    Categorised in:

    No comments.

  20. I always like to find and use the tools that best fit my objective. When you manage this life becomes both more interesting and more fun.

    I’m not happy with the web hosting package I currently use. I mean, does Fedora Core 2 sound good to you? OK, I know, it depends what I’m trying to do…

    I’m trying to develop Java and Ruby on Rails applications, and just getting the thing configured with such an antiquated version of Fedora is an up hill battle! So I’ve decided to make alternative hosting arrangements before trying anything serious.

    On the back of a new business enterprise — Google needn’t worry for the moment — I’m going to get a couple of new VPSs.

    1. A development server; the RoR and Java machine with the appropriate server stacks.
    2. Production hosting of Drupal 5 installations with LAMP for my clients, which are hard enough get faultlessly configured on the current system.

    It also seems like a good idea to separate development and production; I’m bound to knock over the development server at some point.

    Both these systems are going to be based in the UK. They’re also going to be much more expensive than my current VPS, but I’ve learned that you often get what you pay for and I’m prepared for the expense.

    The new host? I’ve asked questions of several and the most responsive and impressive to date is MEMSET and its Miniserver Virtual Machine range.

    Categorised in:

    No comments.