Archive for December, 2006

Happy New Year

Sunday, December 31st, 2006

Passing Parameters in VB6

Friday, December 29th, 2006

This can be summed up with simply, use Scripting.Dictionary.

One of the problems with VB6 is maintaining version compatability. If the parameters on the public object’s functions change you break version compatability. This can be a real hassle. VB doesn’t provide for overloading. So, you can’t add another function of the same name with different parameters. VB does provide for Optional parameters and I’m not sure that would require breaking compatability, I think it would.

The best way to avoid this at the outset is to pass in a Scripting.Dictionary object instead of explicit parameters. This can make maintence quite a hassle since the next programmer doesn’t know what parameters are required or exactly what to name them. However, it does let you pass in variable parameters and maintains version compatability pretty easily.

I was recently reminded of this while looking at some c# code. It used a generic object to hold whatever as parameters. c# is particularly nice at this, because you can include objects, arrays, strings, integers, whatever. Whereas, a dictionary object will limit you to values you can hold in a string.

If the project is big enough it would be worth creating your own “can hold anything” object using c++ or vb6. And pass that in/out.

Which brings up another use for Dictionaries, as the return variable. For some reason, most languages perpetuate the idea the a function returns one things. My guess is this goes back to FORTRAN (FORmula TRANslation and it’s mathematical roots). Of course, you can pass in variables that also pass out using ByRef and address pointers. But this is really a hack around the syntactical design mistakes of the language designers and takes advantage of the fact that computers refer to everything by address number. What if they didn’t?

Return the Dictionary objects instead of the discrete integer, string, etc. types. This will let you return more than one variable without worrying over ByVal/ByRef placements. Scripting.Dictionary is on every MS computer since Win2K or older. It’s highly unlikely this dependency is going to cause a problem and if it does the target computer has a lot worse things wrong with it than your VB6 app/applet.

Pigeons Moved into My Patio Garden

Friday, December 29th, 2006

A few days ago I noticed some sticks rather randomly placed under the fig tree. This is a pretty protected spot and the wind hasn’t been blowing much lately. The next day there were more sticks. Then I realized it must be a nest. For the past week to two I’ve noticed a couple of pigeons who seemed to be shopping around for a place to live. Apparently, my patio looks like a good place to race chicks. Friday, I actually discovered the female on the nest and the male hanging around. They flew off and I started making some adjustments to be able to water the plants without bothering the nest. Saturday, I watched the male flying off and bringing sticks to the female. She would place them. Last night they were both gone and I went out there and saw one egg in the nest. This morning she was back. I don’t want to scare them away, but the plants will have to be watered, it was 100+ 3 times this week. I threw a few breadcrumbs out and they were gone later, so I threw out a piece of corn on the cob, uncooked. Hopefully, I can tame them enough to work around them.

I read about pigeons on the Internet. These are rock pigeons which used to live on cliffs. Unlike most birds who drink by putting water in their mouth and raising their head to swallow. Pigeons can create suction like humans do. They lay two eggs which take about 18 days to hatch. The chicks are fed for another two weeks. The chicks are about the size of the adults when they leave the nest. If things are going well, the couple will start a second nest while still feeding the chicks. Couples mate for life, about 3-5 years, unless one mate is killed.

Update 1 (12/29/2006)
I still see the pigeons about 1 every week or so. I think it’s the same family, unless all the pigeons like hanging around my patio. There are three. Two with similar colors and one with different coloring. I figured the baby was a male, so that makes sense to me. They’re response is also somewhat expected. One male always runs immediately (I accidentally scared the male off the nest too much). But the other male and female sit there or walk away. The female had the morning and evening shift and saw me watering the plants and I talked to her the most. Though it’s hard to say, because at that time both parents looked very similar.

I leave food for them sometimes, especially when I know the weather is bad. It’s usually gone in a day. And I’ve seen them, specifically, eating it. I’ll miss them when I move.

Here is the MySpace video of the “baby” eating God knows what out of a resting flowerbox.

By my count the eggs were laid about 7/5-7/10. Counting from there I get the age of the baby. These pictures are from 7 weeks to 11 weeks when he moved out.

Memory Sticks

Friday, December 29th, 2006

One thing to watch out for when getting digital cameras are the recording medium. There are two types.

Cards are squarish, about the size of a large postage stamp. They are usually marked SD or Secure Digital. There are many sizes down to microSD, which is as big as your fingernail, but narrower. They are by far the most popular.

Sticks are longer and a little wider. There are two sizes. These are found in Sony cameras.

The biggest difference I have seen is price. The Memory Sticks seem to have a $20 tax placed on them. I suspect this is a Sony tax. When buying a camera beware of this. Initially, you will buy a recording medium, because the cameras ship with “cards” so small you can’t even buy that size in the stores anymore. A Memory Stick camera adds $10-20 to this and then adds $10-20 per Stick on every future one. This is a little extravagant for me.

One last recomendation is to get a USB “card” reader for the camera. In case you are with family you can copy the pics to computer without the cable. Here’s one for $5.

Memory Card 1 gig 13.99
Memory Stick 1 gig 33.99

Where’s my Digital Picture Frame

Friday, December 29th, 2006

With all the digital pictures for the camera last year, almost all of them will never see print. This is a good thing. It moves clutter to inside the computer. However, recent digital technology lets you share the pictures much more easily. It would be nice to have a picture frame that cook troll this huge backlog of pics and make them more useful. So, why can’t I share my digital pics with a digital picture frame. I could if I wanted to pay as much for a new digital camera.

WTF, is going on with this space? A keychain 1 inch frame is $20, but a 7 inch is $100+. Most likely, $150. Apparently, we have all been mislead. The expensive part of the digital camera is the LCD window. The rest of it, card reader, motion stabilization, flash, CCD amount to a tiny portion of the cost. Oh, wait that can’t be right because those mobile DVD players with a 7 inch screen are ~$100.

A digital picture frame has plenty of drawbacks, mainly the cord. Also, inability to see it from side angles, can’t see it in sunny locations, likelihood of failure (2-3 yr?), the backlight will make it glow, and the loss of one of your memory cards inside the picture frame ($40/gig). Now the silly thing costs close to $200. I could buy a 19 inch LCD monitor for that. You can buy small TVs for that.

I want a $60, 7 inch digital picture frame to show pics change once per hour, half-day, day, week, month with almost no electicity. Not an mp3 playing, movie playing, wireless networked, microcomputer with tiny display.

My guess is that a licensing deal exists which causes them to pay way to much money to a fat a bloated patent holder, like Bluetooth. Nobody likes a $50 tax except Apple people. Or could be the lack of a chip to read SD cards and drive the LCD. Maybe the only one out there is does everything so the mfr, covering his bases, thinks he should plug all those feature in.

What we need is a Walkman to point out that you don’t need to do everything just one thing. Walkman’s don’t have reverse or record. Just fast forward and play.

Many frames have a read anything card reader, but this is unnecessary. They make $5-10 USB adapters for all types of cards. Use either SD (the most popular) or USB. Needs a setting for freqency of picture change, brightness, and that’s about it. More features can go with the higher end frames (almost all current frames). USB is ultra cheap (Mfrs didn’t want to pay the Apple tax for Firewire). Adapters are ultra cheap. To do anything special like a add/remove photos use a computer with USB drive and Windows Explorer (ie one from the last 10yr). This would give a new life for all those old 16, 32, 64 meg cards that ship with the camera. The target should be <$100 with adapter for a 7 inch frame, ideally $60.

Blog Spam

Wednesday, December 27th, 2006

I’ve had some issues for some time with blog spam. Comments on posts from “people” with URLs and links to poker, sex enhancement, etc. sites. My past response was to block the offending IP address range. Most of it was coming from offshore so that wasn’t much of a problem. None of this spam has ever shown up on the site, because I manually approve all the comments posted.

Recently, I’ve had people trying to hit the site in the US and getting blocked. So, I installed Akismet spam blocker and I’ll relax the IP blocking. We’ll see if that works. Some other alternatives are comments on login only, captcha pictures, or other spam plugins. However, I want this as simple as possible. No ones going to remember passwords or try very hard to leave a 1 sentence comment.

Happy New Year

Christmas Pictures

Tuesday, December 26th, 2006

I’ve got some links for the christmas pictures.

One is the standard holiday pics. I was experimenting a little with no-flash. The Canon A610 is mostly good enough to work inside at night w/o flash. It took a day to get the settings right. So, some pics have a slight blur in them.
Two is movies of Grandma at poker on Christmas Eve and Zoey’s laughing Elmo the next morning. I got a lot of SD card memory at Christmas and started experimenting with the movie feature.
Three is pics of Mom’s yard; tree damage from the ice storm and the frozen pond with the cat still trying to catch the fish under the inch of ice.


YouTube: “Grandma, Smile for the Camera”

Upgrading a TiVo Series 2

Thursday, December 21st, 2006

A couple of years ago I got Bridget a TiVo2 for Christmas. This year it’s 2 yr old. When my first TiVo hit 2 last year about this time I upgraded the hard drive. My experience with computers has me lerry of them over 2+ years, especially when they are run 24-7. I’ve seen drives last over 5 yrs w/o problem. Even an old Connor 400 meg last ~7 yr with tons of bad sectors. There’s a strong financial incentive, because this TiVo has Lifetime Service which is not long sold. A bad hard drive would end TiVo and the lack of a monthly bill.

I researched ultra quiet, cool hard drives and got a Samsung T SP2514. Speed isn’t important with TiVo’s because the hardware is much more limiting than the drive. In fact, I would get a 5400 rpm drive if they still made them. They’re much cool than 7200s. You also need a spare (if you have one) computer to do the copying. Faster is better, older is better (just not brand new). You’ll need a copy of mfstools from Hinsdale burned to a CD. They have a free boot disk image that you need to burn to disk. It’s only a 10.5 meg download.

Lastly and most importantly are the instructions from Hinsdale. This is just a walkthrough of what I did. These instructions are extremely detailed. Follow them if upgrading yourself. There are lots of ways to upgrade a TiVo. This one has the factor single 80 gig drive. It could be upgraded by adding a second drive or replace the 80 with a new one. The new drive is 250 gig and I’ll be replacing the original. Bridget will keep the old drive is a safe, cool place and it will server as a backup. If the new one fails, just pop in the old one. No experience required, anyone with a Torx screwdriver can do it.

For those with a desire to upgrade, but don’t feel the DIY spirit, 9thTee and Hinsdale sell upgraded drives or you can send your TiVo in.

Bridget dropped it off at Thanksgiving and I finally got around to doing it. Mine took well over 8hrs to copy, recordings and all. And you don’t want to screw up the original TiVo drive before it’s copied. It’s kind of a weekend thing.

I opened the TiVo and took out the drive. Put the TiVo drive cage on the new drive. You’ll need a Torx (star shaped) 10 bit. Open the computer you’ll use for copying, unplug all the drives except the CDROM. Plug in the two drives. Turn on the computer and insert the MfsTools Boot disk you burned earlier. Note the cables you put the hard drives on. The cable position determines the drive name; Primary Master=/dev/hda, Primary Slave=/dev/hdb, etc.

Go through the MfsTools prompts till you get a command line. The TiVo drive was on Primary Master with the new drive on Secondary Master. So, I used the following line to copy and expand the swap file to 200 meg. You can see it copying here.

mfsbackup -Tao - /dev/hda | mfsrestore -s 200 -xzpi - /dev/hdc

Wait several hours until the copy is finished and put the new drive in the TiVo. Plug the TiVo in and pray :) .

Here are all the pictures I took.

Update 1:
So the above did not work. I tried it several ways. Nada. The process that worked on my TiVo last year was to use dd to completely clone one drive to the other then resize it. I was terrified of accidentally getting the drive names confused, since there was no backup yet. But dd was my last hope. During the process block errors were coming up every time and there was a faint clicking that told me the drive was iffy. After15-20 minutes I couldn’t take it and stopped the copy, turned off the computer, and plugged the TiVo drive back in to TiVo. GSOD. And the drive clicked loudly signally a likely death in the Maxtor family.

This was exactly the wrong outcome. It seems pretty recently Weaknees has start a blog answering technical questions about the Hinsdale instructions. I saw that some people seemed to be replacing dead drives (no upgrade attempt) with mail order Weaknees drives. So, I posted my issue and the answer was that my drive was likely dead and that a replacement could be ordered containing an unactivated TiVo image. Apparently, the machine key is held in the chips and not on the hard drive. Yeah, I ordered a 250 gig/270 hr.

It came in on Wednesday. Worked great! Nothing is on it at all. It was not necessary to download the USB ethernet driver for networking. No initial phone call was necessary. It immediately saw the network, internet, and TiVo headquarters. I set everything up and it seems fine. The other TiVos see it and it sees them. \
Not that I’m complaining. This is a rather expensive resolution, $170 vs or plus $70 for Samsung 250. No, I’m not returning it. Haven’t broke the 2 TB barrier yet. :) Everything worked flawlessly. If you do have weak knees or need rescue it’s a life save or a TiVo saver or a save my from getting a Dish DVR saver or keep my Lifetime Service saver. Anyway…

Here is the picture of the kit. I added pictures of Christopher’s Dish/TiVo connection and a couple more pics of the kit HDD. They are in the first link.

Missing IDs from ASP.NET Controls

Thursday, December 21st, 2006

The reason to make a control is to clump together common controls or controls plus business logic. For example, a dropdown that looks up a code and has an attached label. The HTML spec provides for dropdowns and labels, but doesn’t glue them together strongly. A Windows UI, however, will allow you to bind them strongly. .Net provides for developers to do the same things for HTML.

In ASP.NET programming, I sometimes feel very much behind the 8 ball, because I have years of client side scripting experience on web pages. So, I know exactly what I want to do. But I have no idea how Microsoft wants me to do it. I feel doubly frustrated. If I knew nothing of client script I would only wonder how Microsoft wants me to do it.

My issue revolved around the standard checkbox control in ASP.NET. The checkbox is an aggregation of a INPUT TYPE=CHECKBOX and a LABEL. Great! The problem comes in trying to control the label from client script. And when the checkbox control starts out disabled the two controls are wrapped in a SPAN tag. Neither of these sub elements of the checkbox had IDs or NAMEs. So, there is almost no way control them programmatically. This is an area where the framework looks unfinished or ameteurish. ALL elements of a control should have an ID tag so they can be controlled by client script. I really want to bang on MS here, suffice it to say I think it’s an eggregiously stupid error especially for language designers.

So what’s the solution? It can’t be possible to be unable to control the checkbox en/dis-able without refreshing the window/frame. Thank God for the DOM. If the checkbox starts out disabled it’s inside a SPAN tag which is disabled. Since one control does have an ID and is in the span tag you can get to it and ask it for it’s parent. window.all("ddnList").parent.disabled = {true, false}.

I guess if you wanted to control the label from client script you would get the checkbox ID, get the parent object, and iterate through all the label children of the parent. Ahh, so elegant. It would be such a waste of an opportunity to make beautifully circuitious code when you could to refer to an object simply by it’s unique identifier.

Worm Composting

Saturday, December 9th, 2006

One of the most beneficial things I discovered about patio gardening was the value of compost to improve plant vigor and fight disease. Composting is used in a lot of gardening and seems like a good way to recycle instead of discard. I read on the internet about kitchen composting bins small enough and clean enough to keep on the kitchen counter. It turns out these pails are carbon lined buckets used for temporarily holding waste for the large outdoor compost pile. The solution seemed to be in worm composting bins.

In the begining of November, I ordered some composting worms from a farm in Albuquerque. After a couple of weeks they showed up. I made a worm bin out of two rubbermaid bins; one plain and one I modified. These are the pictures of the worm bin construction. The worms arrived in a cotton cloth bag with some bedding. Looking back, I can see they were exhausted and stressed. I bought a newspaper and shredded it for bedding, put it in the bin, and watered it till the first rubbermaid bin leaked into the second. The refrigerator contained some green peppers I had never got around to dicing. I added that and the opened bag of worms. The next day I dumped out the bag. For the first few days the worms didn’t like it. Many, many of them were crawling up the sides. At first the smell was somewhat chemical like acetone, but that settled out.

The bin has been going a month. The worms have done very well making the environment to their suiting. Most of the original newspaper has been eaten. All the original food has vanished. Replaced by what looks and smalled like fresh soil. This is the most striking aspect. Given a week or two the item disappears. The worms are very active and there are a lot of them.

I had/have a wierd reaction to them. Afraid to touch or get very close. There’s no problem watching them. The worms are very photoreactive and move quickly out of the light, most of the time. Other times the worms lie there in a clump or singly unmoving. I wonder if the worms sleep or rest at these times. At full size all the worms have a light colored band, where they make eggs. The worms are very quick and are usually entangled in half finished compost, other worms, bedding, and composting item. It seems there are many more worms now, than when the bin started.

It takes three months for the bin to setup and mature. Which is timed with the early spring planting season. I anticipate a few pounds of compost by that time. It’s been a very positive experience. It will be interesting to see where this goes.

http://www.savvygardener.com/Features/worm_composting.html
http://www.cityfarmer.org/
http://www.wormwoman.com/
http://www.wormdigest.org/