Computing

PHP Colour Format Conversion

Allows the setting of getting of colour in various formats: RGB, HSL, CMY and CMYK. The colour is stored as an RGB array. Since RGB to HSL and HSL to RGB conversion is quite heavy it might be better if you also stored the HSL value if it is going to be called frequently. However, […]

Share

Posted in PHP and MySQL | No Comments »

Speeding Up Code: The Last Thing You Do Is Optimise

The reason for this post is that on many websites about coding you will see some comment about the speed of various approaches. Often in the comments you will see such things as I ran code A 200,000 times and code B 200,000 times and code A was 2ms faster than code B. First of […]

Share

Posted in Computing | No Comments »

Latitude and Longitude Distance Formula

What I want to do is to expand the bounds of a google maps by a certain distance. This is because I want to include markers that are outside the bounds of the map since they have overlays attached to them which will overlap onto the current map bounds. For example if I am currently […]

Share

Posted in javascript | No Comments »

Converting Radians in Degrees Latitude and Longitude

The task of converting radians to degrees is reasonably trivial. However, latitudes and longitudes are usually expressed in the range -90 to 90 for longitude and -180 to 180 for latitudes. This is only a convention – latitudes above 90 have real unique meaning and they should not create any problems in google maps etc. […]

Share

Posted in javascript, Mathematics | 2 Comments »

Backing Up A MySQL Database With PHP Using MySQLi

I needed to download a database as SQL and thought ‘why re-invent the wheel?’ However I could not find any snippets that use MySQLi rather than MySQL. Also some of the coding was a bit bizarre to say the least leaving me thinking ‘how long did they play about with that before they got it […]

Share

Posted in PHP and MySQL | 9 Comments »

Subscribe