Projects: Reload-JS (v0.1)

Reload-JS is a javascript live loader whose goal is to be simple and light weight. I created Reload-JS while working on an Infographics Landing Page, and embedding solution, for Newlogic USA. I needed to load and check for any libraries I need (namely jQuery). The loading part has been taken care of in this version, but I am trying to figure out how to include tests for each library, to make sure no override occurs (my jQuery doesn’t break or overwrite the loaded pages jQuery).

More after the jump.

Here is the Reload-JS source code. It is simple and it doesn’t really do anything special. Most of the code has been used previously and is very popular for live loading. It accomplishes its task by using a recursive set of callbacks and has a few ways to call it.

First you can use the following:

Or this

My personal favorite is this following call:

You see Reload will automatically append the js if you don’t already have it attached. This is a nice feature to make nice simple calls like above. Reload allows you to set your primary library location and then takes care of it too. This makes loading multiple libraries pretty nice. However, what if you need to use a different host for one of your libraries? No worries! just make sure you use http:// and Reload will detect that it shouldn’t append your default library location to your URL (absolute URL handling).

Reload also has the ability to load from a variable it holds called libs. This can be risky, if multiple people try to use it and is not suggested unless you are sure no one else is using Reload.

Here is the code (and decently commented):

Enjoy!

CSS Column Magic

These are a few classes I wrote to make columns a little bit easier. I tried my hand and making my own CSS helper classes and I think it worked out pretty well.

Example:

Other people have made much more comprehensive (and better) column systems, but I did enjoy making my own. I highly suggest checking out Columnal for a more fleshed out and proven column experience.

Working on an Art Project: The Tale of Ideagerie

Recently I have taken to doing more web development, even though I truly enjoy music and electronics. I have taken to doing web-based projects because I find them engaging, I enjoy the end results and the web is an essential skill. I have completed two projects thus far, Shears of Elegance and Ideagerie, and my favorite was the later. Why? Because it was an art project.

Throughout most of my life I have been dedicated to music and composition. I value the arts and when my friend, Kaity Reilly, asked me to develop her website, Ideagerie I jumped all over it. The good thing about working with a friend on a project is that the communications are less strained and there is less of a begrudging acceptance of the clients choice. Also artists are less particular about browser compatibility (if it doesn’t work in IE3 they don’t care much, so long as it gets out to a decent audience) and more willing to let you experiment on the backend, they will let you use what they are unfamiliar with. These sort of partnerships should be approached as being exploratory for both parties involved.

For Ideagerie I decided to use Sinatra and Ruby as my main workhorses and deployed on Heroku. This ended up being perfect for what the artist wanted. The git based updates allowed me to update the site swiftly and sink my teeth into development right away. By using Heroku I was also able to engage the artist in the process as they were able to see the updates almost immediately. Of course this is possible through more traditional means, but Heroku is more or less free for low-level use and you can swiftly update everything with a few git commands. Also, the artist I worked with liked to engage themselves in parts of the process, which is a unique opportunity to teach and receive new ideas.

Working with an artist is not all fun and games though. There will be constant disagreements over certain things, especially efficiency. Just because you naturally code efficiency doesn’t mean that the artist desires efficiency. In fact, there are times when the artist might just want to dump everything onto one page and remove pagination completely. Also, they tend to be particular about presentation. As my friend said, “The site [Ideagerie] does not need to be an Apple quality marketing campaign, but it does need to look like a person made it” (Kaity Reilly). Kaity also told me that, “the presentation, for me, is the most important part,” at a point where I was obsessing over efficiency/database issues.

Remember, don’t only work with other engineers or web designers, work with all sorts of people. You will gain more insight that way.

Object.blank? is a very simple construct, basically it just checks if an object is either nil or empty and does an error check to make sure that if empty doesn’t apply to an object it recovers gracefully. In a dynamically typed language like ruby constructs like these become very important to making sure that errors are handled elegantly and as expected, if a variable number of objects may be applied to the same block of code.

A basic implementation of Rails Object.blank? construct

Second Time Soldering A Kit!

My second time soldering a kit.

I got this little kit, Terror-Min from SparkFun. and put it together today. I had a little trouble with the soldering iron at first, but eventually I got the whole situation sorted out (I had to file of a little bit of oxidation on the tip… I might need to buy a better tip for my iron). I made a few mistakes while soldering, but it didn’t effect the fact that the circuit works. I am pretty proud of myself.

Review of 2010

 Some rights reserved by aresauburn"2010 was a busy year for me. It started in chaos and ended quite enjoyably. When I started this year I was a senior in high school confused about what I wanted to do with me life, now I am a freshman in college, still confused, but with an inspiration to create. I am pretty set on engineering now, but more than that I am excited to just make things, DIY things and ultimately express myself through these things. My pursuit of music was a pursuit of expression, but I am starting to find a new way of expressing myself through electronics.

  • Blinking LEDs on an Arduino

Making LEDs bling was my first working Arduino circuit and I, daresay, one of the more intriguing projects I finished because I felt empowered. I don’t think, there is something that can empower a person more than feeling like they have just opened the door to all of electronics, the building block of modern technology and life. Sure it was tiny, but it was meaningful and after a burnt LED or two I learnt a lot.

  • Photo-phone

This was my first foray into the analog side of electronics. The project was to build a photophone, a “phone” which transmits the sound via a fiber optic cable. The schematics were already done for us, but it was the first time I even looked at an op-amp and worked with ICs directly. More importantly, it was the first full working project I made working it was my first time not using the Arduino to process input and generate output.

  • MIDI Ribbon Controller using an Arduino

Moving back to using the Arduino as the base of my project I decided to make a MIDI Ribbon Controller for my Electro-Acoustics/Electric Guitar class. The project for the class was fairly open ended. Despite the project dying during transport I was able to get it working. The last bug I had to work out was the pitch bend algorithm to make it gracefully bend across two octaves lined up (at least approximately) with the notes. I learnt a lot this, especially not to transport breadboard based circuits from Boston to Long Island in a plastic box in your backpack

  • Random Tiny Scripts

This was the year for me to restart with my programming. I had not actually taken programming seriously since 9th grade or so, but finally I am starting to come back around to it. I rekindled my love of programming at RHoK and it has been continuing as a brush up on Python and Ruby (and twiddle around with Haskell and deepen my knowledge of C). Let us see where this goes!