PHP & More

A technical blog about programming in PHP and about technology in general: programming, workarounds and troubleshooting

D3 is a JavaScript framework used for data visualization. Learning how to work with D3.js is very easy. If you begin with the basics, you’ll see how easy it is to use D3, because: the DOM function names are much shorter than those in the legacy DOM library. the same functions are used for both …

Continue reading

How do you declare a static variable in a JavaScript function? Not with the word “static“. In JavaScript “function” is a variable type similar to “object“. The difference is that the reference to a function inside itself is not this but arguments.callee. An example of using arguments.callee is the following function that returns itself: function …

Continue reading

Browsers supporting HTML5 allow you to draw on the browser’s screen without preparing an image file before. Drawing on a canvas is done using the wonderful Javascript language. If you want to draw a 2-dimensional image on canvas element ‘cnv’, get the drawing context using: var ctx = cnv.getContext(“2d”) And use that context to draw …

Continue reading

When you start Processing, you get an editor with a sketch name. You will probably want another name for your program, a name that means something. So, to change the name generated by the tool, you choose file->save as. Choose a name, and the tool will create a folder with that name, and a file …

Continue reading

Processing is a programming language used mainly for animations and graphical applications. If your program is written in pure Processing, the same code can be run in many tools that use their own language: Windows with Java applets, HTML pages with Javascript, Android applications, etc. Running an application  is done by choosing a mode from …

Continue reading

In the post LibreOffice Javascript, I wrote about Rhino Javascript, which is a Javascript interpreter written in Java. This tool has been developed by Mozilla. With this tool you can instantiate Java classes and to access them via Javascript commands ‘importClass’ and ‘importPackage’. How to ass classes and packages you can load ? This is …

Continue reading

In the previous post, How To Develop Firefox Extensions – Intro, we discussed the Chrome document’s DOM. In this post, we’ll learn how to create an add-on that can be installed.  In this post, we’ll learn how to access the Chrome document’s nodes, and to organize an XPI (Cross Platform Installer) file. XPI files are …

Continue reading