Ben's Blog

aesthetics ben December 26, 2017

Scintillating world

miscellaneous ben December 26, 2017

We woke up to a world encased in ice

We have had ice storms before but this one was particularly thorough in covering every nook in cranny of our land.

The sun shone through pine trees and it looked just like a Christmas tree decorated with lights so I updated the list of traditions I understood since moving to Vermont.

I almost plowed what snow we had before the ice came, but in talking to a friend, she brought up letting the ice accumulate on the snow rather than on the ground so it’s easier to kick out.  Duh, what kind of flatlander doesn’t know that.

The storms are rolling in one after another, the tractor has been invaluable in taking care of all this snow. We have great paths, a flat driveway, and all I had to do was push a button and joyride around.

With all this snow and ice, the trees are taking a beating.

On the less glamorous side of things, emptying the portable toilet is a full on arctic expedition these days. We lost access to the septic tank and really, I prefer it this way.

We started on an igloo 🙂 this is the closed I’ve gotten to building one. We’ll see if we can finish the critical top.

homestead automation, I.T. ben December 16, 2017

Improved sensor metric visualization

Homestead Metrics

miscellaneous ben December 11, 2017

Just like that, Winter is here

miscellaneous ben December 11, 2017

Bring it on Winter

I got to play with the snowblower implement today, super fun. Attaching it took some doing but I’m getting to know the tractor way. Putting chains on is always a giant pain.

miscellaneous ben December 10, 2017

Protected: Snowy Trampoline

This content is password-protected. To view it, please enter the password below.

aesthetics, nature encounters ben December 05, 2017

Dawn Supermoon

 

Not the only morning glow

nature encounters ben December 05, 2017

Critter houses

aesthetics, nature encounters ben November 28, 2017

No words needed

self sustainability ben November 26, 2017

Protected: The dry space race before the snow

This content is password-protected. To view it, please enter the password below.

aesthetics, agriculture, apiculture, apple, canning, maple syrup, preserving, self sustainability ben November 26, 2017

Food Pantry Rainbow

I.T., web development ben November 25, 2017

A Universal Caching Algorithm for PHP using Memcached

Here is an elegant way to use the same caching logic for all function calls which should have a cache. With the proliferation of 3rd party APIs I was quite happy to find a way to address them all with a single mechanism.

[php]function expensive_third_party_call( $param1, $param2 ) {
// universal caching algorithm header
$result = memcached_retrieve( __FUNCTION__ . serialize(func_get_args()) ) ;
if( $result!==null ) {
return $result ;
}

// this is where the third party call actually happens, if we are hit the cache missed
$to_return = /* some super complex and time consuming logic, throw in a couple of web calls*/ ;

// universal caching algorithm footer
memcached_store( __FUNCTION__ . serialize(func_get_args()), $to_return, CACHE_TIMEOUT ) ;
return $to_return ;
}

////////// helper functions bellow //////////
$m = false ;

function memcached_retrieve( $key ) {
global $m ;

$new_key = md5( $key ) ;
if( $m===false ) {
$m = new Memcached() ;
$m->addServer( ‘localhost’, 11211 ) ;
}
$temp = $m->get( $new_key ) ;
$result_code = $m->getResultCode() ;
if( $result_code==Memcached::RES_SUCCESS ) {
return $temp ;
} else if( $result_code==Memcached::RES_NOTFOUND ) {
return null ;
} else {
echo "error: can’t retrieve memcached key {$key} with result_code {$result_code}" ;
}

return null ;
}

function memcached_store( $key, $data, $timeout ) {
global $m ;

$new_key = md5( $key ) ;

if( $m===false ) {
$m = new Memcached() ;
$m->addServer( ‘localhost’, 11211 ) ;
}

// a little heavy handed but we use null to represent that nothing was found in the cache so we can’t have this be the data
if( $data===null ) {
$data = false ;
}

$m->set( $new_key, $data, $timeout ) ;
$result_code = $m->getResultCode() ;
if( $result_code!==Memcached::RES_SUCCESS ) {
echo "error: can’t store memcached key {$key} with result_code {$result_code}" ;
return false ;
} else {
return true ;
}

return false ;
}
[/php]

Requirements

  • apt-get install memcached php-memcached
  • make sure to define CACHE_TIMEOUT

Functioning principle

Using PHP’s awareness of the current function it is in along with the parameters which are passed to it, we derive a unique key which is used so store and retrieve from the cache.

self sustainability, wood ben November 13, 2017

Protected: Stocking up on kindling

This content is password-protected. To view it, please enter the password below.

agriculture, self sustainability ben November 13, 2017

The garlic is in

A bit late and not super well done but we don’t want to skip a season. We planted ~400 cloves.

 

We got leaves from the forest, one the of many things trees give us.

 

Today’s insulation is tomorrow’s soil

maple syrup, nature encounters ben November 13, 2017

Must have been here a while

building, self sustainability ben October 22, 2017

The house addition has a roof

As for the gambrel, we outsourced this work. By the time I get to a roof, I’ve completely had it with ladders and I would never be able to do as good a job as professionals with standing seam tools.

miscellaneous ben October 21, 2017

Popping rocks out of the ground

I’ve been hitting a bunch of rocks with the mowers all Summer long. A few minutes with a tractor are all it takes to pop them out. I’m very happy to see these guys go. Except one which is too massive to go anywhere, I just put the soil back on it and pretended like nothing happened.

apple, self sustainability ben October 21, 2017

2nd cider batch bottled

We are at 10 gallons for the season. I wish I could say they suffice to our yearly consumption.

apple, self sustainability ben October 03, 2017

Cidre

Hard time taking pictures of the process, we’re at 15 gallons of cider, 5 of which are now laced with the inebriating nectar of the gods :). We followed an extremely simple farm recipe, the cider is good but not great. The 2 gallons with honey tasted best, maple syrup left no particular taste but did make the cider a little stronger. Good stuff!

 

Every batch labeled with a picture for the story of the tree it came from.

“Old man’s arch”, “Maple ghost moon”, Honey third from the left” are all there.

apple, self sustainability ben September 18, 2017

Protected: Soft Cider -> Hard Cider

This content is password-protected. To view it, please enter the password below.

nature encounters ben September 07, 2017

Protected: Meandering Marmot

This content is password-protected. To view it, please enter the password below.

apple, self sustainability ben September 06, 2017

Apple droppings

Every day we pick up droppings from a tree that is a bit early. We make just enough applesauce for a day, just enough for the house to smell incredible.

 

the nice ones are saved as they keep really well

IMG_1420

the ugly ones are cooked immediately

IMG_1378

nature encounters ben September 06, 2017

Golden age of the Monarchs

Summer 2016 revealed amazing firefly spectacles. They left the stage this year to the Monarch butterfly.

 

caterpillar

IMG_1407

I never saw butterflies as very good fliers, they seem to land on whatever the wind blows them on. Only after following one a while did I realize it hit a milkweed every single time. Despite of their completely erratic flight pattern, they are in fact quite calculated.monarch_milkweeds

Posts pagination

← Previous 1 … 28 29 30 … 53 Next →

This blog is solar powered

Interactive

Handwriting Capture
Mandalagaba
IPv6 link-local to MAC converter
IPv6 MAC to link-local converter
Markov Text Generation
Markov Word Generation
Markov Music Generation
Duplogrifier
Flood Fill Algorithms
Homestead Metrics
RGB Playground
Web Games

Categories

  • aesthetics112
    • plots54
    • specular holography6
  • Books4
  • I.T.208
    • 3D modeling / printing22
    • AI7
    • all out geekery38
    • electronics30
    • homestead automation7
    • maniacal paranoia27
    • plotters49
    • unix / linux29
    • video games4
    • web development30
    • web games3
  • Lego / Duplo67
  • life in the U.S.42
  • miscellaneous206
  • nature encounters116
  • old vinyls3
  • organs2
  • self sustainability567
    • agriculture110
    • apiculture38
    • apple20
    • building132
    • canning3
    • crochet6
    • foraging6
    • hunting10
    • maple syrup47
    • poultry39
    • preserving3
    • solar power28
    • water24
    • wood85
  • trip to a new life6
Theme by Bloompixel. Proudly Powered by WordPress