Just some babblings by Jeff Sparkes

.

January 21, 2005

Another cell phone ringer problem

Filed under: General

In Auto Reset Ringer Style, A Cell Phone Feature I Need (by Jeremy Zawodny), Jeremy asks if there’s any way to reset the silent/vibrate mode on his cell phone automatically.

I have a related problem. I keep my cell phone in my pants pocket, and occasionally it gets maneuvered so that the volume is turned down via the buttons on the side. It also occasionally goes into vibrate mode too. Just having my phone with me at all times doesn’t guarantee I’ll get any calls.

January 20, 2005

python vs. ruby with freeride refactoring

Filed under: Software

I’ve used Perl and python since the 80’s for various scripting things. Before Perl 5, I preferred Perl and have written many thousands of lines of Perl. I never totally grokked Perl 5’s OO stuff, and by then I wasn’t a sys admin anyway.

I switched to python for anything over 20 lines so that I could easily make changes later. If you’re not using Perl daily, at lot of details fade away. I wasn’t writing a lot of python.

Later, ruby came along. I didn’t bother learning it because I already have scripting languages. Ruby persisted and gathered users. It occasionally gets mentioned in smalltalk circles. Now that I’ve used smalltalk and eclipse refactoring, I actually prefer a good IDE. Python never had one. Now that I’ve discovered that ruby has which has a refactoring menu, makes it worth investigating.

One problem with handy little smalltalk programs is the difficulty of sharing them with non-smalltalk users. Ruby would be easier to share. If it’s easy to write as well, I would be sold!

January 18, 2005

Infinite integers

Filed under: Development

One of the downsides of learning smalltalk is smalltalk envy. I need extended integer support in C++. We store floating point numbers to N decimal points by multiplying by 10 n+1 so that we can use only integer operations for speed. Actually, the only operations we perform are addition and a couple of divides near the end.

The problem is that sometimes the numbers get too big, and overflow. I can get a library to handle infinite integers, but with some overhead. I haven’t yet profiled any of my options, but the main thing my application does is add, so the impact could be large.

In smalltalk, I would use the fast SmallInteger type, which automatically would get promoted to Integer when overflow occurs. I avoid the extra overhead most of the time.

Most of the C++ libraries don’t seem to do that. One of them definitely does,  CLN by Bruno Haible. I think that it’s the number library for CLISP, so it’s well tested. It uses an int for as long as it can, and allocates space from the heap for larger numbers. I saw some other math libraries claim that it was the fastest, although I suspect that’s when it’s configured to use GMP. Both of these have acceptable licenses for commericial use.

At least I have a starting point.

January 15, 2005

Kate Bush’s zenith and slooow output

Filed under: Opinion, Art

I’m not one of those rabid Kate Bush fans that searches for every trickle of information about her, so I don’t really know what she’s doing right now. The gap between albums certainly has always grown, and now that she’s a mother, I’m sure it’ll take even longer.

I think that The Red Shoes was a great album, but it continues her progress towards ballady "adult comtemporary" music. My wife even likes some of the songs, but not Rubberband Girl, which is my favourite on the album.

Personally, I think her best album was Hounds of Love. The songs Cloudbusting, The Big Sky and Hounds of Love bring me great joy, and The Ninth Wave is really good too.

However, I think her best song is Wuthering Heights, with the new vocals. Amazing to think she wrote that when she was 14. I find the nasally voice on her earlier albums ruins my appreciation of the songs. There’s great stuff there, but I find it tedious. The improvement in her voice from 16 to 24 years old was incredible. I assume she got some very good lessons.

I imagine that if she were to re-record the best songs from the first three albums, she’d have another superior album. Despite the fact that the songs are already written, and she could re-use the music if she wanted, as a perfectionist it still would take a long time.

In some ways though, I find that many Kate Bush songs are like magic tricks. Once you know how the trick is done, it often seems rather mundane. Knowing what the song is actually about can take all of the depth out of it, and make it seem ordinary. It’s much better to speculate and guess what she’s thinking.

Kate, if you’re reading this (unlikely), reissue old albums and/or songs with your much better voice and make lots of fans happy. Oh, and you’ll make some money too!

January 13, 2005

There was a problem starting Office assistant.

Filed under: General

The following question popped up on my machine:

There was a problem starting Office assistant. Would you like to reinstall it?

Hell, no!

January 12, 2005

Why are there more mad cows in Canada?

Filed under: Opinion, Canada

It’s the usual suspects: greed and stupidity.

Mad Cow Disease (BSE) got started when the brains and nerves of sheep with scrapie were fed to cows. It seems that the prions that cause it weren’t killed by the heat of processing.

The disease spread because the brains and nerves of the cows also went back into cattle food. This spread the prions throughout the British cattle herds.

After it was determined that feeding herbivores to each other was a problem, the rules for cattle feed were changed. The rules then disallowed the feeding of ruminants (grazing animals including cows and sheep) with food that contained remants of other ruminants.

However, the feeding of rendered animal protein to ruminants was not stopped. Cattle feed could contains the remains of pig or chickens, for example. And pig and chicken food could still contain cow remains. This still allowed the prions to make a longer circular journey, which might be one of the problems here in Canada.

Why wasn’t the sensible rule of not feed animals protein to herbivores instituted? This protein allows the animals who eat it to grow faster. It’s also cheap to make. Completely banning leftover animal parts from cattle feed would eliminate any questions on the probability of BSE spreading through food, but for political and capitalist reasons it wasn’t done. Canada cattle producers may continue to bay a huge price.

On the other hand, one working on the latest BSE infected cow, which was born after the ban on ruminant cannibalism, was that it may have been fed leftover food from the previous year.

Still, wouldn’t you feed safer if the cows you eat were fed only plants, like they would eat in nature? I would.

I miss refactoring in Visual Studio C++

Filed under: Development

My bread and butter programming is in C++, but I’ve also spent a lot time with java in eclipse. I’ve had Martin Fowler’s Refactoring book for a long time, and I’ve followed the XP trail back to Smalltalk.

I’ve really learned to take advantage of the refactoring available in eclipse so that it feels completely natural. Now when I’m working in C++, it all seems so hard.

Just to rename a function parameter is such a pain. The software I’m maintaining was originally written by someone else, who seemed to have a fortran view of the world. I’ve improved most of the code by hand over time. Now that I’ve seen the refactoring rubicon, crossing back to the other side is painful.

I once renamed a variable by global replace, and broke the code in a subtle way that took lots of time to track down. This is one of the dangers of dealing with someone else’s code which has a lot of cut, paste and modify. Now I’m forced to rename the parameter in the function declaration, and try to compile. The compiler only warns me once about each undeclared variable, so I fix one use, and then compile again, in a long, slow, painful loop.

I have been writing negative lines of code for a long while as I’ve been improving, but every now and then I have to go into a virgin section of code to fix things, and the horror returns.

January 7, 2005

synchronicity in Christmas presents

Filed under: General

We had our family dinner on Christmas Eve, and somehow the conversation led to me talking about the Darwin Awards. I mentiond that I hadn’t seen any new ones lately. This made my wife happy since she’d bought a Darwin Awards book for me. She didn’t really know what to get me and was happy that she’d gotten me a suprise gift.

Oddly, the marking blurb on the book said: "The Darwin Awards, by the author of the Darwin Awards II". I’d have thought that was obvious!


Get free blog up and running in minutes with Blogsome | Theme designs available here