Wednesday, November 11, 2009

Something more scalable

Warning, this is a geeky post.

At work, we use JBoss 4, EJB3, Hibernate. 3 servers in replicated transactional cluster mode (meaning anytime a database object changes, it gets replicated to each of the servers). It has been working very well for the past couple of years. However, there has been a few things that have been bugging me. Any time we had clustered api change, we had to shut down the entire cluster, deploy the changes and then bring it back up again. The minute of downtime was acceptable enough to the company that we didn't bother with two identical clusters and switching the load balancer between them.

We also had some issues with deploying multiple .ear files in each of the app servers. The .ear files all shared the same classloader (ear isolation was off). This means that any jar files in the first .ear file loaded would become the classes that are used by the JVM. So, if you had a shared .jar file across the .ear files, you may run into version compatibility issues if you don't update the .jar file in each of the .ear files. Lame.

This has been ok because we have workarounds, but not optimal because there is a better way of doing things. It just takes a bit of work and a deep understanding of the system to make it all happen. So, about a week ago, I got a bug up my butt to finally fix all of this. I first turned on ear isolation. However, this had the side effect of screwing with the clustering because hibernate and the clustering code lives higher in the classloader tree than our public API code that was being serialized across the network. Thus, Hibernate couldn't find our classes and epic classloader fail ensued. This made me realize that we should also move away from the painfully slow JBoss Cache 1.x (which comes with JBoss4) and switch to Ehcache. Ehcache would live in the ear classloader, so if there was serialization, it wouldn't be a problem. Ehcache has the following benefits over JBoss Cache: uses an invalidation model (which mostly negates the serialization problems), massively faster than JBoss Cache 1.x, easily configured with hibernate, singleton based and extensive JMX statistics.

Needless to say, after a few trials and failures (mostly related to runtime dependency issues and other oddities), I've now got all of our servers running cleanly on this redesigned system. We no longer have to take down the entire cluster, speed has been increased greatly and as I tune the cache (now that I have real stats of what is going on) database hits will go down. Sure it was a very complicated procedure to execute, but I'm happy it is done now and we can move forward on a simplified platform.

Saturday, October 10, 2009

A massive mistake

Read this link...

"We continue to advise customers to NOT reset their device by removing the battery or letting their battery drain completely, as any personal content that currently resides on your device will be lost."

Someone is going to lose their job.

Tuesday, October 6, 2009

The best way to keep a customer

For example, say you provide a service like DirecTV does. You beam hundreds of channels to homes on a 24/7 basis. Your customers are using high tech equipment which tends to get obsoleted over time. People move from standard definition tv to high definition tv. The government even has a program where they are obsoleting old tv's. You also have competitors who are trying their best to under cut your business by providing more for less. How would you go about keeping your customers from switching?

In my opinion, the best way to keep a customer is to communicate with them. Be proactive and offer special deals and upgrades in advance. Especially to those customers who have been with you for extended periods of time. It should be easy for the sales and marketing department to run a report on who their customers are and include marketing offers with billing statements. In other words, do not wait until the customer has already switched to make them an offer to stay.

Good bye DirecTV. Hello Dish Networks.

Wednesday, September 30, 2009

Tools for The Current State of Web App Development

I've been doing this stuff for a long time. The technologies have progressed quite a bit over the years. If I had to start over today, these are the tools I'd choose:

App server: Resin 4
Web frameworks: RESTEasy, htmleasy and JSR299 (as part of Resin 4).
Persistence: Hibernate with ehcache for the second level / query cache.
Database: MySQL and Sequel Pro is awesome (try the nightly builds).
Presentation layer: Mix of JSP/JSTL with GWT controlling the forms and complex widgets. json and gwt async rpc for communicating with the backend.
Javascript helpers: jquery and possibly some YUI3.
IDE: Still sticking with Eclipse cause it is free and works well enough.

Other interesting technologies: HornetQ for messaging. Infinispan for data grid and possible map/reduce framework in the future.

I've recently spent some time with Stripes and I like it a lot, but the resteasy / htmleasy / jsr299 combo is so much more powerful and complete (while maintaing a fairly simple api), I just don't see the point in using Stripes.

Saturday, September 26, 2009

Twitter Valuation

How can a company that 'has yet to report any significant revenue' be valued at $1 billion?

Just because you have an audience doesn't mean they are going to be willing to spend any of their money. It could be the fact that their audience doesn't have to spend any money that gives them an audience to begin with. As soon as they start charging for services, someone else could easily come along and do it for free again and 'steal' their audience. Still, I just don't get the valuation.

That said, people pay for when OkCupid is free and arguably a more entertaining / useful service. But then again, maybe people pay for thinking they are actually getting a better product or maybe it helps weed out the people who aren't serious. Maybe that is what the investors are hoping for with Twitter.

Regardless, it will be interesting to see how all this plays out over the next few years.

Thursday, August 27, 2009

Ultimate Muscle Roller Legend

Deep in the forest lived Billy and his charming companions. They peacefully honed their bodies and listened to music there. But a wave of development came upon the forests. One who would turn all to road. Kagamine Rin had come. Billy must stop the construction before all is turned to road.

Subtle Subversive Facebook Applications

I just received a request from my uncle on Facebook. This request was interesting because it shows up just like any other friend or even request in the upper right hand corner of the screen.

At first, I thought wow, cool, Facebook has a feature to relate me to other family members. But then after clicking on the '1 add relative request' link, I quickly realized that this is not Facebook, but instead it is a third party application.

This gave me concern because I'm developing a Facebook application myself and I know exactly what sort of information an application gets about you (and all your friends) as soon as you allow access to this application. Even the ACLU has gotten into the action.

The thing is that there is currently over 19 MILLION people using this application, which has been declared a "Facebook Verified App" (which you have to pay $375/yr. for). However, if you look more closely, out of 5760 reviews, it only has a rating of 1.6 out of 5. By reading the discussion board for the application, it seems like quite a few people don't like it. It also seems to me that if only 5760 people have reviewed it out of 19 million people using it, it is clear that most people don't even understand (or care) that it is a third party application, not even written by Facebook. 19 million people also seem to ignore the fact that it only has 1.5 stars when they allow access to it.

Upon further investigation, there is some other interesting stuff going on. For instance, did you realize that is in private beta? What do you think they are doing with all the information they are gleaning from you? Their privacy policy basically says that they are going to do whatever they want with the information that you 'give' them and that they will even send you notifications about services offered by FamilyLink as well as... you guessed it... advertisements.

Digging further into FamilyLink, it is clear to me that this company is based around data mining. They are very much into selling the information they gleam from you and Facebook, with its user base of over 200 million members has become the perfect launching platform for this to happen. Then we can dig into who is behind the company... Paul Allen (the lesser), who is a mormon. You know, the religion that hates same sex marriage.

Just like you have been trained to be careful about which applications you download off the internets, I think people also need to be trained to be careful about which applications they agree to allow into their Facebook profiles. I also think that Facebook needs to be better about ensuring these applications aren't doing bad things.

Sunday, August 2, 2009

Project: APTC Adler Power Torque Clutch Install and Review

I recently purchased this beautiful very low mileage 2008 Ducati Hypermotard off a guy on craigslist for a really great deal that I just couldn't pass up. I had been looking for this bike for about a year now because for me, this is the Ferrari of motorcycles and a dream come true.

Needless to say, about a month after I got it, I took it into the local Ducati shop and they told me that I needed a new clutch because the one I had was burned out. Definitely not my fault cause it was riding like that since I got it.

Anyway, this was a great excuse to upgrade to a slipper clutch (there is a good FAQ about slipper clutches by another company). There are a couple primary advantages to this clutch that I was looking forward to: it is easier to pull the clutch lever in (by about 50%) and most importantly, it prevents the rear wheel from locking up when downshifting and slowing down.

After a lot of my own research, I choose to get an APTC Adler Power Torque Clutch. I choose this clutch because it cost about the same as the official Ducati slipper clutch yet had a few features that I really liked: it is supposed (according to the above website) to be easy to install with no special tools needed (a semi-truth which I will cover below) and because it uses springs instead of ball bearings on ramps for a simpler design. The adjustability description is also incorrect, the clutch doesn't come with extra shims. Make sure you also order the right part. If you have a newer than 2002 bike, make sure to get the DU-109 part number.

I'm documenting this experience because frankly, the documentation that came with the clutch sucks. There is quite a few assumptions that you know what you are doing and the pictures are horrible. I've never done work like this on a motorcycle, so I felt it was a great learning experience that I'd like to share. I definitely made one big mistake, but luckily it won't cost me anything right away. Hopefully, I'll lead you past that without any mistakes yourself. I apologize in advance for the blurry pix, but I promise you that blurry big color pictures are better than tiny grey ones. Of course I also offer no liability if you screw up your bike in any way.

So, lets start the install. I'll give you some text and then show an image. You can click the image to see the Flickr page and I'll note places where you want to click through and read any annotations on the images.

Take everything out of the box and ensure you have all the parts.

Next, undo the 6 allen key bolts around the clutch case. If you pull any out, make sure you carefully note where they go as they are all different sizes.

Cover is off, note that I left two bolts in cause for some reason the clutch cover isn't held on by those two bolts. You will have to remove those bolts as part of the installation process so remember where they go when you take them out. Also remove the giant rubber ring.

Unscrewing the 6 bolts that hold the springs in place:

All 6 springs have been removed now. You won't need them again.

Pressure plate is off now. Note that I briefly stopped after this picture because I broke off one of the spring posts while trying to undo the center nut (not in this picture, but there is a note on Flickr over the part I broke). I realized that I really need to order the special ducati part (the seller is extremely responsive via email) which keeps the clutch from spinning when taking off the big center nut. There is several different versions of this tool by other manufactures, but the one I ordered seemed the most sane. I also hear that if you have an impact wrench you can take the bolt off quite easily. I don't need anymore tools right now, I'm going to be using a big torque wrench I got from Sears and the special ducati part to keep things from spinning.

Here is a picture of the special ducati tool:

Picture of my costly mistake of breaking off one of the spring posts. Since this part is replaced by the new clutch, I'll maybe consider worrying about replacing it later. In this picture, you can also see the special ducati tool installed. It is the plastic bit with teeth on the lower right. It takes a bit of gentle twisting the outer clutch box and inner gear bits to get it all to line up. Also note that I carefully removed a few of the clutch plates in order to get the tool on. I was careful to note the direction and order of the plates so that I could put them back together the same way once I got the clutch out.

Use the 32mm socket. Lefty (counter clockwise) loosy.

The nut is off! It was fairly easy to remove using my torque wrench and a bit of elbow grease. Do this step carefully! You don't want the wrench to slip off the nut and break anything.

Pull slowly on the spring posts to remove the entire clutch assembly. It should slip right out. Be careful to hold it all together cause the clutch plates and the center bits will fall all over the place if you don't. Put the clutch plates back on that you removed in order to use the special tool.

This is a picture of everything out of the clutch box.

Pull the pressure plate pusher off the end of the axel. It is a bit of a pain, but just tug on it a bit and it will eventually come off.

I used some flat expandable pliers to pull the spacer off. You just have to kind of grip really hard on it and pull straight off. I didn't rotate it at all.

Now that the spacer is off, put the spacer that comes with the APTC on. You have to kind of push it hard to get it to seat in there, but it will. Don't over do it.

Take the APTC clutch and slip it into the clutch box. Do not remove the 4 pre-installation screws! It may take some work to get it to line up with the splines. It is easiest if you put the bike in first gear and then roll the entire bike forward while putting some light pressure on the clutch to get it to line up and slip on.

Install the spacer washer:

Now, assemble the special APTC tool that comes with the kit as shown in the picture. Use the two long bolts that come with the kit. Carefully screw them into the threads so as to not strip them. Don't forget to put the top screw through the small metal plate first. It can be a bit of a pain to get everything to line up. The instructions suggested that you loosen up the 4 bolts holding the clutch together just a little, but I was able to get things to line up by just pushing the bike around a bit and forcing the clutch to move into place. Probably puts a tiny bit of wear on the clutch, but I only needed to move things about half an inch.

Screw the center nut that comes with the kit on. I used red locktite on the threads as suggested by the manual. I had to pull out the really long pressure plate opening rod and place it carefully on a clean surface in order to tighten the nut with a 30mm socket and my torque wrench set at 190Nm. After the nut was tightened, I carefully put the rod back.

Put the pressure plate pusher onto the pressure plate opening rod and put the Belleville washer on the pressure plate pusher with the convex side facing on the outside of the APTC.

You can see that the pressure plate is now on and one of the springs is in place. I'll cover the install of the spring screws next.

Screw the 4 spring screws in. Align the silver washer so that the bevelled edge faces the spring. Push the washer over the spring post on the clutch, insert the spring and then top it off with the grey washer and hex screw. Carefully align the screw with the spring posts and push in while slowly making sure the threads line up. Takes a bit of coordination. Tighten these by hand to 7/10Nm.

You can see the silver washer on the bottom facing spring post.

Finally, remove the 4 pre-installation screws. Try engaging the clutch and notice its movement in the clutch box. Put the rubber seal and clutch cover back on and try starting the bike in neutral. Then, let out the clutch a bit and see how well it sticks. Go take your bike for a ride.

My first impressions with the clutch were that the hard braking feeling that I got by downshifting no longer exists. It is a much smoother operation no matter how quickly I let out the clutch. At one point I thought something was wrong with the bike cause I let out the clutch and expected some braking, but nothing happened. I just wasn't used to it. While I got used to more braking by downshifting, it just means now that I'll need to apply the brakes a bit more in order to quickly slow down (also noted in the FAQ reference above). I'm sure there is a penalty with that somehow, but the knowledge that my rear tire isn't going to lock up makes me feel like this is the anti-lock brakes of clutches. Engaging the clutch is also a lot simpler and requires less effort. The clutch also engages quickly when being let out which is easier for me to control.

Next up, I plan on purchasing an open clutch cover so that I can show off my APTC as well as keep the clutch cooler.

Overall, I give this clutch two thumbs up. Let's see how long it lasts. =)

Friday, July 10, 2009

IE6 @ Digg

Digg did a survey about IE6 usage (click the image to see the survey results):

The summary is that most people can't upgrade to something newer than IE6 because they don't have administrator rights to the computers they use at work.

Given that my employer,, also gets a large percentage of IE6 users, one can presumably deduce that there is a large number of people surfing hardcore porn at work.

And you thought twitter and facebook was the reason why nothing gets done.

Monday, July 6, 2009

cock length

There tends to be a lot of humor in my code because of the place where I work... I wrote this today and can't stop laughing about it...

/** */
Long cockLength; // It is Long, cause well, you know my size has to fit into it (JSS).
public Long getCockLength() { return this.cockLength; }
public void setCockLength(Long cockLength) { this.cockLength = cockLength; }

Saturday, May 30, 2009

new release: svntask v1.0.4

My little project for a reliable, simple codebase and easy to use ant interface to subversion just got an update. Version 1.0.4 adds compatibility with svn 1.6.2 as well as a couple more commands: add, commit and switch. Enjoy.

Wednesday, May 27, 2009

Put The Fun Between Your Legs

Looks to me like someone wasn't being very sensitive when they said "Put The Fun Between Your Legs" and got sponsorship from "SF Women Against Rape". I got a 'corrected' email a few hours later. Whoops.

Update: Apparently, I'm not the only one who noticed this.

Sunday, May 24, 2009

Anus lapping

    George Poinar, Oregon State Univ

Since termites and their protozoa are separate animals, each new generation of termite must be united with its microscopic crew of wood digesters. To do so, adult termites secrete a liquid from their anus that is laced with protozoa and newly hatched termites lap it up.

Monday, May 18, 2009


Everyone is buzz wording about Hadoop so I decided to check the core source code out and try to load it into Eclipse. Talk about fail. I read the wiki page for setting things up. It starts off recommending the exact eclipse subversion plugin that I don't use. Ok, that shouldn't be a problem, just check out to disk and import the project like I normally do. Ok, done.

Next problem, you have to use ant to generate the eclipse files. Um, what? Why can't you just check the .project/.classpath files in? They don't change that often and really don't need to be customized.

But wait, they do. Hadoop's eclipse integration has direct ties to running ant because it needs to generate some files which are then used as part of the classpath so that things build within eclipse. Nope, that doesn't work either. I tried.

Basically the summary is that after about 30 minutes of dicking around with things, I have no idea on how to get a clean build of Hadoop within Eclipse. This of course makes trying to contribute some code to Hadoop nearly impossible.

What really should happen is that someone needs to write some clear directions and have an easy path to setting up a working development environment. This should be a number one priority of all open source software projects. If you can't get the build down, what makes me think you can write good code?

Monday, May 11, 2009


I was just reading up on Glassfish v3. Just curious to see what it is like.

Digging around, I stumbled across this bit of documentation that kind of made me giggle...

If you look closely, the 'comma separated' example isn't comma separated.

I'm just a tad bit too detail oriented, ya think?

Twitter Just Landed

So far, I haven't found a use for Twitter as I prefer posting on Facebook a lot more. FB feels more interactive too me.

However, someone came along and started processing their twitter feed for "Just landed in..." and then graphed it on a map. It looks like this:

I really appreciate Tufte style visual exploration projects.


In the tech world, people often say that the online pornography business drives innovation. I think the porno business was just beaten. The newish MD6 hash algorithm was first spotted in the wild as part of the Conflicker worm and the worm authors actually updated the version of the code in use when it was discovered to have a buffer overflow vulnerability. Awesome.


Have you noticed that a few weeks ago, gmail suddenly stopped remembering the "Always display images from [email protected]" setting? Kind of annoying. I wonder what is up.

Friday, May 8, 2009

Hibernate Gotcha #215

I was getting this error when using session.createSQLQuery():

"More than one row with the given identifier was found."

No searching on the interwebs helped at all.

I have an entity that looks like this:

public class Pornstar
 PornstarArea area;
 public PornstarArea getArea() { return this.area; }
 public void setArea(PornstarArea area) { this.area = area; }

PornstarArea is another entity object.

I randomly removed the @JoinColumn and it made that error stop happening. Go figure.

Thursday, April 23, 2009

Places to stay?

I'm looking for places to stay for two trips over the coming months.

a) A cute rental house/condo in Kauai. Ideally on the North Eastern part of the island. Hot tub or large bath tub would be nice. Something close to the action. Hopefully in view of or on the beach. 3 nights.

b) A cute boutique hotel in NYC/Manhattan. It doesn't have to be super fancy and I don't expect a big massive room or anything, but it should also be close to some action. 2-3 nights.

Thoughts and recommendations?

Thursday, March 26, 2009