List to images

I've put together something I've been meaning to make for a while: a little program that takes a folder of images (.eps and .png files, specifically) and turns them into a webpage and a LaTeX document. My MATLAB code spits out images, and it's always a faff to put them together into something coherent and useful.

This is implemented in C++ and bash, and requires some kind of linux with pdflatex installed.

Click here to download the zipped up code, or use wget:
wget http://bethmcmillan.com/geek/ListToImages.tar.gz

Then, to unpack the file, use:
tar -xvf ./ListToImages.tar.gz

Then use listtoimages.sh followed by the path to the folder of images to make the pages. For example, I used:

./listtoimages.sh /users/bethmc/Pictures/

This gave me several files called "output" inside the Pictures directory, including a html file that contained all of the png images, and a PDF containing all of the eps images (the tex file is also supplied).

Anyway. Back to work, all of you!

Edit: my "Pictures" folder is mostly full of photographs of potoos. THEY ARE HILARIOUS.

...

jQuery is actually fairly amazing

HTML display prototyper
After a very brief time reading the excellent jQuery tutorial on w3schools this afternoon. I've made a useful little prototyping page, which allows you to enter HTML in the text box and see it displayed below. It takes a staggeringly few lines of code.

First, the usual top-of-file business:

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">

<title>Try HTML</title>

Then, we load in jQuery from Google.

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js">
</script>

Now, the javascript. First, we check that the webpage has loaded:
<script>
$(document).ready(function(){

Then, we wait for someone to click on the button with the ID "show":
  $("#show").click(function(){

Now we take the value from the textarea with the ID "textin" and use it to set the HTML inside the element with the ID "results".
    $("#results").html($("#textin").val());
  });
});
</script>
</head>

<body>

Then, in the HTML, we have the area for the user to enter text:
<p><textarea id="textin" rows="4" cols="50"></textarea>

The button to press:
</p><button id="show">Show Results</button>

And the area to show the results:
<p id="results"> </p>
</body>
</html>

It has taken me significantly longer to write this blog post than it did to make that webpage. Hurrah for jQuery!

...

Geeky cross-stitch patterns

I've been having lots of cross-stitching fun lately. I'm a big fan of pixel art and especially that found in SNES games. Super Mario Bros 2 was one of my favourite games as a little girl, because you were allowed to play as Princess Peach (who is objectively the best character because she can FLOAT). I'm in the process of making a pincushion-based cross-stitch homage to her - the pattern is at the bottom of the page.

I also participated in the epic Reddit Secret Santa Gift Exchange this year. My giftee is a young gentleman who works in IT, with a love for Legend of Zelda. I made him a cross-stiched Link yoyo...

...and a friendly little sign for his desk.

I've made some downloadable patterns: Link, Princess Peach, and Go Away Sign.

...