Latest


VPN Issues with O2 Wireless Box II

For the last few months I have been connecting to the VPN at work via my O2 Wireless Box II quite happily until it suddently stopped working about 2 weeks ago which has caused me no end of headaches (tight deadlines looming etc). Each time I tried to connect I got presented with a "Error 619 - Disconnected"

I have had my laptop checked out by the IT guy and everything connected fine when it was in at the office and even my iPhone could connect to the VPN when using 3G but this Error 619 kept appearing each time I tried to connect to the work VPN via my O2 Wireless Box II using either the laptop or iPhone.

Read more

Sony VGN-FE21B Memory Stick fix for Windows XP

My Sony VGN-FE21B laptop has been having problems with performance over the last few months, applications were taking a long time to load and the hard drive was getting cluttered with obsolete files, so at the weekend I decided to re-install Windows XP Pro onto my Sony VGN-FE21B laptop.

The original operating system was Windows XP Home but since the laptop has been bought primarily for work purposes, I had also bought a copy of Windows XP Pro but each time I install Windows XP Pro on my Sony VGN-FE21B laptop it always has a missing icon for the memory stick in My Computer. I imagine this is because the hardware is specific to Sony and not a generic Windows XP driver.

Read more

mysqldump on Windows gives "Access is Denied"

I recently had to back up a MySQL database on a windows server so I could restore it to my local MySQL server for analysing the structure of an existing site which we are going to be rebuilding. I have done this hundreds of times on linux server but the usual command did not appear to work on this windows server. I was using:-

but when I ran this I was presented with an "Access Denied" message.

Read more

Wordpress wp_redirect() shows a blank page

Over the last few weeks I have been working on my first wordpress plugin and I am quickly getting to grips with how it all pieces together but I ran into a problem with a rather basic piece of functionality that pretty much rendered the plugin useless until I figured out the issue.

The section I was working on was a form submission (within the wordpress administation) which saved the form values into the database and then redirected the user upon success to another page (using wp_redirect) but this resulted in a blank content pane.

Read more

User Profile Service Failed the Logon

This Christmas was the quietest Christmas I have had in years in terms of the obligatory "if you have got the time" IT jobs as I only had 1 request for fixing a computer this year (instead of the 4 computers and a DVD player I had a few years back... all requested within 2 hours of arriving home).

Luckily this one turned out to be relatively simple and only took 5 minutes to fix although when I first heard about it I thought it was going to take a few hours. My aunt and uncle reported a problem with logging into their laptop (running Windows Vista Home Premium) on my uncle's profile where it would give an error message "The User Profile Service failed the logon", after which it would simply return them to the profile selection screen.

Read more

Raw SQL from Doctrine Query Object - Revised

A few months ago I posted an article taking about how to get the raw SQL from a Doctrine Query Object but with the release of Symfony 1.3 and Symfony 1.4 it would appear that the code no longer works.  As a result I've updated the code to work with Symfony 1.2 - 1.4 and you can find the updated source below:-

function get_raw_sql($query) {
    if(!($query instanceof Doctrine_Query)) {
        throw new sfException('Not an instanse of a Doctrine Query');
    }
 
    $query->limit(0);
    
    if(is_callable(array($query, 'buildSqlQuery'))) {
        $queryString = $query->buildSqlQuery();
        $query_params = $query->getParams();
        $params = $query_params['where'];
    } else {
        $queryString = $query->getSql();
        $params = $query->getParams();
    }
 
    $queryStringParts = split('\?', $queryString);
    $iQC = 0;
 
    $queryString = "";
    
    foreach($params as $param) {
        if(is_numeric($param)) {
            $queryString .= $queryStringParts[$iQC] . $param;
        } elseif(is_bool($param)) {
            $queryString .= $queryStringParts[$iQC] . $param*1;
        } else {
            $queryString .= $queryStringParts[$iQC] . '\'' . $param . '\'';
        }
 
        $iQC++;
   }
   for($iQC;$iQC < count($queryStringParts);$iQC++) {
       $queryString .= $queryStringParts[$iQC];
   }
 
    echo $queryString;
}

I hope that it proves useful.

Read more

TRUNCATE TABLE with Symfony and Doctrine

I am often importing data into a symfony project from an existing site or a CSV file and re-writing this data into the fixtures.yml is usually too complicated or time consuming so I end up writing bespoke import actions.

While I am writing these actions I often find that I have to delete the contents of the MySQL tables as you can never write the routine complete and accurate in one go so as you build it up in smaller steps you find that you have to get rid of the previously old data.

Read more

Magento API - Update Product Stock Levels

Another day... another magento problem!

I was asked to look into a problem with an automated stock level update script not updating the stock levels.  This update script was using the Magento API and on the face of things everything looked ok as the script ran without any errors, the product prices got updated but the stock levels never changed.

Read more

Raw SQL from a Doctrine Query Object

As my use of Symfony is increasing I find myself frustrated that there doesn't appear to be an easy way to get the raw SQL from a doctrine query object so I can simply output it and paste it into phpMyAdmin to debug problems with the SQL. I may be wrong about this but as yet I have not found a built in function to perform this operation.

Sure I am able to output the query with the "?" indicating where the necessary values are to go and I can also easily output the array of query parameters so I can substitute these manually but this takes time and it would be much much simpler and quicker to just output the whole query with the substitution already done so it's a simply copy and paste of the raw SQL from the doctrine query object straight into phpMyAdmin.

Read more

Advertisement

Digital Ocean

Reading List

www.thoughtworks.com

BFF @ SoundCloud

Our friends at SoundCloud embarked on a journey a few years ago that changed their system and moved it from a monolithic Rails application towards an ecosystem of microservices. Read more

The Drum

The Drum

Google'€™s AMP is bringing some much needed speed to mobile but the transition won'€™t be easy for publishers

A week after launching, the Google-led Accelerated Mobile Pages (AMP) initiative has raised more questions than answers for publishers... Read more

SitePoint

SitePoint

Quick Tip: How to Permanently Change SQL Mode in MySQL

MySQL 5.7 introduced some awkward changes for older codebases and tends to break apps. Here's how to temporarily (or permanently) lower the strictness level Read more

SitePoint

SitePoint

How to Build Your Own Dependency Injection Container

Andrew Carter builds a Dependency Injection container from scratch, showing you how that rocket science is really just fireworks strapped to lego figures! Read more

AuthorityLabs

AuthorityLabs

13 Reasons Your Organic Traffic is in Decline | It's Not a Penalty

The landscape of search engine optimization has changed drastically in the last 3-4 years. Even as it changes, a lot stays the same. It has been very challenging to see a multitude of friends and colleagues approach me with problems that often seem beyond repair with clients that they have worked with for years. Read more

Telerik Developer Network

Telerik Developer Network

Leveling Up Your JavaScript

Raymond Camden offers tips, techniques and tools that can improve your development skills for anyone learning JavaScript. Read more