Site content calendar work started

This weekend I started working on a simple page to allow browsing content on my site by last modification date. I don’t expect this to be very useful to visitors. Its main intent is to let me keep track of what I’ve worked on recently.

has a WCalendar widget that I’m using as a base class for the calendar. I extend the WCalendar class and add my own loading (in the constructor), cell rendering to highlight dates on which content was modified, and of course I connect selection signals to my own slots. When a date is selected, a WTable below the calendar will display links to the content that was modified on that date.

I save a cookie holding the last date selected, so that when a user returns to the same page within 24 hours, the calendar will load the month of the last date selected and will select the last date selected. The WTable will be updated appropriately.

Since my indexing code already saves a last modified time as a document value when I’m indexing the web site, and I already had C++ code to pluck document data from the database, it was not difficult to have my application load the data that’s behind the calendar. I spent a great deal more time getting the calendar to look the way I want than I spent writing functional code.

You can see the new calendar here. It’s not finished, but it’s functional.

Website updates March 2012

I spent a little time this weekend tweaking the web site.

First up was to deal with some Wt problems in Wt::Chart classes that I use for my Site Health and Site Traffic pages. I updated from wt-3.1.8 to wt-3.2.0 in hopes of some issues being fixed, particularly rotated x-axis label issues. However, things got a little worse… rotated axis labels no longer work at all with canvas display. So I tweaked my chart applications to not use rotated x-axis labels. In the process I customized the display of the x-axis title a bit. For daily plots, I show hour and minute. For all others I show month and day.

I also restyled the chart background and date range selection buttons.

I completely refactored my blog. New theme based on wallow, and a lot of widget and CSS changes. I think it looks cleaner while still having everything I need on the screen.

The styling of everything else was also modified significantly. I’m trying to produce a fairly consistent look everywhere, but have not yet tackled the gallery3 stuff under Gallery. To be honest, gallery3 is spaghetti code at best. Writing my own gallery code using Wt is becoming a more appealing idea.

web site health monitoring: part 2

Last weekend I finished implementing the CPU temperature and filesystem utilization graphs. They work fine, though I may change the filesystem utilization graphs to just be category charts with a single set; filesystem utilization doesn’t change frequently. The latest can be seen here.

I deployed the health monitoring on the new web site for Randy. That host doesn’t have CPU temperature reporting, so I made changes to the code to not display that graph if CPU temperatures are not available.

There’s a problem with the BIOS on the CPU temperatures are incorrect. I have newer BIOS to load, I just haven’t gotten around to it yet.

web site health monitoring: part 1

This past weekend I finished the data collector for web site health. I keep track of CPU temperatures, CPU utilization and filesystem utilization.

The CPU utilization graph is done. The others are in the works. Like my traffic graphs, the user interface is a Wt application.

web site traffic monitoring: part 2

I’m done with the first pass of traffic monitoring. The traffic page can show graps of web site traffic on port 80 for the current day, current week, previous week, current month, previous month, current year and previous year. Good enough for now.

web site traffic monitoring: part 1

Last weekend I wrote a simple program to store traffic statistics (packets and bytes for both input and output) for port 80 of my new web server. Actually, any pcap filter expression can be used, I just happen to only be tracking port 80 at the moment. I save data every 5 minutes.

This weekend I spent a little time writing an application using Wt to graph the traffic data. The graph works, but it needs some cleanup. In the process, I wound up making some changes to the Wt::Chart classes because it didn’t let me use the desired colors for axis labels, titles and legend text. I’ll have to check these changes into my repository so I can diff them and send a patch to the Wt author.

I now just need some utility classes and functions to allow graphing various time periods of interest.

sitemap deployed

I’ve deployed my web site map. This is the result of the work discussed in my post on Using Wt (C++ Web Toolkit) for a web site map. The original application mentioned in that post can now run as a WidgetSet application, and is now embedded in my php page wrappers.

I’m starting to think that it’d be nice to play with replacing my search page with a Wt application. Not because there’s anything wrong with the existing search, but because I’d like to free myself from maintaining the javascript. The javascript for my search page isn’t large nor terrible since I’m using jQuery, but replacing it with Wt would permit graceful degradation. And while javascript is handy, I’m still a non-expert in it.

Using Wt (C++ Web Toolkit) for a web site map

It had been many years since I had looked at Wt, a C++ library for developing interactive web applications. Last weekend, I started using it again for a simple site map that’s automatically generated so I don’t have to manually update the map.

The first pass resulted in sitemap. I’m using a TreeView with Wt::WStandardItem objects.

The sitemap application initially generated the TreeView on the fly by traversing the filesystem under my document root, using my existing SiteIndexConfig class (used by my menu generators and my site indexer) for configuration. I knew from the start that this wouldn’t work for deployment, since it’d be too slow with all of the content from my old web server. But I already had classes to traverse the filesystem and pluck out web pages, find their titles (already stored in Xapian by my indexer), etc. It worked for a throwaway prototype.

I then wrote a new application to generate the data for sitemap, which I named (with no originality) mksitemap. It dumps a small binary file from a class named Dwm::WWW:DirectoryTree (derived from Dwm::DirectoryEntry), which can be directly read to populate a Dwm::WWW::SiteMap::DirectoryTree. From the instance of Dwm::WWW::SiteMap::DirectoryTree, I directly create Wt::WStandardItem objects for the Wt::TreeView.

The sitemap application itself is fairly small in terms of lines-of-code:

dwm@www2:/home/dwm/src/dwm/www/apps/sitemap% mcloc .
54 ./
22 ./DwmWWWSiteMapApp.hh
43 ./
28 ./DwmWWWSiteMapDirectoryTree.hh
20 ./

Obviously this isn’t counting the more general-purpose classes used by sitemap:

dwm@www2:/home/dwm/src/dwm/www/classes% mcloc src include
14 include/DwmWWW.hh
27 include/DwmWWWDirectoryTree.hh
41 include/DwmWWWSiteIndexConfig.hh
17 include/DwmWWWUtils.hh
97 src/
243 src/DwmWWWSiteIndexConfig.ll
130 src/

I’m not going to count the lines of code from libDwm; it’s a significant library, I’m only using a small part of it in this application, and it’s no effort to use it since I’ve been working on it for a decade. I’m using the Dwm::IO templates, the Dwm::SysLogger class, the Dwm::StringUtils templates, the Dwm::DirectoryEntry class and the Dwm::Signal class since I’m running under mod_fastcgi.

Migrating my web site to new hardware

Tonight I fished the first pass at migrating my new web site from its development machine to its new home on a nearly identical machine. More information is here.

I’m really enjoying the Supermicro MBD-X7SPA-H-O motherboards in the new web server and gateway.  With 6 SATA ports and dual ethernet, and Intel D510 Atom processors that are easy to keep cool, they work well in a reasonable case.  I’m also really liking the Supermicro CSE-731i-300B cases.  Though they’re significantly larger than I need, they’re inexpensive for the features.  The only modifications I made: I cut an intake hole adjacent the hard drive cage for an 80mm Noctua NF-R8 fan, populated the front intake location with another Noctua NF-R8 fan, and replaced the stock 92mm fan with a Noctua NF-B9.  The Noctua fans are all rated for 150,000 hours, and are quiet.

Replacing ‘imageindex’ with my own software: part 2

Over the weekend, I finished the first pass at ‘mcphotoweb’. It generates basic photo albums. On the web server side, I’m using javascript to expand the medium-sized images from the thumbs and the full-size images from the medium-sized images. It works, and the presentation is nicer than what ‘imageindex’ produced. The javascript is hackish, but it works. For an example, see my August 30, 2007 album from the 2007 BMW Z Homecoming.

The next round will probably emit XML files with more meta-information, which will enable some of the EXIF details of photos to be shown.