After taking a bit of a break from blogging, I decided that it was time that I should do something again.
Anyway, last month I took a stab at upgrading PHP to version 5.4, which contained some nice little features and performance improvements. Almost everything went fine, apart from one little thing which made me roll back to version 5.3.x, which was that no matter what I did, no matter how hard I tried, I couldn’t initiate a secure LDAPS connection over our network. This is used to do some Active Directory bits and pieces and so without using an LDAPS connection there was no hope. Everything looked fine though, it was almost as if it just didn’t want to do it for whatever reason.
Anyway, a few days ago, along came 5.4.1 which even though I have checked, doesn’t mention any changes to the LDAP / OpenSSL extensions. I thought that I would give it a go – and guess what – it worked!
In addition to the above, PHP 5.4 now supports paged LDAP results whereby it contains a fix for missing feature to retrieve more than 1000 items from an LDAP server at any one time without making changes to your Active Directory configuration.
Specialising in the development of PHP, MySQL, SQL Server, IIS and Windows Server environments within the education sector. Specifically, most of my development work revolves around a highly customised and integrated version of Moodle.
Wednesday, 2 May 2012
Thursday, 16 February 2012
Fixing MySQL Error 1067 on Windows Server 2008 r2
Let me just start by saying that this has been really annoying me for some time now and obviously taking the server offline to fix this is difficult at the best of times. Fortunately, this week I've had the time to take a look at this and see if I can sort the issue.
From looking at all of the various 'solutions' out there, it doesn't actually seem that any of them are correct. Don't get me wrong, I'm sure there is one somewhere but I didn't manage to find it past page two of Google so I thought I would give it a go myself. Just to save you some time, the following doesn't work despite what a lot of people will have you believe (and if they do, then you have been lucky):
So, in essence you will actually need to do most of your preparation that you would normally do for an upgrade. You might as well download the latest version of MySQL while you do this so firstly go and grab that. Next, do your normal backup of your databases and also your my.ini from wherever you normally keep it. Stop your MySQL service and then uninstall your MySQL installation. Go to your ProgramData folder and remove your MySQL folder, and do the same in your Program Files\MySQL folder (remove your server folder just in case you have your tools or workbench installed in there). Now go to your Users folder and have a look through there and it will normally be hidden in your Default\AppData folder. Launch regedit and search for 'mysql' and remove any instance of it that is related to your server install. Restart your server now.
When your server comes back on, run your nice new installer, giving it the same settings that you had before. Set a new instance up (it can be the same service name if you like) and then it will go off and set your my.ini, your service and your security settings. Your service should now be running straight away. Just to check it though, stop the service and start it again. You should find that it's running without erroring. If it does error, not to worry, open a command prompt and browse to your bin folder inside your new installation and run the following:
Lastly, restore your databases and users / permissions and you should be done. Sorry that this is a bit lengthy but this worked for me and every other solution that I found didn't sort my problem. It seems that this error goes way, way back to MySQL 4.x but nobody has worked out a way to fix this properly. As I mentioned before, other people have posted their solutions which may have worked for them, but that could mean that this is an inconsistent error which is why it hasn't been fixed as of yet.
From looking at all of the various 'solutions' out there, it doesn't actually seem that any of them are correct. Don't get me wrong, I'm sure there is one somewhere but I didn't manage to find it past page two of Google so I thought I would give it a go myself. Just to save you some time, the following doesn't work despite what a lot of people will have you believe (and if they do, then you have been lucky):
- Removing the service and reinstalling;
- Removing and recreating the log files;
- Repairing the install;
- Recreating your MySQL instance;
So, in essence you will actually need to do most of your preparation that you would normally do for an upgrade. You might as well download the latest version of MySQL while you do this so firstly go and grab that. Next, do your normal backup of your databases and also your my.ini from wherever you normally keep it. Stop your MySQL service and then uninstall your MySQL installation. Go to your ProgramData folder and remove your MySQL folder, and do the same in your Program Files\MySQL folder (remove your server folder just in case you have your tools or workbench installed in there). Now go to your Users folder and have a look through there and it will normally be hidden in your Default\AppData folder. Launch regedit and search for 'mysql' and remove any instance of it that is related to your server install. Restart your server now.
When your server comes back on, run your nice new installer, giving it the same settings that you had before. Set a new instance up (it can be the same service name if you like) and then it will go off and set your my.ini, your service and your security settings. Your service should now be running straight away. Just to check it though, stop the service and start it again. You should find that it's running without erroring. If it does error, not to worry, open a command prompt and browse to your bin folder inside your new installation and run the following:
mysqld -remove MySQLWhere MySQL is the name of your service that you specified. Assuming that you have typed that in correctly it will say that it has removed the MySQL service. Now run the instance configuration wizard again (inside your bin folder) and go through it again.
Lastly, restore your databases and users / permissions and you should be done. Sorry that this is a bit lengthy but this worked for me and every other solution that I found didn't sort my problem. It seems that this error goes way, way back to MySQL 4.x but nobody has worked out a way to fix this properly. As I mentioned before, other people have posted their solutions which may have worked for them, but that could mean that this is an inconsistent error which is why it hasn't been fixed as of yet.
Tuesday, 10 January 2012
Looking for My Briefcase in Windows? Microsoft SyncToy is Your Solution!
Remember the days where you had multiple devices that could sync from one location on Windows? Well, when Windows 7 launched I assumed that something like this would exist as a built in feature. I was wrong.
Instead, Microsoft seems to have gotten into the habit of releasing smaller applications as addons for Windows as part of the PowerToys range; one of these is Microsoft SyncToy. According to Microsoft, 'SyncToy 2.1 is a free application that synchronizes files and folders between locations. Typical uses include sharing files, such as photos, with other computers and creating backup copies of files and folders'.
Just last week I was in the position where I needed to have a synchronised set of data that existed on two servers (not ideal I know but it couldn't be helped in this case) and there wasn't any built in solution that I could find. After a bit of searching around I came across SyncToy 2.1 from Microsoft. And it does exactly what it says on the tin. There are both 32 and 64 bit versions available here for your download pleasure.
SyncToy has a friendly interface, that gives you the choice from where you want to sync from (left folder) and where you want to sync to (right folder). There are then three types of sync that you can do:
So there you have it, the return of Microsoft Briefcase! I've tested all three syncs and they all work well, as does the scheduled task. My only criticisms are that this should be part of the OS and also the scheduling should be built in.
On a final note, I've been working on a web paper recently located over at paper.li called the Web Feed which takes a look at an in depth range of articles from around the web and also takes a look at the latest in technology news.
Instead, Microsoft seems to have gotten into the habit of releasing smaller applications as addons for Windows as part of the PowerToys range; one of these is Microsoft SyncToy. According to Microsoft, 'SyncToy 2.1 is a free application that synchronizes files and folders between locations. Typical uses include sharing files, such as photos, with other computers and creating backup copies of files and folders'.Just last week I was in the position where I needed to have a synchronised set of data that existed on two servers (not ideal I know but it couldn't be helped in this case) and there wasn't any built in solution that I could find. After a bit of searching around I came across SyncToy 2.1 from Microsoft. And it does exactly what it says on the tin. There are both 32 and 64 bit versions available here for your download pleasure.
SyncToy has a friendly interface, that gives you the choice from where you want to sync from (left folder) and where you want to sync to (right folder). There are then three types of sync that you can do:
- Synchronize: Does a left and right sync which includes deletes and renames;
- Echo: Updates and new files are copied left to right including deletes and renames;
- Contribute: Same as echo without deletes;
So there you have it, the return of Microsoft Briefcase! I've tested all three syncs and they all work well, as does the scheduled task. My only criticisms are that this should be part of the OS and also the scheduling should be built in.
On a final note, I've been working on a web paper recently located over at paper.li called the Web Feed which takes a look at an in depth range of articles from around the web and also takes a look at the latest in technology news.
Wednesday, 21 December 2011
Upgrade of Moodle 1.9.10
Because this time of year is so quiet, I thought that I would do a small point release upgrade of my standard Moodle 1.9.10 install to the current latest version of 1.9.15 as of today.
There are a few reasons that I wanted to get this done and out of the way before January. Some of my reasons were:
Anyway, as for the update. It actually went very smoothly and quickly. The entire update was done within a few minutes. This is what I did in preparation:
Note to all those upgrading from 1.9.x to version > 2.0.x, make sure that you upgrade to version 2.0.x first before attempting to upgrade to either 2.1.x or 2.2.x. The changes made in version 2.0 were large and so it is recommended within the Moodle documentation that you do this first.
There are a few reasons that I wanted to get this done and out of the way before January. Some of my reasons were:
- General bug fixing;
- Performance upgrades;
- Module enhancements;
- Preparation for Moodle 2.x upgrade;
Anyway, as for the update. It actually went very smoothly and quickly. The entire update was done within a few minutes. This is what I did in preparation:
- Backup the database and file structure;
- Copy over the top of the existing files with the new files;
- Run the update;
Note to all those upgrading from 1.9.x to version > 2.0.x, make sure that you upgrade to version 2.0.x first before attempting to upgrade to either 2.1.x or 2.2.x. The changes made in version 2.0 were large and so it is recommended within the Moodle documentation that you do this first.
Monday, 19 December 2011
IE6: The End Nudges Closer
Microsoft has today announced that from January 2012, Internet Explorer updates will automatically be downloaded and installed in the background whilst retaining all of your custom settings like addons and search providers.
The new feature will work for those who have automatic updates enabled on their machine and this means for anybody using Windows XP you will be jumped up to version 8, whilst if you are on Vista or Windows 7 you will be pushed to IE9 whether you like it or not. This is definitely a good thing for Microsoft as it means that the death of IE6 just moves that little bit closer.
In the past I have criticised Google and Mozilla for pushing out these updates on the stealth as it means that developers are constantly having to make changes - especially when they both at the moment are doing a new release every eight weeks. In terms of security, this is most definitely a good thing for the Internet as a whole. I myself as of earlier this year completely dropped support for Internet Explorer 6 as it was simply becoming too difficult to maintain.
Ie6countdown.com has the world usage for IE6 pegged at 8.3% as of today, with certain countries faring better than others. For example, the UK has 1.8% and the US has 1.0% - fairly impressive, however China is massively behind here at a massive 27.9%. I can only put this down to counterfeit software but whatever happens, the Internet will go on with and without it.
As a final note to those of you out there still using IE6, please, please, please update!
The new feature will work for those who have automatic updates enabled on their machine and this means for anybody using Windows XP you will be jumped up to version 8, whilst if you are on Vista or Windows 7 you will be pushed to IE9 whether you like it or not. This is definitely a good thing for Microsoft as it means that the death of IE6 just moves that little bit closer.
In the past I have criticised Google and Mozilla for pushing out these updates on the stealth as it means that developers are constantly having to make changes - especially when they both at the moment are doing a new release every eight weeks. In terms of security, this is most definitely a good thing for the Internet as a whole. I myself as of earlier this year completely dropped support for Internet Explorer 6 as it was simply becoming too difficult to maintain.
Ie6countdown.com has the world usage for IE6 pegged at 8.3% as of today, with certain countries faring better than others. For example, the UK has 1.8% and the US has 1.0% - fairly impressive, however China is massively behind here at a massive 27.9%. I can only put this down to counterfeit software but whatever happens, the Internet will go on with and without it.
As a final note to those of you out there still using IE6, please, please, please update!
Thursday, 15 December 2011
Manage Memory Limits SQL Server Enterprise 2008
Currently on our network is a server that's running SQL Server Enterprise 2008 running on our Hyper-V cluster. On the cluster, dynamic memory is enabled. Now, normally this isn't a problem, but when configured incorrectly SQL Server Enterprise will eat up as much data as it needs and so you suddenly have a server (low usage) that is eating up 14gb of memory.
The solution is to go to SQL Server Management Studio and right click on the server in the task pane on the left and go to properties. Under memory on the left is an option to set max server memory in megabytes. By default this is set to 2147483647mb (maaaaaaaassive). The minimum you can set this to is 4mb but that would be silly now and so after a bit of a debate we decided that 6144mb (6gb) would be a nice number. It now means we can continue to use dynamic memory on the VM without having to set static amounts of memory for the server itself.
The solution is to go to SQL Server Management Studio and right click on the server in the task pane on the left and go to properties. Under memory on the left is an option to set max server memory in megabytes. By default this is set to 2147483647mb (maaaaaaaassive). The minimum you can set this to is 4mb but that would be silly now and so after a bit of a debate we decided that 6144mb (6gb) would be a nice number. It now means we can continue to use dynamic memory on the VM without having to set static amounts of memory for the server itself.
Wednesday, 14 December 2011
Chrome 16 Out Now
Today sees Chrome 16 released as part of the Google rapid release cycle. With it comes the ability to sync your life, for example when you upgrade to version 16 your home machine with Chrome and your work machine with Chrome will share everything like your extensions, settings, history, bookmarks and other things between each other.
Obviously, in able to do this you will need to pair your Chrome with your Google account which also has other benefits including being automatically logged in to any Google based sites. Is this potentially dangerous though especially with Google + (Plus)? The jury is out on that one for now I think.
Personally for me, this is where Mozilla is going wrong with Firefox. These features simply don't exist and once upon a time it would have been Firefox with all of the new bells and whistles so for me this deserves a pat on the back. Well done Google! Now that Mozilla are following Google with their rapid release cycle, I think it will be even harder for Mozilla to keep up.
Chrome 16 is available to download now, or if you already have Chrome installed then just sit back and wait patiently for Chrome to update the next time you load up your browser.
Obviously, in able to do this you will need to pair your Chrome with your Google account which also has other benefits including being automatically logged in to any Google based sites. Is this potentially dangerous though especially with Google + (Plus)? The jury is out on that one for now I think.
Personally for me, this is where Mozilla is going wrong with Firefox. These features simply don't exist and once upon a time it would have been Firefox with all of the new bells and whistles so for me this deserves a pat on the back. Well done Google! Now that Mozilla are following Google with their rapid release cycle, I think it will be even harder for Mozilla to keep up.
Chrome 16 is available to download now, or if you already have Chrome installed then just sit back and wait patiently for Chrome to update the next time you load up your browser.
Moodle 2.2: Coming to a Webserver Near You
Last week saw the release of Moodle 2.2, which actually wasn't a long time since we saw the release of version 2.1, and again wasn't long before we saw the release of the rather buggy version 2.0. Me? I'm still sat here on version 1.9.10 because of this rapid release cycle.
See, the problem is, during the year it is very difficult to suddenly make changes that users aren't used to and for that reason I usually do my system upgrades at the start or end of the academic year. I hope for the sake of Moodle and its massive following is that this isn't a sign of things to come. They really need to focus on quality at this point as once upon a time, I had originally planned to jump on the Moodle 2.0 bandwagon and am I glad that I didn't. After I installed it on my test web server, I soon found that I had made the right decision. Simple things didn't behave as expected and so I actively discouraged those who asked me about version 2.0 to not go ahead with the upgrade.
2.2 takes off where 2.1 finished and adds to many of the new features found in 2.0 onwards including many bug fixes. In the release notes, Rubrics, external tools, common cartridge and Mymobile themes are all mentioned. The notes also have a small mention about version 2.3 due in June 2012 and so I will most likely be hanging on for this release.
See, the problem is, during the year it is very difficult to suddenly make changes that users aren't used to and for that reason I usually do my system upgrades at the start or end of the academic year. I hope for the sake of Moodle and its massive following is that this isn't a sign of things to come. They really need to focus on quality at this point as once upon a time, I had originally planned to jump on the Moodle 2.0 bandwagon and am I glad that I didn't. After I installed it on my test web server, I soon found that I had made the right decision. Simple things didn't behave as expected and so I actively discouraged those who asked me about version 2.0 to not go ahead with the upgrade.
2.2 takes off where 2.1 finished and adds to many of the new features found in 2.0 onwards including many bug fixes. In the release notes, Rubrics, external tools, common cartridge and Mymobile themes are all mentioned. The notes also have a small mention about version 2.3 due in June 2012 and so I will most likely be hanging on for this release.
Friday, 9 December 2011
Correct Silly HTML Mistakes
For those of you that have read my blog, you will know that I'm a little OCD about website performance - and so should you be. If your website becomes the source of frustration for an end user, more often than not you will lose your viewer and since the choice on the web is now so vast, you may not ever get them back.
For every mistake that is made in your code, your browser has to interpret what it is that it should be doing. Not a problem you think? Well you might be right, but squeezing every ounce of performance should be your key goal. Just using a handful of my favourite tools will highlight any problems that you have very quickly. These include:
<?php
function show_image($url, $width, $height, $alt) {
return '<img src="'.$url.'" width="'.$width.'" height="'.$height.'" alt="'.$alt.'" />';
}
?>
You could include this in your header or whatever and then call it each time you need an image on your page. This way, you are forced to have each parameter so that your image will be displayed properly. The function could also be expanded to include JavaScript, Class and ID parameters etc. but for a quick and easy solution there isn't much else better. You could then apply this theory to other elements on your page and you will quickly then get the hang of things.
Always, always run a validate check to see if your code really does validate. If you are confident in your code being very good, you could think about making your site XHTML 1.0 strict and while this sounds easy, it sometimes isn't and could mean that you have to redesign part of your site to compensate.
Other areas that will offer performance increase are:
For every mistake that is made in your code, your browser has to interpret what it is that it should be doing. Not a problem you think? Well you might be right, but squeezing every ounce of performance should be your key goal. Just using a handful of my favourite tools will highlight any problems that you have very quickly. These include:
- Firefox / Chrome Plugins: Google Page Speed, HTML Validator, Firebug, Web Developer Toolbar and YSlow
- Smush.it
- Jcompress.com
- W3 HTML Validator (bit of a given really!)
<?php
function show_image($url, $width, $height, $alt) {
return '<img src="'.$url.'" width="'.$width.'" height="'.$height.'" alt="'.$alt.'" />';
}
?>
You could include this in your header or whatever and then call it each time you need an image on your page. This way, you are forced to have each parameter so that your image will be displayed properly. The function could also be expanded to include JavaScript, Class and ID parameters etc. but for a quick and easy solution there isn't much else better. You could then apply this theory to other elements on your page and you will quickly then get the hang of things.
Always, always run a validate check to see if your code really does validate. If you are confident in your code being very good, you could think about making your site XHTML 1.0 strict and while this sounds easy, it sometimes isn't and could mean that you have to redesign part of your site to compensate.
Other areas that will offer performance increase are:
- CSS sprites;
- Too much JavaScript;
- Images that are too large for the job, i.e a 16x16 image shouldn't be 10kb;
- Cache as much of your code that won't be changing, i.e. JavaScript;
- Minify your HTML, CSS and JavaScript;
- Avoid DNS lookups;
- Too many HTTP requests within your page;
Monday, 5 December 2011
PHP: mysql_fetch_assoc Vs. mysql_fetch_array
Recently I've been doing a lot of work to optimise my work so that pages load more quickly and server load is reduced. When I was looking through to my database calls, typically I've always used the mysql_fetch_assoc function because it always returned less data than the mysql_fetch array which actually returns two arrays - one which has a numeric index and the other which has an associative key index.
Having a play around and doing some benchmarking between 1,000 and 10,000 iterations of a fairly small amount of data, I found that the mysql_fetch_assoc function was between 24% and 31% faster than the mysql_fetch_array function. Good news for me really as this is how I typically return data from my MySQL database and so I won't be doing any rewriting any time soon. This is what I expected really as the size of the data processed and returned is half (well less than that really because it's numeric) so good news here.
Of course there are occasions when the mysql_fetch_array function is needed and I'm not questioning its existence at all, but purely as a benchmarking exercise I would pick mysql_fetch_assoc everyday.
As a side note, it's also important that I mention the mysql_fetch_object function as well which is for those of you who prefer the OO notation. However, using the same benchmark against the mysql_fetch_assoc function, this is still on average between 8% and 14% slower.
I hope this helps anybody who is currently in the process of performance tuning. Every little bit saved does help to improve the user experience.
Having a play around and doing some benchmarking between 1,000 and 10,000 iterations of a fairly small amount of data, I found that the mysql_fetch_assoc function was between 24% and 31% faster than the mysql_fetch_array function. Good news for me really as this is how I typically return data from my MySQL database and so I won't be doing any rewriting any time soon. This is what I expected really as the size of the data processed and returned is half (well less than that really because it's numeric) so good news here.
Of course there are occasions when the mysql_fetch_array function is needed and I'm not questioning its existence at all, but purely as a benchmarking exercise I would pick mysql_fetch_assoc everyday.
As a side note, it's also important that I mention the mysql_fetch_object function as well which is for those of you who prefer the OO notation. However, using the same benchmark against the mysql_fetch_assoc function, this is still on average between 8% and 14% slower.
I hope this helps anybody who is currently in the process of performance tuning. Every little bit saved does help to improve the user experience.
Friday, 2 December 2011
Browser Wars: Chrome Steps Up
In yet another bout of good news for Mozilla, Chrome has displaced Firefox as the second most popular browser according to research boffins at StatCounter. Microsoft's Internet Explorer still holds the top spot by quite a large amount, but what is most surprising is the time that it has taken Chrome to establish itself in the number two slot.
Chrome has been around now for quite some time, but not nearly as long as Firefox. The Chrome market share now stands at 25.7%, while Firefox has dipped to 25.2%. Not a massive amount I agree, but this could be a sign of things to come. StatCounter point out that just two years ago, the Chrome share stood at just 4.5% and so this is a massive achievement for Google.
Firefox seem to be trailing in strategy as well, as they now seem to be following Google with their own rapid release cycle methodology (albeit rather annoying at the same time). I'm not entirely sure that Mozilla have been doing anything massively wrong as such as of late, but they don't seem to have the innovative touch that they once had. Bugs crop up from time to time as they do with all browsers and I'm adamant that Firefox is the best browser for debugging as it has the widest range of addons available right now. I think that it's time for Mozilla to regain that creative spark that it once had, rather than becoming the market follower.
Chrome has been around now for quite some time, but not nearly as long as Firefox. The Chrome market share now stands at 25.7%, while Firefox has dipped to 25.2%. Not a massive amount I agree, but this could be a sign of things to come. StatCounter point out that just two years ago, the Chrome share stood at just 4.5% and so this is a massive achievement for Google.
Firefox seem to be trailing in strategy as well, as they now seem to be following Google with their own rapid release cycle methodology (albeit rather annoying at the same time). I'm not entirely sure that Mozilla have been doing anything massively wrong as such as of late, but they don't seem to have the innovative touch that they once had. Bugs crop up from time to time as they do with all browsers and I'm adamant that Firefox is the best browser for debugging as it has the widest range of addons available right now. I think that it's time for Mozilla to regain that creative spark that it once had, rather than becoming the market follower.
Tuesday, 29 November 2011
Mozilla Adds Flash to Firefox Android
Over at the Firefox Nightly builds site, Mozilla have released Firefox for Android with 'experimental support' for Flash. After Adobe publicly killed off mobile Flash earlier this month, this turned up as quite a surprise. I've installed it on my Android phone and I must say, it's actually quite good. It's not quick, and it sometimes judders a little as Flash on a mobile always has been, but that's a given really. I suspect that my phone was partly to blame here as well.
Even though this isn't sold as a stable release, I didn't experience any problems with Flash or the browser itself. I would even say that in a way, I preferred it to the standard Chrome install on my phone.
Could it be that mobile Flash will eventually be spun off into an open source project for the wider Internet community to take hold of? Only time will tell, but don't expect to see the final version until early next year.
Even though this isn't sold as a stable release, I didn't experience any problems with Flash or the browser itself. I would even say that in a way, I preferred it to the standard Chrome install on my phone.
Could it be that mobile Flash will eventually be spun off into an open source project for the wider Internet community to take hold of? Only time will tell, but don't expect to see the final version until early next year.
PHP 5.4 On The Way
Earlier this month PHP 5.4 RC1 was released to the general public. No big deal you might be thinking, but actually I noticed a small change in the latest release that could potentially be of massive help.
The note specifies 'Added class member access on instantiation (e.g. (new Foo)->bar())' which could be very handy if you only need quick access to a function from within a class. OK, not massive I agree but sometimes for some of the smaller classes that I have this would be great.
Other improvements include the usual round of bug fixes and improvements in both the core and extensions.
Anybody considering PHP 5.3 who is on a version of 5.2 or less should hang on for a week or two until the final release.
The note specifies 'Added class member access on instantiation (e.g. (new Foo)->bar())' which could be very handy if you only need quick access to a function from within a class. OK, not massive I agree but sometimes for some of the smaller classes that I have this would be great.
Other improvements include the usual round of bug fixes and improvements in both the core and extensions.
Anybody considering PHP 5.3 who is on a version of 5.2 or less should hang on for a week or two until the final release.
Wednesday, 16 November 2011
Mobile Flash is Officially Dead
Now that Adobe has publicly killed off Flash for mobile devices, what are the wider implications for the rest of the development community? Well, hopefully it will be a brighter future thanks to the emphasis on HTML5 that the company seems to be placing all of its eggs.
It's certainly been a long time coming, and to be perfectly honest I'm not surprised at all. There are many reasons, just take your pick as to which is your favourite. The big two are cost and the lack of cross-platform access which Apple unfortunately has had its way with. There are very few companies now that develop sites in Flash as it is far more costly, harder to work with and lacks many of the standard accessibility features that most browsers apply to standard HTML websites. The cross-platform thing has certainly hasn't done Adobe any favours, but to be fair I don't think Adobe have done themselves any favours either.
I forever hate updating my machine whenever a minor point release of Flash is released, which at the moment seems to be every week as soon as Windows starts. Really, is that absolutely necessary? I'm sure it isn't. Then one point that I do agree with Apple on, is that it is a battery killer because it is very CPU intensive. Even though on the PC Adobe have now shifted some of this load to the GPU, it wasn't enough. It also took them forever to release a 64 bit version of Flash, which is something that I've never understood. For a company as big as Adobe, it's a huge let down. Is the desktop going to be the next one to fall? Apple no longer include Flash as part of their standard OS installs (again, no surprise there), so it's a sincere possibility.
The good news is that is seems to be a victory for web standards and compliancy and it's something that I almost always do my best to conform to. While mobile Flash won't be going anywhere soon, it certainly is an admission of defeat for Adobe. Even Microsoft haven't included Flash in its latest mobile operating system so it was probably best that Adobe gave up sooner rather than later.
Personally I've never really liked Flash. It has always been difficult to develop and so I always skated around the subject when it came up, but now, it's a sign of relief that I know to put my eggs in the HTML 5 basket.
It's certainly been a long time coming, and to be perfectly honest I'm not surprised at all. There are many reasons, just take your pick as to which is your favourite. The big two are cost and the lack of cross-platform access which Apple unfortunately has had its way with. There are very few companies now that develop sites in Flash as it is far more costly, harder to work with and lacks many of the standard accessibility features that most browsers apply to standard HTML websites. The cross-platform thing has certainly hasn't done Adobe any favours, but to be fair I don't think Adobe have done themselves any favours either.
I forever hate updating my machine whenever a minor point release of Flash is released, which at the moment seems to be every week as soon as Windows starts. Really, is that absolutely necessary? I'm sure it isn't. Then one point that I do agree with Apple on, is that it is a battery killer because it is very CPU intensive. Even though on the PC Adobe have now shifted some of this load to the GPU, it wasn't enough. It also took them forever to release a 64 bit version of Flash, which is something that I've never understood. For a company as big as Adobe, it's a huge let down. Is the desktop going to be the next one to fall? Apple no longer include Flash as part of their standard OS installs (again, no surprise there), so it's a sincere possibility.
The good news is that is seems to be a victory for web standards and compliancy and it's something that I almost always do my best to conform to. While mobile Flash won't be going anywhere soon, it certainly is an admission of defeat for Adobe. Even Microsoft haven't included Flash in its latest mobile operating system so it was probably best that Adobe gave up sooner rather than later.
Personally I've never really liked Flash. It has always been difficult to develop and so I always skated around the subject when it came up, but now, it's a sign of relief that I know to put my eggs in the HTML 5 basket.
Installing PEAR Packages on Windows
Ok, so now that you've read my previous post about setting PEAR up on Windows, it's time to start installing some packages that will help you on your way.
An absolute must for any sort of database connection is the DB package. You could argue that the built in database connectivity from the PHP modules is good enough, and you would be right. There is a certain degree of flexibility in using these packages though, as they are continuously updated throughout the year by a large community (as is PHP), but in some cases it's all about how you interact with your database connectivity as you will see, it's certainly more class driven in how it's all written. For example, there is support for scalar parameters as shown below (taken from the PEAR documentation):
An absolute must for any sort of database connection is the DB package. You could argue that the built in database connectivity from the PHP modules is good enough, and you would be right. There is a certain degree of flexibility in using these packages though, as they are continuously updated throughout the year by a large community (as is PHP), but in some cases it's all about how you interact with your database connectivity as you will see, it's certainly more class driven in how it's all written. For example, there is support for scalar parameters as shown below (taken from the PEAR documentation):
<?php // Create a valid DB object named $db at the beginning of your program...require_once 'DB.php';
$db =& DB::connect('mysql://usr:pw@localhost/dbnam');
if (PEAR::isError($db)) {
die($db->getMessage());
}// Once you have a valid DB object named $db... $sql = 'select * from clients where clientid = ?'; $data = 53; $res =& $db->query($sql, $data);
// Always check that result is not an errorif (PEAR::isError($res)) {
die($res->getMessage());
} ?>This has certain other benefits including the potential for easy cross-platform availability (bar the changes to the SQL syntax that change between SQL servers). One thing that PHP 5.x users will need to do is replace the '=&'s that tend to crop up as they are now depreciated because of PHP 5.x; these can just be replaced by a simple '='. If you have errors switched on (which I would at this point during installation and testing), you will most definitely see these being pointed out as errors.
The full list of functions is available under the documentation for each of the specific packages, and so the many other functions for the DB package are listed here.
So now that you know how to use it, it's time to install it. Launch a Command Prompt, and browse to your PHP folder. Once there, type 'pear install DB' and press return. Congratulations. You've now installed the DB package, it really is that simple. To use it, you will need to have either an include or a require (as shown in the example above) to reference the DB package (DB.php).
Other packages within PEAR tend to reference this class in some way so it's always a useful one to install. At the time of writing, DB has been superseded by MDB2 and so that is something that is also worth a view.
Installing PEAR on Windows
This really is just a short quick guide on how to install PEAR manually on a Windows box. There are currently multiple ways of setting PEAR up, and I'm going to show you my preferred way, only because it's easy to fault find in case anything goes wrong.
For those who don't know what PEAR is, PEAR is essentially a customisable framework of many components that you can choose to have on your system. It really takes aim at giving access to functionality that doesn't exist with the standard PHP functions.
First thing first, you will need to have a working copy of PHP installed and working on your system (preferably the latest version), and that is really about it. You should notice that you already have a PEAR folder in the root of your PHP folder anyway, and so this ready and waiting for you to activate the features.
To do so, open a Command Prompt (go to Start > Run > type 'cmd' and press enter) and navigate to your PHP folder. Once you've made it there, the command prompt on the left should be showing that you are in the root of your PHP folder. If not, you are in the wrong place. It should look something like it does here on the left.
Next, type 'go-pear' and hit return. You will be asked if you would like to install a system or a local copy, so you will need to type 'system' here. Once you have done this, you will be presented with 11 options that specify locations of your files and folders. Normally this is correct straight out of the box, but if you like many people move your PHP folders then you will need to update these locations. When you are ready, hit enter again, and off it goes.
The next screen will show PEAR installing and when it's ready there will be a small paragraph at the bottom asking you to execute a reg file that has been placed in the root of your PHP folder called 'PEAR_ENV.reg'. Don't worry, this is completely harmless as this just lets Windows know that PEAR is up and running on your system.
And, well, that's it really. You've set PEAR up on your system and are nearly ready to go! All you need now are some packages that are freely available from the PEAR website.
For those who don't know what PEAR is, PEAR is essentially a customisable framework of many components that you can choose to have on your system. It really takes aim at giving access to functionality that doesn't exist with the standard PHP functions.
First thing first, you will need to have a working copy of PHP installed and working on your system (preferably the latest version), and that is really about it. You should notice that you already have a PEAR folder in the root of your PHP folder anyway, and so this ready and waiting for you to activate the features.
To do so, open a Command Prompt (go to Start > Run > type 'cmd' and press enter) and navigate to your PHP folder. Once you've made it there, the command prompt on the left should be showing that you are in the root of your PHP folder. If not, you are in the wrong place. It should look something like it does here on the left.
Next, type 'go-pear' and hit return. You will be asked if you would like to install a system or a local copy, so you will need to type 'system' here. Once you have done this, you will be presented with 11 options that specify locations of your files and folders. Normally this is correct straight out of the box, but if you like many people move your PHP folders then you will need to update these locations. When you are ready, hit enter again, and off it goes.
The next screen will show PEAR installing and when it's ready there will be a small paragraph at the bottom asking you to execute a reg file that has been placed in the root of your PHP folder called 'PEAR_ENV.reg'. Don't worry, this is completely harmless as this just lets Windows know that PEAR is up and running on your system.
And, well, that's it really. You've set PEAR up on your system and are nearly ready to go! All you need now are some packages that are freely available from the PEAR website.
Saturday, 29 October 2011
Opera 12 Alpha + Hardware Acceleration = Fast!
Last week saw the release of Opera 12 Alpha with full hardware acceleration for WebGL graphics.
Opera 12 Alpha can be downloaded from their site over here.
The main benefits being touted include:
It's a good release for an alpha and it feels smooth and speedy. I still find that some pages look a little odd sometimes in Opera, and it's something that has happened over the past five or six releases and I have never worked out why. That might just be me, but I don't think it is. It's also a bit of a memory snatcher as well, but this is quite typical of an early release. It's worth a try anyway.
Opera 12 Alpha can be downloaded from their site over here.
The main benefits being touted include:
- Faster graphics with hardware acceleration
- New HTML5 engine
- Faster browsing with reduced memory usage
- New themes
- New address field
- WebGL support for games 3D content
It's a good release for an alpha and it feels smooth and speedy. I still find that some pages look a little odd sometimes in Opera, and it's something that has happened over the past five or six releases and I have never worked out why. That might just be me, but I don't think it is. It's also a bit of a memory snatcher as well, but this is quite typical of an early release. It's worth a try anyway.
Firefox 7 Released (three weeks ago!)
In a rather delayed post, Firefox 7 has now been released, wooo! The release comes just six weeks (yes you read that correctly) after Firefox 6 arrived. The two major selling points of this release are speed (as ever!) and the memory demand has been reduced by half, which is quite impressive.
Over the past few releases, I have noticed that Firefox has become a bit of a pig for the amount of memory it uses. Why that is I'm not sure, but anything like this is always a welcome boost.
For web developers, the news gets better. Navigation timing spec will benchmark your pages which I'm all in favour of as this is something that I've always tried to run to get the best out of the user experience. More good news comes from the people that make Firefox who claim that this release will be less likely to break your addons. There is better support for compatibility with your older addons that were download from their own site, however bits from elsewhere may not work as well.
Over the past few releases, I have noticed that Firefox has become a bit of a pig for the amount of memory it uses. Why that is I'm not sure, but anything like this is always a welcome boost.
For web developers, the news gets better. Navigation timing spec will benchmark your pages which I'm all in favour of as this is something that I've always tried to run to get the best out of the user experience. More good news comes from the people that make Firefox who claim that this release will be less likely to break your addons. There is better support for compatibility with your older addons that were download from their own site, however bits from elsewhere may not work as well.
Firefox Silent Updates
Future versions of Mozilla Firefox will shortly be delivering updates to your computer without you even knowing about it, saving users the bother of downloading and installing updates. Good idea? Maybe.
Right now, both Firefox and Chrome are seeing frequent updates and if reports are to be believed, Microsoft will be joining that party soon with the development releases of Internet Explorer 10. The danger is that users are no longer aware of these updates and what benefits they will bring. Personally, I'm a little bored of minor releases being marked as new version releases which I feel Firefox has been doing as of late.
Notifications are irritating, full stop. Every time I load Firefox at the moment it tells me that an update is available. The problem is, I don't want to update. The last time I did this, it broke all of my addons which is one of the reasons that I use the browser in the first place. Ironic. This will also cause problems in large companies where users do not have permission to install updates and then deployment also becomes a problem. This is why most companies use Internet Explorer which ties in nicely with other Microsoft products so that updates are easily deployed along with security fixes. Right now, Mozilla say that they are testing a Windows service that will install an optional component that will automate the update install without UAC prompts. Sorry, but if something changes on my machine, I want to know what is going on.
This is both good and bad, but perhaps they need to start to change the approach that they are taking right now. The benefits may outweigh the problems. By taking the rapid release cycle approach, we are constantly moving forward so that we are no longer stuck with older browsers like we had with the IE6 fiasco. I really am in favour of this as the envelope of web technology is constantly being taken forward. As long as the way in which pages are rendered doesn't change, this is good with me. I remember when IE7 was released and many developers complained back then that had to write hacks to get their code to work with IE6. This can't be allowed to happen again.
So yeah, as you can imagine I'm a little divided!
Right now, both Firefox and Chrome are seeing frequent updates and if reports are to be believed, Microsoft will be joining that party soon with the development releases of Internet Explorer 10. The danger is that users are no longer aware of these updates and what benefits they will bring. Personally, I'm a little bored of minor releases being marked as new version releases which I feel Firefox has been doing as of late.
Notifications are irritating, full stop. Every time I load Firefox at the moment it tells me that an update is available. The problem is, I don't want to update. The last time I did this, it broke all of my addons which is one of the reasons that I use the browser in the first place. Ironic. This will also cause problems in large companies where users do not have permission to install updates and then deployment also becomes a problem. This is why most companies use Internet Explorer which ties in nicely with other Microsoft products so that updates are easily deployed along with security fixes. Right now, Mozilla say that they are testing a Windows service that will install an optional component that will automate the update install without UAC prompts. Sorry, but if something changes on my machine, I want to know what is going on.
This is both good and bad, but perhaps they need to start to change the approach that they are taking right now. The benefits may outweigh the problems. By taking the rapid release cycle approach, we are constantly moving forward so that we are no longer stuck with older browsers like we had with the IE6 fiasco. I really am in favour of this as the envelope of web technology is constantly being taken forward. As long as the way in which pages are rendered doesn't change, this is good with me. I remember when IE7 was released and many developers complained back then that had to write hacks to get their code to work with IE6. This can't be allowed to happen again.
So yeah, as you can imagine I'm a little divided!
Tuesday, 23 August 2011
Google Page Speed for Chrome and Online
Another of my favourite performance tools for reducing every millisecond from loading times is Google Page Speed. Although it's a little fiddly to install (fiddly in the sense that it takes more than 30 seconds), it's still a brilliant extension to have for Chrome.
If you already have Chrome, take a look over at the Page Speed site for what it brings to the table. The install notes and download links are available here.
Again, I recommend using this in addition to certain other tools so that absolutely everything is covered. Other tools that you really should use are: -
Some of the recommendations that it will ask you to make include: -
If you already have Chrome, take a look over at the Page Speed site for what it brings to the table. The install notes and download links are available here.
Again, I recommend using this in addition to certain other tools so that absolutely everything is covered. Other tools that you really should use are: -
- Smush.it;
- Yslow (Firefox, Chrome and Opera extensions available);
- JCompress;
- HTML Validator Firefox extension;
- Firebug Firefox extension;
Some of the recommendations that it will ask you to make include: -
- Minify HTML and JavaScript;
- Combine images into CSS sprites and avoid CSS @import;
- Optimise images and specify dimensions;
- Specify a character set;
- Put CSS in your document head;
Subscribe to:
Posts (Atom)




