Category: General
Posted by: x mar

Subtitle: Good Engineering is so much harder than doing mediocre science

I had been spending hour muddling around with the scrollviewer I was customizing. Days ago, I customized a stand alone scroll bar. That took me over a day. But that was a much extensive customization, with a 3D appearance everything. Besides, that was the first time I've ever tried to customize the appearance of a control, with WPF or not, with Windows or not.

When I proudly presented that flashy custom scrollbar during a group meeting and was not shy in admitting how long it took me to do that. "Next time, it will be only two, three hours for me to do something like this", I concluded.

Other than the fact that the scroll bar is embedded in a scrollviewer, the customization itself is much less extensive this time. Surely I can have it done in a couple of hours, so I thought.

A couple of hours into the task, things seems goes well, albeit it's not completely a smooth sail. All the code seems to be in place. The only defect is that the thumb was yet to show up. "It must has something to do with the z-order, opacity, or things like that. It shouldn't take more than a few minutes to fix it." So I thought. But subconsciously, I started to feel uneasy.

Unfortunately, my subconscious thought turned out to be correct. As I seep through my code, nothing seemed to be responsible for the obstruction of the thumb. Minutes turned into hours, I see no end-of-the-tunnel light.

Of course, "Give up" is not in my vocabulary, so I perservered. I tried every approach, from within the reign of logic analysis to the use of brute force trial and error. But my beloved little thumb of the scrollbar refused flat-out to show it's face.

It was deep into the overtime. Although Fatigue was yet to be a serious problem, I do have a deadline to meet. I will be demostrating the prototype in less than two weeks. So I decided it was time to leave the imperfection and move on, to added the content to the scrollviewer. So did I. Then I ran the program to see the effect, and I was surprised with what I saw. The scrollbar all appear as it should appear. The problem I had been so desperately seeking a solution for never even existed!

Category: General
Posted by: x mar
Nearly five years ago, The Old New Thing talked about windowless control in this blog. One reader fantizied about a windowless control development frame work: "It would be nice though if MS came up with a solution that would enable their developers to accomplish the same thing as the IE team, instead of just keeping it to themselves." Just at about the same time frame, I migrated away from visual studio 6. I was upset that Visual Studio 2005 took away the ability to creat windowless control.

05/11:

Category: xz@localhost~>
Posted by: admin86

C++ certainly has its faults, but if you can stay out of the worse parts of the neighborhood and use decent quality practices, you can write some very good software in it. I've never bought into the "era of abundance" paradigm, since it encourages sloppy practice and general cycle-wasting.

Wasted cycles cost money, in case you'd forgotten that. It's the "I'm going to drive an SUV because it's 'safer'" argument, while blithely ignoring that the 'safety' costs minimally twice as much to maintain as with any other vehicle; a well-built, safety-conscious smaller vehicle would be perfectly viable--just so long as you don't have the larger gas-guzzlers careering all over the interstate.

Languages that get more done in fewer cycles cost less to run at the plug. Arguments over maintainability will seesaw back and forth over the decades, and that's a separate set of costs, anyway. (SUVs cost more to repair, too, if you want the analogy.)

This is not to say that there isn't some other middle ground. C# is very well thought-out, and very easy to learn for a C++ programmer. (Maybe even for Java programmers, but I don't see a lot of them volunteering.) Not sure about the economics of C# yet, but I'm thinking about it.

mrprogguy on January 15, 2007 7:53 AM

Category: xz@localhost~>
Posted by: admin86

I've been working hosting my cvs server in a virtual machine inside my development machine. Not an ideal situation but I make sure files for the virtual machine resides in a separate hard disk.

This works reasonablly good until now when I started working on this ultrasound project. The ultra sound card I'm working on crashes a lot and can only be reset by shuting down the computer. That means a lot of turning on and off the guest OS in the virtual machine.

The good thing is, I'm putting my old server back online. The bad thing is I had to move the guest OS back to the old server. Last time it took me a couple of hours to move a guest OS from one host to another.

To my delight, I saw a pair of "Import Appliance" and "Export Appliance" items under the "File". This new feature packages a guest machine in an "Appliance" that can be distributed.

Category: xz@localhost~>
Posted by: admin86

We were on our way to a record dry May. That was, until two days ago. The lawn was so dry on the memorials day, I acknowledged my defeat and decided to water my plants, knowing that rain was in the forecast. I hosed the water directly down at the root of my rose bush. Five seconds, ten, thirty, ... I never saw the water seeping out from under the mulch. The soil soaked up all the water like it's a sponge.

...

"Don't you want to bring a rain coat with you?" Asked Mom as we were getting in the driveway into the car. Before I could answer, a few huge rain drops hit my face and within seconds, it was a downpour. From the car to the garage was a ten feet dash, but I was nearly soaked. Daughter's rain coat was not in the garage. "Surely she's not going to run in the rain. Beside, when I was driving back home, the darkness of the cloud was to the north." So thought I, and dashed back in the car and pulled ourselves out of the drive way.

The first thing I noticed in the morning was that gutter was overflowing. It was raining heavily. "Maybe this will get me out of the race." I regretted signing up for the race when I realize I'm starting to have difficulty keeping up with my six yo daughter. Lately we had been running the half mile races from the high school to the town library. I was out of breath at the end of the race while she still had quite some stream left, despite that she just had a half hour swimming lesson. The Corporate Challenge is a race seven time longer in distance. Am I really able to make a three and half mile run? I had never been a good runner. "If it keeps raining like this, I shall use it as an excuse to get out of the race." As I drove to work in the morning. Then the weather improved dramatically as the day progresses. No one was talking about skipping the race. I'd go get my gear, I left work at four. As I drove north in Five Mile Line Road, I saw the sky to the north was darkened by heavy cloud.

The news that was coming out from the radio wasn't too bad at the beginning: "Areas near the lake shore are experiencing rainfall." Atlantic Avenue was not exactly near the lake shore. But hey, the racing site was still quite a few more miles further south. Then came the worrisome news: A flood warning was issued for the entire county for the evening. Reality finally hit me. I started to imaging how it would be like riding in the bus back to the lot where the cars would be parked, with everyone else, all soaked from racing in the cold rain. "Team No. 2!" My daughter proudly proclaimed in her bigger than normal big voice, pointing at the number on her T-shirt, as we were waiting in the line boarding the bus. Everyone laughed. "I'm surely not going to let her race in the rain." I thought.

It took me quit some trouble locating our tent. Several people was in the tent when I got there.
"Are you going to race with your daddy?"
"Yes!"
A was slapped on her chest. There was no way out now. The good thing is, the rain had been in remission ever since we arrive at the parking lot where we boarded the commuter bus. "Let's go!" daughter dragged me towards the starting line. She was not interested in the small talk, or the adult food.

The starting are was packed. Everyone was anxiously waiting for the race to start. It's getting darker and darker. Then it comes the inevitable. When the race finally entered the running mode, everyone was thoroughly soaked. "I can't open my eyes!" Daughter complains as she ran.

No sooner than we passed the starting line, than I was in trouble. I felt a cramping sensation at the left leg. "Please, not now!" At the same time, pain was creeping up in my lower left abdominal. "I ate only some cheese and a couple of cookies." I thought: "An a cup of water! Can drink water before exercise upset my stomach?" My daughter was getting used to the rain and getting into better condition. She was running a kind of awkward way: She's not flexing her leg joints. But she seemed to be enjoying it and had been talkative. "Are we close to the finished line yet?" People laughed.

Under the two mile mark was a big clock and the time was announced by a loud speaker. We had been running in a steady pace. Twice had she thought she saw the end line, only to find the racing kept stretching out. "We're not going to win the race, right?" Reality finally got her! "But that's OK! You don't have to win every time!" School sure prepared her to accept defeat well. "That's good, right?" Said her when I told her we just passed the half.

"Twenty-nine fifty-eight, twenty-nine fifty-nine, thirty". We clear the two mile point at the thirty minute sharp. Her pace are noticeably slowing and she's been quiet for a few minutes. "The finishing line is right around that corner!" Now it's my turn to pretend. Two corner later. We reached to the second water station. This time, she accepted a cup of water. "We can have a little rest while having some water." I told her. She finally realized that not everyone around her was running. "I'm not rested enough yet!" That was the repeated theme throughout the last mile. Many tricks I resorted to: "We don't want to be the last either, right?" "There'll be much fun stuff [than the water puddle] ahead." "The thunder's going get us!" "We don't want to miss the ice cream." (A bad one, as it turned out ice cream was not in the menu)...

28/05:

Category: xz@localhost~>
Posted by: admin86
匡国当用倚天剑? 镇恶只须修脚刀!
Category: xz@localhost~>
Posted by: admin86
The state [California] had previously allowed such marriages after the same court [California's Supreme Court] ruled that, "An individual's sexual orientation -- like a person's race or gender -- does not constitute a legitimate basis upon which to deny or withhold legal rights."
Category: Programming
Posted by: x mar
1. AVIFileOpen cares about the the extension of the file name. If you try to use a file with extension, say "tmp", the function will return a HRESULT of 0x80040154 - "Class not registered "

02/02: Amazing Grace

Category: General
Posted by: admin86

It's been nearly five years since the passing away of Ronald Reagan.

Category: Bugs & Errors
Posted by: x mar
  • Trying to run a program from a removable drive freezes the "Windows Explore" window where it is being lunched from, or the command window if trying to run inside one.