Skip to main content

Posts

Node JS Multiplying Float Matrices

I don't know why I wrote such stupid code for readMatrix.js . I guess when someone uses a new language their brain cells seize up, effective function becomes impossible. After tests I ran on Friday, I wanted to see how Javascript does with floating point numbers? JS only supports 64 bit floating-point numbers, but there must be special code in their to make integers look like integers ... unless their isn't. When I went to update my code to support numbers with fractions, my first thought was to flag whether a decimal point had been seen and then keep track of the value by which to divide, multiplying by ten for each fractional digit. I quickly realized I was sinking into the mire of coding stupidity; JS must have a function to convert strings into integers or floats, and indeed it has parseInt() and parseFloat() . But in my research I discovered ( or re-discovered ) that there's no need for the conversion. Like Perl, JS allows arithmetic on the string representation

Node JS As The Universal Shell Scripting System

For the past 20 years, I've focused on programming in real languages for real applications, as opposed to web stuff, :-). When I have dealt with the web, it's been using server-side scripts. Definitely not that Javascript crud. Mind you, back when I worked for a porn website, they also came up with a JS based website, Simple.com, long before other people were doing all-JS interfaces. But the time has come to re-evaluate ... well, everything. Javascript can be checked for validity and style using JSHint & JSLint; it can be debugged. There are frameworks and layers that make it possible to do useful things easily, treating old JS as a sort of widely-supported low-level language on which to implement more elegant systems. One of these new paradigms is the implementation of node.js to run JS programs on the server, rather than in a web page. Node uses the Google's V8 Javascript engine from the Chrome browser, which means a large corporation ensures high performance on

Saint Patrick's Day plus one

Perl5i Presentation to Toronto Perl Mongers

I presented a workshop based on the blog articles I wrote in March & April about perl5i. It went out on the Google Hangout, and the recording is available on YouTube , though unfortunately it stops short of the end. There may be a way that can be fixed, though i doubt it. Slides are available at Scribd , as are the speaker notes . Thanks to Michael for the module, Ingy dot Net for his YAPC mention of my Rosetta Code efforts, and Stephan Little for p5mop, his attempts to bring OO into core Perl5.

Dear John Nack #2

I suppose I should name this Dear Adobe , since John isn't actually involved with Lightroom or Photoshop. And I will, next time. I LOVE the Adaptive Wide Angle filter in Photoshop CC .... except when I don't. AWA is a filter like Lens Corrections, that places a preview of your image in  window of its own, where you modify various controls and view the effects in more-or-less real time. When you click OK, the modifications are applied to the entire image. While there are a number of options, which vary the amount and type of controls available, I use it on panoramas. You draw a line on the image, by clicking the endpoints, and a guide line is presented, bisecting a circle. By clicking where the line and circle intersect, you can cause the line to rotate to a different angle. But unlike a simple image rotation, you can have many lines, rotated to various angles, manipulating a mesh superimposed on the image. I use it to straighten out panoramas, so my horizontals are hori