Starbeamrainbowlabs

About

Hello!

I am a computer science student who is in their third year at Hull University. I started out teaching myself about various web technologies, and then I managed to get a place at University, where I am now. I've done a year in industry too, which I found to be particuarly helpful in learning about the workplace and the world.

I currently know C# + Monogame / XNA (+ WPF), HTML5, CSS3, Javascript (ES6 + Node.js), PHP, C++, and a bit of Python. Oh yeah, and I can use XSLT too.

I love to experiment and learn about new things on a regular basis. You can find some of the things that I've done in the labs and code sections of this website, or on GitHub. My current projects are Pepperminty Wiki, an entire wiki engine in a single file (the source code is spread across multiple files - don't worry!), and a Prolog Visualisation Tool, although the latter is in its very early stages.

I can also be found in a number of other different places around the web. I've compiled a list of the places that I can remember below.

I can be contacted at the email address webmaster at starbeamrainbowlabs dot com. Suggestions, bug reports and constructive criticism are always welcome.

Blog

Blog Roll | Article Atom Feed


Latest Post

Line Simplification: Visvalingam's Algorithm

An screenshot of my demo of my implementation of Visvalingam's Algorithm. (Above: A screenshot of the demo of my implementation of Visvalingam's line simplification algorithm. Link below!)

For a secret project of mine I've been working on since about February time (if I recall correctly), I've discovered that I could make some considerable use of a line simplification algorithm. The tricky thing is though that I need an implementation in both Javascript and C♯ - which will both return identical results.

Initially, I chose the Ramer-Douglas-Peucker Algorithm, but I ended up implementing Visvalingam's Algorithm instead, as I encountered issues with calculating the shortest distance from a point to a line reliably along with other algorithmic problems that I determined weren't worth the time to fix.

Visvalingam's algorithm is actually really simple. Suppose we take a line:

A line with 6 points in it.

If we create a sliding window with a width of 3 and slide it along the list of points, then we get a set of triangles. To simplify the line, we can calculate the area of each of these triangles, and remove the centre point of the triangle with the smallest area.

The same line with the triangles highlighted.

The same line with a point removed.

Then we can continue removing the centre point of the smallest triangle until we reach a triangle with an area that's above a threshold we set - and this is Visvalingam's Algorithm.

Though I haven't written the C♯ version yet, I've completed the Javascript implementation - and created a demo for you to play around with! Here's a link:

Visvalingam's Algorithm Demo

Note that you'll need to enable ES6 Module support in your browser to get it to work, as I've used ES6 Modules whilst building it.

In Firefox this can be done by setting dom.moduleScripts.enabled to true in about:config, and in chrome by visiting chrome://flags/#enable-javascript-harmony (sorry, hyperlinks don't work for chrome:// urls IIRC!), enabling it, and restarting your browser.

It's open-source, of course - under the Mozilla Public License 2.0. You can find my code on GitHub - and pull requests are welcome :D

Finally, I've released it as an npm package. If you aren't aware of npm, it's really cool. It's the primary package manager for Javascript - I've written a blog post on this here.

Once I've written the C♯ version I'll have another bash at trying to get Nuget to package it. I think I know what the issue has been so far - so hopefully it works this time! If it does I'll blog about that too.

Found this useful? Think it's cool? Let me know in the comments below!


By on

Labs

An implementation of Valvalingam
Line Simplifier
Share files and images on your computer with your friends!
GalleryShare
A night sky full of pretty twinkling stars.
Starry Sky
A small gem I found in my archives. From 2013.
Archives: Colour Picker
A bicycle riding through some procedural scrolling parallax hills.
Parallax Bicycle
A procedural castle generator I wrote for /r/proceduralgeneration
Procedural Castles
A pen I created as a demo whilst writing a class to draw regular shapes.
Rotating Shapes
A pen I created as a demo whilst writing a class to draw smooth lines.
Smooth Lines
A small experiment to get my head around how fractals work.
Fractal Shapes
An example of context.ellipse in action, written for a blog post.
Ripples
Get all the fun of the fair without the noise and the cold.
Big Wheel
Some treasure is hidden on your screen. Can you find it using only your ears?
Audio Treasure Hunter
A Voronoi Diagram Generator
Voronoi Diagrams
A random snowflake generator
Snowflake Generator
A fully functional wiki in a box.
Pepperminty Wiki
Some clouds drifting across the screen, drawn via the HTML5 Canvas.
HTML5 Canvas Clouds
A turtle based drawing program for your first forays into simple programming.
Imaanvas
A client side online tool for stitching strings of still images into an animated gif.
Gif Renderer
A set of parallax scrolling stars using the HTML5 Canvas
Parallax Scrolling Stars
An (almost) pure CSS spotlight demo.
(Almost) Pure CSS Spotlight
A Javascript Bookmarklet to fade the unimportant parts of a page. Also features HTML5 fullscreen API integration.
Lightsout
A small script to trianglify (draw triangles on) an image.
Image Trianglifier

Code

An implementation of HTTP and Websockets in pure C♯ as a library. Does not use System.Net.HttpServer.
Gliding Squirrel HTTP
A program that detects and decodes morse code embedded inside an audio file.
Audio Morse Decoder
The one and only C♯ class generator. Tired of typing the same old scaffolding out all the time? Give this tool a try.
Cscz
A class modelled on StreamWriter that makes it easy to generate CSV files.
CSVWriter
A web based tool that generates diagrams based on Prolog traces.
Prolog Visualisation Tool
A command line tool to generate random noise, written in C#
Noisebox
A (hopefully) better traceroute utility written in C#
TraceRoutePlus
An easier way to generate XML.
Simple XML Writer
A PHP based Atom feed generator.
PHP Atom Generator
A simple CodeMirror based javascript bookmarklet editor.
Bookmarklet Playground

Tools

I find useful tools on the internet occasionally. I will list them here.

Brackets
ConEmu
WinSCP
7zip
Bfxr
I'm Only Resting
HxD
DCPicker
Art by Mythdael