|
|
|
Dynamically Adding Elements to a Form with JavaScript
|
|
Most web forms are static, as it's known in advance exactly what fields the form should show. In some cases however, you need a form that permits the user to enter a variable number of fields. Using JavaScript, you can add a button which the user can press when they need extra form fields. The button must trigger a JavaScript function to add the extra elements using the JS DOM. |
|
|
Making Multiple Simultaneous Requests with AJAX in JavaScript
|
|
This article looks at how we can iterate through a set of different items on a page using JavaScript, and get further information on each in the background via AJAX. Once the AJAX calls get the extra information, we can update the items on the page. What is different about the approach shown here to others you may be accustomed to is that multiple AJAX requests are made simultaneously, allowing us to retrieve information for an indeterminate number of page items at once, allowing us to keep multiple content zones independently updated. |
|
|
Graphs and Charts in PHP using PEAR Image Graph
|
|
There are many 3rd party solutions out there for drawing charts and graphs in PHP. Some are a little ropey, many are over-priced (particularly for commercial users). My research into what is available boiled down to the Image_Graph package in the PEAR repository, and a PHP class called PHPlot from a guy named Miguel de Benito Delgado. Miguel's code offers the benefits of compactness - you only need add a single PHP file to your site in order to use his drawing functions. This single file defines the PHPlot class, and is admittedly over 4000 lines long. To draw charts with PEAR on the other hand, you need all the associated base PEAR classes, and set up is a fair bit more drawn out. However, the PEAR solution is considerably more versatile allowing a huge range of charts. |
|
|
Selected JavaScript Fun and Goodness
|
|
Here's a sample of JS code for allowing users to choose multiple items from a list of available options. There are many examples of code like this, however this example has the enhancement of keeping the lists well organised. To do this, we need to find the parent OPTGROUP that contains a selected OPTION, and we also need to insert a new OPTION in a specific OPTGROUP of a SELECT list. |
|
|
Useful Ubuntu Linux Commands
|
|
Linux commands can be far from intuitive, with files related to a single application seemingly scattered throughout various locations, such as usr, bin, etc, var. This can make it difficult to recall how to invoke certain essential but not every-day commands. This page lists these commands in a single place. |
|
|
Installing and Configuring Zen-Cart
|
|
Zen Cart is an Open Source e-commerce solution. It includes an admin CMS, which allows a non-tech end-user to change many options on their site. This article looks at the low-level tasks that must be completed before a site is ready to be finalised by the end-user. |
|
|
Reformat PHP code with Dreamweaver
|
|
Dreamweaver's support for regular expressions in search and replace is immensely powerful and useful. It makes otherwise tedious replacement tasks a breeze. In this article, a few expressions for some useful search / replace tasks are illustrated. Dreamweaver's regular expression search and replace is particularly handy for developers because you can do multi-line search and replace, and you can seach and replace over an entire site or selected files in the site at once. |
|
|
MySQL's Greatest Date and Time Functions
|
|
A quick run down of MySQL's date and time functions. These can be a little confusing, and there is a little overlap between several of them. This article looks at the most useful ones. Note that in all the following functions, "date" denotes a column which can usually be of DATE, TIME, TIMESTAMP or DATETIME type. |
|
|
Could a Machine Fix Errors in its own Rationality?
|
|
This question was one I chose to tackle during my University degree, as part of a Philosophy of Cognitive Science module. The assessed component involved devising a suitable question to use as the subject of an essay. Rather than trying to answer the question, students were required to propose six possible theories which might apply. |
|
|
Play.com
|
Are you a UK ebayer? If so, never buy any music, games or DVDs without checking the price on play.com first. Based in Jersey, Play can sell most of their products VAT free, and consequently offer lower prices than just about anywhere else. <click to read more...> They often sell films and games for less than you can pay on ebay.
The choice between paying less for a brand new product and paying more for a second hand one is a no-brainer. Your order is sent by first class post, and usually arrives in a day or two. Some other companies have recently set up Jersey operations, notably Asda and Tesco, but I've found Play are usually the cheapest. |
|
|
Animated Optical Illusion
|
|
This optical illusion is pretty neat: it's a very simple animation, and when you first look at it you should see a ring of pink circles. One of the circles is missing, creating a gap - this gap appears to be moving around the ring. <click to read more...>
Depending on how you look at it, you will see one of three different things. The moving gap, or a moving pale green disc instead of the gap, or finally just the pale green disc on its own.
I had to actually check the animation file to be sure that there are no pale green discs in it at all, and no there aren't. The animation is just 12 frames long, each frame being a ring of pink dots with one of the dots missing. |
|
|
'How Cars Work' Guide
|
|
|
Well-written and presented guide to some technological areas relating to modern cars. The text is concise but backed up with plenty of good diagrams. <click to read more...> There are even some darn fine animations hidden away in some of the descriptions. The descriptions themselves are not heavily technical, making it a good read for beginners or children. |
|
|
|
|
Time to get busy with MySQL
|
|
|
Very basic introduction to MySQL's date functions. MySQL has 40-odd functions for manipulating dates - this article only looks at a couple of them. <click to read more...> However, it's enough to get a flavour of what MySQL can do. Some calculate the difference between two dates in days, months or years. Others (DATE_ADD and DATE_SUB) can be used to easily add or subtract a set amount of time to a date to get a new date, taking into account the variable days in a month, even leap years. |
|
|
More hidden secrets of MySQL
|
|
|
MySQL has a built-in data type, FULLTEXT, especially designed for use with searches. Quite how it works I don't know, but the manual page linked above is pretty thorough as you'd expect. <click to read more...> This feature offers support for natural language search, such as 'how do I open a new document?'. It also supports a ranking feature, which rates each result for closeness to the search terms. The other feature I've spotted in my quick scan of the manual page is search refinement, where a new search is generated from the best matches of an existing search. |
|
|
Newgrounds - Everything By Everyone
|
|
|
This site is one of the most popular existing sites for entertainment, with a forum, a flash area, and an audio area. Newgrounds gives you the chance to vote for your favourite movies and games with its voting system and when they are first submitted, you can choose to vote for them or against them. <click to read more...> Submissions with a very low score will be deleted, or 'blammed', whereas submissions with a higher score will be kept. Submissions which get outstanding scores will be placed on the front page, and submissions which get a very high number of views get an award. The audio portal also has a rating system however the submissions here do not get deleted by users, although they may be deleted by the administrators. |
|
|
The Elegant Universe
|
|
|
"The fundamental particles of the universe that physicists have identified—electrons, neutrinos, quarks, and so on—are the 'letters' of all matter. Just like their linguistic counterparts, they appear to have no further internal substructure. <click to read more...> String theory proclaims otherwise. According to string theory, if we could examine these particles with even greater precision—a precision many orders of magnitude beyond our present technological capacity—we would find that each is not pointlike but instead consists of a tiny, one-dimensional loop. Like an infinitely thin rubber band, each particle contains a vibrating, oscillating, dancing filament that physicists have named a string." |
|
|
Introduction to WINE
|
|
|
I was pretty skeptical of WINE up until I tried it. It seemed unlikely that a fake Windows could be able to cope with any degree of reliability or performance. <click to read more...> I was pretty much resigned to having to switch to Windows for some tasks (which is still the case, but fewer than I'd imagined). The first WINE program I tried was IEs4Linux, which is internet explorer hacked to work with WINE. It works very well, and weighs in at around half a Meg for the no-frills interface(!). WINE also runs Steam very well, you wouldn't know it was a Windows app. This guide to running windows apps on linux gives a good overview. |
|
|