Monthly Archives: December 2014

Firefox: Get Rid of the Scratchpad Greeting

The Firefox browser has a little tool for JavaScript editing build-in called “scratchpad”. Based on the editor CodeMirror it is a bit better than writing a small HTML file with a textarea and a button to eval() the content but not very much.

The pros are the ability to “fold” code and a some pop-up things like code completion.
The cons are many, the main theme is probably that bugs (including usability issues) get ignored but featuritis is rampant. Another one is the fact that you cannot configure it a lot, actually, only half a dozen things of which only one or two affect everyday work. Continue reading

Factoring an Integer in JavaScript with a Wheel

Update: bugfix in code

Factoring an integer with a wheel is a known algorithm for which many examples exist for many programming languages. Google might be of some help to find them.
Most of them are either way too simple or way too complicated; I would even say that all of them fall into one of these two categories but I do not know all of them.
One example that could fit both categories at once is the program factor from the GNU-coreutils which uses a wheel to do its work. I did a JavaScript version of it if that language suits you more. The program itself is quite simple yet hard to understand.
For example: what are these numbers at the start and where do they come from? Continue reading

Multiple Precision in JavaScript: Rational Arithmetic III

Elementary Functions: Second Try

Not that I found the code for the rational exponential function I wrote (that’s lost) but I found it unfair to say “too slow” without giving a reason, so i did it again, for exp() and log(). Continue reading

Multiple Precision in JavaScript: Rational Arithmetic II

Elementary Functions

While trying to implement even the most basic elementary functions, like square root, nth-root and the exponential function I had to admit that the Bigrational library is just too slow. Square and nth-root work ok, but the exponential function is of not much use with that low speed it needs floating point arithmetic. Yes, I am working at it.

But all of that is no reason to drop the whole mess completely as you might have seen if you took a look at the Bigrational library. Continue reading