# Rodrigo Silveira

## Blog

My playground and R&D lab

• ### Hitomezashi Stitch Patterns in HTML Canvas

The other day I came across the concept of Hitomezashi stitch patterns from a Numberphile video on the subject. Before the video was over, I realized I had to code that up and see for myself how the probability for a point starting on/off would influence the pattern.

• ### Genetic Algorithm Example

In this toy demonstration of genetic algorithms, the algorithm learns some arbitrary 2D function. The “chromosome” is represented by a sequence of `<distance, angle>` pairs. By rendering the first point at some location, we can render the next point in the sequence by computing the `<x, y>` coordinates relative to that first point by using the distance and angle for the current gene.

• ### R&D Backlog

The purpose of my blog is to post unpolished, throwaway, R&D type stuff. The more in-depth discussions will generally be posted on Medium.com and the posts here will contain more interactive demos. Below is a growing list of things I’m curious to try out and research more, as well as new ideas I come across.

• ### Machine Learning - Linear Classifier

An interactive demo showing linear regression fitting a very separable dataset. This work was very early practice as I was learning the foundations of supervised learning.

• ### Machine Learning Painting with Linear Regression

An interactive demo of using linear regression to minimize a function that “learns” what the values of a matrix of pixels should be so that it forms a photograph. This work was very early practice as I was learning the foundations of supervised learning.

• ### Maze Traversal with Breadth-first Search & Depth-first Search - Old Demo

An interactive demo of using BFS and DFS to traverse a maze.

• ### HTML5 2D Game Programming Tutorial with GWT

This is proof that I was one of the cool developers who grew up, graduated from jQuery, and stepped up their game using Google Web Toolkit (back when it was a Google project and the world was still purple and gray).

• ### Composite Design Pattern in PHP

Yet another explanation of some design pattern. I’m posting this almost 7 years after I first wrote this. Hopefully it helps you on your homework or on that job interview you’re preparing for :)