Activeminds logo

Activeminds Software Ltd.
Software Development
Dynamic Web Design
Telephone: (403) 990-1402
E-Mail Activeminds Email Activeminds
Box 991, Bragg Creek, Alberta
T0L 0K0, Canada 
Active Minds innovative software development Home Contact Site Map

Software Blog

Stumble Upon

RSS News Feed RSS News Feed What's This?

Select a topic from the list below. Topics are ordered by date with the eight most recent at the top.

Show All Articles

July 19th 2010
iPhone App Development
We are moving on from AJAX applications to the development of iPhone apps (and apps for other smartphone platforms). There are many challenges in making this move, some of which are described here.

July 18th 2009
Facebook Security Issues
Facebook has serious problems with its attitude to privacy, so much so that they appear to be in breach of Canadian privacy laws. Any action by the Canadian government will however be limited to just a small part of the wider problem. Facebook has to go much, much further. This article makes some suggestions on how I think they should clean up their act.

July 5th 2009
Multi-Language Support
Translations of complete web pages have come a long way from the early days of Babelfish, although they still leave a lot to be desired. But what if you only need to translate individual phrases? Should you construct the phrase in English and then use Google Translate or do we need to do something more sophisticated?

November 4th 2007
Working From Home
Working from home is becoming easier and easier as computers, the internet and mobile phones become more sophisticated. Why then don't more people (and more companies) embrace it?

July 8th 2007
Using AJAX In Practice
AJAX is a powerful programming tool that is without doubt the future of the internet. However, until the search engine and browser developers catch up with the new reality, there are a few gotcha's you need to be aware of.

April 22nd 2007
Web Design Trends
Web pages are moving away from fancy graphics to dynamic interactive sites with added value for users. To develop such pages, web developers need to be able to program in a variety of different languages. If you can't program, there soon won't be a place for you in the web development industry.

March 19th 2007
More On Mobile Devices
Mobile devices become smaller and more multi-functional with fewer buttons and bigger, touch sensitive screens. Those of us with limited short range vision should be getting worried by these developments. Perhaps the science of haptics wil be our saviour.

February 25th 2007
Censorship On The Internet
Some censorship of the internet is necessary. I fully support the removal of child pornography for example. But insiduous censorship by special interests is slowly creeping over the internet and eroding free speech. These special interests include web site owners who censor forum posts and business owners who deliberately remove competitors ads from public listings.

  Earliest post   Previous post 
Next post   Latest post 
 

Unit Conversions - January 7th 2007

     

Unit Conversion Tool

A NEW CONVERSION TOOL

 

I started out to write an online unit conversion tool that overcomes the limitations I find in many (if not all) of the alternative offerings. The principles I used in the design were:

  • All conversions must be stored on a database so that new dimensions, units and conversions can be easily added by a user.
  • Conversions are to be stored on the database as an equation not just as some factor.

Storing conversions as an equation gets around the problem that some units cannot be converted just by multiplying by a factor. For example in the pressure dimension:

Atmospheres Gauge = Atmospheres Absolute + 1.0

This also allows us to do more than just converting between units. Using the appropriate equations, we can for example convert a circles radius into its area using:

Area = 3.14159 * r * r

In the implementation, I used a MySQL database with PHP to access the data and code up the necessary pages and Javascript to do the actual conversions. When a dimension is selected, the conversion page refreshes and the PHP code writes the Javascript that does the actual conversions. This means that conversion is instantaneous when a change is made to the value to be converted. Since the conversion code is Javascript, any valid Javascript can be used in the equations stored on the database. The value x is always used to represent the incoming value so to calculate a circles area from its radius we can use the equation:

x * x * Math.PI

and the inverse conversion to get radius from area uses the equation:

Math.sqrt(x / Math.PI)

The further advantage of using equations rather than fixed factors is one of precision. To convert between feet and inches, we can use x*12 to go from feet to inches and x/12 to go from inches to feet. The conversion from inches to feet using a multiplicative factor only would mean having to use the factor 0.083333333333 and where should you stop with those recurring threes?

Similarly, we can use equations to use only exact conversion factors so that in converting from feet to metres, we use x*0.3048 and going from square feet to square metres we use x*0.3048*0.3048 which is more obviously understandable than x*0.09290304.

I haven’t as yet put many dimensions or units on the database, nor have I implemented the code necessary to allow users to customize the application. These additions will be coming soon. Anyway, give it a try under the Tools menu item and let me know what you think.

If you are interested in getting a copy of this code for your own uses, drop me an e-mail and I'll send you the stuff by return. It would be better if you were familiar with PHP and MySQL as I don't plan on providing an install script or anything fancy like that.



   

Comment by jeff on September 8th 2007

Comment by jeff on September 8th 2007

 

Hey, I'm an Architectural student at Humber College and have some of my own conversion factors I use (Feet + inches = ??), but I always have submit to see the answer.

I used a calculator most of last year, but that became tedious.
I would love to look at your code so I don't have to refresh the pages all the time. I have used mysql db and php for about 6 months now. A dump of mysql would be the easiest for me.

   

Comment by David Sawers on September 8th 2007

Comment by David Sawers on September 8th 2007

 

Jeff (and others who may be interested).

I sent you the source code and a few implementation notes. If you use the code, please accredit Activeminds and provide a link from your site to the unit conversions application on this one.




Please feel free to comment on what you've just read by adding a note in the box below. Your name will be posted alongside your comment but your e-mail address is only for my records and will not be made public or sold or given to any third party. If you choose not to give an e-mail address, that's fine but your credibility is increased in my eyes if you are prepared to stand by your comments. Please do not be abusive, use strong language or post spam or other junk. Due to persistent abuse by spammers, all comments will be moderated before they are published. Therefore, your comment will not appear immediately. By commenting on this form, you agree to permit Activeminds Software Ltd. to publish your comments on this website. Activeminds Software Ltd. accepts no responsibility for any comments posted on this site. They are solely the view of the commentator.
Your Name:
will be published
Your E-Mail address:
will not be published
Your Comment:
By typing in the words in the box, you are helping to digitise books and manuscripts whilst preventing abuse of this comment facility.
 
     

All rights reserved Activeminds Software Ltd. © 2000-2009