Musings of a Fondue

On the Nature of EPUB

I was wondering if an ePUB file could be embedded with malicious script since this is a well known vulnerability of Adobe’s pdf files. A quick Google search linked to a forum where someone had asked the same question.

So it turns out ePUB is just a bunch of html and css files! What?!

Then I came across this article from Smashing Magazine. And yup it is just a bunch of html and css files.

Not only that, it is just as easily editable!

Teardown - PC

Believe it or not, this was the first time I ever opened up a desktop PC.
#late2thegame

Automation With Sikuli

I had used BB Flashback to record a scene I was interested in animating. However, the program doesn’t come with a way to export several images at once. You have to export each one individually.

I had done this before for about 200 images and it was a never again experience! Through the magic of Google and StackOverflow, I came across Sikuli.

Speed Test - UI

In the previous post, I used a Raspberry PI to gather a week’s worth of internet speed data.

I have a rough idea of what I want the D3 visualization to look like. My main inspiration is this one by Joseph Nudell where he visualizes his texting habits.

For the user interface I wanted big and fancy buttons and knobs. I searched the interwebs and came across several awesome Photoshop tutorials. My initial plan was to learn from them so that I could create my own custom designs from scratch. Learn I did but for now I will work with the designs from the tutorials and put my focus on the CSS.

Speed Test - Raspberry PI

We were having some problems with consistent internet speed. I wanted to see how it varied over time by gathering a week’s worth of data and visualizing it with D3.

One option was to manually run the speed tests periodically. A more sane option, was to have a program do this.

I didn’t want to leave my computer forever on to accomplish this. And there was a Raspberry Pi sitting unused, that could stay running for days on end happily. So Pi it was.

But how to write such a program?

Sieve of Sundaram

I was working through question 10 on Project Euler which requires you to find the sum of all primes below two million. I had written some code to find primes in previous questions, but it was far too slow to accomplish this. I hit Google to find efficient algorithms for prime number generation and came across the Sieve of Eratosthenes and the Sieve of Sundaram.

The article on the Sieve of Eratosthenes had a great gif by Sebastian Koppehel which showed visually how the sieve works. It was very clear and quickly gave you the gist of what was happening.

I thought it would be nice to have something similar for the Sieve of Sundaram so after I worked out how Sundaram’s sieve ticks, I made a similar gif for it.

I used JavaScript, HTML, and CSS to make it. See it in action here

If you want to see the code, right click and select view-source. It was cool to contribute something to a site I rely on so much!

A GUI for FFmpeg

Similar idea as my previous GUI for Youtube-dl.

I wanted a GUI (Graphical User Interface) to interact with FFmpeg instead of using it through the command line.

Specifically, I was interested in using FFmpeg to capture frames from a video. (I do this often for sequences I’m interested in animating.)

This is how it came out.

Also, this time around I tried to make a tutorial for how to go about it. It’s not the greatest so I’m not going to direct link it. But at least if you search for “windows GUI tutorial” on YouTube, there’ll be one more playlist out there to help you out.

Scraping Pictures With Ruby

Another snippet!

I was trying to get some images from this site. They are part of an animation sequence of about 200 images.

At about the sixtieth image it got quite tedious to right click and save each image manually.

So, I did a quick Google search for “using ruby to grab images from a site” and came across this answer on StackOverflow.

Only four lines of code! Four!

A Budding Interest in Hardware

The following sites have exposed me to a whole world I had no idea existed. And it’s mind blowing!

Eager to learn their language, and since this battery charger was the closest thing on hand I could open up, it will be my guinea pig. My goal with the charger is to be able to identify all the components on it, how they work together to accomplish their intended task, draw a schematic for it, and recreate its PCB. I figure in the process I’ll learn a lot about Hardware and Electronics.

Battery charger

Eagle PCB Layout

I was going through a SparkFun tutorial on reading schematics, when I decided to use it as an opportunity to learn a thing or two about PCB layout.

My candidate circuit was that of the FT231x breakout board mentioned in the article. SparkFun releases all of its products as Open Source Hardware, so the relevant schematics were provided on the product page.

Once Tedious

What would once have been a very tedious selection with the CTRL key literally took a minute by writing a simple code snippet (and using Chrome’s console to run it). =D!

This,
manual

Became this,
automated

Open CV

Image from this video

I am interested in making a game that relies on hand gestures being detected by a webcam. In search for how to go about this, I came across videos like this and this which used Open CV to detect hand gestures.

I then found this tutorial series on YouTube. In the process of working through it I learned a lot! Checkout the series if you want a great intro to Open CV.

Since this is one of the few times the only time I managed to keep a dev log, I present it below.

JResig Book - AutoComplete

In chapter 12 of his book Pro JavaScript Techniques, John Resig walks through how to create an autocomplete search using AJAX.

Here’s my go at it1

User Interface

The UI was fun to work on. Okay, maybe not all the time. But the end product was rewarding.

As seen in the book,

My take on it,

Server code

The autocomplete search relies on a file called auto.cgi being called and executed as the user types. For example when the user types “c”, a request is sent to the server for auto.cgi?to=c. The server executes auto.cgi with c as the argument, returning all the users whose names contain the letter c.

Responsive Layout Tutorial

I was looking for a framework I could use to make my blog. I wanted something lighter than Bootstrap and came across Skeleton. I also came across this tutorial series on TutsPlus on Building a Responsive Layout with Skeleton, and the accompanying videos.

The series turned into an unexpected lesson on web design. I learned about Photoshop mockups and their use in website design, about font pairing, responsive design, grid layouts, textures, patterns, media queries, and lots of other good stuff.

Checkout the resulting website here

It’s optimized for Desktop browsing.

JResig Book - Gallery

A simple image gallery based on chapters 7 and 9 of John Resig’s book Pro JavaScript Techniques.

Check it out here

The book is great if you want to dip a toe into writing better JavaScript.