Wisteria 2014

March 24, 2014 12:19 pm

Perhaps it has something to do with the amount of dead material I cut out of the trellis last Fall, or maybe it’s something else entirely, but the wisteria filled in really well this Spring.  This is what it’s looked like for the last couple of weeks (and probably will for another week or two):
Wisteria 2014And it smells nice too!  Just watch out for the bees and wasps….

Mechanical analog computers

March 21, 2014 1:47 pm

ArsTechnica has a great article about the mechanical analog fire-control computers used in the navy and how they work. I think it’s fascinating that people thought up these clever combinations of simple machine concepts. It makes me want to dig out my Kinect set and try to make a simple mechanical computer contraption…maybe I will!

http://arstechnica.com/information-technology/2014/03/gears-of-war-when-mechanical-analog-computers-ruled-the-waves/

The videos on the second page are definitely worth watching if you have even a passing interest in how simple machines with no electricity can compute mathematical functions.

February Miscellany

March 15, 2014 2:23 pm

Playing with Mama’s tablet is a good way to start the day:

IMGP1636as

Heather and I made some decorations for Valentine’s Day. Most of her work got mailed to grandparents, but the top-right heart is hers. (In case you couldn’t tell.)

P1000472as

She really likes to do puzzles.

IMGP1651as

Eating cereal at the counter with Daddy. And if he’s going to be reading stuff on his tablet, she wants hers, too!

IMGP1657as

I went looking for her and found her reading to Penguin. I can’t remember why she had no clothes on.

P1000534as

I worked on this cross stitch for 4 years, and I finally got it framed! It was a project unto itself, but I think it came out well.

P1000537as

Heather in her new dress. Yay!

P1000541as

SocialSharePrivacy and WordPress

12:32 pm

As I mentioned previously (“Your (the Reader’s) Privacy“), I’ve set up this blog with the SocialSharePrivacy toolkit to allow these posts to have convenient “share” buttons, but without allowing those services to track your movements involuntarily.

And, as I mentioned, using that toolkit isn’t entirely friendly yet.

This is what I did to get it working properly:

I downloaded the toolkit and placed it in the “js” subdirectory of the child theme I’m using to customize the standard “twentyfourteen” theme.

Directory structure:

/path/to/wordpress/wp-content/themes/twentyfourteenchild/js/socialshareprivacy

In that directory are the files for the toolkit:

.../socialshareprivacy/css/jquery.socialshareprivacy.min.css
.../socialshareprivacy/images/[whole bunch of images here]
.../socialshareprivacy/jquery.socialshareprivacy.min.js

I then updated my theme’s functions.php file to load the toolkit:

add_action( 'wp_enqueue_scripts', 'social_share_privacy' );
function social_share_privacy() {
        wp_register_script(
                'social-share-privacy',
                get_stylesheet_directory_uri() . '/js/socialshareprivacy/jquery.socialshareprivacy.min.js',
                array('jquery'),
                '14.02.04',
                true
        );
        wp_enqueue_script('social-share-privacy');

        wp_register_script(
                'social-share-privacy-init',
                get_stylesheet_directory_uri() . '/js/socialshareprivacy/socialshareprivacy-init.js',
                array('jquery', 'social-share-privacy'),
                '14.02.04',
                true
        );
        wp_enqueue_script('social-share-privacy-init');
        wp_localize_script('social-share-privacy-init', 'socialshareprivacyinit', array(
                'title' => wp_title("", false),
                'image' => site_url() . '/apple-touch-icon-114x114-precomposed.png',
                'path_prefix' => get_stylesheet_directory_uri() . '/js/socialshareprivacy/',
                'css_path' => 'css/jquery.socialshareprivacy.min.css'
        ));
}

This enqueues two scripts to load: ‘social-share-privacy’ and ‘social-share-privacy-init’ both of which depend on jQuery already being loaded.  I use dates for version numbers because it’s easy to keep track of how old things are.

After enqueuing the scripts I also make a call to “wp_localize_script” for the ‘social-share-privacy-init’ script.  This allows me to pass in data that needs to be calculated by WordPress to function properly (things like the directory location of the socialshareprivacy files [“path_prefix” and “css_path”]).

Now we need to actually create that ‘social-share-privacy-init’ script which lives at:

.../socialshareprivacy/socialshareprivacy-init.js

I wasn’t able to get the documented global settings variable (combined with auto-wiring) to work correctly so instead I did things manually:

jQuery(document).ready(function($) {
        socialshareprivacyinit.info_link_target = '_blank';
        socialshareprivacyinit.order = ['gplus', 'facebook', 'pinterest', 'mail'];
  socialshareprivacyinit.services = {
                gplus:{status:true},
                facebook:{status:true},
                mail:{status:true, body:function(options, uri, settings){return "Thought you might find this interesting: " + uri;}},
                pinterest:{status:true},
                twitter:{status:false},
                buffer:{status:false},
                delicious:{status:false},
                disqus:{status:false},
                flattr:{status:false},
                hackernews:{status:false},
                linkedin:{status:false},
                reddit:{status:false},
                stumbleupon:{status:false},
                tumblr:{status:false},
                xing:{status:false},
                fbshare:{status:false}
        };
        $('div.share').socialSharePrivacy(socialshareprivacyinit);
});

Notice that I only configure gplus, facebook, pinterest, and mail.  Also, notice that I’m assigning to an assumed existing javascript variable called “socialshareprivacyinit” this is the variable that WordPress will create and populate from the wp_localize_script call we made and will be available before socialshareprivacy-init.js is executed.

We just finish populating the object and then wire up the share divs.

It appears that you have to manually set every service you don’t want to “false” as the default seems to be “true” (which I think should be switched).

The final piece is to actually put divs on the page that will get wired up; in this case, divs that will match the $(‘div.share’) selector.

In each of the layout pages you use (content.php, content-image.php, content-gallery.php, content-video.php…) add the following code just after the closing tag for the <div class=”entry-meta”> div, so it’s still inside the <header></header> tags:

</div><!-- .entry-meta -->
                <div class="share" data-uri="<?php echo esc_attr(get_permalink()); ?>" data-title="<?php echo esc_attr(the_title(false))?>"></div>
        </header><!-- .entry-header -->

In that tag I use the “data-*” attributes to pass useful information to the socialSharePrivacy code.  I set “data-uri” to the post’s permalink and I set “data-title” to the post’s title.  SocialSharePrivacy will use these values when a user clicks a “share” button to pre-populate that share.

I believe that was everything.  So you should be all set at this point.

Heather takes a nap

12:02 pm

Heather got up at her usual time this morning (about 7:30am) after going to sleep at her usual time last night (around 7:30pm).  She had breakfast, watched some Daniel Tiger’s Neighborhood, and we played outside a little bit; a fairly normal morning.

Jess and I were just hanging about when Heather wandered off.  The quiet was suspicious and eventually Jess went looking for her.  She was lying in bed cuddled up with her blanket and pacifier trying to fall asleep.  So we asked her if she wanted us to close the blinds (she said, “Yes”).

We left her alone and about 20 minutes later she fell asleep (about noon).

Apparently she decided she was tired and so she went to take a nap.

What a goon.

Edit @ 4:10pm:
She just did it again! She was playing in the living room and just went back to her bedroom and closed the door. After about 10 minutes we went to check on her and she was in bed again, with her projector on, cuddled up with blankets.

We asked her if she wanted to go to the store and she said, “No, I’m still sleeping.”