to your HTML Add class="sortable" to any table you'd like to make sortable Click on the headers to sort Thanks to many, many people for contributions and suggestions. Licenced as X11: http://www.kryogenix.org/code/browser/licence.html This basically means: do what you want with it. */ var stIsIE = /*@cc_on!@*/false; sorttable = { init: function() { // quit if this function has already been called if (arguments.callee.done) return; // flag this function so we don't do the same thing twice arguments.callee.done = true; // kill the timer if (_timer) clearInterval(_timer); if (!document.createElement || !document.getElementsByTagName) return; sorttable.DATE_RE = /^(\d\d?)[\/\.-](\d\d?)[\/\.-]((\d\d)?\d\d)$/; forEach(document.getElementsByTagName('table'), function(table) { if (table.className.search(/\bsortable\b/) != -1) { sorttable.makeSortable(table); } }); }, makeSortable: function(table) { if (table.getElementsByTagName('thead').length == 0) { // table doesn't have a tHead. Since it should have, create one and // put the first table row in it. the = document.createElement('thead'); the.appendChild(table.rows[0]); table.insertBefore(the,table.firstChild); } // Safari doesn't support table.tHead, sigh if (table.tHead == null) table.tHead = table.getElementsByTagName('thead')[0]; if (table.tHead.rows.length != 1) return; // can't cope with two header rows // Sorttable v1 put rows with a class of "sortbottom" at the bottom (as // "total" rows, for example). This is B&R, since what you're supposed // to do is put them in a tfoot. So, if there are sortbottom rows, // for backwards compatibility, move them to tfoot (creating it if needed). sortbottomrows = []; for (var i=0; i
Nearly twenty years ago, we invented a small part of the Internet. Specifically, we invented a method that greatly automated the computer programming needed to put simple computational applications onto the Internet where they might be accessed by anyone with a personal computer or an Internet-capable mobile device. Today, the now much more sophisticated descendants of what we made easy to create are simply called "apps".
To make a long story short, we submitted a proposal to our employer at the time to patent our invention, which ultimately went nowhere. Not being in an Internet or computing-related business, they declined to file an application for our invention with the U.S. Patent and Trademark Office.
Ten years ago, we saw an opportunity to resuscitate our original invention and launched Political Calculations, where we would augment the analysis of current events with the kind of simple, yet specialized computational tools that our invention made easy to generate.
And that brings us to today, where we're not just celebrating our tenth anniversary, but also marking the occasion where if our employer at the time had applied for a patent for our invention, the term of the patent would now be expiring and entering into the public domain!
And, as an added bonus, today is also the day that the Khan Academy is encouraging people everywhere to experiment with creating computer code with its Hour of Code event!
So welcome to our Toolmaker's Tool - a stripped-down and simplified version of the invention that we've used frequently over the past decade to create many of the applications developed for the Political Calculations blog!
Our Toolmaker's Tool is designed to aid you in creating JavaScript-based math calculation tools. As such, you can take advantage of the math functions and built-in constants used in JavaScript. You may also take advantage of HTML code to help create your tool and its surrounding commentary.
By way of providing an example, we've entered some basic data for a tool that will calculate the future value of an investment, using the following formula:
F = P(1 + I/N)N*T
where F = Future Value, P = Starting Value, I = Interest Rate, N = Number of Compounding Period per Year and T = Time Held in Years.
Please feel free to overwrite this data to do your own calculations! Also, you are more than welcome to post any tool you create using this prototype on your own blog or web site, provided you retain the "Code created with the assistance of Political Calculations" text and link under your generated output table.
The Toolmaker's Tool is designed to make programming web-based computing applications as easy as filling out a form. Once you've organized the mathematical algorithm you'll use in generating your tool to identify your Constants (or Initial values), User Input Data, and Formulas - you'll probably find that you'll spend less time programming than you do writing the text around your tool! But, why wait to find out? Get started now....
Update 9 December 2014: Blogger made it a challenge, since our code ran in Blogger's draft status, but curiously, not after being published. We've solved that problem now, eliminating the last barrier between you and building your own online tools - it's all wide open now!
Update 8 December 2019: Google is making life difficult. We had previously solved the problem of making the underlying code by hosting it on Google Drive. Unfortunately, Google's evolution from Google Drive to Drive has broken the connection to make the Toolmaker's code work. We're working on a fix.
Our anniversary posts typically represent the biggest ideas and celebration of the original work we develop here each year. Here are our landmark posts from previous years:
We celebrated our 2013 anniversary in three parts, since we were telling a story too big to be told in a single blog post! Here they are:
And finally, our tenth anniversary post....
We're finding ourselves increasingly being pulled toward new and exciting projects. Unfortunately, we only have a limited supply of time, which means that something that we're doing currently has to give, and that something is going to be our regular workday posting schedule here at Political Calculations.
We're not going away, but we won't be posting with the frequency that we've established over the past decade. To best keep up with us, we recommend subscribing to Political Calculations' free RSS news feed through your preferred news reader.
Labels: tool
Welcome to the blogosphere's toolchest! Here, unlike other blogs dedicated to analyzing current events, we create easy-to-use, simple tools to do the math related to them so you can get in on the action too! If you would like to learn more about these tools, or if you would like to contribute ideas to develop for this blog, please e-mail us at:
ironman at politicalcalculations
Thanks in advance!
Closing values for previous trading day.
This site is primarily powered by:
The tools on this site are built using JavaScript. If you would like to learn more, one of the best free resources on the web is available at W3Schools.com.