Mostly about my amusement

Year: 2010 (page 7 of 13)

Pool algorithm?

Tomorrow we’re having some friends over, so today I’m doing pool duty. This involves me vacuuming the portions that the robot does a bad job on, and then tossing in said robot so it can do it’s thing.

Around 7 AM I turned on the filter pump, went over the lines where the pool slopes meet, and made my way around the pool. I started on the deep end, made my way around, and checked that I didn’t leave any big patches. Not complicated just tedious.

I ended up with a bucket full of leaves, dead bugs, and some pebbles. I turned off the filter pump and tossed in the robot. It’ll take 2 hours for it to run it’s cycle.

This is what geeks think about: How does it make a decision to go one way or the other? When it hits a boundary it sometimes climbs up the wall. Other times it pauses and goes back and turns. In a couple of hours I’ll pull it out and wash it’s filter. That will have a bagful of leaves, sand, bugs, etc.

It’s work, but watching it run is a kick for me. Later on I’ll double check how clean it is by doing some swimming with the family.

Google XML Sitemaps and WordPress Multisite

Update August 13th, 2011: I’ve switched over and am giving a new plugin a try. It’s called Better WordPress Google XML Sitemaps (with sitemapindex and Multi-site support) and so far so good.

What really convinced me to look at this one is that the guys at WP Engine added it to their Curated Plugins list. If they are giving this a try then that’s really all justification I need.

Update July 23rd, 2011: These instructions still work for the newer 3.2.5 version as well. While this simple modification is useful, I plan to switch the to the 4.0 beta.

Update: Arne has posted an early test version on the WordPress support forums here. At this stage it’s not yet ready for release. If you would like to test that version, you can support Arne’s effort by downloading and reporting any issues to him on that thread.

I’m lazy and have not yet tried the early release version. 🙂

——————————————————–

WordPress 3.0’s Multisite feature is cool and useful. The Google (XML) Sitemaps Generator plugin is also cool and useful. Unfortunately Arne Brachhold’s excellent plugin does not work with multisite blogs.

If you activate the plugin on a multisite enabled WordPress install, you get this error message.

Which is a shame, but it did not take me a long time to find a work around. My setup is using multisite with sub-domains and with the Domain Mapping plugin. These instructions are for the 3.2.4 version of the plugin.

1. Modify the plugin

Edit the file wp-content/plugins/google-sitemap-generator/sitemap.php and comment out lines 53 to 58 to look like this

//Check for 3.0 multisite, NOT supported yet!
// if((defined(‘WP_ALLOW_MULTISITE’) && WP_ALLOW_MULTISITE) || (function_exists(‘is_multisite’) && is_multisite())) {
// if(function_exists(‘is_super_admin’) && is_super_admin()) {
// add_action(‘admin_notices’, array(‘GoogleSitemapGeneratorLoader’, ‘AddMultisiteWarning’));
// }
//
// return;
// }

You can delete these lines, but I prefer to comment them out.  All this does is prevent the plugin from detecting the multisite setup and not becoming active.

2. Get your rewrite rules ready

In your blog’s .htaccess file add these lines above your WordPress rules

RewriteRule ^sitemap.xml sitemap-%{SERVER_NAME}.xml [L]
RewriteRule ^sitemap.xml.gz sitemap-%{SERVER_NAME}.xml.gz [L]

This will come in handy later.

3. Activate the plugin and set these options

Now on each of your sites in your WordPress network, activate the Google (XML) Sitemap plugin. Do not Network Activate it.

Now got to your XML-Sitemap options page and for “Location of your sitemap file” select Custom location.

In the custom location change your change the file name sitemap.xml to sitemap-yourblogservername.xml. My server name is blog.dembowski.net so I’m using sitemap-blog.dembowski.net.xml. Save the options.

Look in your WordPress installation’s root and check if you have sitemap.xml or sitemap.xml.gz. If you do then delete them both.

Now at the top of that options page, click on “rebuild the sitemap manually” and confirm that your new sitemap-yourblogservername.xml has been created.

4. Test and confirm that this worked

Now test two things. Start by pointing your browser to http://yourblogservername/sitemap.xml and then http://yourblogservername/sitemap-yourblogservername.xml. If you setup your .htaccess rewrite rules correctly, then both URLs should work.

Load up your WordPress generated robots.txt file via http://yourblogservername/robots.txt and look at the Sitemap line. Mine reads like this

User-agent: *
Disallow:

Sitemap: http://blog.dembowski.net/sitemap-blog.dembowski.net.xml.gz

I have that rewrite rule in case the default location for the sitemap is used.  When you load the sitemap via the normal location, the rewite rule sends it to the correct location. The second gziped sitemap URL is fine.

There should be no real sitemap.xml or sitemap.xml.gz files in your blog’s root directory. Instead, each sitemap file should have your virtual WordPress network names instead.

5. Rinse and repeat

Repeat this process for each site in your WordPress Network and you can continue to use this sitemap plugin. You will need to activate the plugin in each of your sites and change sitemap.xml to include the site name just as I outline in step 3.

6. The caveat

If this works for you, great! But if it doesn’t, please don’t bug Arne. If and when he makes his plugin multisite compatible, then it will be probably a better solution than this one. I’m not seeing any PHP errors or warning in my log files, but there may be reasons why this is not a good idea.

Also, when you modify your copy of a plugin in the WordPress plugin repository and that plugin is updated you will lose your edits from step 1 when you update the plugin.

In the meanwhile, I can continue to use this excellent plugin.

Converted to WordPress 3.0 Multisite

I have a few blogs and I’ve been maintaining them each one at a time. So when a new version of WordPress is released or plugins get updated, I end up repeating the same process 5 times.

WordPress 3.0 (I’m using 3.0-RC2 as of this writing) supports multisite functionality. One set of software runs multiple sites and I only need to keep on that installation up to date. Setting up the multisite was easy and I just followed the instructions here.

For the WordPress part, I opted for the sub-domain model and with main blog as my existing blog.dembowski.net with all other blogs as *.blog.dembowski.net.

On the DNS and Apache2 portions, I added to my dembowski.net zone a new wildcard entry for *.blog.dembowski.net and added a ServerAlias in my Apache2 vhost for *.blog.dembowski.net to point to blog.dembowski.net.

I then did a WXR export of my existing blogs and imported them into the new setup. My existing blogs are blogname.dembowski.net, not blogname.blogs.dembowski.net. Not a problem. Once I had the data imported, I modified my Apache2 vhosts to point to the new install and followed Otto’s domain mapping tutorial and I’m good to go.

There is some learning for me to do. Not all plugins work in the multisite setup  and I’m working out which ones can be Network Activated or need to be activated in each instance. I’ve doped out the vhost issues including SSL, so that’s not a problem. But this is new and somethings will not work as it used to.

Cool. This ought to be a lot of fun.

Tom Toles gets it right

Once again, Tom Toles nails it.

I especially get a kick from Sarah Palin complaining and editorializing about President Obama. The oil spill is a mess, but instead of getting together and fixing it, the radical right is just trying to score cheap points.

I am now the pool boy

What a fun couple of weeks this has been. We’ve opened up our pool and the whole family is enjoying it. It been a huge project to get to this point.

Last November, my wife and I had an in ground pool installed and we’ve been scurrying to get it fully operational for the Memorial Day weekend. We started the vetting process to select the company back in August of 2009 and for each portion we spoke with 4 or 5 companies. Lily wanted to make sure we got a good deal as well as what we wanted.

With all the construction, the pool has a layer of dirt and sand on the bottom.  I’ve put in the pool roomba (it climbs the pools walls!) but Saturday I vacuumed out the whole pool. I got almost all of the sand on the bottom but I also stirred up some sand too, so I’ll be vacuuming on a regular basis for now. The water is clear but the remaining sand is hiding out in the corners and it bugs me.

With any pool construction, you need to deal with at lots of companies. The pool company, the landscapers, the fencing company, and the sprinkler company. This is going to sound like one big product endorsement, but I want to say thank you to all the companies involved.

The construction was fast and well done. We used a company called Swimking and they’ve been great. I’ve called them, and they have patiently answered my questions and came back to deal with some small adjustments. I’ve never had to deal with any pool so I’ve had lots of questions. There have been minor things and they sent someone over to sort it out quickly.

I’m in IT and while I can visualize what people are describing very well, I’m no good at designing a layout. Our plantings and garden work has all been done by Cappiello Landscaping. The owner Joe described a really good-looking plan, told us what plants we were getting etc. But seeing it in place is fantastic. Joe’s company works fast and efficiently and in a few days they transformed a construction site into a great back yard garden. The whole layout with the pool works great.

We selected Continental Fence to install estate fencing where you can see it and black chain link where you can’t. I was afraid the surrounding the pool with a fence (NY state safety code, and its a good thing too) would make the pool area look small. But the reverse happened and the effect makes the pool look bigger. It took Steve’s company less than 2 days to put the fencing in and it looks great.

For the in ground sprinkler work, we use Dean’s Sprinkler Service. We’ve been using Dean’s company for about 5 years. Dean and his guys chase down every sprinkler head, tunes the system with the gardener. And Dean personally drops by on his day off and makes sure the whole system is working. I can’t say enough good things about Dean: he explains what and why he’s doing something and gives you a lot of options to work with.

Once the pool is all cleaned up I’ll post photos. We started using the pool already but there are still some more things to complete.

WordPress 3.0 menus and Hybrid theme

WordPress 3.0 beta comes with support for a customized menu system that optionally replaces the wp_page_menu with wp_nav_menu. Drag and drop menu management is a cool and useful feature. It’s like widgets only for navigation purposes.

For my WordPress blog I am using a child theme of Hybrid called WP Full Site and I’ve made some minor changes and additions. Among them I have removed the Home link and added a Subscribe link in my menu.

Modifying my functions.php file like so accomplished the deed:

add_filter('wp_page_menu', 'custom_page_nav');

function custom_page_nav( $menu ) {

    // My blog title is already clickable, why have another Home link?
    // Remove the Home link from the home page
    $zaphome = '<li class="current_page_item"><a title="Home" href="' . get_bloginfo('wpurl') . '/">Home</a></li>';
    $menu = str_replace( $zaphome ,'', $menu );

    // Remove the Home link from everywhere else
    $zaphome = '<li><a title="Home" href="' . get_bloginfo('wpurl') . '/">Home</a></li>';
    $menu = str_replace( $zaphome ,'', $menu );

    // Now add a RSS subscribe link with CSS id
    $links .= '<li id="feed"><a href="' . get_bloginfo('rss2_url') . '" title="Subscribe to the feed">Subscribe</a></li>';
    $menu = str_replace( '</ul></div>', $links . '</ul></div>', $menu );

    return $menu;
}

And I added these lines to my style.css (I am pretty sure I appropriated it from another of Patrick Daly’s themes but not sure which one):

#navigation ul li#feed {
    width: 120px;
    float: right;
    background: url(images/feed-icon.png) 100px 13px no-repeat;
 }
#navigation ul li#feed a:hover {
    background: #433B14 url(images/feed-icon.png) 100px 13px no-repeat;
 }

And that took care of that.

The upcoming Hybrid 0.8 theme is in beta and has support for the WordPress 3.0 menu system. Activating it changes the CSS styling and replaces wp_page_menu with wp_nav_menu. I wanted to give the menu system a try while keeping my modifications. It was easier than I thought.

First up, fix the CSS. With the wp_page_menu output, the menus are styled with CSS ID of navigation. This gets switched to a CSS class called menu when you use wp_nav_menu.

/* Menus */
.menu {
        background: url('library/images/nav-bg.gif') repeat-x;
        border-bottom: 1px solid #433B14;
        border-top: 1px solid #0F0F0F;
        height: 38px;
}
.menu li {
        border-left: 1px solid #262001;
        border-right: 1px solid #322a03;
}
.menu li ul li {
        border-bottom: 1px solid #433B14;
        font-style: italic;
        font-weight: normal;
        text-transform: none;
}
.menu a {
        color: #fff;
        display: block;
        font-size: 14px;
        font-weight: bold;
        line-height: 14px;
        padding: 12px 18px;
        text-decoration: none;
}
.menu a:hover {
        background: #433B14;
}
.menu li ul li a {
        background: url('library/images/nav-bg.gif') repeat-x;
        border-bottom: 1px solid #0F0F0F;
}
/* My subscribe button */
.menu ul li#feed {
        width: 120px;
        float: right;
        background: url(images/feed-icon.png) 100px 13px no-repeat;
        }
.menu ul li#feed a:hover {
        background: #433B14 url(images/feed-icon.png) 100px 13px no-repeat;
        }
.menu ul li#feed a {
        }

Tedious, but not really a big deal and I just copied the existing CSS in the child theme. I’m not very CSS savvy so there is probably an easier way to re-use the existing section.

To add my Subscribe link all I had to do was add one more filter like so.

add_filter('wp_nav_menu', 'custom_page_nav');

Now I can switch between using the new or old menu system and maintain the look and feel that I want.

1/1 scale Hoi Hoi-san model

All done.

This one was good, but the hair ruins the balance of the whole model. Also I may glue some of the hair pieces. They fall off if you look at it too closely.

I’m not sure which model I’ll pickup next. It’s a toss-up between the heavy arms version or another Gundam model.

Hoi Hoi San WIP

Not my usual type of model.

This is the work in progress picture for the 1/1 scale Hoi Hoi-san model. It’s for my 6 year old girl. To make sure that it all works out, I’m gluing the pieces together when appropriate. The head will have interchangeable faces so I need to remember to NOT glue those parts together.