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 made a quick function to take care of this task that might save you some time.

function getCurrentFile() {
  var filename = document.location.href;
  var tail = (filename.indexOf(".", (filename.indexOf(".edu")+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.

21 Jul
2010

Converting .MTS video files into .mp4 files

I have a Canon HF200 video camera and it outputs HD video, but it’s in .MTS file format. This is a pain because there are no good free video converters or editors for .MTS files. But using Avidemux, an open-source video converter, I was able to edit and convert my video to .mp4 while keeping my sanity and my money.

Read More »

17 Jul
2010

The OSRAM SLG2016 and AVR

I happened to scavenge a couple of SLG2016′s from some old workstation debug displays. After finally locating a datasheet, I realized that they used the standard ASCII charset, so they are extremely easy to drive. Note: The SLG2016 differs from the SLR2016, SLO2016, and SLY2016 only by LED color.

Read More »

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.

16 Jun
2010

Victor Speed Controllers and EMC2

I’m currently working on building a EMC2-controlled CNC machine with mostly parts I have on hand. I decided to use Victor 883′s to control my servos, but EMC2 does not put out the RC-style PWM signal that victors are driven with. Thankfully, hardware in EMC2 is configured with HAL, allowing the software to work with nearly any hardware. Below are the values and configuration I used. If you are planning on using other RC-style motor controllers, you’ll need to calculate these values yourself.

Read More »

13 Jun
2010

Google Voice and Asterisk

Google Voice & Asterisk

There are numerous guides about setting up Google Voice and an incoming sip number for free outgoing calling. Sadly, all of the guides I found were written for FreePBX or some other Asterisk bundle, and also used a shell script to do much of the work (scary!). I have compiled the minimal amount that you need to put in your asterisk conf files to make things work, GUI-free and variant-independent.

Read More »

11 Jun
2010

End of the road for free data on iDen?

It looks like getting free data access on iDen handsets is going to end, likely on or before 6/20/10 according to this Sprint document (credit Engadget). Coincidentally, this is the same day that the Motorola i1 is released, the first Android phone on the iDen network. With this phone, Sprint would needed to lock down iDen data access a bit harder than blocking the phone’s built-in browser (the status quo), so the change will affect all phones on the iDen network (Boost and Nextel).

This also means that getting mobile connectivity for your Arduino will no longer be free. Boost mobile’s data rates run at $.35/day.

Update: 6/20 has passed, and I still have data access.

25 May
2010

Initial CNC Prototyping

I’ve started constructing the basic electronics for the CNC machine I’m working on. It’s going to be a cheap machine made with what I have on hand, so don’t expect anything too amazing :D . Here are some random build photos…

Read More »

25 May
2010

Randomly Decent Music

Here’s a quick aggregation of some decent not-incredibly-well-known-for-the-most-part music. Links just point to google searches, which will hopefully provide some relevant method to play the song.

Animal Collective – Daily Routine

Freelance Whales – Generator First Floor

TV on the Radio – Staring at the Sun

30 Seconds to Mars – This is War

Chiddy Bang – The Opposite of Adults

Mute Math – Stall Out

Black Gold – Detroit

Aqualung – Brighter Than Sunshine

20 May
2010

(Really) Cheap RFID door opener

Well, the school year is over, so I thought I’d post up some information about my (extremely cheap and junky-looking but functional) door opener. Read More »

The OSRAM SLG2016 and AVR

The OSRAM SLG2016 and AVR

I happened to scavenge a couple of SLG2016′s from some old workstation debug displays. After finally locating a datasheet, I

Victor Speed Controllers and EMC2

Victor Speed Controllers and EMC2

I’m currently working on building a EMC2-controlled CNC machine with mostly parts I have on hand. I decided to use