|
|
Web Browsers as Programmable Calculators ...for those special calculations |
|
|
Almost any scientific formula can be turned into a bookmarklet. Scientific formulas tend to be small in size (like bookmarklets), and since bookmarklets can be easily configured within your Bookmarks/Favorites they enable you to quickly set up a range of special-purpose calculators for temporary or frequent calculations.
There are some advantages to using web browsers over traditional programmable calculators:
To write a special-purpose calculator as a bookmarklet, study some of the examples in the Calculate/Convert section. You can get the "source" of a bookmarklet by copying the link location from the bookmarklet link, then paste it into a text editor and play with it. For example, here is the source of a simple version of a Download Calculator which roughly tells how long it will take to download a file of known size using a 28.8 modem: javascript: X=prompt('File size:',''); alert('At 28.8, the file will take about ' + X*1024*8/28800 + ' seconds to download.') Try it. Normally in a bookmarklet the script would all be on one line, but I've written this out on seperate lines for greater readability. The idea is quite simple: you just prompt for the input, then alert the output. Inside the alert you place a formula - in this case it's X*1024*8/28800, which converts between KiloBytes (which are used to describe file sizes) and Kilobits (used to describe transfer rates). As you study more examples, you learn more tricks: ways of handling errors, taking more than one input variable, making it easier to copy the output, and so on. But the crucial part is in knowing a good formula to start with. Once you've made a special-purpose calculator you can share it with others by making a link to it, just as you would with a webpage URL. Visitors to your page can keep the tool by pointing at the link and selecting "Add to Bookmarks/Favorites" from their (right-click) menu. (Macintosh/Unix users may have to rename the Bookmark after keeping it.) - Simple! If you come up with any good ones, or need some extra help, please let me know! Back |