read the fabric-care labels…

Note:this starts out as a rubbish about fabric-care…

It turns out that just because something is 100% cotton does not mean you simply wash it in warm water, or add fabric softener during the rinse cycle. Based on some horrible results, I should have realized this maybe 8 years ago, but that’s another story. Anyway, read the fabric-care labels on your clothes. Some cotton-based items are damaged by fabric softeners, like those stain/wrinkle resistant pants. I spill both food and drink often, some might say daily, so this is important to me.

As for the water temperature, you still need hot water for your whites; if you care for the environment, use warm water – Tide has some new detergents that work well in cooler water temps. However, your colored cottons may vary. Some need cold water and low drying only, or they’ll shrink! Well, the real problem is not the fabric, it’s the lack of reading the fabric-care labels. If I actually read them, I wouldn’t lose a good shirt on an average of every 2 months. The same goes for everything we do in life. Although you wont find care labels on your family, job or home. There’s existing wisdom on these subjects. You may have to search for it; or maybe just open your eyes and ears.

Case in point: The red brick walkway in front of my home was added in the 70’s, 2 owners ago. It’s an odd pattern that winds from the front porch to about 8 feet from the street. So, it doesn’t go directly to the driveway, nor does it actually go to the street. I never understood why. Some of the bricks started to fall into the ground. I knew this could be a bigger problem than just looks: mail-person trips on one of those, and I’m screwed. I called around for estimates, and selected a bid that wasn’t the cheapest, but a 3rd-generation concrete guy in the area.

You may be thinking: “have him remove the old walkway, and build a new one going directly to the driveway.” I assumed it would cost (much) more, so I decided against it. My neighbor, we’ll call him Dale (since that’s his name), mentioned that the walkway was considered odd when it was initially put in. It had not real goal, other than to be eccentric and draw attention. Here comes some of that wisdom… After I gave him some background, he schooled me on some things. The bricks were actually worth something (esp. to a brick/concrete guy), and that I should ask for another estimate for a shorter walkway. He was right: removing the old walkway, back-filling that with sod they took from another job, and adding a new concrete walkway, actually cost me much less. As I said, you may have been thinking that, but I wasn’t. You may also be the kind of person who already knew to read the fabric-care labels. If you are, I kinda hate you.

Posted in General | Leave a comment

oh how true…

Today’s Dilbert strip is a poignant one. I tend to have tons of time on my hands; enough to read this strip, write a post on it, and think about how ironic this all is. If you read his God’s Debris, you get this kind of existential dialogue for an entire book. Expect, replace the garbage man with an old man, and Dilbert with a delivery guy.


Today’s Dilbert strip

Posted in General | Leave a comment

good article(s)…

Eoin Woods (an enterprise architect for UBS Investment Bank) wrote a solid 2-part article basically describing how to avoid some common architectural pitfalls. Here’s Part 1 and Part 2. Worth reading.

Posted in Technical stuff | Leave a comment

searching hibernate…

Hibernate Search (Search) is well-documented, with a clean and easy to use API. The first line in its architectural overview states that it “…consists of an indexing and an index search engine. Both are backed by Apache Lucene.” It’s really that simple. You’ll still insert/update records as you always have. Except now, you have the added benefit of using free-text queries to search your data. You aren’t forced to now search in one way or another – just more freedom (pun intended). If you have experience with Hibernate’s Query, Criteria, or JPA’s Query APIs, you are already half-way there.

getting it done…

To get this working, I had about four major steps. First, I added hibernate-commons-annotation, hibernate-search.jar and lucene-core.jar. Next, I then went about converting some of my named queries to lucene queries, but that was more busy work than anything. Third, I had to make my base Daos Search-aware, which really means adding three methods: one for (re)indexing (that gets called at startup), and two for creating org.apache.lucene.search.Querys – one for default field queries, and another for multi-field queries.

slight bump in the road…

My fourth step was less installation, and more problem solving. I ran into an issue when I tried top apply type filtering. It seems that the ObjectLoader and QueryLoader handled items loaded from the current Hibernate Session a bit differently. The ObjectLoader attempts to initialize the loaded item, just in case. While the QueryLoader only adds a loaded item as a result if it is already initialized. This may be correct, but it didn’t work for me. After some debugging and testing, I found that just as the ObjectLoader, initializing the Session-loaded object worked fine. After no word from the forum, I made the relevant changes to my local Search build.

Overall, getting Search up and running was mostly straight forward. Based on the fairly small dataset, I have no need for the sharding/partitioning functionality. I have heard that keeping indices in synch can become an issue. I don’t know if that was before or after the Search’ JMS-based workers.

Update: I did get a response on the Hibernate forum. There may be an additional feature added, but for now I can move forward.

Posted in Technical stuff | Leave a comment

natural progression…

OK, for the most part, if your application (commercial or otherwise) has a small, let’s say trivial amount of data. Simply retrieving as few hundred records and displaying them shouldn’t be too IO intensive. but with natural progression, some trivial applications become non-trivial, and require a bit more care.

In my case, I retrieve some records via Hibernate. Then I display results via DisplayTag, and I wasn’t using partial-lists. Some of you might be thinking, “Hey genius, of course it’s going to be slow!” Well, you’re right: there’s a ton of object creation going on behind the scenes, and asking DisplayTag to decorate and sort n-thousand records is not going to work. With my non-trivial test data, I saw responses go from sub-second to ~5 seconds! So, with DisplayTag’s advice, I turned my attention to PaginatedLists. Nothing too crazy, basic ValueList Handler. I give PaginatedList instances a Spring-wired Dao, a SearchBean (search params) and an optional PagingAndSortingInfo reference. As you may have guessed, PagingAndSortingInfo knows the following:

  • what column(s) are being sorted,
  • in what direction,
  • what page sizes are,
  • and lastly, what page we are on.

As expected, performance goes back to sub-second. However, there’s a catch: I externalize all my queries (both big and small); regardess of what PagingAndSortingInfo may know, I can’t apply sorting information to an existing Hibernate Query. Since the returned is not a Hibernate Collection, Session.filter(…) is also out of the question. Lucky for me, there’s Hibernate Search. Hope it’s not too much work. I’ll let you know how it goes…

Posted in Technical stuff | Leave a comment

practice makes greatnesss…

I came across this article that discusses a but of greats (in sports and business), and I thought the last few paragraphs were very poignant:

For most people, work is hard enough without pushing even harder. Those extra steps are so difficult and painful they almost never get done. That’s the way it must be. If great performance were easy, it wouldn’t be rare. Which leads to possibly the deepest question about greatness. While experts understand an enormous amount about the behavior that produces great performance, they understand very little about where that behavior comes from.

The authors of one study conclude, “We still do not know which factors encourage individuals to engage in deliberate practice.” Or as University of Michigan business school professor Noel Tichy puts it after 30 years of working with managers, “Some people are much more motivated than others, and that’s the existential question I cannot answer – why.”

Maybe we can’t expect most people to achieve greatness. It’s just too demanding. But the striking, liberating news is that greatness isn’t reserved for a preordained few. It is available to you and to everyone.

Well, first off, I’ve never understood how Brady does that – he’s special. The article is dead-on, but one thing to remember is that some of the cases sited had horrible home lives. In large part due to their obsession to win or compete, etc. Of course, as with all things, some people are better at obsessing in controlled bursts than others. Tiger Woods comes to mind. The key to it is finding that switch, and being able to actual turn it off.

Posted in General | 5 Comments

netflix, finally…

First off, I like Netflix a lot. However, like most real companies, with customers and stuff like that, they can be slow to add fairly simple features. The feature I have in mind is pre-fetching. It’s not that hard to implement. Yes, I understand they a larger user base than 1 person, and they also have a large list of titles to sort through, but I don’t care.

It’s a simple feature, and you aren’t building the wheel — there are sites and 3rd party libs that help make this easier. Anyway, they finally have it, and it’s a big help. Still, this shouldn’t take that long… By the way, the depicted movie, MST3K: I Accuse my Parents, is pure genius.

Pre-fetch in Action

Posted in General | Leave a comment

and we’re back…

OK, so I’m back on the online, and attempting to be productive. I got the new machine with Vista Home Premium, thinking it couldn’t be that bad. Well, it’s not that bad, but it does have its quirks. The UI is cleaner and smoother, but this is expected. Especially with the hardware advancements as they are. The one thing that did strike me as odd was Microsoft’s new ‘take’ on shortcuts.

It’s not the kind of thing you want to figure out by trial and error at 1 AM. Luckily there’s something called the Internets (plural), and there are rumors on it. Anyway, Wesner Moise made things pretty clear. So now, in order to make the desired shortcuts, soft links: I right-click on the item, and ask it to create a shortcut. Then I move that created shortcut where ever I need to. Slight nuisance, but not enough to diminish the joy of having a powerful machine again. Oh, the laptop has a quality widescreen, which makes all my current monitors and the last laptop look like pure rubbish (nothing like a side by side comparison to point out differences).

About 2 weeks behind on both active side projects, and I still need to upgrade my Hibernate-Acegi implementation to Acegi’s new ACL service paradigm. More lessons learned (1 and 2), and we’re back.

Posted in General | 2 Comments

worst shipping company ever…

Today was the first day I’ve ever written an angry letter (OK, paragraph) to a company (Dell, about my new laptop). The reason was not the company itself, but the shipping company, DHL. I will keep this short, a simple shipping transaction I’ve done thousands of times via UPS or the United States Postal Service, is not so simple when DHL is involved.

Three day ground shipping of a 13 lb. box, signature required. OK, if one of the other two shippers were doing this, they’d have a neighbor sign, or allow you to sign the post-it they left the first time. This would ensure someone would sign, and everyone could move on with their lives.

Not so with DHL. During call #1, a customer representative tells me that this is not acceptable, and that I have to personally sign for it (she says per Dell’s request). Being that the courier just left the note at 10:13 AM, and I work minutes from home, she agrees to tell the driver to come back, that I will be home to sign. I leave work and wait at home. Two hours pass and I realize that maybe I wont be able to return to work today, but at least something will come out of it.

After my third call to DHL, a representative lets me know that this was never a possibility. The reps have no direct contact with the courier, and that he was already done for the day (this was about 2 PM). I ask if he will attempt the delivery tomorrow? She says yes. Alright, no problem.

Next day, I wait at home, and around noon I begin to wonder, “where is this guy?”. Maybe his routes a bit heavier today. OK, but based on the incompetence and imaginations I witnessed yesterday, I thought I’d better check. So, I make call #4 at about 1 PM, and asked the representative if she knew if the courier was near (I actually planned on going into to work, albeit for only half a day). She did not (no surprise), but she did say that for 2nd attempts, it’s usually done between 2 and 4 PM. Oh, OK. I wont make it into work today, but at least something will come out of it (well, maybe).

Obviously, by this time, DHL has not only lost my trust, but caused me to lose my patience. So, I am checking the status of the package every half hour. Quarter after 4 PM, and I see an update. What’s this? Place of business closed, will try next business day. Ummmm, I’m in a residential area. Wait, wait. Did the courier just go to the wrong address, even though my address is on the box? Nice.

OK, so I call the customer service again (call #5), and wonder if I am reading this right. Did he go to the wrong address? She is sorry, but basically can only direct me to pick up the package myself, or wait. I decide to end the charade. But I’m also compelled to let Dell know that I never want DHL to be the courier ever again.

After I let off that letter (paragraph), I Google "worst shipping company". Surprise, surprise. DHL’s at #1, #2 and #7 on the page one results. Along with companies I had never heard of. DHL’s been around for over 30 years… why are you this bad?

Posted in General | 3 Comments

that’s great advise…

No matter how strong you think you are, no man (person) is an island. In your everyday life, you need some form of guidance. This is regardless of whether you are a religious person. From time to time, you need an external verification source — a sounding board. To be specific, an adviser. A person who can take your input, preferably along with some experience, and give you (a) possible solution(s). Some people are great advisers, while others are horrible at it. Here are some of the types I’ve met (rough categorization and not an exhaustive list):

The Trouble Maker

This adviser likes to say things that will most definitely bring about trouble. If smart, they’ll word the advice in a leading fashion. Implying just enough for you to make the real trouble yourself. Hence, free from later incrimination. They like saying things like “I never actually told you the bear cage was empty”.

The Opposer

Also known as the Iconoclast, this adviser simply opposes your core ideas. This adviser is rare, but if you find them, they’re difficult to deal with. Moreover, they’re kind of crazy. They may or may not understand the situation, but based on keywords that trigger certain emotions, they go off.

Me: I got a job offer from the local NAFTA branch.
Opposer: NAFTA? Don’t they touch kids?!

For the record, I don’t believe that any member-nation of the agreement overtly(?) harms children. However, I do believe that members of NAMBLA do. Note: the Oppposer didn’t know the difference between the organizations.

The Agree-er

This adviser will basically agree with any possibility you present. They’re basically useless. Some smart people do this so you’ll never bother them again. While the others are afraid to be perceived as a Trouble Maker or Opposer, they simply go with whatever you say.

The Reasoner

This adviser is the best, and for that reason, the hardest to come by. This adviser usually has a good amount of knowledge, and the ability apply it: wisdom. This adviser calmly takes things as they come, and puts them in perspective. Weighing the possibilities, and usually returning a feasible solution. Although great advise, it can be the hardest to take. The reasoner may find you at fault, or may suggest something crazy like humility.

Someone’s missing

In the end, let’s not forget the most important actor, the advised, you. All the best advise in the world wont necessarily save you. Along with deciphering the good advise, from the bad, there’s proper application. Intuitively, you should have known better than to go into the bear cage (see Trouble Maker). Adapting is key, after that NAFTA and kids line, never approach this person for advise again! Like I said, you need an external verification source. Not someone to make decisions for you, but to reign you in when you’ve gone or are going off track.

Posted in General | 4 Comments