StatCounter

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 a 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!


Monday, February 20, 2012

Best iPhone Apps 2012


A colleague recently made me aware of Time's new list of 50 Best iPhone Apps 2012.

There's a lot of fluff on this list from Time magazine. But here are some of the apps from this list that I actually use and recommend.
  • ShopSavvy (better than RedLaser). To discover, for example, that most groceries at Target are actually very competitively priced.
  • Dragon (I find the classic version, minus the Go!, to be more useful). To dictate lengthy responses to emails while driving. Required very occasionally, but when you need it you really need it, for example as you're pulling into the parking lot to let someone who is in a meeting and can't take a phone call know that you need them to fetch a projector for the very next meeting. Mildly not useful if you have to correct the transcription but works well once you get used to speaking clearly. Side benefit: helps you learn to speak clearly!
  • GasBuddy. Good for that initial "wow" discovery that some gas stations (usually ones off the beaten path, surprise) are actually significantly cheaper than others. Once you know, you generally don't need to keep checking. Especially useful, now that gas prices are said to be approaching $5 a gallon!
  • Yelp. Indispensable reviews-driven service if you're in a new place and need to find a decent restaurant, hotel, etc with some color commentary (e.g. Stay Away! Rough part of DC! Google Maps just doesn't tell you this!).
  • Shazam. You're waiting for your haircut or driving in your car and a song comes on that you totally love. Use Shazam to find out what song it is.
  • Flipboard. More than anything, I think of it as a visual way of browsing Twitter. Saves me from clicking on Twitter links because it presents a summary (pictures included) of the underlying link. It does an unbelievable job of caching so that I'm able to flip through 20 to 30 of the most recent stories during a subway ride without phone signal. Pandora is the only one that matches up. Many of the apps I value are only useful to folks who are information hounds like me.
  • Dropbox. Invaluable for syncing important files (e.g. PDF books I'm currently reading/consulting) across all computers/devices.
  • Flashlight. Thankfully, I've actually only had to use this a few times. But this is exactly what you need when you've accidentally dropped your keys in a dark parking lot.
  • Pandora. Perfect mix of songs you've told Pandora you like (so it'll play them every so often) and songs you like but didn't know (Pandora will offer up songs in the same genre and you're guaranteed to find something new that you like). Also, does a super job of caching so that you can keep listening on the subway even if you lose phone signal for several minutes.
And while I'm on a roll, let me also list a few apps that I find extremely useful but Time magazine did not include on their list.
  • Evernote. A great compliment to Dropbox for text files you need to edit. For example, it's not as much fun now but when my son Ronak (7) was younger I maintained a list of words he mispronounced. Evernote syncs the notes across all computers/devices so you can edit wherever you are. Extremely useful, given that Dropbox still does not allow editing from a handheld device.
  • Pulse. Not as flashy as Flipboard, but sometimes news is more than just cool pictures. And Pulse does a great job of presenting the most important news of the day in a convenient to consume layout. It also allows you to save stories for future reference and integrates with Facebook and Twitter. You can add any news source that has an RSS feed, which in today's world means ANY news source. BBC News is also good but lacks flexible integration with RSS feeds and social media sites.
  • Starbucks. For the small but meaningful convenience of being able to swipe my card and collect points using my phone, i.e. without having to carry the physical card around.
  • AroundMe. Has bailed me out a few times when I'm in a new place, am completely out of gas, and desperately need to find the NEAREST gas station even if it means making a u-turn!
  • VZNavigator. For Verizon subscribers only and requires a paid subscription ($5 per month, I think). But it is hands down the best I've used. Waze is free and quite good but has let me down too many times so I've returned to the tried and trusted GPS tool from Verizon.
  • GroceryIQ. Enter things you buy repeatedly into a master list. Then add items from the master list into your shopping list. Check off items from the shopping list as you go through the aisles. Priceless because if you're unable to find leeks at Market Basket even after three trips, leeks are still on your list when you happen to stop at Trader Joe's.
  • Flixster. In my opinion, this is the best app for finding out which movies are playing near you or where that hard to catch foreign film is playing within a 30 mile radius. Conveniently displays review scores from Rotten Tomatoes as well as Flixster users.
  • IMDb. A nifty app from the best place to go to for details when the information on Flixster just isn't enough or you want to explore a recommendation from a friend.
  • FlightControl. The best little game to help pass time and keep you awake while you're waiting at the doctor's office.
  • iBooks. I haven't tried all of the gazillion PDF readers out there, but this one from Apple is excellent. It lets you easily navigate chapters, create bookmarks, highlight passages, add notes, and search within the PDF. Mind you, I'm not a fan of carrying around a Kindle, tablet or what have you just so I can read books. My phone does a good enough job of it, thanks to helpful PDF readers like iBooks.
  • CapitalOne and ING Direct (now acquired by CapitalOne). Not a match for the excitement of a game or news app, but these two are among the best banking apps. Schedule a payment on the due date right from your phone. Every bank needs to have an app that is at least this capable.
  • Skype. Excellent rates for calling phone numbers, competitive with calling cards. And, of course, Skype to Skype calls are free! Now with Bluetooth support, makes it a breeze to use. 
  • Amazon. I do a lot of my shopping on Amazon and this app makes it easy to conduct business via the iPhone. Also good for quick price comparisons while shopping brick and mortar stores. I have occasionally received discounts on items just by flashing the Amazon price at an unsuspecting vendor.
Also see PC Magazine's List, which focuses on free apps and makes a good complement to Time's list.

The current (March 2012) issue of MacLife also has an excellent list of 100 best apps (Upgrade Your Apps) that's a bit off the beaten path, but (understandably) isn't yet available online (so, buy the print version or wait).

Follow me on Twitter @PuneetLamba

Sunday, January 15, 2012

iPhone Screen Capture

Use this cool tip to capture your iPhone screen as an image. Useful for documenting a setting you want to save or for demoing how an app works.

Friday, January 13, 2012

Rangeele Presents Kailash Kher's Ballads

Kailash Kher, performing live in Boston, November 13, 2009. Copyright Puneet Singh Lamba.

I've been a fan on Kailash Kher ever since he came into limelight with the outstanding Allah Ke Bande (2002). After his appearance as a judge on Zee TV's SaReGaMaPa 2011, I also became a fan of his forthright personality and his shudh/pure Hindi.

I had the pleasure of seeing this amazing singer perform live in Boston on November 13, 2009 at the historic Somerville Theatre. It was an especially enjoyable show for me, given Karsh Kale's surprise guest appearance on drums.

Kailash Kher's long-awaited new album, Rangeele, is a more sober offering relative to his previous works. Understandably so, now that he is established, married, and a father. The album contains eleven delicious ballads, which I've reviewed below. This is the kind of CD we all long for, one that you can leave on continuous play and let it loop as it quietly seeps into your consciousness.

1. Rangeele. A thoughtful title song with horn and flute accents. The tune grew on me after a few listens.
2. Tu Kya Jaane. A gentle, meditative love song that lulled me into a trance.
3. Albeliya. A shorter, mesmerizing ballad. "Main to azaadi mein bhi kaid ho gayi."
4. Yadaan Teriyaan. A haunting, Punjabi song.
5. Daaro Na Rang. A slightly faster, catchy, irreverent offering with captivating banjo-like string work.
6. Kathagaan. A song of adoration. Continues the upbeat theme (and banjo?) from the previous song.
7. Babbaji. No one does spiritual songs quite like Kailash Kher. And this yearning song is no exception.
8. Yadaan Teriyaan (Acoustic). A welcome repeat, as is the entire album.
9. Hudkaan Maan Bitti. A playful song. Presents a change of pace before the fitting album finale.
10. Dharti Pe Jannat. A dreamy, short continuation of the upbeat groove. Left me wanting more.
11. Ujaale Baant Lo. The album ends on this lovely, uplifting anthem. My favorite track from the album.
12. Ambar Tak Yehi Naad Goonjega. My version of the album doesn't have this song.

Monday, December 19, 2011

What Is Enterprise Architecture Anyway?



There aren't a lot of books on enterprise architecture, never mind good books. The Art of Enterprise Information Architecture by Godinez et al (IBM Press, 2010) fills a big void. I recommend the book for an excellent overview of enterprise architecture (EA) and reference architecture (RA), followed by a detailed discussion on Enterprise Information Architecture (EIA) and an EIA RA.

The authors define architecture as well as EA. They provide an overview of EA as well as RA, noting that there are various elements of an architecture including business architecture, application architecture, security architecture, and, of course, information architecture (IA). After the introductory chapters, the book launches into a detailed discussion on IA, EIA, and a RA for EIA. EIA is explored in terms of multiple views (conceptual, logical) and models (component, operational).

As the authors explain, the key that explains the "enterprise" in an EA is the manner in which an EA provides a bridge between an enterprise's business strategy and IT strategy and implementation such that business and IT are aligned across the enterprise. Furthermore, an EA strives to seek consistency and reduce redundancy in IT initiatives across the enterprise.


As the book clarifies, a RA is a proven architecture template or blueprint for a particular domain that can be adapted for the enterprise at hand.


The survey includes references to some classic articles on the subject (see below) as well as detailed discussions on important elements of a next-gen EIA including cloud computing, enterprise information integration (EII), metadata management, master data management (MDM), mashups for Web 2.0, dynamic warehousing, and business analytics and optimization (BAO).

I am reproducing links to selected articles referenced in the book. (I wrote this blog entry mostly to save these links for my own future reference.)

  1. Design an SOA solution using a reference architecture. Arsanjani et al. IBM developerWorks. 2007.

    The authors present multiple views of their SOA reference architecture.
  2. A comparison of the top four enterprise architecture methodologies. Session. MSDN. 2007.

    Useful overviews of: (1) Zachman Framework for enterprise architectures, (2) The Open Group Architecture Framework (TOGAF), (3) the Federal Enterprise Architecture (FEA), and (4) the Gartner Methodology.
  3. The Open Group Architecture Framework's (TOGAF) Architecture Development Method (ADM).

    ADM is perhaps the key component of TOGAF and it provides useful guidelines on how an organization should go about developing its architecture.
As other reviewers have pointed out, the book does tend to get redundant and repetitive. For example, Table 2.1 on page 35 "EIA RA Work Products" describes Business Context Diagram as "Contains the Business Context Diagram that documents ..."

While we're on the subject of books on EA, the only other book I've investigated carefully is A Practical Guide to Enterprise Architecture by McGovern et al (Prentice Hall, 2004). It is a good complement to the above-mentioned book since it doesn't talk much about TOGAF and FEA and instead delves more into the Rational Unified Process (RUP) and Agile based approaches. However, McGovern et al completely neglect to talk about the "enterprise" bit. It's almost as if the book is about architecture and the title was an afterthought from a marketing person. And that's why the offering from Godinez et al is all the more useful.

Saturday, September 3, 2011

India's Great Expectations

A fascinating debate, with a well-rounded panel, on India's superpower status, aspirations and potential. The panel: Manish Tewari (politician), Anil Dharker (columnist), Gayatri Shah (journalist), Rizvi Syed (poet), Vimlendu Jha (environmentalist), Neera Chandhoke (academician), Y P Singh (police).

Tuesday, August 30, 2011

Java Founder Leaves Google, Joins Startup

Just months after joining Google, Java founder James Gosling has moved on to a start-up working on oceanic robotics.

Friday, August 26, 2011

Hurricane Survival Kit

1. A flashlight. This is important. If you don't have a flashlight, buy an iPhone and install the flashlight app.

2. A bottle of scotch. If you don't have a bottle of scotch, you're SOL.

Thursday, June 16, 2011

iCloud Is Lame, Stay With Dropbox

I feel silly now, but I was pretty excited when Apple (and Steve Jobs) announced iCloud just the other day (June 6, 2011, to be exact). Given the quality of their other products (iPhone et al), I had high expectations. But this is a truly mediocre effort and a premature announcement.

How did I arrive at this controversial conclusion? I installed iCloud on my desktop (also known as CloudMe, why can't Apple pick a name and stick with it?). I also installed the CloudMe sister app on my iPhone so that I could review the integration across devices. To my dismay, I discovered that iCloud is, in fact, no more than a file upload facility, whereas Dropbox is a true file sync tool. One saving grace is that it works at the folder level. You tell it which folders to track on your device, let's say your desktop. And if it sees a new file in one of the folders you've asked it to track, it will upload the file to the cloud. However, and this is where Dropbox leaves iCloud in the dust, if you remove one of the previously uploaded files, iCloud will not remove it from the cloud! So, other devices will continue to have the redundant file. And, wait for it, it gets worse. If you rename a previously uploaded file, iCloud assumes it is a new file and uploads it. Duh! The file with the old name also continues to live on the cloud. As far as I'm concerned, iCloud offers absolutely nothing that I don't already have with Dropbox and does a worse job of it. And Dropbox has an awesomely functional iPhone app to go along with it.

In this context, I will share a philosophy that I solidly believe in. A company can only be successful at a few chosen things. As soon as a company starts to get in on everything that seems like too big a market to ignore, its value proposition is sure to shrink. And in this case, Apple has caused me to doubt whether all of its products are equally superb and reliable.

Sunday, June 12, 2011

Nature Capture | Stream of Leaves

 © Puneet Singh Lamba

Who: A river stream, jam packed with fall(en) leaves
What: Mostly oak leaves, looking gorgeous in their reflective container
Where: Greater Boston Area
When: November 13, 2010
Trivia: The leaves and acorns of oak trees are poisonous to cattle, if consumed in large amounts

An Economics-based Argument for Good Software Design

Martin Fowler is one of my favorite technical authors. I am sharing a link to his eminently thought-provoking keynote address (VIDEO) at the Agile Connect 2011 conference, June 8-9, Las Vegas. In order to whet your appetite, I'll reveal that his talk is comprised of three sections as follows. And I'll offer short summaries, in case you decide not to watch the 1+ hour video.
  • Non-deterministic tests and how best to deal with them. These are tests that succeed or fail randomly. They, therefore, cause your build to succeed or fail randomly. Fowler correctly recommends that such tests should be taken out of the suite and quarantined until the non-deterministic behavior has been fixed. He also lays out several root causes for non-deterministic tests including lack of test isolation (i.e. inter-test dependencies), asynchronous behavior (i.e. non-sequential events), remote services (i.e. failures outside your code).

  • An economics-based argument for when and why to invest in good software design and pay off technical debt. Fowler proposes a "Design Stamina Hypothesis" whereby initially ignoring good design might allow you to deliver new features more rapidly, over time poor design reduces the efficiency with which you can add new features.

  • The current state and future of Agile (and a few, highly welcome, words on social responsibility).
It's in the must-watch category. Candy for geeks.