Archive for the ‘Algoritmi’ Category
Angular.js does an excellent job on preventing a form submission when invalid but only if the action attribute is not present, otherwise we have to implement a few tricks to achieve the same behaviour.
I spent part of the last weekend on this experiment that startet with a question: it is possible to convert a video to a stream of CSS properties ? Surprisingly the answer is yes. We can dump each video frame to a canvas and then create a special (and very long) multiple background property (one background for each video row) where each pixel is created using a 1px size gradient.
Recently I had to deal with a WordPress multisite instance, the task was moving the contents of one of the sites hosted on the network to a local copy, update them and the re-move them to the production server.
Yesterday was sunday and I came up with a fascinating idea: what happens if I use wordnet to measure the distance between two words ? By assigning weights to all the relation types and by navigate this relations graph I thought to be able to measure the distance between a word and the others in terms of the minimum sum of weights of the edges between each pair made of the chosen word and another.
During the last hour I modified my previous version of Game Of life trying to reproduce the same behavior using an analogic discriminator. Instead of counting the number of neighbours I elaborate their medium color and use this value to decide the next rgb combination of the cell.
Everybody knows the popular Game of Life created by Jhon Conway and becamed famous after been published by Martin Gardner on Scientific American in 1970. It is essentially a cellular automation algorithm with a very few simple rules that determinate how to grow a pool of one-pixel-shaped organisms layed upon a 2D matrix.