Recently I was surprised to learn that web browsers allow any site you visit to make requests to resources on localhost (and that they will happily allow unreported mixed-content). If you'd like to test this out, run an HTTP server on port 8080 (for instance ... more
In this video I show how easy it is to build an Internet of Things device hub using only a Pixl.js and a little bit of Javascript code. To demonstrate I control a few devices using Bluetooth Low Energy and LoRa ( Lo ng Ra nge radio). ... more
Hey everyone, so I just got some LoRa modules from REYAX to experiment with long range network applications and these things are so cool! So far I've made a long range security alarm, a button to water plants on the other side of my property, and some ... more
Today I put together a quick tutorial on how to build a 3d terrain in Javascript, from setting up three.js to loading a heightmap and texture. More will be added later (controls and collision). Each step is organized as a release in the Github repo so ... more
Here's another quick web experiment, this time exploring the use of particle systems to generate art. You can watch it generate a random forest live here: https://wybiral.github.io/code-art/projects/trees/ Or if you're one of the cool kids you can clone ... more
I'm always looking for an excuse to build something fun... So it was only a matter of time before I got the idea to create a virtual air hockey game, and then train a neural network to play it. Check it out: https://github.com/wybiral/air-hockey The idea ... more
As a fun little side project to kick off the season I decided to write a Halloween themed strategy game (in the style of the tower defense genre). Appropriate for children (there is no gore or violence) although it may be a bit challenging for young ones. ... more
All I wanted for Christmas was a quantum circuit simulator. So I wrote one in Javascript using NumericJS. Check it out: http://www.davyw.com/quantum For a good "Hello world" circuit, here's the diagram for a Bell State... Try evaluating it yourself ... more
I just recently found this javascript library. So far it's looking pretty good. I've always wanted some sort of Javascript equivalent to NumPy and while this isn't anywhere near that extreme, it does offer some pretty handy features. Here's a jsFiddle ... more
Update: This API is deprecated. Use the new json api instead. I needed a way to deal with planetary positions and velocities and found NASA's HORIZONS and the ephemerides. But I wanted a simpler interface than telnet or lugging around the massive ephemeris ... more
I recently had the need for some sorted insertion in Javascript arrays, thought I'd share this tiny bit of code: Array.prototype.bisect = function(x, lo, hi) { var mid; if(typeof(lo) == 'undefined') lo = 0; if(typeof(hi) == 'undefined') hi = this.length; ... more
Given the limit on individual requests with GAE, doing things like batch updates to your database (live) can be an interesting challenge. I recently had to update all of the votes for Challenge-You! to support a new rating system. The best approach I ... more