Creative Commons License
This weblog is licensed under a Creative Commons License.

« January 2006 | Main | March 2006 »

February 28, 2006

Publishing System Addendum: Home Page

Forgot to blog about how I did the home page (http://www.theeislers.com). This page is designed as a composite of all the things we have: KT's blog, my blog, our blog about our boys, and our pictures. A while back, I wrote some PHP that can read an atom or RSS file and create links to the recent blog entries. I leveraged this, plus the random picture selecting code I wrote for the pictures page to build our home page.

The home page still links to individual pages for KT & I, the boys, and our dog (poor cats don't get a page!). That is pretty obsolete, my thinking going forward is that the blogs should be the primary page, with links in the side bars to the kinds of things that are linked to from the individual page.

Here is the code you need: homepage.zip (3 KB). It has to be copied to the root of your web site. Index.php is the file to customize for the blogs, pictures, links etc.

This is incremental to the site code for pictures that was part of the first publishing blog below - SiteRoot.zip (8 KB)

Comments

My Publishing System

A kind internet wanderer named Mike recently sent me an email complimenting me on the web site I've created for the family. He asked me how I did it, and since a couple of my friends have asked me about how to set up something the way I did, I thought "hey - what a great topic for my technology blog".

I use Yahoo! Small Business for hosting. They are very reasonable - $19.95 a month buys you 10 gigs of storage, a huge amount of transfer (400 gigabytes a month), hundreds of 2GB email addresses, the ability to manage your domain, FTP, and support for publishing technologies like MySQL, PHP, and MovableType. They also have a $11.95 package that is the same except 5GB of storage and 200GB data transfer.

My approach has refined over the past 8 months of blogging. At first, all I posted were pictures. My approach for years was manual - crawl through the pictures, and use Photoshop to create an internet friendly version and a thumbnail. Then I would manually create the HTML for each picture set. Gah! It took hours to get photos up. I eventually ran out of steam doing that and my photo publishing lagged for over a year until I discovered Picasa. Then last June I started blogging, and this is where photos, video and narrative all merged to our family blog.

Photo Publishing

Picasa changed everything for me - I add a label to a photoset, go through and cull the blurry ones from the label, and then click on the label and select "Make a web page". I didn't like the default templates provided as they insert a Picasa logo and weren't customized to my site navigation, so I made a couple of tweaks which you can find here: PicasaTemplate.zip (50 KB). These files copy into C:\Program Files\Picasa2\web\templates - the links.js and style.css are there because Picasa 2.1 starting hanging without them. Links.js is some javascript that adds whatever links you want beside "Next set" and "Previous Set". I created links.js so that I could the various links whenever I wanted without having to go back and re-edit every single photo set I published. I chose the blackbg template and customized as follows (you only need to know this if you don't want to use the template I provided):

  • HEADER.HTML, ITEMHEADER.HTML and INDEX.HTML: change the stylesheet reference from "style.css" to "../style.css". This will have each photoset you publish share the same CSS, so you change change it in one place only.
  • IMAGETARGET.TPL: remove the '#' sign from thumbnailWidth and thumbnailHeight, and change the numbers to 200 from 160. I like bigger thumbnails than the default.
  • INDEX.TPL: in the first line, change "Template blah blah" to something you can identify like "Craig". Also, like IMAGETARGET.TPL, make the changes to thumbnailWidth and thumbnailHeight
  • TARGETLISTHEADER.HTML: little bit bigger change, remove the text between the tags, and replace it with:

    <a href="/indexfull.htm">Previous Set</a> | <a href="/indexfull.htm">Next Set</a><SCRIPT src="../links.js" type=text/javascript>

    Each time you create a new photoset, you just change the "Previous Set" and "Next Set" hyperlinks to link between the most recent photoset and the newest photoset.

That's it. I use Microsoft FrontPage to publish, and all I do is copy the directory created in My Documents\Picasa Web Exports. Yahoo runs FreeBSD, which doesn't support spaces or punctuation in filenames, so you will have to manually rename the directory before copying it - I just eliminate punctuation and replace all spaces with underscores ('_'). Copy the directory you just renamed to the appropriate directory in your web site in FrontPage (I use a master directory called Collections - you need to copy the style.css and links.js from above to this directory, by the way), go into FrontPage and link the new set with the last set and vice versa. It is quite quick in FrontPage - just select the "Next Set" in the older set, right click and select "Hyperlink", and link it to the new page. Then do the same thing for"Previous Set" in the new set, remove the hyperlink from "Next Set", and republish.

I used to manually create a link to each photo set on a static page, but that got old and time consuming, plus I couldn't search, sort, or categorize my pictures. So I created a little PHP program that dynamically generates a main pictures page based on an index file. T he index file is called "picturelist.txt" (I include a sample in the download package below in the "Setting up a Blog" section) and it contains simple information for each photo set: URL, directory, date, title, and whatever categories you want to assign, e.g.:

http://www.theeislers.com,/Collections/2005-11-25_Two_Best_Friends_Conked_Out,2005-11-25,Two Best Friends Conked Out,Angus,Cats

Pictures.php generates a page from this information. It is pretty cool, see it in action here

Aside from pictures.php, there is also newpictures.php that needs to be run every time you add a picture set. Newpictures.php generates the last pictures and thumbstrip that you see in my boys blog. You run it by entering http://www.yoururl.com/newpictures.php into your browser. I used to compute the last picture list and thumbstrip at page generation time (along with a cool calendar), but Yahoo! has pretty random performance for PHP that accesses the file system, so I had go to this publish-time instead of real-time method.

That is all there is to my photo publishing system - I can go from photos copied off the camera to published on the internet in 5-10 minutes, depending on how long I spend culling the photoset. I also like to do a blog for each picture set I publish, I find it to be a great way to remember context of the photoset. At some point I would like to link the photoset back to the blog, too, but that would be a bunch of retro-work that I keep putting off.

All the PHP for my pictures is found below.

Setting up a Blog

The main page for my family is my boys blog. I use Movable Type through Yahoo's hosting to host and manage this site. Setting up Movable Type is pretty straightforward - you just go into your Yahoo! control panel and follow the instructions. If you aren't using Yahoo!, my earlier blog about how to set up MovableType on Yahoo! might be helpful - I wrote this before Yahoo! supported MovableType natively, and a lot of the stuff you need to do should be the same on any hosting environment. There is also stuff there on how to move your blog out of Blogger which is irrelevant if you aren't doing a transfer from Blogger (duh!).

I built my own custom set of templates - I don't like MovableType defaults, they are 2 column (not 3) and assume an 800 pixel wide display, which is really out of date. My templates are 3 column and assume a 1024 wide display (which is also way out of date - my new Dell 30" display is 2560x1600 pixels, which KICKS ASS). Assuming that Yahoo still hasn't fixed the rebuild bug, once you change the templates (below), you will need to follow my instructions on how to make rebuilding work.

My left column has a custom archive feature that I built based on the same idea I had for pictures - the ability to sort and filter the blogs. The "Recent Pictures" and "Found Pictures" strips found on the left and right column come from code that is generated when you run the newpictures.php file I referred to above.

Copy these files to the root of your blog directory: BlogRoot.zip (9 KB). This code does one thing only - it allows a viewer of your site to dynamically change the color scheme of the blog. It was a nerdy feature that seemed like a good idea at the time. You can remove this ability by editing the Alpha Module template (see templates below).

Copy these files to the root of your site: SiteRoot.zip (8 KB). This is the code that handles all the picture stuff from the previous section.

Here are the templates to install in MovableType: Templates.zip (15 KB). This is a little work as you have to create a bunch of templates in MovableType. There is a directory for each class of templates:

  • Indexes: you need to either create a new index template (for bloglist.txt and bloglist.php) or copy the contents to an existing index template (index.php and styles-site.css)
  • Archives: replace the contents of Category Archive, Date-Based Archive, and Individual Entry Archive with the contents of the supplied text files
  • Modules: I designed a LOT of flexibility into the "gamma" module templates (the right hand strip), perhaps too much - when I was done adjusting for all the performance problems of PHP on Yahoo!, all the Gamma_*** templates looked the same. Anyway, you need to "Create New Template Module" in the Modules template section with a name that exactly matches the file name (less the ".txt") of each file in the Modules directory of Templates.zip. For example, you need to create the template "Alpha" in the Modules template section that has the contents of Alpha.txt.

The only screwing around you will have to do with the above is to find all instances of "www.theeislers.com" and change it to your main site URL, and to change all instances of "theboys.theeislers.com" and change it to the URL of your blog.

Note that all of this assumes that the blogs are in a subdirectory of the main ftp site and the pictures are in a directory called Collections. I don't know what happens if you don't do it this way - Caveat emptor, and remember, you are getting what you paid for with this code!

Mobile Blogging

Setting up mobile blogging is pretty easy - Flickr has a really nice feature for this (it does require you to blog with a photo, mind you, but that is how I do it so it works for me). After following the instructions, you get an email address you can send a photo to that will not only publish to Flickr, but will publish to your blog. The subject of the email becomes the blog title, and the body of your email becomes the text. Just add the email address that Flickr gives you to your phone address book and you are good to go, assuming you have a camera phone that is configured to send mail.

I don't like to leave the Flickr photos there - I prefer 320 pixel wide pictures, and Flickr only gives you 250 or 500 as options. So usually when I get home I republish the mobile blog (using Anconia RocketPost, discussed below) with the larger thumbnail linked to the full pictures. But that is pretty anal and probably not necessary.

I found one cool side effect of mobile blogging through Flickr - they mashed up with QOOP, and you can print a photo book that has all the subjects and text you typed in. I ordered one Friday night, it was only 13 bucks for 12 pages (48 pictures). We'll see how it turns out, but it is a neat idea.

Blogging tools

I blogged about the lack of tools but finally found one I liked - Anconia RocketPost. It is the only one that lets you drag and drop pictures easily. My wife loves it - she is a big fan of weaving pictures into her blogs. RocketPost has issues - so fair warning as it is a bit buggy for the $99 price.

  • RocketPost doesn't respect the "upload as draft" status or a manually set date when you post. It happened with this post - I wanted to get it into my blog from my laptop so I could edit it from home, and it ended up published even though I had changed the status from "publish" to "upload as draft" and I had to go into the web interface for MovableType to put it back to draft status.
  • You enter a width and height for default thumbnail size, and the tool respects height instead of width. So if you have pictures from different cameras with different height/width ratios, the width of the thumbnail varies instead of the height. I HATE this - I want fixed width, variable height, since my blog has a fixed width for each post. I should be able to chose which dimension I want to be fixed (height or width), and let the other get computed based the relative height/width of the photo in question.
  • RocketPost doesn't clean up its HTML very well when you edit in WYSIWYG mode. For example, in this post I wanted some text to be Courier small font. Then I changed my mind and wanted extra-small, so I selected the text, and chose extra-small text. No change. Tried again. No change. Tried a bigger font to see if that mattered. No change. And again and again and again. Finally I look at the code, and the text had dozens of tags around it, but the inner most tag set was the original "Courier small font" set, and so all that got rendered was that. RocketPost also doesn't delete the tag when you delete a hyperlinked image, so you end up with more dead HTML. That is a theme, lots of dead HTML can get left behind.
  • Sometimes WYSIWYG mode pegs the CPU (and renders the editor unusable) if you have a lot of pictures or rich text (I was constantly pegging my laptop while writing this blog on the plane Saturday).

All grousing aside, RocketPost is the best tool I have found. They update it regularly, which I love - I am delighted with it overall. When all else fails, using the web interface is fine, but if you want to have pictures resized & auto-thumbnailed, along with having your blog autosaved every couple of minutes so you don't lose anything, RocketPost is awesome.

Comments

February 26, 2006

Holy FREAKING Moley - Dell 30” Widescreen Flat Panel Meets ATI Radeon X1900 XTX

I lost my patience with waiting for a sale and bought a Dell 30" Widescreen Flat Panel Monitor last weekend. It showed up this past Tuesday, and it is stunning how large it is - the resolution is 2560x1600, or 4,096,000 pixels. What is amazing is that there was not a single dead pixel. I can't believe manufacturing has gotten that precise - I remember when a dead pixel or two on a 1024x768 display (786,432 pixels) was considered "acceptable" by the manufacturers.

I got my cool display in anticipation of my new gaming PC (more in a later blog), but then when I talked to the order verification people last week I found out my new PC was going to take 30 to 45 days. No big deal, I think to myself. But then I hooked my new display to my current PC. The "obsolete" card I have (an ATI Radeon X850, which was the state of the art a year ago when I got the machine and now might as well be an ATI Mach 64 from DirectX 1 in 1995) can only display 1920x1200. The display can't do 1920x1200, it can only do 2560x1600 or 1280x800 - so my display had to scale down to 1280x800 and was running at 1/4 the resolution it could. It was looking at my Sony Vaio T series through a giant magnifying glass - underwhelming to say the least.

Rationalization set in quickly. Well, I say - my gaming machine of today is about to become my guest gaming machine of tomorrow. Surely my guests deserve to have state of the art graphics. What kind of host would I be if I invited someone over and my new gaming machine SO overshadowed the guest machine? A crappy host! And being a good host, I ordered a new ATI Radeon X1900 XTX - the single card version of the dual cards I am having put in my new machine (only they call them "Crossfire" to make you feel extra special).

I was in Seattle for a few days, and the card arrived while I was gone. I got a chance to install it about 30 minutes ago (I LOVE Dell cases - they are so easy to work with), and I only have one thing to say.

HOLY FREAKING MOLEY.

I can't go back, I won't go back. 2560x1600 is not be believed. I have an unholy amount of screen real estate. I thought my productivity went up when I had got my 24" Samsung flat panel @ 1920x1200 and my visible information jumped through the roof - this is as state changing as that. 2,304,000 pixels jumps to 4,096,000 pixels - 78% more pixels. GACK!

I haven't even tried it for gaming. I had to reinstall Windows on this machine a few weeks back (love that it is 2006 and you still have to do that) and have yet to put any of my games on. Can't wait to see how the X1900 performs (it is working with a 3.73 ghz Pentium Extreme Edition with a 1066 mhz front side bus, so hopefully it will kick some serious butt). Gotta go find out!

Comments

Good for you for not waiting! If not now, when?? Sounds amazing - hope we can see it. xoxox C

February 20, 2006

DirectX Then and Now (Part 1)

I finally ordered my new gaming PC on the weekend (more on that in Part 2), and looking at the specs got me thinking about the amazing way things have changed since I started work on Direct X over 11 years ago. In November of 1994, 2 friends of mine (Alex St. John & Eric Engstrom) & I had what we thought was a simple idea - what if it was possible to give game developers access to the high end features of video cards? Would games finally migrate from DOS to Windows (specifically, Windows 95 back then)? Could Windows really be a gaming platform that could compete with Sega and Nintendo? At the time, it wasn't clear there was any way this could possibly happen. The efforts that I inherited when I went to work in the Windows 95 multimedia team were WinG, a port of bitmap APIs from Windows 95 back to Windows 3, and DCI, which gave access to the frame buffer of a video card but ignored all of the other cool features that were in video hardware.

The three of us figured we could do something about it, so that December Eric & I wrote a powerpoint and presented it to a bunch of game developers that Alex brought up. Thus was born a mad dash to build something to change the game so that high end games could run. We had to get to beta for the Computer Game Developers Conference (CGDC) in April of 1995, and I didn't write the first code until Christmas break 1994 - talk about a mad dash! Since multimedia on Windows had a bad reputation back then, we were adamant not to have our stuff associated with "multimedia" and so we called the first beta the "Game SDK". We got the idea to name it DirectX because some reporter made of fun of how we had DirectDraw, DirectSound, and DirectPlay - Direct "X" they wrote. We took it and ran with it, and so every set of functionality became DirectSomethingOrOther (Direct3D, DirectInput, DirectSound3D all followed).

The video card hardware folks LOVED the idea of something that took advantage of their hardware. ATI, Cirrus Logic, and S3 (there were others I'm sure but those are three I remember) all came up to the Microsoft porting lab in building 20 to get their hardware to work with DirectDraw (I lived in building 20 with those guys for almost 2 months). After a huge push we had a beta ready for April - it only worked on the ATI Mach 64 card (with what was then a huge amount of RAM - 4 megabytes) and a Soundblaster card. We finished the beta with literally minutes to spare - I remember roaring down 405 at 120mph in Eric's Mazda RX7 after being up all night, racing to make the Saturday morning fed ex pickup so the CDs could be manufactured and shipped to us at the CGDC that Tuesday. The CDs literally arrived a couple of hours before we had to go on stage.

From April to September 30th of 1995 is a giant blur, but we pulled it off, and a bunch of games shipped for Christmas 1995 - and I got an ulcer and gained 25 or 30 pounds as an added bonus. We even pulled together a CD with bunch of games on it that went into retail stores. The games had "high end" requirements of a Windows 95 PC with a 486 66mhz processor, 8mb of RAM, and a 256 color display card.

After we shipped DirectX 1, I took a vacation for about 3 weeks while Eric & Alex went to Japan to launch DirectX 1J. I heard stories of sushi on the face - they were quite popular in Japan, those two. While they were busy insulting a millenia old culture, I bought a Mazada RX7 and drove it home - having never driven a stick before. I used those weeks to teach myself to drive a standard transmission, and only had to have the clutch replaced after 4000 miles.

The next two versions were done less than a year later and were equally mad dashes - we shipped DirectX 2 on June 5, 1996 and Direct X 3 on September 15h 1996. Alex pulled off a way cool launch party for DirectX 2 at the Computer Games Developers Conference in April of 1996. 'Pax Romana' was the theme, with a playboy playmate playing Cleopatra, live lions and our own DirectX coins. The Hospitality Suite sign was from that show, and it stayed in my office at Microsoft for years (it now lives in my home office). While in my office at Microsoft, it had a clever edit from a co-worker that changed the "Hospita" to "Hosti". With that simple edit, my office forever became known as the "Hostility Suite" - a badge I wore with pride for years!

For the DirectX 3 launch that fall, we took over a part of "Red West" (the first off-campus building set Microsoft built) and did a huge Halloween launch party. There were Doom tournaments, a haunted house with some band where the lead singer dressed as a giant penis, and Alex, Eric & I dressed in demon outfits. All I remember of that skit was Alex and Eric doing a bit about arguing about whether horn width or length mattered and I came out wearing a giant set of horns ($500 buck custom job) and them shaking their heads and agreeing that horns didn't matter. DirectX 3 was where we first launched Direct3D, based on the technology of Rendermorphics, a company we acquired earlier that year.

After DirectX 3, we had planned a DirectX 4 for December 1996 that would allow access to some special features that Cirrus Logic was going to put into laptop video chips (I think, its been 9? years). When the chips got delayed, we opted not to ship DirectX 4 as it had us in a huge rush (3 months between 3 & 4) for no reason. We had also told the game developer community about Direct X 5 that was targeting summer of 1997, and so we decided to simply skip DirectX 4 rather than confuse people. DirectX 5 shipped on July 16, 1997 - and to this day, people ponder about what happened to DirectX 4. So much for avoiding confusion.

Around the end of DirectX 1 or the start of 2, we had a military coat made with the radiation logo and "Team Direct" put on it. We also had some patches made with code name of each project each time we shipped a version. You will never be able to pick out the theme...

Now here we are in 2006, DirectX is is on version 9, and the PC hardware for games is not to be believed - but more on that later. On a final note, I have seen internet debates of the dates of shipment of the various versions, so I thought I would set the record straight: here is my first "Ship It" block from Microsoft, and it has the dates of each release.

Comments

This obviously wasn't written by Alex! It is very accurate and includes the other people involved by name. Sorry for the ribbing Alex, thank you for the nostalgic journey Craig!

Hi, is anyone able to provide DirectX Version 1.0? :) http://www.oldversion.com/talk/showpost.php?p=16508&postcount=33

Congratulations to all 3 of you for creating something that really had a lasting impact on the industry. I'm just really surprised you still have all the CD's laying around. Hasn't KT made you throw all that stuff out yet?

hi craig,
im a big fan of directx and i love games, i also have thebook renegades of the empire . can you like show some old code snippet of directx way back from version 1 .id love to see real microsoft code from prehistoric era Lol! ..
cheers,
Jack

Hey Jack - I posted 3 zip files of the SDKs for 1, 2 & 3. These have all the sample code, dlls, etc from the way back machine! DirectX Then and Now Part 2

Thanks for this very interesting and trip down "Memory Lane." I am not a "gamer" and never really knew what DirectX was about. Nice job! Wish I knew you!

February 5, 2006

Sony VAIO SZ Premium

Okay, this is my next laptop. Sony announced these at CES a month ago, but I just discovered it today (I need a better loop as I am out of the one I am in now).

My current day to day laptop is my Sony VAIO T370, which weighs 3.1 pounds and claims 7.5 hours of batter life with a standard battery. My configuration is a 10.6" widescreen, 1GB of RAM, a 60 gig harddrive (4200 RPM, putt, putt, putt, freakin' PUTT!), and a 1.2 GHz Pentium M processor

The SZ Premium (which isn't out yet, supposedly available in March) will weigh 3.7 pounds and give 7 hours of battery life from a standard battery. And it is apocalyptically better for the extra 0.6 pounds of weight (here my configuration when I get to order it):

  • 13.3" wide screen (my eyes are starting to have trouble with my 10.6" screen, sad but true)
  • 2GB RAM (2x the RAM, and we all know more is better)
  • 120 GB harddrive @ 5400 RPM (2x the harddrive space, and faster to boot. See "more is better" rule above)
  • 2.16 GHz Intel Core Duo Processor (righto, not only an extra gigahertz, but TWO, count 'em, TWO cores)
  • Integrated Biometric Fingerprint Sensor (damned cool!)

Plus all the same goo I have now - DVD burner, WiFi (only a/b/g, not just b/g), and Bluetooth. And of course a useless & annoying memory stick reader.

Can't wait!!

Comments

I'd rather go for the 7k100 since it bests all the other laptop drives out there in every way (see storagereview and silentpc).

Or if aiming for capacity there are 160 GB laptop drives just coming.

What horrible Edward Gorey Death will you die?

Not really a gadget or technology blog, but this was an entertaining quiz KT sent me. All the cool ways to die can be found in the extended entry.

Go easy on that.
You will drink too much gin. Not the worst way to die, but you won't remember too much of your life. Hey, at least you made some people laugh!

What horrible Edward Gorey Death will you die?

Being%20sucked%20dry%20by%20leeches%20isn't%20so%20bad.

You will be sucked dry by a leech. I'd stay away from swimming holes, and stick to good old cement. Even if it does hurt like hell when your toe scrapes the bottom.

Oooh%2C%20easy%20does%20it%20on%20the%20metal%20food%20group

You will swallow some tacks. You are a little weird, maybe not so much in a good way. Buy a yellow tie and wear it on your head.

Fit%20fit%20fits.

You will perish of fits. Repeat this to yourself: "Things can work out even if I don't get my way. Things can work out even...."

Go%20easy%20on%20that.

You will drink too much gin. Not the worst way to die, but you won't remember too much of your life. Hey, at least you made some people laugh!

Don't%20Trip

You will be smothered under a rug. You're a little anti-social, and may want to start gaining new social skills by making prank phone calls.

*Slosh*

You will sink in a mire. You like to think you're normal, but deep down you really just want to strip off your clothes and roll around in chicken fat.

Comments