Archive for the 'General' Category

Song(s) of the day - 06/14/2008

Songs because the video is multiple songs sung by Frank Sinatra and Antonio Carlos Jobim but the song I want to bring attention to is the “Girl From Ipanema”.  This is a clip from Sinatra’s 1967 television special A Man and His Music + Ella + Jobim when the Bossa nova craze in the United States was going full-tilt.

Sublime is too simple of a word to describe this music.   Sinatra’s crooning combined with Jobim’s guitar work and Portugese vocals on “Girl from Ipanema”  just ooze style and class. The tuxedos certainly add to the atmosphere. Just amazing stuff.

I have to say though that it’s still shocking to see Sintra dragging on a cigarette right on stage ;)

“Girl from Ipanema” kicks in at about 4:40 (total length of about 6:30).

Do I really have to…

…feel like complete shit when I get home from work every day?

Just asking…

Create one thing a day

All I gotta do.  Move the personal projects along one step at a time.

A creation a day keeps the doldrums away.

Want to be an artiste you gotta do the art.

Eclipse UI Elements: the Vertical Ruler and Overview Ruler

Maybe I’m blind but I’ve looked all over the Eclipse help files and there are references to both the “vertical ruler” and the “overview ruler” yet there isn’t an explanation as to what those terms mean.  Similar searches on Google don’t turn up anything other than Eclipse API references and the Platform programming documentation.  Those do explain what these items are but I think its kind of crazy that there isn’t an explanation right in the Workbench (or Java Editor) docs.  Here is what they mean:

  • Vertical Ruler - the vertical space on the far left of an editor window (next to the gutter that shows line numbers if you have them enabled) that area scrolls along with the content of the editor.  Markers placed here aren’t in view if the line they’re on isn’t in view.    For example: debugger breakpoint indicators are set here and scroll in and out of view as you scroll the editor.
  • Overview Ruler - the vertical space on the far right side of an editor window (to the right of the editor scrollbar). This area shows markers for the whole file being edited and it does not scroll along with the editor window.   This area is used to place markers for such things as errors and occurrences of methods, etc.  For example: this allows you to see approximately where all errors occur in a file.  If you click on one of the indicators it will move the editor to that specific line.

Not earth-shattering information but useful nonetheless ;)

Song of the Day

Enjoy!

Storing JasperReports in a database using iBATIS and Oracle 10g

I’ve used JasperReports in two different jobs now to provide reporting services for clients of the various web applications I’ve worked on. My first experience definitely turned out to be a great learning opportunity.

It was a great opportunity because I learned what not to do when designing a web-based reporting system the main lesson of which was:

  • Don’t store report defintions on the file system.

We experienced a lot of deployment headaches in the clustered application server environment that was provided to us because we were not provided any sort of shared file system for application assets such as reports. Each application server in the cluster only had access to it’s own file system.

This article shows how I solved the file system issue by storing JasperReports report definitions in a database. I’ll assume familiarity with the iBATIS “ORM” database framework since I am not showing a full iBATIS setup here.

Part 1: Oracle Setup

The first thing that I did was get my database tables in place. Our needs were pretty simple and I created two tables: one, REPORT, to hold the various pieces of information about the report such as the name, description, and ID and another, REPORT_XML, to hold the actual report definition. These are tied together via a foreign key on the ID column of the REPORT and a REPORT_ID column on the REPORT_XML table. The most important piece of information here is the choice of the datatype to hold the report definition.

To allow easy creation of reports we are using the iReport visual report designer and saving the reports in the JRXML format. I didn’t see any benefit to compiling the definition and putting that in the database. With XML it makes the report definition fairly easy to read and very easy to parse should that be necessary. With that in mind I chose to use the CLOB type in Oracle.

CLOBs are good for storing large pieces of character data and they are handled effortlessly by iBATIS since the only thing being passed in to the library are String objects. As of release 10g of the Oracle JDBC driver there is no longer a need to use the extensions that Oracle provided for dealing with CLOBs (oracle.sql.CLOB) in previous releases. The only requirement is setting a new Connection property, SetBigStringTryClob, to true. When this is done the String being passed in to a PreparedStatement (or to a ResultSet for data coming out of the CLOB column) is inspected to find it’s size and if its over 32k a different call is made, to an OraclePreparedStatement object, to set the CLOB value properly. This is handled transparently by the driver.

The iBATIS and Java Code

Let’s take a look at how this works. Here is an iBATIS XML snippet to handle inserting a report definition into the REPORT_XML table:

<insert id="addReportXML" parameterClass="map">
  insert into report_xml
  (id,last_modified_date,last_modified_by,description,report_id,xml_def)
  values (#id#,sysdate,user,#reportId#,#reportId#,#xmlData#)
</insert>

There is no special CLOB handling here. We are just dealing with standard types.

Here is the code in my DAO object that is calling the insert statement above:

private int addReportXML(String reportId, String xmlData)
{
 
  IdManager idMgr = IdManager.getIdManager();
  Connection connection = null;
  int result = 0;
 
  Map paramMap = new HashMap();
  paramMap.put("id", idMgr.getUniqueId());
  paramMap.put("reportId", reportId);
  paramMap.put("xmlData", xmlData);
 
try
{
  result = this.getSqlMapClientTemplate().update("ReportConfig.addReportXML", paramMap);
 
} catch (SQLException e) {
 
}
 
return result;
}

In my actual code I do have exception handling code in the catch block above ;) I am just trying to only include the important stuff here and for this posting database error handling isn’t important. I also left out the connection handling.

IdManager is just a class that will generate a unique ID string based on various bits of system information. We could use a sequence generator in the database as well the the ID generator works better for how we deploy our applications.

This code is obviously pretty straightforward. The only thing we are doing here is passing in a String that contains the full XML as well as the report ID this report definition corresponds to. Java Strings can be very large (char array indexed by an integer) so you’d have to have an awfully large report definition to reach that limit.

Just note again that we are only dealing with standard types here. There is no special handling being done by either the Java code or iBATIS. All of the heavy lifting is being done internally by the Oracle JDBC driver.

That is pretty much it. There is nothing special that needs to be done to store the JasperReports report definitions in the database. Had I known on the first project that it was this easy I certainly would have done it this way ;) It is better by far to centralize the storage of the reports when deploying in a clustered environment. It allows easy deployment and updating, easy backup and recovery, and easy access. How can those be bad things? :)

Perhaps the ultimate GTD tool?

The Livescribe Pulse Smartpen.

Not sleeping…just thinking :)

I posted here today with the subject ZZZzzz… and indicated I was going to be taking a break for a bit.  I decided soon afterwards to remove that post and continue posting.    I have my reasons for such an abrupt change.  Worry not fearless reader (the few of you out there)…. I’m still here ;)

All that is necessary to be a saint is to want to be one

But Lax said: “No, All that is necessary to be a saint is to want to be one. Don’t you believe that God will make you what He created you to be, if you will consent to let Him do it? All you have to do is desire it.”

So says Thomas Merton in “The Seven Storey Mountain”. I ask “is it really that easy”?

I’m not a religious person by any stretch of the imagination. Spiritual yes, but not religious. So in reading this book by Merton my eyes start to glaze over when he starts expounding the virtues of religion and the necessity of faith in God to complete one’s life. Having said that if I try to take a broader view a more interesting picture begins to take shape.

I’ve had enough experiences in my life that proves, to me at least, that there is some “higher power”. I don’t necessarily believe that higher power is God, or resembles God in any way. I don’t think this higher power is watching over us and I certainly don’t think this higher power cares about my sins. But I do think this power is available for us to channel when we need to which is why I’ve found this passage by Merton so interesting.

Is it really that obvious that by thinking about something you can make that thing happen? Is simply asking for it enough? I’ve tried and it has worked in the past. I’ve asked for proof and been given that proof but somehow I always struggle with these ideas. What, in the words of Merton, did God create me to be? How do I figure it out?

In my current situation in life I struggle a lot. Something doesn’t feel right and I feel disconnected, without purpose. Is the answer simply to stop struggling, ask for help, and just be?

Sayonara U-verse…it’s been a slice

“So when are you actually going to do something about the noise the Tivo is making?” I’d only been talking about fixing the whining hard drive in the DirecTivo for about a year and my wife was reminding me again that I’d been talking about doing something about it, well, for a year. “Soon” I said. “But the places that sell the drive replacements online aren’t exactly cheap and we’ve got a bunch of other stuff coming up that are a higher priority.”. But damn that whining was annoying.

Coincidentally I was talking with a friend, Brian, about AT&T and their U-verse product because at some point they’ll probably start working on fiber-to-the-curb like Verizon has been doing with FIOS. I had checked the U-verse page quite awhile ago to see if it had been available at my house and at the time I was out of luck. I checked again though right after I finished talking with Brian and it turned out that U-verse was available at my house. Even more shocking was the fact that I could get the system installed the next day if I wanted. I signed up for an install and thought I was saying so long to DirectTV.

Let me talk about DirecTV for just a moment because I’ve had their DirectTivo service almost since it was first available. The price has always been right, the programming selection has always been good, and I’ve always had good results with their customer service. The two strikes that they always had against them, even though both happened only sporadically, were rain fade and snow on the dish.

Rain fade, in most storms, affected almost every channel but the local channels I was receiving via DirecTV. During a big storn, that could be miles away from us but still between us and the satellites, we’d lose every channel that wasn’t on a spot beam. A spot beam is how DirecTV broadcasts your local channels and the signal area is much tighter than the general signal and generally much higher power. In the worst storms we’d lose those as well but most of the time they were OK.

The other big hit was snow build up on the dish out in our backyard. Simple enough to clean off but in any significant storm, and we had a lot of those this past winter, it is a drag to have to trudge out in the snow to brush off the damn dish to be able to watch TV. Admittedly this hasn’t been too much of a problem but it was really annoying this past winter. U-verse had the promise, like cable TV, of no rain fade and no concerns about snow. Enter U-verse.

For $60 We’d get more channels than we had with DirecTV. We’d also get a DVR unit that would record up to four standard definition (ie: regular TV) shows at once which is great because we don’t currently have HDTV. With the DirecTivo we’d had only 2 recordings at once as a possibility. Oh, and not contracts. I wasn’t really sure what else to expect aside from those things but it sounded like a good trade-off so that is why I ordered the service.

The serivce guy shows up. He does a nice install job. The new wiring required for the DSL line was very cleanly done. He didn’t ask me where I wanted things installed but he was a nice guy and did a nice job overall so I really didn’t care much. I could always move it myself. When he left I had an upgraded DSL circuit with a bit more download speed and a significant boost in upload speed. I had a new router which I wasn’t too happy about initially since I really like my Linksys WRT54g but since I didn’t have a choice and hadn’t explored the 2wire unit that was installed yet it really wasn’t that big of a deal.

I also had the DVR unit upstairs which was connected to the 2wire “Residential Gateway” in the basement by coax cable. The installer had it easy because the only thing he had to do was disconnect one of my two wires coming in from the DirecTV dish outside and hook it up to the 2wire gateway device. He didn’t have to cut anything since the installer for DirecTV did a great job way back when I had DirecTV service first installed. The AT&T guy only needed to unscrew the coax from the grounding block on the wall for the satellite and screw it in to the gateway device. The other end only needed to be unscrewed from the old DirecTivo unit to the new U-verse DVR. Pretty simple stuff.

So how is the service? Pretty good.

  • The picture quality for standard definition is better than what I was getting with DirecTV.
  • How can you complain about 4 recordings at once? T
  • The system is snappy and channels change quickly.
  • Since the system is integrated with DSL I can access some AT&T Yahoo! stuff pretty easily like
    • My Flickr account and all the photostreams in it.
    • Some AT&T Yahoo! games.
    • Via the “U-bar” my local weather, stock portfolio, etc.
  • Video on demand which we didn’t have with DirecTV.
  • You can program recordings and delete old recordings remotely.

So I’m speaking in the past tense here about DirecTV yet the title of this post is bye-bye AT&T so what gives? Well, the initial honeymoon was short lived and my wife and I quickly started to not like the service. We had three major complaints with the service that caused me to go crawling back on my knees to DirecTV (well, not really but I’ll talk about that in a moment).

  1. We lost the ability of the the DirecTivo to have two shows being buffered for playback at the same time.

    The DirecTivo has two physical tuners built in and via the remote control you could switch between the two. Want to have the local news buffering in the background while you watch something else and then, during commercial breaks in the important show, go back and scan the news? Easy as pie on the DirecTivo. Switch each buffer to a different channel and you’re set. All of this without having to worry about recording something. Turns out losing this feature is one of the biggest complaints people have about the newer, non-Tivo, DirecTV DVRs as well. More on that later.

    With the AT&T unit any change away from the channel you’re watching clears out the buffer. The scenario I laid out above simply isn’t possible and quite frankly that was a show-stopper. The unit even clears out the buffer of the currently watched channel even if you stay on that channel but watch something that has already been recorded.

  2. We lost the XM music channels that are provided by DirecTV.

    You might think I’m nuts but that was a big deal for me. I’m a classical music freak and I listened to the XM classical stations a lot.AT&T, which apparently provided Music Choice at some point and which I had with DirecTV before (maybe it was Dish), switched their music to URGE which, quite frankly, sucks. The classical selection really stunk. Based on reports I’ve read on various U-verse-related forums I was not the only person not happy with those music channels.

  3. No FitTV.

    Laugh if you will but it is an important channel for my wife.

    The thing that was odd was how AT&T had their programming. FitTV was actually available with their U Family package which was the low-end offering. It wasn’t available (along with others) in the next two tiers, U100 and U200. U200 was the offering I chose for $60 a month. It was available in the U300 tier which is an extra $20 a month but includes some movie channels.I don’t give a damn about movie channels. I’ve tried them multiple times with DirecTV and always end up dropping them because they play the same stuff far too often to make it worth my money.

    I can’t understand why FitTV wasn’t in the U200 offering. It seemed very odd since almost every other channel is included in that tier aside from the movie channel offerings.

Given those things I wasn’t too comfortable sticking with AT&T for TV service and decided to hightail it back to DirecTV and hope they’d take me back (OK I’m exaggerating..I hadn’t canceled my service yet).

I called DirecTV last Tuesday, less than a week after having U-verse installed, to cancel my account. Not surprisingly they offered me incentives to stick with them having been a customer for so long. I was offered $10/month off my bill for a year plus a new DVR unit for free. The DVR upgrade means I will be sticking with DirecTV for another two years but I guess that is OK as I’ve been with them for six years already ;) Given the issues I wrote about above I accepted their offer. Last Friday I received the new DVR unit, an R15 model, via second-day FedEx and hooked it up.

A bit later I will post about the R15 and the annoyances we have with it but I’ve got XM back, my wife has FitTV back, we still have two tuners, and life is good. Oh, and DirecTV added the ability to at least set up new recordings remotely. The feature isn’t as good as what AT&T offers but it’s close and very convenient.

Overall the AT&T service was pretty good but some issues were just too much for us to overcome. I’d actually recommend the service to other people if they didn’t care about the types of things I outlined above. The price is fair, there is no contract, and you get good DSL service too boot.

Next Page »