HomeDigital EditionSys-Con RadioSearch Java Cd
Advanced Java AWT Book Reviews/Excerpts Client Server Corba Editorials Embedded Java Enterprise Java IDE's Industry Watch Integration Interviews Java Applet Java & Databases Java & Web Services Java Fundamentals Java Native Interface Java Servlets Java Beans J2ME Libraries .NET Object Orientation Observations/IMHO Product Reviews Scalability & Performance Security Server Side Source Code Straight Talking Swing Threads Using Java with others Wireless XML
 

Every time I come around to writing this, I have this fear: What the hell am I going to write about? Then I sit back and have a think of what has happened in the last month and what is likely to happen in the forthcoming month and something usually presents itself. Fortunately, Mother Nature has something quite exciting up her sleeve for me to touch on this month, so I thank her for that. This is the month of the eclipse of the sun no, nothing to do with McNealy and associates. This is the SUN.

Last month I was all excited with the afterglow of JavaOne. If I droned on a bit too much about that, don't worry. This month will be JavaOne free. Doh! I've just gone and mentioned it there. Sorry....Sorry.

So what has been happening this month? Well, we've been having lots of fun with Java and Microsoft, and have also seen the launch of the UK's first Java Servlet hosting ISP. But before all that, let me tell you about my new wee toy.

Yes, I am very excited. For years I've been fighting the urge to get a portable computer. As you know, I do quite a bit of traveling. This very article has been penned on a variety of people's computers. I even had to resort to the old pen and paper on one dark occasion. I'm a bit like the magpie in that respect. Not having a nest of my own, I tend to flock to others for such "nest" requirements. The resistance has been for any of a number of reasons. One, I was never a fan of the size of them. When you're walking about, it's always obvious that you're a "carrier," and this never really appealed. Considering the career path I've chosen, I'm not a big fan of the technology gadgets in which we insist on entrusting more and more of the responsibilities of our daily lives. Besides, if I had a portable, others might be under the illusion that I actually do coding on the move. I don't think so! I don't even wear a wristwatch. Never found the need for one.

Of course, I have gone through all the fads of personal organizers my desk drawer is a testament to that. Therein lies a graveyard of old Psions and Apple Newtons, and there's even an old Casio address book knocking about. But I get bored with them. Sure, it's a great novelty to carry these things around, and let's be honest, there's a certain street-cred to be had when displaying your wares in the high street or office. When I had my Newton, it was a great way to talk to people as they would come up in bars and restaurants and go ooh and ah.

But more recently, as my company grows and expands, I find myself doing more and more documentation, and keeping on top of e-mail has become paramount. So the need for a portable PC raised its ugly head again. I had a look around at the current offerings, and not a single unit caught my eye. I was still bored! But then I remembered a machine I spotted in Tokyo last year and thought, How cool is that? It was the Sony Vaio PictureBook, the one that's half the size of normal portables and has a camera built into the top of the screen. It only recently became available on the market, and when it did, I was bowled over by the price of it: so cheap. So I ordered one, and a couple of days later it was delivered. I love it. It's a full PC with Windows 98 and has my entire development environment on it with all my documentation tools. But it's small, with a keyboard just the right size. Any smaller, it would be awkward to type documents of any real size. It's no bigger than the Apple Newton, so I can carry it about with my other crap without the need for a separate "Targus" bag.

Excelled...
My developer's background is with the early Windows API. For reasons best known to me at the time, I wanted to be a Windows programmer. I wanted to create great programs that would blow people away. But I was constantly frustrated about why official Microsoft products always ran better than mine and seemed to have access to features I couldn't find any documentation for. Then I discovered the ancient art of the undiscovered APIs.

An experienced developer who mentored me took me through some of these real beauties that aided and abetted my cause. Well, this was a practice I assumed was being downplayed as I moved through the Java community. After all, we've heard many of the big software vendors complain about Microsoft's undocumented APIs, and how this unfairly creates an uneven playing field. But being solely in the Java universe, this is an argument I've been able to follow as closely as anyone would want.

But my company has been involved with a project that called for some of this knowledge. One of our requirements was the ability to read an Excel spreadsheet file and be able to manipulate it. I had performed something similar many years ago under Windows and C, and recall having lots of wonderful fun when trying to write an Excel version 4.0 file.

So it was with a certain amount of trepidation that we ventured into the world of writing a class that could read Excel 97 files. As the first port of call, we researched the Microsoft site, looking for information on the structure of these enigmas. At first call it seemed rather easy. All the information seemed to point toward a rather simple HEAD/DATA record format. You simply read the header information, which then paves the way for the layout of the data section.

Simple. Creating a Java class that could perform this didn't seem too problematic. After creating a core structure that would iterate through all the records in a file, we felt confident we would have this one done 'n' dusted within a couple of days. Well, you know the feeling you get when you're coding, that what you're working on is a work of art. It will run first time and the optimism you feel allows you the luxury of a false sense of security.

We compiled and then ran. Failed! Not a single record was read. Ho hum, guess we must have missed something silly. Looked through the code; nothing major was highlighted. Must be something we missed, but nothing obvious was coming forward. Feeling a little discouraged, we resorted to opening up the original Excel file with a hex editor to see if we could read it manually.

Nothing looked familiar. But after, say, the first 512 bytes, the format looked characteristic of what we were looking for. So we modified our class to skip forward the necessary bytes and lo and behold! The code started to churn out Excel records. But then it failed as it approached the end of the file. How frustrating.

Nothing in the Microsoft documentation pointed to or even hinted at this strange behavior. We looked through the postings in the newsgroup via what has to be the best research tool in the world: www.deja.com. We found many others that shared our problem, and even one guy who said, "Oh, you don't want to be doing that." Very helpful, thank you.

The problem seems to stem from when we encounter a worksheet boundary. From there on in the file becomes unreadable. We're still unable to read multiple worksheets, and at the present moment we have a class that reads a single worksheet. If anyone has successfully unlocked the secrets of the Empire's Excel spreadsheet, please don't hesitate to e-mail me. Would love to hear from you.

We of course tried to e-mail Microsoft with our query, and what a well-invested effort that turned out to be! Having e-mailed a number of Microsoft channels, it's now the third week and we've still heard nothing. If anyone from Microsoft reads this column, please get in contact with me, as I would love to discover how developers are to get through to Microsoft. The likes of Sun and Oracle have opened their doors to developers, and I am wondering whether it's a case of not knowing where this mythical door is located, or does the door, like the mythical Scottish town Brigadoon, appear only every 100 years. Answers in an e-mail, please.

Mailing List
I'm sure we're not the only ones to have hit this sort of closed-door syndrome. How many of you have had to wrestle with other Microsoft formats? I'd love to hear from you. Come and chat on our mailing list and share your views with the rest of us. To join, send an e-mail to listserv@listserv.n-ary.com with subscribe straight_talking-l in the body of the e-mail. From there you'll get instructions on how to participate on the list.

Reader Profile
A wee while ago I briefly touched on the makeup of you all and recounted the weird and wonderful places in which you've been reading this fine piece of literature. Well, many of you have e-mailed me with some strange places, and I think the current leader in this rather unique field has to go to Giuseppe Persiani, an Italian Java developer. Giuseppe e-mailed me about a number of issues I raised and then tagged on the bottom where he was when he first read this column. It was just before he saw his daughter for the first time on an ultrasound in a clinic. Whoa. I assume, of course, that he took JDJ in with him. I can't imagine JDJ forming that pile of communal magazines we all nervously thumb through while we patiently wait our turn. If I'm wrong and it was, what a cool clinic! it gets my vote.

Speaking of that, we live in a farming community and the types of magazines we have are Farmers Weekly and Scottish Farmer. What sorts of magazines are available in the deepest Silicon Valley clinics? Would love to know if any techy journals are among this pile. Let me know, please.

Salute of the Month
In this article I'd like to take my hat off to someone who over the last month has gone above and beyond the call of duty. This month I am going to stay at home and salute two of my developers. I had disappeared way up to Glasgow for the weekend, and came home late Sunday afternoon to discover the office open.

I thought, hmmm, how strange. I wonder who's in today? I then proceeded to enter the premises and discovered Keith and Murray working away, developing Java. It was a hot Sunday afternoon, and we had a project that looked as though it was going to overrun. These guys had the forethought to try to get a lot of the work done earlier as opposed to leaving it to later. To celebrate this act of foresight, we then proceeded down to our local for an evening's drink or two, and it turned out to be a very good night. So Keith and Murray, I thank you.

Book Review
This month I finished the story behind Netscape from Jim Clark. It was actually a very short book when all is said and done, and most of it was filled with the observations of Jim Clark comparing Netscape to the way his old start-up, SGI, ran. It was a very interesting read, and it really opened my eyes to the history of Netscape. My only criticism is that it didn't go into enough detail. This was another book about a company that suffered from having no sales, then you turn a page and they're suddenly having millions of dollars worth of sales. Most frustrating. Again no explanation of how they grew that side of the business, and no information on how bagging that first revenue check really felt. Are these people becoming complacent and forgetting the simple joys of starting a business? I know that from my point of view I'm more interested in the early days than how they are battling the likes of Microsoft. Would love to know how these chaps operate around the birth of a company. That said, excellent book, and highly recommended.

. . .

Spending time with some of you Americans is beginning to scare me and more important, affect me. I've found myself saying "I guess" an awful lot more. I can't seem to catch it in time, and once it's out in the open you have to run with it. But inside I'm kicking myself, and mentally noting not to say it again. So before I'm tempted to utter it again, I shall bid you farewell, and look forward to speaking to you next month.

Have a nice day y'all! Nooooooo!

Author Bio
Alan Williamson is CEO of n-ary (consulting) Ltd, the first pure Java company in the United Kingdom. A Java consultancy company (www.n-ary.com) with offices in Scotland, England and Australia, they specialize solely in Java at the server side. Alan is the author of two Java Servlet books and contributed to the Servlet API. He can be reached at alan@sys-con.com

 

All Rights Reserved
Copyright ©  2004 SYS-CON Media, Inc.
  E-mail: info@sys-con.com

Java and Java-based marks are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries. SYS-CON Publications, Inc. is independent of Sun Microsystems, Inc.