Code: page 1
The Little Manual of API Design
The Little Manual of API Design This manual gathers together the key insights into API design that were discovered through many years of software development on the Qt application development framework at Trolltech (now part of Nokia). When designing and implementing a library, you should also keep other factors in mind, such as efficiency and ease of implementation, in addition to pure API considerations. And although the focus is on public APIs, there is no harm in applying the principles described here when writing application code or internal library code. Read more β
SQL Server 2005 Dump to SQL statements
Say you have a development environment setup using SQL Server 2005 Express Edition and your customer has a SQL Server 2000 database accessible only via ODBC and you can only run a DB import via a script. How would you do it? Easy you might think just run msdbdump.exe on the command line, well this isnβt MySQL so you are not so fortunate. Backing up your DB is easy with SQL Server using the following commands: Read more β
Here is a small script that I put together to grab the XML list from the ISO website and convert it into an SQL statement. The idea is that the script can be used to just obtain a list for web projects or it can be setup to run periodically to make sure that a list is always kept up to date. Obviously none of the associated checks to make that work have been written into this code so you will need to add it yourself (ie. Read more β
Geographic Calculations in PHP
warning This library is now deprecated in favour of my new Navigator library. Please use it instead - its much better, tested and makes use of newer PHP features! Recently I have been involved with a project that maps yachts during an ocean race, which got me thinking about basic calculations and conversions that would be useful to fellow developers. I envisage this being useful in projects leveraging Google or Yahoo maps. Read more β
I have been asked numerous times in the past how I create this effect in some forum signatures so now I am releasing the code so you can see. It could equally be used as a background image in CSS (like the photo of the excavator above) so you could have a circulating series of background or in this case header images. I am sure you can think of many other neat uses for this script. Read more β
During a recent project I ended up using ADODB and found it very effective. Especially the wrapper it places around PHPs sessions, it stores them in the DB instead of in the temp directory, which can be less secure. It also handles encryption of the session variables contents, but only using MD5 originally and I prefer to use SHA1. So I hacked the following to allow me to do so and I contributed it to ADODB. Read more β