Children's Discovery Museum

March 25, 2014 8:11 pm

Heather and I went to the Children's Discovery Museum in San Jose with some friends. It was a fabulous idea, and I'm so glad we went!

Chasing pigeons outside:

P1000618as

The first thing we did was stop at the face-painting station, and it was a big hit. Heather actually asked to "go to museum for paint facing" for the next several days.

P1000620as

You can see my friend Sarah behind Heather, and her kids Emma and Liam.

P1000622as

Heather said she was a tiger. See the stripes?

P1000623as

Emma was a kitty cat.

P1000626as

I kept having to wipe paint off Heather's upper lip so she would stop licking it. Tasty!

P1000627as

The three hooligans driving a fire truck (Emma, Heather, and Liam):

P1000629as

There was an entire exhibit about archeology, and Heather did some excavating:

P1000633as

Another section was devoted to food and cooking. In particular, Heather is gathering a healthy rainbow of foods:

P1000638as

Driving an ambulance:

P1000641as

The water area was so cool! Heather found it very overwhelming at first, what with the big kids and loud water and balls flying overhead, but she really enjoyed the calmer little-kids area.

P1000642aas P1000648aas

The reading area had fun mushrooms to sit on.

P1000652as

I think this sand table was another of Heather's favorite activities. Scoop and pour, scoop and pour...

P1000654as

We finished up with painting:

P1000658as

And at the end of the day, we had three tired kiddos!

P1000664asThere was so much other fun stuff that I didn't even get pictures of. We'll definitely have to go back!

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.