« January 2008 | Main | March 2008 »

February 2008 Archives

February 28, 2008

What a great idea- switch oil subsidies to become renewable energy subsidies

I just heard today that the House has passed a bill to take current oil subsidies and re-allocate them to subsidies for renewal energy. Has there been an issue in front of Congress recently that has been more clearly sensible? I personally think you'd be hard pressed to find a better idea. With the price of oil ranging at historic highs between $70 to $100 per barrel, Big Oil has been making record profits for years now. Seriously, how can anyone defend subsidies for an industry in which the market leader made a profit of 11.7 billion in the fourth quarter of last year, and a total of $40.61 billion for the whole year? And we're giving them tax breaks?

Unfortunately, the bill faces resistance from Republicans in the Senate and from President Bush, who say that the removal of the subsidies "would raise fuel prices for consumers, discourage oil and gas exploration in the United States and unfairly discriminate against a single industry". That's just silly-- the measure would amount to less than 2 percent of the profits of the five biggest oil companies, and would amount to about a penny a gallon of gas if the cost were passed along to consumers. And as for being unfair-- well, isn't a subsidy an unfair favor in the first place? I can't see how anyone can seriously argue that these companies need subsidies while they're making tremendous profits. It really baffles me.

And I think the real point is, here, that America's continued reliance on oil is unsustainable, since global oil reserves will only last us 50 more years and will start to decline in production long before then; since oil will become only more expensive as it becomes scarcer and consumption from third-world countries like China and India increases; and since it's politically unwise to continue to purchase high-priced fuel that puts money in the pockets of countries whom we consider to be unfriendly or even hostile to us.

Click-and-drag resizing of a textarea

In a few applications, I've noticed a relatively new feature (at least, new to me): a "handle", or bar, at the bottom of a textarea that allows you to resize it by clicking-and-dragging. I think this is a great addition to the usability of any site where a user might type in just a little or a lot into a textarea.

There are a number of JavaScript toolkits which can give you this capability, but not everyone wants to add the loadtime of a full toolkit to their site. So I'll point out one script that can give you this capability: Jonathan Leighton's Textarea Resizer.

Continue reading "Click-and-drag resizing of a textarea" »

February 22, 2008

Great ColdFusion 8 article; how about a comparison to PHP/RoR?

Boston's own Brian Rinaldi has just authored an article on SitePoint, ColdFusion 8: Believe The Hype. In it, he tells web developers about why they should consider using ColdFusion 8, with details on increased speed, stability, AJAX integration, server monitoring, debugging, and other items. All in all, the article is a great read. Kudos to Brian for working to publicize the great strides that Adobe has made in an already-fantastic development platform.

One topic that I'd like to see more of in ColdFusion articles, though, is why a developer should switch to ColdFusion from another environment, or what the specific advantages of CF are over other languages. Until this kind of thing is addressed, I don't think that people who have already invested their time in PHP or Ruby on Rails will bother to even consider CF, not to mention bother to read CF articles. Brian quotes a ColdFusion developer at The Economist who recently upgraded to ColdFusion 8, who says, "...the whole thing is ridiculously stable." That's absolutely true, but when we have a former PHP/RoR developer saying that instead of a CF developer saying it, then we'll have reason to really shout about it!

(Sheepish) Yes, I know, I should probably just volunteer to write an article myself... but I want to encourage others to do it as well.

February 25, 2008

Shrinking/optimizing databases to save filespace

The other day, our company's managed hosting provider alerted me to the fact that the hard drive on our SQL 2000 database server was running out of filespace. So I logged on to the server to check out what was going on. What I found was that besides accumulating a few extra testing databases over the years, certain of our high-traffic databases were taking up quite a lot of space on the hard drive. And while looking around, I remembered a technique that I haven't had to use for years that helped me to regain a lot of the space on the drive: "shrinking" SQL Server databases.

Continue reading "Shrinking/optimizing databases to save filespace" »

February 15, 2008

Using TortoiseSVN's "diff"(aka TortoiseMerge) to pass updates to new files

Today when I checked a third-party site for updates to the XSLT files I use in Microformats.cfc, I found myself wondering how I'd update the new files so that they contained the minor modifications needed for use in my component. I could have saved the new files in a separate directory, then opened each new file and compared it to my older version, making changes by hand. But I was a little worried that I'd forget to notice a change or two-- these XSLT files aren't exactly easy to read, and I only work with them once every few months. Then I remembered the ever-so-handy "diff" utility from my Subversion client, TortoiseSVN.

Continue reading "Using TortoiseSVN's "diff"(aka TortoiseMerge) to pass updates to new files" »

XSLT style files updated for Microformats.cfc

For you microformats buffs out there who use my microformats CFC, I have an FYI: I've updated the XSLT stylesheets with the latest from hg.microformats.org. The updated files include:

  • hAtom2Atom.xsl
  • hreview2rdfxml.xsl
  • mf-templates.xsl
  • xhtml2vcal.xsl
  • xhtml2vcard.xsl
There were no updates available for datetime.xsl and uri.xsl.

February 14, 2008

Updates to Clickheat for ColdFusion

Colin suggested some smart changes for my Clickheat for ColdFusion project, which I've duly commited. Here goes:

  • In settings.cfm, I've taken my own email address out. [Doh!]
  • In click.cfm, I've replaced hard-coded email addresses in the CFCATCH with the email variables from settings.cfm.
  • In click.cfm, I've replaced GetDirectoryFromPath() with VARIABLES.logPath from settings.cfm.
  • In index.cfm, I've changed the form action to index.cfm instead of view.cfm.
  • In clickheat.js, I've changed URL paths which refer to the root so that they're relative to the root, so that the application will work correctly in any location off the root.

A great way to arrange a Disney vacation

I'm off to Disney World at the end of the day tomorrow, and I don't know who's going to have more fun-- me, or the kids. I haven't been to a Disney theme park since I was 11 years old and very nearly fell out of the Space Mountain roller coaster. You know that bad boy's on my list of rides to tame this time around (that, and going through the haunted house as many times as I can).

And I do want to give some props to the person who arranged our whole vacation, Sandy, who runs Instant Impressions Travel Services. Because she goes to Disney at least four times a year with her young daughter, she knows the park in and out, including rides, lodging, transportation, and dining. And the best part? Having her book your vacation is completely free to you.

Whoops! Relocating your Subversion working directories to another server

Just an FYI to everyone who read yesterday's post about changing the URL for your Subversion working directory when your repository is migrated to a new server: Stefan from TortoiseSVN politely informed me that I was mistaken to suggest that the "switch" function could be used to associate working directories with new URLs; instead, the "relocate" command should be used.

I might as well take this opportunity to thank Stefan and the rest of the TortoiseSVN team for not only making such a great FOSS product, but for ensuring that I don't propagate my own silly mistakes to the rest of the Internet developer community. ;)

Humor: A mother's letter

From a poster that was above our table in the local Irish pub last night:

A MOTHER'S LETTER

Dear Son,
    Just a few lines to let you know that I am still alive. I am writing this slowly because I know you can't read fast. You won't know the house when you come home, we've moved.
    About your father, he has got a lovely new job. He has 500 men under him, he cuts grass at the cemetery. Your sister Mary had a baby this morning. I haven't found out yet whether it's a boy or a girl, so I don't know if you're an aunt or an uncle.
    I went to the doctor's on Thursday and your father came with me. The doctor put a small tube in my mouth and told me not to talk for 10 minutes. Your father offered to buy it from him.
    Your uncle Patrick drowned last week in a vat of Irish whiskey at the Dublin brewery. Some of his workmates tried to save him but he fought them off bravely. They cremated him and it took 3 days to put the fire out.
    It only rained twice this week, first for 3 days then for 4 days. We had a letter from the undertaker. He said that if the last payment on your grandmother's plot wasn't paid in 7 days, up she comes.

Your loving mother

P.S. I was going to send you 5 pounds, but I have already sealed the envelope.

February 13, 2008

Switching your Subversion working directories to another server

[Editor's note: this posting has been updated to correct an inaccuracy about which Subversion function should be used to associate working directories with new URLs.]

Pete Freitag mentions a way to move a Subversion repository from one server to another server by making a dumpfile from the old repository and importing it into the new repository. I've had to accomplish the same thing, but I was faced with an extra step afterward. If you're like me, you may have some changes that you're testing in your working directory but haven't yet committed; so how do you keep those changes while reassigning your local working directory to use the new repository?

The answer is the "switch" function. Just select the top level of your working directory and run "switch" The answer is the "relocate" function. Just select the top level of your working directory and run "relocate"(which in the case of my SVN client, TortoiseSVN, means right-clicking on the working directory.) You'll see a dialog that looks something like this:

tortoise-svn-relocate.gif

Just enter the URL for the new server, and all of your local SVN files will be updated to use the new repository. That way, you don't have to check out from the new repository and you can keep changes that you haven't yet committed.

February 12, 2008

Solution for label collisions in ColdFusion pie charts

Hareni Venkatramanan of Adobe commented on my previous posting about an issue with how ColdFusion 7 and 8 display labels for small values in pie charts, saying that there was a solution posted for this issue in the 7.0.1 Updater. Indeed there is-- but the solution isn't applied automatically via the updater. Instead, you have to edit the XML files that define your chart styles. Read on to see what the new chart looks like and to find out how to edit the XML file.

Continue reading "Solution for label collisions in ColdFusion pie charts" »

February 8, 2008

Pie chart spacing problem for small values in CFCHART

Built-in charting capability is definitely one of the great conveniences of using ColdFusion over other languages (although I'd argue that Google's Chart API, which lets any developer call custom charts through a REST API, is eroding that advantage; more on that later). But sometimes there are a few flaws in cfchart that make you look at other charting solutions.

Continue reading "Pie chart spacing problem for small values in CFCHART" »

White Whale of the Skies

"French designer Jean-Marie Massaud has a vision, one which looks like a huge white whale with flippers and flukes." This from the Spiegel web site, which tells the story of a great white whale and the... French designer who wants to make it fly. Make sure to check out the image gallery. It's a beautiful concept. We can only wish the Goodyear blimp looked this nice.

February 6, 2008

Two reasons why America is ready for a ground-breaking candidate

In Tony Weeg's post about how Obama makes him "proud to be an American", one commenter mentions that he's worried that neither Democratic candidate, Clinton or Obama, will be electable against any Republican candidate because a majority of Americans aren't yet willing to vote for a woman or a minority. I respect his worry, and it's a valid question for a political party when it's choosing which candidate to field. But even if there are worries that a candidate isn't electable because of their gender or race or religion, someone or some group is going to have to make the first step of ignoring those biases, so that others can learn to follow.

But do we need to worry about these candidates' electability? I know of two factors which lead me to believe that America is ready to elect a ground-breaking candidate.

First, a recent CNN poll reported that 72% of white Americans and 61% of black Americans think that the country is ready for a black President. I can't think of a more obvious piece of evidence to answer this question in the positive.

Second, the number of Democrats coming out to vote for these primaries has been quite large; larger than the number of Republicans, and larger than the Democratic turnout from years past. That tells us that existing Democrats are more excited about these two candidates than others in the past, or it tells us that more people out of the population at large are willing to vote Democratic than are willing to vote Republican. Perhaps both are true. Either way, more people are turning out for Obama and Clinton than turned out for Kerry or Gore.

So whether you're going to vote for Hilary Clinton, Barack Obama, or John McCain, I think we can share a feeling of humble satisfaction that Americans decide this election based on the candidates' values, qualifications, and policy. That's what it should be, and nothing more.

Creating modal dialog boxes with lightbox.js

lgw-tla.gifWhen you click on the "Member login" link on the Text Link Ads site or respond to a comment through the admin section of a Movable Type installation, you'll be presented with a new form in a slightly different manner than you're probably used to: instead of being sent to a new page, or seeing a popup window, the current page darkens, or "greys out", and a form appears immediately overlying it. It's a really neat way to keep the user in the current page context, and it neatly gets around the growing tendency for users to suppress popup windows.

They both do it with Lightbox Gone Wild, which is an adaptation of Lokesh Dhakar's Lightbox project. It's a very easy technique to pull off... link to three script files and one stylesheet in your main page; create a second page containing the code for your form; and then put a link to the second page in the main page with a class of "lbOn". Complete instructions can be found on the Lightbox Gone Wild page.

I know that cfwindow offers some of the same functionality, but it seems to me that cfwindow can't achieve the same level of flexibility as Lightbox.js can. For instance, I think cfwindow is somewhat more limited in how much of it you can style, and is also limited in whether forms in the dialog area can target the whole page.

February 5, 2008

New iPhone and iPod touch models out

CNNMoney has a column saying that Apple has released new versions of the iPhone and iPod touch today. From their article:

Apple added new models of the iPhone and iPod touch Tuesday that double the memory capacity of earlier models.

The new 16-gigabyte (GB) iPhone will sell for $499, and the 8GB model will remain at its $399 price.

I've been waiting for new iPhone models to come out before I upgrade, so this news has me drooling to replace my Treo 650. But I still wonder if I should wait for the iPhone to come out with a faster data connection. Or, it is intriguing to think about what devices could come out on the supposedly more "open" networks of the major carriers.

Does Eli Manning really need that Cadillac Escalade?

On the subject of the Super Bowl, I'm have to say that while I'm happy for the ever-underachieving Eli Manning to have made it good, I was a little disappointed by one of the post-game traditions: the presentation of a new luxury car, such as this year's Cadillac Escalade, to the most valuable player. Why would a car company think that the rest of us want to see an already well-paid, honored pro athelete receive yet another free perk?

I know that the car companies want to promote their products as a prize worthy of a great contest, and as something that you should drive because it's associated with a great athlete. But I object to the idea of giving a free car to someone who doesn't really need it when the rest of America is struggling to meet their mortgage payments and is paying more than $3.00 per gallon of gas.

My solution? Make it an act of charity. Cadillac (or Eli himself) should give a new Escalade to some poor, worthy family in the name of the MVP athlete. That way, the car goes to someone who really needs it, the car company still gets exposure at the Super Bowl and association with the athlete, and both the athlete and the car company get some great publicity for their charitable work.

Oh well. At least they gave him a hybrid.

CSS Tricks: Different styles with static code

Ben Nadel's post about parsing CSS rules in ColdFusion reminded me of some of the techniques I've used in the past to make dynamic stylesheets. I've since stopped that practice, though, figuring that for my needs it didn't make sense to create a secondary CF request for the stylesheet each and every time someone called a page. So, I switched to a static stylesheet and used some of the techniques I've found from around the web. Save yourself some CPU cycles by letting the stylesheet and browser do the work instead.

Take, for example, the navigation at the top of my blog. The code for the navigation bar itself and the code for the stylesheet are the same for every page, yet the highlighted tab changes depending on which section of my site that you're in. The one thing that does change is the id attribute of the body tag. Read on how to get this technique to work for yourself.

Continue reading "CSS Tricks: Different styles with static code" »

February 1, 2008

Dvorak's condensed EULA terms

I know that John C. Dvorak of PC Magazine gets a bad rap sometimes on Slashdot and tech blogs, but he has a hilarious column out about how ridiculous the terms of some EULAs (end-user license agreements) are, such as those which tell you that you've accepted the contract just by opening the box it cam packed in, or that you agree not to sue the company even some harm comes to you and it's their fault. He even points out an example of one company that, in its EULA, required any lawsuit against it to be initiated in Bermuda, even though the company itself was based in Canada!

He summarizes all modern EULAs with the following:

Generally speaking, a software license and various terms-of-service and terms-of-use agreements say the following:
  • Whatever you think we said, or whatever we said, about the product may have nothing to do with reality, and you agree not to expect that it does.

  • No matter what happens, including damage to your equipment or even someone's death, you agree not to blame us even if it is our fault.

  • If we are a Web site and you use it, no matter what bad things happen, it is not our fault.

  • If you contribute anything at all to a site or system, we own it.

  • You will never sue us for anything, ever.

I love his final advice...

My advice is to have a 13-year-old do all the installations and make all the agreements. They cannot legally enter into these contracts. I wish someone would try that trick and litigate it.

I swear I'm going to try that with my own kids-- just the installation part, not the litigation.