Sunday, March 11, 2007

But is it news?

It seems like the news organizations in the recent years have lost track of what is actually news. They produce stories about a small group of self-centered, egotistical, media-created starlets. I'm talking about people with names like Paris Hilton, Anna Nicole Smith, Donald Trump, Britney Spears and Michael Jackson. I really don't need (or want) to hear the minutia of their life. More importantly, how is every detail of their lives news? Sorry, I don't think Paris going to the supermarket and acting like fool is news.

Perhaps, the news organizations should vet their stories a bit differently. I propose a "news worthiness" test. The test to see if story is news would be to temporarily change the person in the story to your next door neighbor. If it is still worthy of reporting, then the article is news.

Friday, February 23, 2007

Word 2007 Table Woes

Last week, I converted over to Word 2007. As part of my work, I review use cases for an upcoming application. The text of use cases are all in one table that spans multiple pages. (Yeah, it's not very pretty, but that's what people thought looked good.)

I've been periodically having display problems with Word 2007. I'll be typing along in one of the cells, and suddenly the screen will flash and part of the table (including the text I was typing) is gone. By gone, I mean no longer in any part of the visible document. It doesn't matter whether I'm typing in draft view mode or page layout. I can get the text and table back by undo. The issue seems to also be related to where the page break is in relation to the visible document. Because I can scroll the document up and down, and it doesn't have any problems. However, if I don't scroll, I'm back in the Word twilight zone.

So… you have been forewarned about tables in Word 2007 (12.0.4518.1014).

Word 2007 Access

I think I have Word 2007 setup to access my blog. Let's see if this actually works…

Wednesday, December 07, 2005

Ajax

I've been reading lately several blogs from people mentioning the promise of Ajax. It seems to be rating very high in the "coolness" category. Of course, I don't believe the people who have been writing have actually delivered a significant application. So, I'm a bit skeptical about all the hype.

Background
Several years ago, before .NET and broadband connections, I created a web site that delivered streaming audio to a Windows media player embedded in the browser page. It made extensive use of Javascript to control the player. Since only some people had high speed internet connections, there where 2 different audio sources for each song, a low-bit-rate and high-bit-rate version.

The project was a learning experience. Here's some of the JavaScript issues that I discovered:

  • JavaScript has slightly different implementations between browsers.
  • Each browser has a slightly different DOM that means you must do browser detection and modify some code.
  • On some browsers, I discovered some precision errors when doing simple math.
  • There no one tool for easily testing JavaScript code against different browsers.
  • Lack of types creates big problems as the code base gets larger and you need to refractor code.
Suggestion
Instead of getting on the Ajax bandwagon, I think I'd get on the .NET smart-client wagon. Here's specifically what I mean:
  1. Write a web service with .NET that supplies business logic/data.
  2. Write a .NET Windows form application which provides UI but uses the web service for the business logic/data.
  3. Host the Windows form application on the web site and provide a link to it.
It's really not that different from the whole Ajax concept. The only difference is that you have a real application providing UI instead of a browser. You get a typed language with a consistent execution environment, and a strong toolset for application creation.

Rebuttal
Yeah -- I hear those people who are scoffing because it won't work for Apple and Linux users. They seem to be the not so silent minority. In the last 4 years, I've run many, many web reports and have paid close attention to browsers. In the "real world" Apple and Linux users hitting any web site I've created has been < 1% of the entire traffic.


I realize that users will have to have the .NET framework installed. I don't see that as a major issue. On the web site, a link to the .NET framework could be provided with instructions to install it first. Since that's just a one time installation, I think that is not a major issue with most users. In fact, the browser web traffic that I've seen shows that a slight majority of the users already have the .NET framework installed. As more and more applications are created using the .NET framework, I think some day soon, its going to be a common assumption that most users will already have the .NET framework installe.

Tuesday, September 27, 2005

Pointers vs references

C++ coders seem to overuse and abuse pointers. Frequently, they really should be using a reference instead of a pointer. It would definitely simplify maintaining code. For instance, I am going to create a method and have 2 options for the message signature:

void AClass::MyMethod(AItem * pItem)
or
void AClass::MyMethod(AItem & oItem)

In the first one, if I need to make changes to the code at a later date, what do I have to worry about? Well, what it pItem. Is it really, really an object or can it be NULL. Now in simple projects that's not an issue. You can hunt down all the places where MyMethod is used and decide how it is used.

However, in professional projects that have a million lines or so, that is not really an option AND it's not productive. It's not an option because there are just too many code pathways to conclusively determine the usage.

Some coders say, "Yeah, well I'll stick an ASSERT at the top of the method and everyone will know how it is to be used." The problem with that is in development it works fine and is fairly easy to catch issues. However, at runtime, that check goes away. If there is an error path that causes the pointer not to be set, execution falls into the method and real wackiness ensues.

I say if you meant for the method to have an object passed in, code it that way. By using the second method signature, it is unequivocal what the code meant. Plus, you don't get legacy methods where in parts of the method has:

if (pItem)
pItem->DoIt();

and then other parts of the method you get:


pItem->DoIt();

I wouldn't mind maintaining code, if the people who originally wrote it would write easy to maintain code.

Friday, April 08, 2005

ImageList woes

Ah, it's that time again... It's been about three months and time for the ImageList issues to strike again. Redmond loves to talk about how difficult it is to create software that meets users expectations for correctness.

Guys let's face it. The reason why us users have such demands is because you are unresponsive at fixing defects. The ImageList has been cobbled since day one. It should have been fixed at least in a service pack, but obviously that's not where Redmond is pushing its customers.

If you weren't going to fix the ImageList, at least make it unsealed so we could derive a class from it to workaround the problems.

Monday, November 08, 2004

RPC voodoo

It's easy to blow off your data structures class as a weed-out class. There are lots of structures to learn and not much relavancy. Who really needs a linked list after all. You can get by with a dynamic array and some good index management.

The system I work on took that approach with its RPC APIs. The server passed back arrays of structures that were the size specified by the client. That way the client could statically allocate a buffer array and the server could fill the array. The server also passed back how many records were really legitimate. It has worked fine for many, many years.

Last week, I did some remote lab testing. Remote lab testing is where the server is sitting in another state from the client and has a DSL internet connection. Usually the server is sitting 5-10 feet from the client in the lab on a 100mbs network. One word to describe the situation - "Ouch". Performance really stunk.

So, based on the numbers, I tracked down the issue. Frequently the client was allocating a 10K buffer. So, even if there was a few records of 200 bytes (or so), the server would return an array of 10K. Something like 90% of the response was garbage.

Unfortunately, the server really doesn't know how many records are going to be returned because it is just reading information from a dynamic database cursor. So, I bit the bullet and changed from an array returned to a linked list of structures. Only valid data is returned. Performance improved greatly! In certain cases, results that used to take 1 second are returned in 0.1 second. Cool!!!

Lessons learned...

  1. If you use a client/server design, always have a development lab configuration that can duplicate real world/word case environment.
  2. Becareful with arrays, they can lull you asleep with a false sense of security.
  3. Data structures (specifically linked lists) are your friends. Yeah, they make you think, but done in moderation it's not too bad.

Tuesday, August 17, 2004

XP SP2 woes

I just wasted one entire day trying to upgrade to XP SP2.. Lots of problems (most of them software related).

After installing SP2...

1) Logging in took 5+ minutes before you would get the taskbar.

2) Frquently the Windows explorer application would freeze up for 2 minutes.

3) The upgrade disabled Norton AV 2002.

4) One mysterious system reboot.

5) One error reported back to Microsoft do to (Explorer) application crash.

In the event viewer, I was seeing frequent DCOM errors in the System folder. Most of them about a server not registering with DCOM in a certain amount of time.

Then there's the XP SP2 support problems...

I left an email support ticket in the morning. (Like that does anything.)
Tonight I tried the SP2 phone support. I talked to a woman who had a seriously foreign accent. She took my information and put me on hold several times. Finally, she tried to put me through to a technician. She was unable to do that. She corrected me when I asked her "So what good was the being on hold for 20 minutes do?" She informed me that I was on hold for 27 minutes. I would need to send an email support ticket none-the-less. So... why do they even bother answering the phone?

I go by the three strikes and your out. I tried reinstalling SP2 three times. All three times gave me the same problems. The last time, I had even uninstalled NAV. So, I'm done with SP2. I'll wait for SP3 (and I strongly suggest you do too).