Archive for July, 2010

29 Jul
2010

Macro video and photos with the S3 IS

With a couple bucks worth of cheap macro filters, you can get great macro video and photos with the Canon S3 IS (works with the S1 or S5 IS as well). All you need is a lens adapter that fits all of the canon S* IS models and a set of dirt-cheap filters.

(more…)

26 Jul
2010

JavaScript “Current Filename” Function

I found the need to get the current filename, without the file extension, of a webpage using javascript. I thought there would be an easy way with jQuery, but I found a good way to do it in plain javascript. I made a quick function to take care of this task that might save you some time, the compressed version is shown below. I’ll add a more human-readable version in the near future.This code is very unreadable! Please don’t use it blindly, as it may not work in all cases.

function getCurrentFile() {
  var filename = document.location.href;
  var tail = (filename.indexOf(".", (filename.indexOf(".org")+1)) == -1) ? filename.length : filename.lastIndexOf(".");
  return (filename.lastIndexOf("/") >= (filename.length - 1)) ? (filename.substring( filename.substring(0, filename.length - 2).lastIndexOf("/")+1, filename.lastIndexOf("/"))).toLowerCase() : (filename.substring(filename.lastIndexOf("/")+1, tail)).toLowerCase();
}

This function returns the current filename (minus the file extension) in all lower-case. Feel free to modify it to suit your needs. It also works properly even when a URL does not have a file extension (such as with some asp-based sites), or when there is no filename present (returns the folder name). This function is great for highlighting menu items based on which page the user is currently browsing. If you don’t understand some of the syntax, note that I’m using javascript’s conditional syntax as shorthand for if/else statements.

1 Jul
2010

New “Projects” Pages

I created a new “Projects” type to list some projects currently on protofusion. Check out the link in the top menubar, or click here. Have a project that needs some of the resources that protofusion can provide? Send an email to admin@protofusion.org.

Arduino Leonardo - Interrupts

Arduino Leonardo – Interrupts

As of Arduino 1.0, interrupts are not supported on the Arduino Leonardo. I’m working on a project using the atmega32u4

ZonCoffee v3 PCB

ZonCoffee v3 PCB

The first prototype ZonCoffee v3 boards have arrived and are nearly up and running. I’m currently porting the code over