Pew Pew Laser Blog

Code. Glass art. Games. Baking. Cats. From Seattle, Washington and various sundry satellite locations.

Past Blogs

Cursing the Heavens.

9.27.2007

Because of my mad JavaScript skillz, I am the company Silverlight developer. I've been working with it for about a month now, and it's been slow going. I am not an animator, nor am I an applications developer. I have had some small success with Silverlight, but also some great failures. Recently, my movie player stopped working - and I have no idea why. Once I've finished with my production work, I'll be able to work on Silverlight again.

We had ordered a Silverlight book by one of Microsoft's evangelists that looked like it would be very helpful. Sure, there are many Silverlight tutorials out there, but it's difficult to find ones that are well written, or give me the knowledge foundation that I need. But Microsoft's Silverlight book's release has been pushed back another month. I think we'll have to get the O'Reilly e-books.

On the bright side, nice packages have arrived at our house recently. My tulip bulbs arrived yesterday, and today we got a laser pointer from ThinkGeek. The kitties LOVE the laser pointer. Or should I say, they hate it? In any case, they are entertained.

Halloween Planning.

9.25.2007

That's all folks!

Lust for Knowledge.

9.23.2007

I bought Danny Goodman's JavaScript and DHTML Cookbook about a year ago, and it was an excellent choice. O'Reilly's Cookbook series of books aims to provide useful, pre-written scripts (recipes) in the technology of the book. For a book written in 2003, I still found the recipes unbelievably useful, elegant and forward-thinking. It was a great purchase and provided the answers I needed on a number of occasions.

Last month, the Second Edition of the JS and DHTML Cookbook was released, and I am very jealous. There are over 20 new recipes; including AJAX and updates for the current generation of browsers. I wish I could drop my first edition into a puddle, and buy the second edition. The rest of you can avoid this remorse, by picking up a copy of the JavaScript and DHTML Cookbook, 2nd edition right now.

SQL Optimization Tips.

9.19.2007

In honor of International Talk Like A Pirate Day, Pew Pew Laser Blog brings you this message from the SQL Pirate.

Yar me heaties! I were diggin' around in me old booty-chest o' code and I found this here venerable list of SQL tips. These here tips be for keepin' yer SQL queries runnin' faster than me crew towards the last bottle o' rum. Keep it close to ye vest.

Genius or Disaster?

9.18.2007

I love Halloween - you might even say I'm fanatical about it. As it approaches, it's more difficult for me to avoid buying glossy magazines with pumpkins on the cover. My hate and envy for Martha Stewart gets kicked into overdrive.

It will come as no surprise to you that I've noticed all of the Halloween themed goodies that will be available for the next several weeks. I saw the most delightful thing at Costco, but I'm not sure it's a good idea. It's 80 small cans of Play Doh to give away to trick-or-treaters. My thinking is "Wonderful! It's a toy!" But will the kids feel screwed out of candy? Aren't they already getting enough candy? Do kids even play with Play-Doh anymore?

I think I'm going to have to supplement the Play-Doh with candy. But, parents, I need to know if your kids will like the Play-Doh, or come back in the night with eggs.

Classy Links.

9.14.2007

This is a pretty simple bit of code, but I though it might come in handy as it was something I hadn't covered yet. Here is one method of using CSS to apply a different appearance to some of your links using CSS.

<style type="text/css">
a.alternate { color: #FFFF99; }
a.alternate:visited { color: #CCCCFF }
a.alternate:hover { color: #6699FF; }
a.alternate:active { color: #990033; }
</style>

<a href="#" class="alternate">Alternately styled link</a>

This is a regular link. Only this middle link will have a non-standard style. This is another regular link.

The above method uses a class (the ".alternate" part) combined with the pseudo-class selectors (the ":hover" part) that are used in links. Alternately, you could group the links inside an element with an id or a class, and select them as shown in the following code.

<style type="text/css">
#nav a { color: #FFFF99; }
#nav a:visited { color: #CCCCFF }
#nav a:hover { color: #6699FF; }
#nav a:active { color: #990033; }
</style>

<div id="nav">
<a href="#">Alternately styled link</a>
<a href="#">Alternately styled link</a>
<a href="#">Alternately styled link</a>
</div>

Once you've selected your links, you can add any style declarations that you wish. I've specified only the foreground color (the text color of the link) here for simplicity.

Just remember to use specify your link declarations in the following order:

This order will ensure that the cascading styles for links are displayed as as you expect them to.

Screen Reading.

9.10.2007

I was listening to the Boadworld Web Design podcast recently, and there was an eye opening section about screen readers, which included hearing a screen reader attempt to parse some web pages. A screen reader is a piece of software (typically used by folks with no or low vision) that reads a computer screen aloud. The cold staccato Steven Hawking voice of the screen reader had a terrifyingly difficult time reading Amazon's pages in particular. If you want to know why CSS is good, and table based layout is bad, I highly recommend that you take a listen - scroll down to the "Ask an Expert" section. As you listen, consider the internet's most influential blind user of all - Google.

Crunchy Reflection.

9.9.2007

Summer is over, regardless of this weekend's nice weather. School's in session, there's a chill in the evening air, and the trees have begun to drop those nice crunchy fall leaves. We've had the town house for a couple months, and it's working out nicely. (The kitties are also working out nicely.) The job at Widemile is good, and I think we (the company) are really going to go somewhere. We've got clients that keep paying us, and venture capitalists keep coming to the office.

All in all, Seattle isn't so bad. I don't mind the sales tax too much, and I can pump my own gas. Though since I commute to work on the public bus (about a half hour trip), I rarely need to buy gas. One thing that's particularly nice though is the lack of a deposit on bottles and cans. I can just put the beer and coke cans out with the recycling every other week, and they're magically gone. Back in Oregon, I had to spend time at the grocery store feeding the cans into the machines to get my precious nickels back. I'm sure the Oregon recyclers would have picked up the aluminum cans, but I wasn't going to give away my deposit nickels. No way no how.

Photoshop Small Image Enlarging - Addendum.

9.5.2007

A TruffleAfter reviewing the previous entry, I must agree that the 4x truffle doesn't look very good at all. Also, I completely screwed up the size attributes, so there was some browser resizing occurring. Mea culpa. I offer the same method applied to a truffle enlarged to only twice it's original size.

A TruffleAnd here is a truffle enlarge to only 1.5 times it's original size. That's not too shabby, and probably the best we can do without getting a source vector image or re-creating the truffle.

Photoshop Small Image Enlarging - 10x and Blur Hack

9.3.2007

A TruffleSuppose you have a lovely little image, such as the one shown at right. You'd really like that image just a bit larger in dimension, but you don't have the source vector image. How do you enlarge it while minimizing the artifacts and jagged edges? These steps will walk you through a procedure for enlarging the image using Photoshop.

A TruffleThe simplest way to enlarge an image is to select Image, and then Image Size from Photoshop's menus. Enter new height and width that you'd like, and blammo - you've got an enlarged image. The image at right has been enlarged to 4 times it's original size. But all those jagged edges sure look ugly. So instead, try the slightly more complex method.

A TruffleInstead, first enlarge the image to 10 times what you'd like the resulting size to be. So, in this example, open the height and width to 1280 pixels for both height and width in the Image Size dialog box. (1280 is 4 times 10 times 32 - desired size times 10 times original size.) Then, to smooth things up a bit, add a Gausian Blur the the super huge image. To do so, from the Filter menu, select Blur and then select Gaussian Blur. For this example, set the pixels to 20, and then click OK. (You'll want to try different values to find the best setting for your image.) Then use the Image Size dialog to set the height and width down to the desired result - 128 pixels each in this example. The result of this is shown a right.

The image resulting from the new 10x and Blur method is not prefect - for that you'd need a vector source graphic. But it certainly is less jagged than otherwise. Enlarging an image to 4 times it's original size is a bit excessive. I've gotten pretty good results by enlarging images to as much as twice their size.

Do you like the original image shown here? You can get your own truffle, and many more, at Iconbuffet.

Last Month

Next Month