Archives for: 2009
26/12/09
Happy Christmas & new year
24/12/09
Shrewsbury badminton club
10/10/09
CGH Electrical Services - Telford Electrican
09/10/09
11/09/09
MSN Live finally supports login from multiple devices
09/09/09
Mount iso image on Windows 7
Not all software that works on Windows XP/Vista will work on Windows 7. Mounting ISO files can be difficult if you’ve been using Daemon Tools to do it so far. There is an updated version of Daemon tool available but it is not official. You need to search bittorrent for with.
Currently we have found two utilities that support windows 7.
http://www.poweriso.com/download.htm
and
http://www.winmount.com
08/09/09
Windows 7 - Cannot copy files required for installation error
There are many reports on the “Cannot copy files required for installation error” (with error code 0x80070017). There are many reasons:
1. When you burn the ISO image to a DVD, you need to choose the lowest speed and verify it after burn.
2. Do a memory test. You can get a tool from
http://www.memtest.org/
Any errors reported need to be ironed out.
3. Reload your BIOS settings to default and make sure you are not aggresive to overclock your system.
Compared to Linux or XP, Windows 7 is very poor in terms of overclocking. We had a over-locked system running Linux for a couple of years but Windows 7 freezes from time to time so we have to undone the overclocking.
You can also disable things you do not need (such as onbard wifi for a desktop, firewire etc..)
28/08/09
Associate a syntax set with a file type in vim
Vim is an excellent text editor that can do amazing stuffs.
When the web server is configured to treat html as php file, the vim editor needs to configured to recognize all the php functions within the html. To do that,
Code:
to open the configure file.
and add one file to the bottom
Code: | autocmd FileType html set syntax=php |
The latest vim has syntax turned on automatically anyway. If not, add this line to your config file
Code:
17/08/09
grep email address from a Word file
We just have a task to extract all email addresses from a word document text file containing more than 800 pages. The size of the doc file is 250M. But the size does not matter. To extract the email address, we need to
1. convert the .docx file into a plain text file.
2. transfer the text file to a Linux machine
3. use grep to extract the email address and save result.
grep -E -o --color "\b[a-zA-Z0-9.-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9.-]+\b" email_list.txt > output.txt
This code is obtained from http://enure.net
4. Use Excel to open the text file and save it as a workbook.
5. Do the mailshot using the Excel file
04/08/09
Getting paid while you shop
Shopping online is becoming more and more popular.
http://news.bbc.co.uk/1/hi/business/2372577.stm
There are many price comparison websites to help online shoppers to save money. The most famous one is moneysupermarket.
One of my customers has a website called poundpig.com
http://www.poundpig.com
Members of the website can get cash back if they shop via the website. Membership is free. On registeration you will get £2.50 of credit immediately. So give it a try!
and if you refer a friend to the poundpig.com site, you will get £7.00
01/08/09
XML driven flash components
30/07/09
Create data graph on the fly
Generating graph from data collected on the internet and shows it on the web can be very useful.
I found 2 ways to create data graph/chart on the fly:
1. Use the google api
http://code.google.com/apis/chart/basics.html
To create a simple pie chart, all you need is one line of html
XML: | <img src="http://chart.apis.google.com/chart?chs=350x100&chd=t:60,40&cht=p3&chl=Web_designers|Programmers" alt="Sample chart" /> |
And you will have
2. Use php + GD Library
to create the same chart you need the following codes. Codes are based on
http://www.talkphp.com/advanced-php-programming/2508-3d-pie-charts-php-gd.html
with small changes
PHP: | $image = imagecreatetruecolor(300, 300); |
|
|
| $white = imagecolorallocate($image, 0xFF, 0xFF, 0xFF); |
| $gray = imagecolorallocate($image, 0xC0, 0xC0, 0xC0); |
| $darkgray = imagecolorallocate($image, 0x90, 0x90, 0x90); |
| $navy = imagecolorallocate($image, 0x00, 0x00, 0x80); |
| $darknavy = imagecolorallocate($image, 0x00, 0x00, 0x50); |
| $red = imagecolorallocate($image, 0xFF, 0x00, 0x00); |
| $darkred = imagecolorallocate($image, 0x90, 0x00, 0x00); |
| |
|
|
| imageFill($image, 0, 0, $white); |
| imageColorTransparent($image, $white); |
| |
| |
| for ($i = 160; $i > 150; $i--) { |
| imagefilledarc($image, 150, $i, 200, 100, 0, 45, $darknavy, IMG_ARC_PIE); |
| imagefilledarc($image, 150, $i, 200, 100, 45, 75 , $darkgray, IMG_ARC_PIE); |
| imagefilledarc($image, 150, $i, 200, 100, 75, 360 , $darkred, IMG_ARC_PIE); |
| } |
| |
| imagefilledarc($image, 150, 150, 200, 100, 0, 45, $navy, IMG_ARC_PIE); |
| imagefilledarc($image, 150, 150, 200, 100, 45, 75 , $gray, IMG_ARC_PIE); |
| imagefilledarc($image, 150, 150, 200, 100, 75, 360 , $red, IMG_ARC_PIE); |
| |
|
|
| header('Content-type: image/png'); |
| imagepng($image); |
| imagedestroy($image); |
If you need to know more about using GD Lib to create graph on the web, please visit a tutorial at
http://php.about.com/od/advancedphp/ss/gd_library_6.htm
You need to be careful when you are using server side script to generate graph as it is CPU intensive.

29/07/09
Windows Small Business Server (SBS)'s backup disconnect remote desktop
I don’t anyone of you know why this could happen:
A Windows SBS 2003 would disconnect a remote desktop session when it starts its backup. The default windows backup verifies the backup copy and it takes forever. I have to edit the executive file to stop the verification following this guide:
http://www.slickit.ca/2009/05/turn-verify-off-sbs-2003-backup.html
This allows me to re-schedual backup to starts later at night so people can do their work at the early evenings. But this just avoids the problem.
Please let me know if you any idea …

Are you are web design agent?
If you are a web design agent and looking for good quality web script programmer, please feel free to contact us. We provide programming service for web design agents in UK.
We have good experience in writing CMS, e-commerce and web-based application in PHP/Mysql, Javascript (Ajax). If you have questions in technical issues, please also feel free to ask.
WE will provide a strong portfolio if required.
Have a good day!

Javascript form validator script
I have been using the a javascript from
http://www.javascript-coder.com/html-form/javascript-form-validation.phtml
for awhile and I totally like it. It’s very easy to use in order to validate the web form. What’s more, it is very easy to extend.
Here is how to extend the script so that it can find out if a user input the right confirm email address or not.
Code: | function confirmEmail () |
| { |
| var frm = document.forms["custForm"]; |
| if(frm.email.value != frm.confirm_email.value) |
| { |
| sfm_show_error_msg("Confirm email does not match "); |
| return false; |
| } |
| else |
| { |
| return true; |
| } |
| } |
| |
| frmvalidator.setAddnlValidationFunction("confirmEmail"); |
27/07/09
How to force a download using php

Image button submit value
For example, if you have a image button like
Code: | <input type="image" name="Submit" value='Register' class="btn" src="images/register_form_btn.jpg" /> |
When the form is submitted via POST. there is nothing for $_POST[’Submit’]. However, you will have $_POST[’Submit_x’] and $_POST[’Submit_y’] that records the x and y coordinates of the click.
You can not do Code: | if($_POST['Submit_x'] ) { |
| //do something |
| } |
that’s because a user might press the Enter key to submit the form. In this case, $_POST[’Submit_x’] and $_POST[’Submit_y’] are both 0!!
A convenient solution is to put a hidden field such as
Code: | <input type='hidden' name='form_sent' value='1'/> |
within the form. Then in your php code
Code: | if($_POST['form_sent'] ){ |
| //process form |
| } |
22/07/09
Harden web server with suhosin
Suhosin is a “hardened php” project which can improve security of a web server running php script. If you are having some troubles running some scripts after you’ve installed, you will have to change some of the configuration values. I learned that when one customer has a very large html form to submit data using POST. However, only part of the form data can be accessed via the $_POST variable.
One way to sort it out is to put
Code: | suhosin.post.max_array_depth = 1024 |
in the account’s php.ini file.
Another way is to put
Code: | php_value suhosin.post.max_array_depth = 1024 |
in your .htaccess file. This only works if your administrator put
Code:
in the global php.ini file.
– Ben
30/06/09
Warwickwright.com website ready
twitter
Sparkcom is twitting now!
Follow us here 
12/06/09
No IE8 shipped with Windows 7
In a move to basically outflank the EU antitrust investigation, Microsoft has announced that all version of Windows 7 shipped in Europe will not include Internet Explorer 8 by default.
This is reminiscent of the Windows XP N editions, which did not include Windows Media Player, but the difference here is that Microsoft will not ship versions of Windows 7 with Internet Explorer 8 in Europe.
[More …]
New website live
AFP is an Independent Mortgage Adviser in Shrewsbury, Shropshire. The director, Gary Harper, has excellent reputation in Shrewsbury dealing with Mortgages, Life insurance and re-mortgages. The website features a free mortgage calculator.
Please check out more at AFP Shrewsbury Mortgages & Protection.

|
|