StatCounter

Monday, July 28, 2014

DIY: Rebuilding My Front Porch

My new DIY project. Rebuild the front porch. Lessons learned (actually confirmed) so far. Nothing is as easy as it seems. Always allocate time for preparation, evaluation and planning (don't jump straight to project execution). Pick a small representative (and, ideally, non-critical) section of the project to execute first. Apply the lessons learned to the remainder of the project (if something goes wrong, the impact is somewhat limited).

Watch this space as I report on the progress of this project.

Sunday, March 16, 2014

Learning to Fly: School Bus Adventures in Delhi


I spent most of my younger years in New Delhi, India. I lived with my family on the campus at IIT Delhi and attended Modern School, Vasant Vihar. The campus where we lived was like a walled city within a city. School buses weren't allowed inside the campus. So, in order to catch their respective school buses, kids had to walk from their homes to the campus gates, of which there were three or four. This could easily be up to a half mile walk. On occasion, I missed the school bus and had to take the public transport bus. Delhi's public transport system is known as the Delhi Transport Corporation or DTC.

As anyone who has lived in Delhi would know, taking the DTC bus is an adventure and a test of fitness. During rush hour (i.e. when I missed my school bus in the mornings), DTC buses don't quite stop at designated stops. Rather they merely slow down because while they must let off passengers they don't quite have room to let on more passengers. Therefore, those who need to get off must do so with great skill and determination, running for a few steps upon getting off to keep from falling due to inertia. And they must do so while taking care not to wipe out by stepping into a pot hole or on to a banana peel.


And while the bus slows down to let off passengers, those who have sufficient confidence in their abilities (or a desperate urgency) try to run and hop onto the moving bus. And getting on the bus isn't as simple as it might sound. Recall that the bus is full. Passengers are bulging out of both the front exit and the back entrance, neither of which have doors (see picture above). Therefore, a passenger wishing to get onto the bus must first use one hand to secure a grip on something -- a handle bar, a window, or even another sturdy passenger. Second, the passenger must now quickly secure a foot hold, ideally on the exit or entrance steps but occasionally on another passenger's unsuspecting foot.

These rush hour rides were great exercise and an excellent opportunity to travel ticket-less because the destination would typically arrive before one could wrestle one's way to the bus conductor comfortably seated in the back of the bus.

Anyway, I digress. Back to the school bus. I remember that sometime in the middle grades we had a Sikh bus driver. I, too, was born into a Sikh family. So, the driver might have been partial to me. Anyway, he used let me sit next to him on the engine cover, which used to get pretty hot (so one needed motivation to sit on it). And, as you will discover, I had a certain motivation. At some point I mustered up enough courage to ask him if he would let me shift the gear for him -- just once. To my surprise the driver turned out to be quite a sport and played along. Slowly I graduated to shifting gears for him all the way to school (several miles). He would, of course, press his foot down on the clutch and I would try my best to time the actual gear shift with his clutch work. The engine cover used to be hot as hell, which was tolerable during winters (our school uniform required shorts until grade 10) but sucked during summers. The stick shift was this large apparatus (about as big as a baseball bat) that I could barely maneuver. Every once in a while I'd screw up and cause the transmission system to let out embarrassingly loud grunts and roars. The driver would smile and bail me out. I can only hope that I didn't do any great harm to the transmission system during these adventures. But I had fun and the driver was an absolute darling for humoring me and providing me with my first ever driving lessons, albeit rather unconventional ones.

Saturday, December 7, 2013

My Experiments with the PICAXE 08M2+

PICAXE 08M2+
I generally prefer to do things the hard way. For example, you can either microwave a frozen dinner or cook from scratch. The microwave option is a good backup plan, but cooking from scratch has far too many advantages, as I outlined in a recent blog post on the do-it-yourself way of life.

In the electronics and robotics world, the analogy of cooking from scratch is to build circuits using a bare bones micro-controller chip (e.g. the PICAXE) rather than a fancy board (e.g. the Arduino). Therefore, once I get a circuit working with the packaged Arduino approach (e.g. this robot I built recently), I usually try to replicate the circuit using more basic components like the PICAXE.

My decision to consider the PICAXE was influenced by Charles Platt's coverage of it in his awesome book Make: Electronics. But essentially, I am a minimalist and I want to see how much I can get done with a bare bones chip rather than a bulky board-based micro-controller like the Arduino. My current favorites are the Nano (quite small, just $7, breadboard friendly, and just as easy to work with as the Uno). My next experiment will be the ATtiny85V-10PU chip because I believe it's still fairly easy to work with (it can be programmed via a regular Arduino and has many of the same capabilities as the Arduino -- many programs written for the Arduino can easily be modified to work on the ATtiny), costs just $2.50, and is of course breadboard friendly. (I don't mind soldering, but for most of my experimentation breadboards are the way to go.)

And the actual PICAXE I chose was the latest model of the smallest chip available, i.e. the 08M2 ($7), for which (as a gentle soul on one of the forums clarified to me) the label on the chip actually reads 08M2+.

If you're planning to use the PICAXE, step one is to figure out how to program it. PICAXE programs are written on and uploaded to the PICAXE chip using an integrated development environment (IDE) known as the PICAXE Programming Editor, which is available as a free download. Henceforth I will refer to this software as simply the IDE. As it turns out, this IDE is fairly handy and includes a simulator to show you how your program will play out on the PICAXE chip once you upload it. Note that PICAXE programs are written in BASIC (yeah, not the most popular language out there) as opposed to Arduino programs, which are written in C and Raspberry Pi programs, which are written in Python.

Uploading your program to the PICAXE is the first major hurdle you're likely to encounter. As I have discovered, everything involving the PICAXE is harder to do than it is with the Arduino. That's because the PICAXE is just a bare bones chip, whereas the Arduino is a micro-controller chip on a board along with a fairly large supporting cast of components and connectors (e.g. USB).

The standard way to program the PICAXE is by using the AXE027 (USB to 3.5mm jack plug male audio cable) or the USB010 (USB to RS232 9-pin male cable). In either case, additional components are needed to complete the setup.

The AXE027 cable uses an FTDI chip to perform the USB to RS-232 serial conversion required to program most micro-controller chips. However, I was inspired by this video by Kevin Darrah and other postings on the web to employ means other than having to buy this pricey $30 cable.

Kevin Darrah's approach uses an Arduino Duemilanove, which I don't have. So, I tried doing this with the Arduino Uno. The Uno didn't work because the Uno uses the Atmega16U2 chip to perform the USB to RS-232 serial conversion. According to my testing, using the PICAXE IDE's "Test Port" feature, the Uno's serial converter did not seem to support the RS-232 "break" command. The IDE's "Test Port" feature works by turning the signal on and off and a multimeter hooked up to measure the voltage across the PICAXE's serial input pin and 0V (or ground) is supposed to detect a change in voltage as the test LED is switched on and off.

This port test did succeed for me when I tried it with the Arduino Nano, probably because the Nano uses an FTDI chip to perform the USB to RS-232 serial conversion, which clearly does support the RS-232 "break" command.

Note: the exact chip I used was the PICAXE 08M2+, which is a significant upgrade on the 08 and 08M chips. I paid about $7 for it (compare with $35 or so for the Arduino, $45 or so for the Raspberry Pi, and $2.50 for the ATtiny85).

Note that the FTDI chip and most other USB to serial converters that perform the conversion often stop short of inverting the signals, as is needed for programming the PICAXE. The FTDI chip can be configured to invert the signals using FTDI's FT_PROG tool. However, I decided to heed the warning on the FTDI site and use the circuit I've described in this blog to invert the signals rather than mess around with the FTDI chip on my Nano and risk having my Nano being rendered useless.

As I mentioned previously, the reason this circuit is required at all is because signals are inverted in the RS-232 serial protocol. Using 0V to represent logic 0 (a bit value of 0) and 5V to represent logic 1 (a bit value of 1) is the more common approach and is known as the transistor-transistor logic (TTL) level. The RS-232 serial logic levels are not only higher (+/- 12V, so you wouldn't want to connect them directly to your chip since most chips operate on 5V or 3.3V) but also inverted. Therefore a USB logic 1 signal needs to be converted to a logic 0 signal and a USB logic 0 signal needs to be converted to a logic 1 signal. The circuit described here accomplishes that inversion of signals.

To program the PICAXE the IDE needs to send data to the PICAXE and receive data back from the PICAXE. Think of the RX (receive) pin on the Arduino as representing data arriving from the PICAXE IDE via the USB-to-serial FTDI converter. When the IDE is sending data to the PICAXE, the RX logic 1 signal is applied to the transistor's base, which results in completing the circuit from the transistor's collector to emitter and a logic 0 signal being applied to the PICAXE serial-in pin (the logic 1 signal from the Arduino's RX pin got inverted to a logic 0 signal prior to being sent to the PICAXE's serial in pin).

Conversely, when the PICAXE sends data back to the IDE, a logic 0 signal from the PICAXE's serial out pin causes the transistor to remain off and the 5V (logic 1) signal is applied to the Arduino's TX pin. And a logic 1 signal from the PICAXE's serial out pin, when applied to the transistor's base, turns the transistor on, thereby causing a logic 0 (0V) signal to be applied to the Arduino's TX pin. Hence, the inversion of signals is accomplished via the use of these two NPN 2N2222 transistors and four 10K resistors.

So, finally, here's the circuit that I've been describing in the paragraphs above.

Schematic From Kevin Darrah's Video
And here's the breadboard version of the diagram I created, to help you implement this for your own use. I recommend purchasing a bunch of smaller breadboards for this kind of thing so that, for example, once you've setup the breadboard for programming the PICAXE 08M2+ you can set that breadboard aside and leave it dedicated to that purpose. In fact, what I do is to simply move the jumpers off the PICAXE's serial in and serial out pins, move them to an used part of the board, wire the PICAXE's serial in and serial out pins to ground (assuming they will not be used) and then use the same breadboard for operating the PICAXE circuit. Bottom line, you probably want to dedicate a board per micro-controller so that you can have the circuit required to program it left in tact for the next time you wish to use it, and possibly use the same board to operate the micro-controller project you're developing.

Breadboard Circuit for Programming the PICAXE with an Arduino
Also, here's the actual simple program that utilizes this circuit.

LED Blink Program for the PICAXE
But my challenges did not end once I had figured out how to program the PICAXE. After I first wired up the LED it wouldn't blink at all. After some soul searching I realized that the pin assignments on the PICAXE 08M2 follow a port.pin address space in order to to provide for a greater number of options. (Note that the 08M2+ chip is vastly improved and expanded relative to the 08 or 08M.) I have to say, PICAXE has done a poor job of explaining how port.pin addressing works. Also, the fan base seems to be declining since there aren't enough YouTube videos or web posting on these important topics. Accordingly, my next stop is likely to be the ATtiny85, which is roughly comparable to the PICAXE 08XX series, but might enjoy a somewhat better community due to the traction it gets via its inclusion into the Arduino boards.

However, to be fair, I should acknowledge that Atmel also uses different physical/hardware and software/code pin numbering schemes for its chips, e.g. the ATtiny85. Regardless, I'd appreciate it if anyone could point me to a good tutorial on how to use the four ports (A, B, C, D) on the PICAXE 08M2+.

The ATtiny85 by Atmel
Anyhow, after some trial and error, I realized that based on the port.pin addressing scheme, the "traditional" pin 3 is what mapped to B.4 (the port I had programmed to turn on and off every second, using the port.pin notation). I now had my LED blinking, but very erratically. For a brief moment I considered abandoning the PICAXE as a lost cause. But that was a very fleeting moment indeed. As any engineer knows, perseverance bears sweet fruit So, I summoned all of the resources on the web and my learning in the past about the ll-effects of "floating" pins (i.e. pins that are neither clearly low nor high). And so, I added a rectifier diode (1N4001) and ceramic capacitor (0.1 micro Farads) between 5V and the PICAXE's voltage in pin. Additionally, I tied the unused pins to ground via a 560 ohm resistor (the only one I had handy). And low and behold, the LED started blinking the with the clockwork regularity you expect from a swinging pendulum.

PICAXE 08M2+ Pin Assignments
This was a learning experience for me about how working with chips is different (and a bit more challenging) than working with boards, such as the Arduino Uno, that come with supporting circuitry to ensure that unused pins are not left "floating" etc.

Here's the circuit I put in place to get a reliably blinking LED. Note that this is the configuration you'll need in case you wish to have the serial in/out pins to double duty, e.g. digital I/O. However, my favorite configuration is one in which I leave serial in/out pins dedicated to programming and use the other four pins for I/O. That way, I can program on the fly. Also, note that here the Arduino is merely supplying power (5V) and I have not shown here the USB cable from my laptop providing power to the Nano.

Breadboard Circuit for PICAXE 08M2+ Blinking LED
Something I noticed about the PICAXE Programming Editor or IDE may be useful to point out. On Windows 8 the IDE seems to get orphaned (i.e. the process continues to run in the background even after you've closed the UI) and chews up a fair bit of CPU (50% in my case). Something to watch for.

In closing I'd like to share one final observation. So far, I have been lucky to have fried or damaged very few components. The first was a set of three LEDs that came with my Raspberry Pi starter kit from Adafruit. That was until I realized that I simply must add a 1K resistor in series with LEDs at all times. And I also realized that once you know exactly what you want (which requires a bit of learning and research), it's a lot cheaper to buy components via eBay. The second was the Raspberry Pi's SD card slot, which broke upon the slightest application of vertical stress. (BeagleBone's MicroSD card slot is a much better idea since it's smaller and less susceptible to vertical stress.) And finally, the first PICAXE I ordered either arrived damaged or was damaged during my experiments with trying to program it. I suspect it might have been the former (a ding against eBay), because when it arrived the painted branding information (PICAXE 08M2+ and serial number) had already worn off and I had to strain to read the engravings (a shout out to the iPhone magnifying app "Mag Light" for making this a lot easier). The second PICAXE I ordered (again via eBay), which is the one I successfully programmed, seems pretty resilient. I have even accidentally applied reverse voltage and all it did was pop the software fuse on my laptop's USB port (requires a laptop reboot to reset). To be fair, I have ordered many, many components from eBay at extremely reasonable prices and have had very few negative experiences (although the best deals do take forever to ship and will test your patience and stamina for electronics). Note that I always make sure that the seller has at least a few hundred reviews and a 98% or higher ratio of positive feedback.

Update: Good news! The first PICAXE, which I had set aside as "damaged" has turned out to be perfectly fine and healthy. I swapped it into my programming/test operation circuit (described above in this blog post) and I am able to program and operate it. So, it was human error after all. However, when I'm at my wits end I often fall back to swapping components like chips that cannot easily be tested with a multi-meter. And it is certainly good to have plenty of spare breadboards and jumpers so that once, for example, you've established a working circuit for programming a micro-controller chip you can set it aside and not have to tear-down and build it each time you need to program the chip. Now on to programming my 2D string array of remote control codes for my Arduino robot project (see link above), which I eventually want to try controlling with the smallest bare bones micro-controller that'll do the job, e.g. a PICAXE or an ATtiny. Also, I am told that faded etching on top of the engraved chip markings are quite normal and are not necessarily a sign of wear.

I know I had a bunch of trouble getting my PICAXE 08M2+ to do my bidding. So, I decided to document my experiences in order to help others and perhaps even myself, if several days from now I can't recall how I actually got it working. As I mentioned, working with the PICAXE (or any other bare bones micro-controller chip like the ATtiny85) is sure to be more challenging than working with a board like the Arduino boards. Also, relative to the PICAXE, there is a lot more help available for the Arduino in the form of videos, web posts, and books. But if you're up for the challenge, then the PICAXE can give you more control at a smaller cost. All said and done, I feel very positive about the PICAXE and its prospects on future projects of mine.

Thursday, November 28, 2013

Arduino Robot | Step 1 (Basic Operation)

Arduino Robot | Step 1 (Basic Operation)
I started this series of projects to teach my kids (Ria and Ronak) about programming, electronics, mechanics and robotics. Although this design has been informed by numerous books, videos and articles (see references below), the final design is my own (not kit-based, except for the chassis, or copied verbatim from anywhere) and I will have to take responsibility for any flaws and imperfections. However, as you can see from this video I uploaded to YouTube, it does work reasonably well for its intended goal.

Component List

  • Arduino Uno. I plan to switch to the smaller Arduino Nano to see whether the Uno is overkill for this project. Subsequently, I also plan to see how far I can get with the ATtiny85V, PICaxe 08M2 and any other smaller micro-controllers worth trying.
  • Breadboard. I know how to solder (and you should, too), but it's not much fun at all and risks burning out components. Breadboards are great for prototyping, making modifications on the fly, and building projects incrementally, in phases (not unlike Agile software development). Later on, you can solder the robot into a permanent gadget, if you really want to (and have no need to reuse the components). This is why I want to experiment with smaller/cheaper micro controllers units (MCUs), although the cheap prices for the MCUs are often offset by the complicated/expensive setup required to program them.
  • 9V Battery. To power the Arduino. It's a good idea to keep the Arduino circuit separate from the circuit driving the motors for several reasons. One, the two circuits might require different voltages to drive them. Two, doing so protects the Arduino from the noise produced by induction motors. Three, the Arduino might not directly be able to provide the current required to drive the motors (I tried and failed to run the motors directly off the Arduino digital pin output).
  • Custom Arduino Software/Program. The actual program that causes the robot to move in the pattern you see in the video.
  • Jumper Cables. Invaluable for connecting components using a breadboard. For example, jumper cables are used to carry the digital output signals from the Arduino to the breadboard.
  • Test Leads with Alligator Clips. These are also invaluable when you don't have the ideal connectors handy. I used these to connect the 9V battery to the Arduino, using jumper cables.
  • 2WD Chassis. This is the base for the robot.
  • DC Motors. These are attached to the chassis.
  • Wheels. Attached to the motors.
  • Caster Wheel. Attached to the back of the chassis. This provides a simpler option than a 4WD robot, which is harder to make and manage, in part because you then have four motors to manage instead of just two.
  • 6V Battery Case. This is what powers the circuit for the motors.
  • 2N2222 Transistors. These happen to be the most popular semiconductor of all time. I used the TO-92 packaging components to bridge the Arduino circuit to the motor circuit. The digital output from the Arduino is wired to the transistor base (via a 560 ohm resistor in series). When the base receives a signal from the Arduino, it allows current to flow form the collector to the emitter, thereby completing the circuit for the motor and causing the motor to run.
  • 560 Ohm Resistors. As described above.
  • Double-Sided Tape and Velcro. Invaluable for attaching things (e.g. the breadboard, the Arduino and the 9V battery) to the robot chassis so that they don't fall off while the robot is operating and they can be easily removed when you need to use them for other prototypes.
Next Steps

This step is just the beginning on what I expect to be a long road with the following enhancements and/or modifications.

  • Add a distance sensor (SR04) for obstacle/precipice avoidance.
  • Add light sensors (LDRs) for light following behavior.
  • Add infrared (IR) remote control capabilities. At least for me, the VS1838 module (a little board with a built-in LED) was a miserable failure. So, I switched to the raw TSOP4838 (not a module), and it works like a charm (with the Keyes remote control that shipped along with the VS1838 module).
  • Add an H-bridge using the L293D chip (I pulled it off my Arduino Motor Shield, which I found to be overkill) to allow the Arduino to reverse motor direction without rewiring.
  • Experiment with smaller micro-controllers, e.g. the Arduino Nano, the ATTINY85V, and the PICAXE.
  • Experiment with alternate wireless remote control technologies, including Wi-Fi and Bluetooth wireless.
  • Store robot configuration (e.g. MRU motor speeds) in EEPROM using I2C serial communication from the Arduino.
  • Add LEDs to indicate status, e.g. remote control signal received (blink), light following behavior on/off, turning indicators/blinkers.
References

  • Make: Electronics by Charles Platt. A delightful book with detailed pictures, drawings and explanations. Easily the best modern book on the subject.
  • Arduino Cookbook (Second Edition) by Michael Margolis. Encyclopedic treatment of all that you can do with an Arduino micro-controller.
  • Arduino in Action by Martin Evans. There a lot of Arduino books in the market. But I found this one to be one of the most useful books.
  • YouTube Videos. Especially the ones by Jaidyn Edwards and Jeremy Blum.

Wednesday, October 30, 2013

Learning to Fly: Peanut Butter, Sardines, and Turbans

Haagen Dazs Chocolate Peanut Butter Ice Cream

During my most recent visit to New Delhi my cousin's wife re-introduced me to an old classmate, of whom I had only vague recollections. She was able to convince me that we had been classmates. She recalled that I used to bring peanut butter and honey sandwiches to school for recess. Of course, I had purged that little detail of my school days, along with all of the other embarrassments that caused me not to blend in. Nobody else brought peanut butter sandwiches to school for lunch. This was New Delhi, not Canada, where I was born and raised for the first three years of my life and where I undoubtedly developed a taste for peanut butter sandwiches.

The school I attended was Modern School (initially the Humayun Road branch and later the Vasant Vihar branch, aka MSVV). This is a rather Westernized and hip private school. And yet no one except me brought peanut butter sandwiches to school. To add to my inability to blend in, unlike Guru Harkrishan Public School (GHPS) up the street on Poorvi Marg, not many kids at MSVV looked like me. So, in more than one way, I did not blend in. I had unshorn hair, worn in a top bun, as is done by observant Sikhs, and covered up using a patka or turban. Sikhs are like India's Jews, a mere two percent of the population, but responsible for disproportionately large contributions in the military, agriculture, transportation, sporting, and many other endeavors. Memories of me wearing a turban are some of my proudest moments, in large part because it made my family happy. Paradoxically, wearing a turban caused me to stand out, which is the direct opposite of blending in, but in a good way. Most kids, as well as adults, want to blend in, that is if they're not going to stand out in good way. Observant Sikhs automatically get to choose the latter.

My turban was welcome protection during the winter months. But for the most part it was a source of ridicule. Among the countless forms of teasing observant Sikhs have to endure in India's schools, friends openly speculate on whether their turbaned mates stand any chance with the most sought after girls. Gone were the days, it would appear, when a turban signified respect, honor and prestige in Indian society.

My former classmate's recollection about my fondness for peanut butter sandwiches had rung true because I still like them and they are, to this day, a favorite option for breakfast. The turban, on the other hand, is no more. I had never liked wearing it although I was quite adept at tying it neatly and looked smart in it, or so I was told. The protection a turban offered me in the winter months was massively offset by the discomfort of unshorn hair, especially during New Delhi's sweltering heat and never-ending hot spells.

To make things worse, my curly hair was particularly unsuited for keeping long. I remember countless hours of working through knots that would form in my hair after washing them and letting them dry for a few hours (see my Afro pictures from college days upon returning to Canada). As a kid I had help from my mom, but later in life I had to fend for myself. And it was quite an ordeal. I don't know what the statistics are globally, but at least in my circles curly hair are a fairly rare feature and so not many people (i.e men) have experience with the torture involved in keeping them long or unshorn. My daughter has inherited my curly hair and it didn't take her long to discover hair straighteners, which vastly simplify her life. The wonders of technology.

My parents used to tell me that I liked sardines. Of that I have no memory. I don't like them presently and no classmate has stepped forward to own the rekindling of that memory. Perhaps that is in store for my next trip to India. And although I remain opposed to sardines, I am very passionately ambivalent to turbans, which I find any excuse to don, including religious and family events. The extent of my indecision is so extreme that I sometimes wish I could wear it to bed and never ever take it off, as if it were stuck to my head with peanut butter.

Monday, September 23, 2013

Sikhs as a Firewall for Hate Crime

By the time this reaches you, you would likely already have heard about the heinous hate crime attack on a Sikh professor from Columbia University in New York. All too predictably, the attackers referred to the victim as "Osama" and "terrorist".

In building construction, a firewall is built as a barrier to prevent a fire in one part of the building from spreading through the rest of the building.

Building on the analogy (no pun), in Web or Internet technology, which is where I earn my living, a firewall is used as a first line of defense to block unauthorized access from sources that wish to perpetuate attacks of various kinds on a Web site.

I have borrowed the term "firewall" to describe the role Sikhs have played, from their origin leading up to current times.

The Sikh religion was formed, in some part, due to the dire need to protect India's predominant Hindus against unrelenting attacks from Muslim invaders from Mongolia, Persia, and beyond.

Fast forward to today. And we find that, in America and in other Western nations, Sikhs have become a perpetual "mistaken identity" for Muslims and have faced uncountable "mistaken identity" attacks (starting with Meso, Arizona). In doing so, unwitting Sikhs have served as a canary in a coal mine, warning the Muslim community of what awaits them once the firewall melts and is no longer able to stop the spread of the fire.

Tuesday, September 17, 2013

Learning to Fly: Learning to Swim

The IIT Delhi Swimming Pool
(This is the first of a series of posts I intend to write in order to document my life. The series is called "Learning to Fly". This post is called "Learning to Swim". The posts in this series will be chronologically random, a stream of consciousness, if you will -- typically, thoughts triggered by an event.)

I can't recall the last time I had to work on a Saturday. But taking the kids to swim is not work. It's a joy to see kids learn, and grow. I remember learning to swim at the swimming pool at IIT Delhi (India). My father, who was a professor at IIT, used to stress that it was an "Olympics size" pool. I have no reason to doubt that it was. IITD had awesome facilities. And I am lucky to have grown up on campus.

I remember my father doing length-wise laps in the pool. He was a good swimmer. (My mother's strokes were a bit more labored. She could only manage breadth-wise laps.) My father used to tell us that a good swimmer causes little or no splashing in the water. The strokes must be smooth, like a knife through butter. He didn't say that last part. I added that because it describes what he had tried to convey. We (my younger brother and I) got the message, loud and clear. But I never became as accomplished a swimmer as my dad. In fact, I doubt I'm more accomplished than him at much at all. Perhaps squash? Perhaps parenting? Taking the kids for swimming lessons is good parenting. But my dad taught me himself. There were no swimming lessons to be bought.

We were instructed to hold on to the lip around the pool and splash our legs. Of course, we had inflated tire tubes around our waists holding us up. We weren't going to sink. And we weren't going to swim. The most I ever managed was to push my self off one side of the pool, splash wildly, and land on the pool floor, often just short of making it from one side of the shallow end to the other. But not quite knowing how to swim didn't stop me from joining white water expeditions during college in Windsor, Ontario (Canada). Of course, I had no life vest and had not contemplated the possibility of the raft tipping over! And when it did, I had to recall everything I had learned about making a few lunges from one side of the pool's shallow end to the other and, somehow, I managed to grab hold of a boulder sticking out of the water. Once the group found out about my swimming prowess, I was banned from joining them on wilder expeditions to follow.

And, yes, somewhere between the raft tipping over and the group managing to get it back under their command, we lost the beer we had ingeniously tied to outside of the raft (so that the water would keep it oh so cold). I sincerely hope that my kids will turn out to be better swimmers than me and will show better judgment than I did when asked to partake in a crazy adventure. But then, they might not have anything to write about.


Thursday, May 23, 2013

Are JSP tag libraries still relevant?


Figure 1
Figure 2
Figure 3

Figure 4



Dump JSP tag libraries and switch to JSON.

I often see development teams using JSP tag libraries when they shouldn't be. I wrote this post to explain why it's best to view JSP tag libraries as relics of the past.

Most non-trivial web applications store data in a database on the server side. These applications need mechanisms that allow the clients (web browsers) and servers (e.g. Java application servers) to exchange data. Typically, either a) data needs to be displayed for the user (so, the client sends the look up criteria to the server and the server responds with the relevant data) or b) the user changes data in the browser and the client needs to submit the data modification to the server for processing and/or permanent storage.

Until recently, most Java web applications have used JSP tag libraries as a client-side mechanism to extract data out of Java objects (JavaBeans) passed back and forth between clients (web browsers) and servers as part of the JSP/servlet paradigm offered by Java. (Note: JSPs are HTML files that get converted into Java servlets so that they can contain Java code for manipulating server-side Java objects.) In each case, the server responds with a new page (with embedded data), also known as a full page refresh.

In 1995, AJAX came along and changed the full page refresh paradigm described above. AJAX allows for partial page refreshes and data exchanges between the browser and the app server without having to do full page refreshes.Since then, AJAX has continuously gained momentum with support built into popular frameworks like Spring (for Java) in v3.0/2010 and jQuery (for JavaScript) in v1.5/2011. 

The data exchange format that works best with AJAX is JSON, since JSP tag libraries cannot be invoked unless a full page refresh is involved. There are several options for mapping between the server-side Java model objects (JavaBeans) and JSON, which can easily be consumed by JavaScript running in the browser. (Note: Since JSON is the literal representation of a JavaScript object, the conversion from JSON to JavaScript object is trivial.) The option I recommend and have been using is Spring MVC's @RequestBody and @ResponseBody annotations as part of the controller method definitions (which leverage the Jackson library for JSON processing) to automatically map JavaBeans to JSON and back (see figures 3 and 4). (The alternative is to use a proprietary framework like Direct Web Remoting or DWR, which I do not recommend for obvious reasons.)

As a result, I recommend to most teams I consult with that it's best to abandon JSP tag libraries entirely in favor of a pure AJAX/JSON based approach.

Here's a summary of the reasoning behind my recommendation to use AJAX/JSON exclusively (even for full page refreshes).


  1. Unless, you have a very simple application, you will likely need to support partial page refreshes using AJAX (rather than do a full page refresh each time that some data needs to change on the page). To do so, you need to map between Java objects (JavaBeans) and JavaScript objects (JSON) in order to exchange data between the browser/client and the application server. Therefore, it probably doesn't make much sense to support two channels for data exchange (JSP tag libraries for full page refreshes and AJAX/JSON for partial page refreshes). And if you have to pick one it has to be AJAX/JSON, since JSP tag libraries don't work for partial page refreshes. Hence, my recommendation to go head first with AJAX/JSON and abandon JSP tag libraries. But if you need more incentive, please read on.

  2. I have worked with teams that have analyzed the size of the data being shuttled back and forth across the network and found that JSON consumes a lot less network bandwidth than the JavaBeans/JSP tag library approach or even XML payloads. Their analysis seems to make sense to me since JSON is a bare bones pure text format without the syntactical overhead involved with XML or the rich object overhead involved with JavaBeans.

  3. Relative to the acrobatics required for manipulating JavaBeans using JSP tag libraries (see figure 1), the JavaBeans to JSON mapping is completely seamless with Spring MVC and requires no coding whatsoever (see figure 2). Whether or not you're using JSP tag libraries, chances are that you need to populate JavaScript objects with the data in order for the data to be consumed by jQuery widgets. In other words, the JavaScript object(s) are required in regardless of whether you use JSP tag libraries or not. Abandoning JSP tag libraries allows you to skip step 2 (see figures) and go straight to JSON and the corresponding JavaScript object(s) without having to muddle through the manipulation of JavaBean objects using JSP tag libraries.


Thanks for reading. I hope I've made my case adequately. However, I'd like to have your feedback, especially if you believe I've overlooked something.

Saturday, May 4, 2013

Ode To The Handyman




I recently posted a list of DIY projects on Facebook and a friend responded to suggest that I hire a handyman. So, I wrote this response to explain why I prefer the DIY route.

Understand. I like to understand how things work. Fixing things is a great way of achieving an appreciation for how things work, what causes them to stop working, and how to build them better and use them the right way so that they last longer. (While growing up, one of my father's books The Way Things Work was among my favorites. Hard to believe, but this 1967 classic is apparently still in print!)

Delegate With Competence. I like to know how something is done before I delegate it. That way I can provide competent supervision and am less likely to be taken for a ride.

Reduce Waste. Once you develop a handyman mentality, you tend to fix things rather than throw them away. We have become a throwaway society that creates far too much trash. So, I am always looking for ways to reduce my garbage footprint.

Save Time. Rather than schedule an appointment with a handyman, likely take a day off work, wait for his arrival, and hang around while he works, I can do the job during off hours, at my own convenience.

Stay Active. All the fixing helps me maintain an active lifestyle. And that's a major plus in today's sedentary society wherein we spend most of the day either sitting or lying down.

Save Money. It's cheaper. Not only do I not have to pay exorbitant hourly rates, I also don't lose a vacation day at work. And I can use the money I save to fund our next vacation trip.

(Of course, none of the above really applies if you're not handy. And in that case you have no choice but to either hire or befriend a handyman.)

Saturday, January 5, 2013

How to Select and Install Shelves

The kitchen in my house has a closeted area for laundry, where the washer and dryer take up the floor space. But there's 50 square feet (5' wide x 4' high x 2.5' deep) of space above the washer and dryer that was going unused. So, I started researching shelving systems. I began online at Home Depot, Lowe's, etc. But this isn't something you can do online unless you've worked with that exact system previously and know exactly what to order. After speaking with someone at the local Home Depot, I ended up going with a ClosetMaid ShelfTrack system that has several parts that all need to be coordinated carefully to get a working system. That is the system I will describe in detail in this post. But I'll also allude to other options.

First, note that this is a system especially suited for situations like mine where you're working exclusively within the top half of the space between the ceiling and the floor. Here is the component list for the ClosetMaid ShelfTrack system, also referred to ClosetMaid's web site as Adjustable Mount Hardware.

Shelf End Caps
Hang Track
Standard
Bracket
Superslide Shelf

  • Hang Tracks. Installed horizontally near the top of the shelving area. Create one-step leveling and prevent the need to level each standard separately. The length of the Hang Track should be as much a as possible without exceeding the length of the space in which you plan to install the shelving system.
  • Standards. Installed vertically. The notches at the top of the standards fish tail with the Hang Tracks so that the Standards lock into and hang from the Hang Tracks. The height of the Standards should be a much as possible without exceeding the height of the space in which you plan to install the shelving system.
  • Wire Shelving Brackets. Attach to the Standard at the desired height and spacing such that Brackets sit parallel to the floor and support the shelves. The Bracket size (e.g. 16'') should match the depth of the Shelves you intend to install.
  • Superslide Shelf. There are several kinds of CloseMaid Wire Shelves that can sit on top of the Brackets. Superslide Shelf is the one that seemed most appropriate for my purpose. Shelves come in fixed lengths. So, I had to buy a 72'' Shelf and have it cut down to 60''. And when you cut a shelf, you end up with sharp edges at the cut end. So, it's best to cover up those sharp edges with Shelf End Caps. (I did consider wood shelves but somehow could not find the right size. Also, the CloseMaid Wire Shelves snap onto the back of the Brackets so that they don't move around once they placed on the Brackets.)
This system cost me around $150.


Wall Clips
Wall Brackets

Support  Bracket


At this point I should mention a major alternative, suitable for situations where you're only planning on one or shelves and aren't worried about being able to adjust the height. Fittingly, this is the system listed under ClosetMaid Fixed Mount Hardware. Broadly, it consists of Wire Shelves and the following.


  • Wall Clips. These are used for attaching the back of the Wire Shelves to the wall.
  • Wall Brackets. These are used for attaching the front of the Wire Shelves sideways to the wall.
  • Support Brackets. The top end attaches to the front lip of the Wire Shelves and the bottom end is screwed into the wall. 

Although picking a shelving system and buying the right shelving components that fit well together is hard enough, the part that stumps most people is the correct methodology for screwing these pieces into the wall. In most Western houses, walls are erected by screwing sheets of dry wall to wood or steel frames setup along the perimeter of each room. The frame is typically made up of 1" x 2'' or 2'' x 4'' slabs of wood, also known as studs. Whenever possible, you want your screw to go into a stud so that it will be more secure and will support enough weight. However, locating studs isn't easy and involves either knocking on the dry wall to use the change in sound to detect the existence of studs or the use of a stud detector ($10 to $50, depending on the level of sophistication). And when you're installing something horizontally (as is the case for our Hang Track) you will be lucky if you're able to line up one or two of the 6 screws with a stud. The remaining screws will go into dry wall, also known as hollow dry wall. And this where most people get stumped. If you use regular wood screws to screw your Hang Track into dry wall, the Hang Track will not have must support and will come down like a house of cards as soon as you put some weight on your shelves.

Dry Wall Installation

So, an entire cottage industry has evolved for coming up with creative ideas on how to more successfully drive screws into dry wall (and have them stay there). The primary choices are as follows.

Dry Wall Screw With Anchor
Dry Wall Screw With Self-Drilling Anchor
Dry Wall Toggle Bolt
Dry Wall Screws (Hybrid or Triple)
Dry Wall Screw (Anchor-less)
  • Dry Wall Screws With Anchors. You first drill a pilot hole and tap the anchor into the dry wall with a hammer. Then, as you rotate the screw into the anchor, the anchor typically expands on the other side the dry wall, thereby locking the screw in. These are cheaper and are a good choice for low load situations, e.g. if all you're planning to put on the shelves is pillows.
  • Dry Wall Screws With Self-Drilling Anchors. This is a bear claw style anchor (as opposed to the expanding style) and has the advantage of not requiring a pilot hole to be drilled first. You just drill in the anchor and then put in the screw. These are more expensive and are a good choice for high load situations, e.g. if you're planning on loading the shelves with cans of soup or books.
  • Dry Wall Toggle Bolt. This is actually a bolt with spring-loaded wings that expand once they get past the dry wall. As you continue to screw in the bolt the wings will eventually be flush with the other end of the dry wall and will lock the bolt in place.
  • Dry Wall Screws (Anchor-less). This is an all-in-one option that is typically best for situations where the leading half of the screw is going into a stud. However, it may not work in many situations because the hole in the part you're trying to screw into the wall isn't wide enough for this type of screw.
  • Dry Wall Screws Hybrids. Sometimes also known as triples, these are futuristic looking anchors (generally plastic) that implement multiple locking strategies as described above.
Here's how my ClosetMaid ShelfTrack system looks fully assembled (except for the rod at the front, which is handy in case you wish to hang clothes -- but I didn't need to).



I hope you found this useful. Happy shelving!

Tuesday, January 1, 2013

Understanding Indian Classical Music


I've recently developed a deeper interest in appreciating and understanding Indian classical music, of which there are two major forms -- South Indian (Carnatic) and North Indian (Hindustani). A brief exploration is sufficient to realize that this is a very complex discipline indeed, which explains why ustads (maestros) aren't made overnight but are the result of a lifelong pursuit of classical music as a passion and career.

By the way, the masters whom I admire most are the ones who leverage their classical foundation to deliver successful popular music. There a many examples, but the ones I am most familiar with include Jagjit Singh, Daler Mehndi, Sonu Nigam, and Shankar Mahadevan (of Shankar-Ehsaan-Loy).

In this blog post I merely hope to document the major concepts and bookmark the links to which I hope to return when the next wave of inspiration strikes me to develop my amateurish understanding to the next level.

I would ask serious students to consider the Shankar Mahadevan Academy (SMA), a carefully constructed online system of coursework that is both thorough and fun. But before you pay a hefty sum to enroll at the SMA, you should probably check out the excellent raag-hindustani.com website to get a sense of what you're in for in case you decide to take the plunge. Also, worthy of attention are some online videos including Understanding the Basics of Indian Raga Music. Meanwhile, I shall return to my present level of engagement with this art form, which is listening to Rashid Khan's amazing performances cataloged in The Best of Rashid Khan. Ustad Rashid is a rising star who is presently at the peak of his form. I got hooked on to him when I saw him perform at Jagjit Singh's remembrance (you MUST WATCH this even if it's the only link you click on this blog post).

Before I leave, here's a machine gun version of the key terms and concepts. It all starts with swars (notes), which develop into ragas (a series of notes), accompanied by a tala (beat). And I better stop before I go astray. So, check the sources above and enjoy!

Other good references.

Tuesday, December 4, 2012

A geek hotline!



31 Tools Every Web Developer Should Know About

[A book review of "Web Development Recipes" by Hogan et al. The Pragmatic Programmers. 2012. 321 pp.]

This terrific compilation of recipes (42 recipes in 300 pages) is akin to having 24/7 access to a bunch of super-geeks who have found the time you wish you had to explore every promising new web development technology out there. Moreover, the authors have prepared a nice little recipe (generally under 5 pages) for each idea that is worthy of further attention.

For the most part, you can skim through the book in any sequence. And you can either read or try out the recipes. I actually tried a few on my web sites (e.g. recipe #3) and they do work! And there's good thoughtful cross-referencing between recipes, pointing out prerequisites and ideas for further exploration.

Even if you're not motivated enough to try out all of the book's recipes, skimming through this book is the best way I can think of to develop a meaningful understanding of cutting-edge web development technology trends.

Of particular value is the "progressive enhancement" approach the authors evangelize and display while building their recipes. Start by laying down a pure HTML foundation. Then add JavaScript interactivity. Add CSS for styling. This results in a decoupled system which work even when JavaScript isn't available or up-to-date on the user's client.

Here's a comprehensive list of the cutting edge, proven web development technologies this book will introduce you to.
  • HTML5 and CSS3. The latest techniques for constructing and styling your web pages. (Multiple recipes.)
  • CSS3 Transformations. To animate without using Flash so you're iOS compatible.
  • jQuery, jQuery UI, jQuery Theme. The most popular of the JavaScript libraries. (Multiple recipes.)
  • Mustache. A tool for creating HTML templates (a cleaner approach relative to generating HTML directly from JavaScript).
  • AJAX. A JavaScript technique for server requests for portions of an HTML page without having to request a complete page update.
  • QEDServer. A standalone web application with a product catalog database and a RESTLike API that allows developers to focus on front-end proof-of-concepts without having to worry about setting up a back-end to run against.
  • History. A JavaScript library for providing graceful fallbacks for older browsers without the History API.
  • Google Maps. Use the Google Maps API to integrate with it on your pages.
  • Highcharts. A JavaScript library for creating interactive charts and graphs.
  • Knockout. A JavaScript library for generating dynamic UI widgets using the Model-View-View Model (MVVM) pattern.
  • Backbone. Use the MVC pattern in JavaScript. Also introduces readers to Underscore and JSON2.
  • JSONP. JSON with Padding, to get around the "same origin policy" and load data from a server in another domain.
  • CouchDB's CouchApps. Easy to use document database and a framework for building and deploying HTML and JavaScripts apps for CouchDB.
  • jQuery Mobile. Create one application that'll work on all mobile platforms (iOS, Android, etc.).
  • Jekyll. A tool for creating simple blog sites.
  • Sass. Extends CSS, provides variables and the ability to reuse code.
  • CoffeeScript. A new dialect for writing JavaScript that produces clean, compliant results.
  • Git. The version control system of choice for open source systems today. Allows developers to work on multiple versions in parallel.
  • Ubuntu. A version of Linux.
  • Firebug Lite. For creating a JavaScript debugging console in older browsers. Also, handy for inspecting the rendered HTML, CSS, and the DOM.
  • ClickHeat. A PHP script for generating heatmaps to show which parts of your pages are being clicked most often.
  • Selenium IDE. A Firefox plug-in for recording and playing back keystrokes and mouse clicks in order to capture UI test cases.
  • Cucumber. A tool to extend Selenium tests to non-Firefox browsers and multiple browser versions. Tests are written in text, which promotes behavior-driven development (BDD) and increased stakeholder involvement.
  • Jasmine. A JavaScript testing framework that promotes BDD.
  • Dropbox. Cloud-based utility for syncing and sharing files across multiple devices.
  • VirtualBox. An open source option for creating virtual environments with the ability to save and share environment snapshots.
  • Vim. A powerful text editor.
  • Apache. The industry's most popular open source web server. The authors explore configuration, setup of Secure Sockets Layer (SSL/HTTPS) and URL rewriting to preserve links.
  • Jammit. Combines and compresses JavaScript and CSS files for asset packaging and easy automated deployment.
  • Guard. Combines with Jammit to rebuild packaged assets when underlying files are changed.
  • Rake. A command-line tool written in Ruby for creating automated tasks. (Many of the recipes require a Ruby environment and the book shows you how to set one up.)

Monday, November 12, 2012

Utility trailer buying guide


Introduction

I recently bought a utility trailer. (I'll explain momentarily what that is and why you might consider buying one.) Going through the process (research, preparation, purchase, registration, setup and maintenance) has taught me that it's not a simple endeavor and very little good documentation exists in the public domain (e.g. on the Internet). Hence, this post.

Research

In dictionary terms, of course, "to trail" means "to follow" (or to trace the path of a primary vehicle). Alternately, Wikipedia defines a trailer as an unpowered vehicle pulled by a powered vehicle.


So, let's get acquainted with what a utility trailer is and why you might consider buying one. If you're a hardworking, blue collar American you probably already have one -- it's the back half of your pickup truck. Well not quite, but that's the reason Australians refer to a pickup as a utility vehicle. A pickup is characterized by the presence of a flat bed in the back half of the vehicle.

This flat bed can be used to carry bulky items. Conversely, white collar yuppies tend to drive cars and sedans whose trunks can't accommodate bulky items. A utility trailer, then, is a bridge between the beastly pickup and the yuppie sedan or SUV.


In the simplest terms, a utility trailer is a detachable version of the back half of a pickup. Your car, sedan, or SUV represents the front half to which you can attach a trailer. Owning a trailer gives you the flexibility of driving a high mileage vehicle without losing the ability to lug a load of garden soil or a washing machine home yourself rather than having to shell out delivery charges. And once you own a trailer you will discover all of the other things you can do yourself rather than pay someone else to do.

There are, of course, many types of trailers. A utility trailer is a general purpose trailer, as opposed to a semi-trailer (typically used to transport large quantities of commercial goods across long distances), or a mobile home, travel trailer, or camper. In its most basic form, a trailer is nothing more than a flat bed with no predestined purpose. The flat bed can then be enhanced or customized for the purpose at hand, e.g. to transport a boat, a machine, or nearly anything else. However, what usually turns a trailer into a utility trailer is the presence of a flat bed surrounded by a 12 to 24 inch high walls to contain the load. The flat bed is generally made out of iron, steel, or aluminium. The walls are generally made of iron mesh or wooden planks.

Renting Versus Buying

In case you find all of the above somewhat intimidating, you can always just rent a utility trailer from U-Haul, the preeminent provider in this space. However, when you arrive at U-Haul to rent a utility trailer, U-Haul will remind you that regardless of whether you decide to rent or purchase you need to install a hitch on your yuppie vehicle in order to attach a trailer.

Preparation

A hitch installation involves several facets, as outlined below.


First, you need to know your vehicle's gross combined weight rating (GCWR). This rating is generally explained in your vehicle's owner's manual and posted on the driver's side doorjamb. The rating represents the total weight your vehicle's engine can support, including the vehicle, driver and passengers, and the trailer. Some owner's manuals make it simpler and directly specify a maximum towing capacity for the vehicle. Also, most vehicles will recommend a lower maximum weight for a trailer without brakes. Trailers with brakes can carry a higher load because they have their own brakes to contain their momentum when the primary vehicle is slowing down, i.e. undergoing deceleration.


Second, U-Haul will recommend one or more hitches suitable for your vehicle. Hitches are categorized by class, e.g. class I, class II, etc. Higher class hitches generally support a higher towing capacity. Try to pick the highest class hitch available for your vehicle. The hitch's towing capacity should match or exceed your vehicle's towing capacity. Also, try to pick a hitch with a 2 inch receiver so that you will be able to tow most standard size trailers. The hitch is firmly bolted on to your vehicle's chassis on the bottom rear of your vehicle.

Third, you need to select a hitch ball and mount. If you installed a standard hitch with a 2 inch receiver, then will want to install a 2 inch ball. Ball mounts are available in various heights and depths in order to match the height of tip of your trailer's tongue when the trailer is level. Either buy the ball mount once you decide on a trailer or buy a "standard" mount and hope it fits.


Fourth, ensure that whoever installs your hitch also installs wiring for powering the trailer lights with a standard 4-way, flat wiring connector that'll work with most trailers.

Purchasing

It took me a while to figure out that there's pretty much no point in looking anywhere except on Craigslist. Almost any trailer you buy online is likely to be in the self assembly, ultra light category. So, if you're looking for a solid trailer, often Craigslist is the way to go. One more incentive for us yuppies to buy a trailer, in case I haven't already offered plenty, is the opportunity to make and break things and engage in do-it-yourself (DIY) projects like we did before everything became either disposable or controlled by mysterious microchips.

In addition to the above-mentioned, there are many things to consider when buying a utility trailer. One of the most important considerations is towing capacity, which should match or exceed that of your vehicle and your hitch. Also, consider the size of the trailer. 5'x8' is the most common size. I bought a used, homemade 5'x8' for $500. Some of the homemade trailers might be somewhat smaller or larger.

Setup


Depending on the condition of your trailer on purchase, you may have to do some minor setup and/or maintenance to get it in working order. In my case, I needed a new setup for attaching the safety chains from the trailer to the hitch. Safety chains are intended to keep the trailer tethered to the vehicle in case it gets disconnected from the hitch. The existing hooks were too narrow for the loops on my hitch. After trying a few different options, I ended up buying a pair of Lehigh Quick Links. Before you buy, check the link's load capacity as well as the size of its opening so that you know that it will fit through the loops on your hitch.


A tip I picked up from another web site: adjust the slack in the chains to allow for a jackknife turn but no more and cross the chains to catch your trailer tongue if it ever gets detached from the vehicle while towing. This will prevent the trailer tongue from hitting the ground and getting damaged.


As I discovered several days following my purchase, I also had very slow leak on the left tire. It meant that the tire would remain sufficiently inflated for the several hours required for any reasonable task but would have to be reinflated in a week or so. Luckily I had an air compressor and the appropriate attachments to inflate the tire every week. It's a good idea to spend $25 or so on a portable air compressor that will run off the power source in your car and provide you with much needed assurance in case of a flat tire (to inflate the flat tire or the spare tire). However, after a few weeks of inflating I decided to fix the problem. I took the tire off the trailer. Depending on the amount of rust on the tire's nuts and blots you may need a breaker tool to get the nuts off. Once you do get the tire off, it's a good idea to spray the rusted nuts and bolts with WD40 to protect them from further rusting. With the tire lying on the ground, pour some soapy water on it to find the source of the leak. Bubbles will accumulate around the leak. As often happens with older rusted tires, the tire rim begins to rust and the rust breaks the seal between the rim and tire, thereby causing tiny rim leaks. I was able to get Pepboys to sand the rust off the rim and apply a fresh bead where the tire meets the rim. It cost me $25 and I now have a perfectly good tire that holds air forever.


Finally, it is worth buying a small padlock that you can use to lock the trailer's locking lever that makes it possible to hook the trailer to a hitch. No one can tow your trailer unless they unlock the locking lever. Consider using the lock when your trailer is sitting at home unused or when you have it parked somewhere (e.g. at a store) for a long period of time.


Even if you're not using the lock, always use a pin to prevent the locking lever from unlocking as you go over a bump or something.

Registration

A trailer with a gross vehicle weight (GVW) of 500 lbs or more must be registered with the appropriate office of the department of motor vehicles (DMV). At the time of registration you will need to provide a title or (in the case of a used trailer without a title) specifics about the trailer such as towing capacity, color, etc. You will also need to provide a bill of sale (BOS). A new trailer will likely already have a vehicle identification number (VIN), usually somewhere on its tongue. If you bought a used trailer without a VIN, then depending on the rules in your area you may be required to get a local police officer to visit your home (free of charge) and look the trailer over to certify in writing that the trailer doesn't already have a vehicle identification number (VIN) or other visible markings indicating prior ownership. Typically, your DMV can provide you with the form that is to be used by the police officer for the VIN check. Once you register the trailer you will get a title and VIN, which you should keep in a safe place. You may also consider engraving the VIN onto the tongue of your trailer.

Maintenance

As with any other large item, regular maintenance will extend the life of the trailer and increase the likelihood of problem free service. Examples include applying machine oil (e.g. from Singer) to the release latch to help it operate freely, applying a coat of paint to cover rusted areas (after sanding), and applying grease or oil to moving parts in the axle. Finally, consider buying some tarp to either protect the floor of your trailer or to cover up soil during transportation. Use R-pins to tether the tarp to the trailer's walls.

Tips

The first time you drive with a trailer attached, go slow. The trailer has its own momentum and it takes a while to get used to it. Also, backing up can be tricky. The rule of thumb is to turn your vehicle in the opposite direction of the direction you want the trailer to go. Also, be careful when loading your trailer and keep your trailer's load capacity in mind. The rule of thumb for buying wholesale garden topsoil is that a one cubic yard bucket or scoop weighs roughly 1 ton/tonne or a 1,000 kilograms or 2,000 lbs.

References

  1. http://www.youtube.com/watch?v=1w9mmuAXXAA
  2. http://www.howstuffworks.com/search.php?terms=utility+trailer

Happy towing!

Tuesday, October 23, 2012

Programming Languages At A Glance

A humorous synopsis of today's major programming languages. Very cleverly done and pretty much hits the nail on the head. Your favorite language is sure to be discussed, albeit not necessarily in complimentary terms!