Monday, June 12, 2017

A Harvest Life - Episode 2: Sprouts and Bunnies

Year 1 - Spring Day 84

While adorable, these fuzzy little creatures are not your garden's friend.  They are it's deep, dark nemesis.  We have a ton of little cottontail rabbits in our back yard, and while we do have a cattle dog that loves to chase them out, they still come back often.  So in order to keep them away, I built a fence around the garden.  Problem is... the fence and garden walls are only 18 inches high... and cottontail bunnies can jump up to 24 inches high! These guys have ups!  So, the fence may or may not work, but so far none of the sprouts appear to have been nibbled.  I also made sure to get the garden fence as close to the yard fence as I possibly could and tried to eliminate any gaps between each that could be exploited.

But, the next exciting part is that despite the fence not QUITE being high enough, sprouts have emerged!  The basil, garlic, cucumber and bean plants are all showing their first leaves.  The garlic was the first to push through the ground followed by the cucumber plants and then the basil started pushing away the dirt around it.

When I first noticed the cucumber sprouts a few mornings ago, I walked outside and found three sprouts on one hill and one on the back one.  When I went later that night, there were 5 sprouts on the first hill, (which was all of the ones I planted) and three on the second hill.  Pretty soon I'll need to start thinning the garden and pick out the best plants to survive.  I'll need to do that pretty aggressively for the carrots and the basil since I dropped a ton of seeds in each location I planted them.  I could barely see the carrot seeds so I just poured them out in an indented line and then covered the up with a bit of dirt.


Bean Bush

Lemon Cucumber

My next plans include devising a way to do drip irrigation.  I recently got a Raspberry Pi 3 for my 30th birthday and I have been meaning to use one of the ones I already had to do a project, so a drip irrigation system with moisture sensors would be pretty awesome to try out and post the information to a web server where I can track the moisture in the soil throughout the day and after watering.

Also I might need to built something to scare the bunnies away, maybe a robot owl?  We'll see about that.  But for now the things are all growing and its very exciting!

Saturday, June 3, 2017

A Harvest Life - Episode 1: Spring Planting

Year 1 - Spring Day 75

Since I'm new to the life of farming, I'm a little late to the season during the first year of living the Harvest Life, but I have finally started out on the grand adventure of farming and gardening!  Today I finished filling my garden with soil and planted my first batch of crops!  The seeds shipped recently from a little local place I like to visit called the internet, from a shop called SeedsNow.  They've got very reasonable prices and great varieties of all sorts of plants.  I built my raised garden with a bunch of wood I had laying around in my garage from remodeling the house, and ripped up a bunch of the soil underneath so that the plants can grow down into the soil below as well.  The plot is 4 ft deep x 24 ft long x 6 in tall and took about 25 bags of soil at 1.5 cu ft per bag to get a good covering over the existing dirt.

Today after filling the garden, I planted the following:

And I still have a plot of potatoes to plant, which I need to pick up at a local store.  

But the garden is started!  There will still be many things left to do, such as watering and weeding every morning, and making sure that pests don't eat away my crops.  I picked up a Tier 1 Watering Can as well.  A good old green plastic can works for now!  I had started a couple tomato plants a while back and just transitioned them to outside.  Once the plants sprout, I'll need to do something called thinning.  I've planted a TON of seeds, and once they sprout if I don't pick the best ones to survive and thin out the weak ones, they'll all fight too hard to survive and I won't get the best crops.

I'm still new to all this, but reading up on each crop has been helpful.  I'm trying to do my best to follow companion planting and pay attention to the state of my soil, so hopefully pests will stay away and the crops will help each other grow.  I found a couple decent guides on companion planting: What NOT to plant near each other, and one about What TO plant near each other to get the maximum benefits.

There are many other things to do around the yard as well.  I have a wood pile to chop, but I have a low level axe and my woodcutting skill is rather low, so its taking some time getting it all chopped.  I've already got a massive stack of fire wood, but there is still so much left!  Also the grass in the yard seems to keep growing week after week!  So I keep having to cut it.  We've lived in our new home for just over a year now, so we're finally getting to working on the yard since last year was all home remodeling and indoor work.

Feeling the cool black earth beneath your fingers is a phenomenal feeling.  Although trying to research on the computer with hands covered in mud between each seed type that was planted probably was not a great idea.

If you want to start a garden as well, there are a lot of resources out there and I hope to hear about your adventures as well!  Stay tuned for more updates of my first adventure living the Harvest Life!

- Lv 1 Gardener: Jace -

Wednesday, May 10, 2017

BitBit - A little compression library

Ever needed to compress a bunch of settings in a JavaScript object down to fit in a couple of bytes worth of data?  No?  Well that's okay I didn't either until recently.  While working with some embedded systems I needed a way to take simple number and boolean settings in an object, where I could store them in a readable format, and pack those down into under 2 bytes to be sent to and stored on a memory limited device.

Now, bit masks are useful if you're only dealing with multiple boolean values, but I needed to support integers as well, so I needed an easy way to say:  "Ok, bit 0 will be setting A, bits 1-6 will be setting B and bits 7-16 will be setting C."  So I created a little library called BitBit.

BitBit works by letting you create a new BitBit object with a schema that defines how a JavaScript object maps to certain bits.  For example, if you had a thermostat object with settings about a thermostat that you wanted to pack down into under 2 bytes, you could set up a new BitBit object like so:

What this is doing is creating a new BitBit object with a valid schema.  A schema must be an object with string keys that map to an array of 1 or 2 numbers.  A single number means it's a boolean and uses a single field.  2 numbers mean that its mapped to a number that uses the bits spanning the numbers given in the array (inclusive).  If you wanted to return a number that was just 0 or 1, you could use an array with 2 numbers that were the same.

Once you have built the schema, you can pack the settings down into an integer for storage.

As you can see above, once you pack the object, it will ignore anything not specified in the schema, which means you lose that data once it's unpacked.  A good way to use the unpacked data is to merge it back over your original object with lodash.merge.  This works well if the device you're sending it to and from can modify it.

In addition, you can use lodash accessor keys to get nested objects, array indices, etc.  There is an example of that on the Github Readme.

Well, that's about it, it's a small library I created since I needed something like that and didn't see anything out there that existed yet that satisfied those requirements.

If you like it feel free to contribute!  That's all for now, hopefully I'll have more time for these little side projects.

Sunday, March 12, 2017

New Year, New Job!

It has been a while since I have posted, and a lot has changed!  Recently I got a new job at SimpliSafe as a Backend Software Engineer, continuing my work in NodeJS, which is really exciting.  Also, I now work at a place where there is no taboo on talking about where I work, like there was at Layer3 TV!  So lots of exciting things have been going on the past few months.

Other than the new career, I took part in the Global Game Jam in January and completed a fairly polished game within the 48 hours with my good friends Ben Taylor and Dawn Rivers.  The game is called BubbleDub and its a couch coop/competitive rhythmic puzzle game, where you must rapidly select the colors of orbs and complete chains to out score the competition.  It was a great time and it's always a good feeling getting to dive into game development for a bit and get a creative break from enterprise development.

I'm also trying to figure out what side projects I want to continue to work on and take to being a fully fleshed out product.  Lots of things I could work on from Stock Market analysis and learning about neural nets and machine learning to other games and the like.  Still trying to figure out what I want to invest a bunch of time and energy into, but still have a lot of projects around the house to do as well.

So... quick post after a few months of neglect, once I get into the groove of things at the new job I should have some mental energy to work on side projects and post about them.

Wednesday, December 14, 2016

Heart of Winter - Poem

I wrote a poem for our work poetry contest for our holiday party, so here it is.

Heart of Winter

Angel feathers fall from a cotton sky
As the arctic wind pinches my strawberry nose.
I pull the wool scarf my mother knit, up around my face,
Blinking with frost laden lashes.
Cinnamon steam swirls from my mug,
Lifting with it the scent of apple, orange and brandy.
One sip extinguishes the chill, a warm hug from the inside out.

Inside children sit near a playful fire,
Bathed in its flickering warmth,
Reading stories of pirates and books of adventures in the clouds,
Hours slipping by without a care.

The tree in the corner nestles down on kaleidoscope boxes,
Her bows protecting them like a mother hen,
Dressed in a sparkling cacophony of color.

Night emerges and peaceful silence settles in,
Crackles and pops from a dying fire sparsely interrupting.
Back and forth the chair rocks, as eyelids droop and conscious wanes.

Sleep encroaches quietly and a carefully placed blanket becomes a warm embrace
In the heart of winter.

Tuesday, August 30, 2016

Schema Check

It has been a while since I've done a post about side projects, but lately I've been working on a little NPM Module called Schema Check, available on NPM and Github and wanted to share it.  Schema Check is a light JavaScript object type enforcer which uses private properties and Object.defineProperty to create getters and setters for various fields on a JavaScript object.

Schema Check uses schema objects to describe the fields on the object and the types they should accept.  It then modifies the getters and setters of that object to only allow values of that type to be set.  This came out of a desire to have something that could be used to enforce some types in JS without resorting to something like TypeScript entirely.  It's also just a fun side project I can work on here and there in my spare time.

How it works

Schema Check at it's core is built on Object.defineProperty.  By using defineProperty, schema check allows you to apply a schema to an existing object - which will force the fields of that object to conform to certain restraints.

Take for example, the following object:

  var dude = {
    name: "Chad",
    is_single: true,
    cash: 100  

Our dude, Chad, has three properties: name (a string), is_single (a boolean) and cash (a number).  If we're manipulating data and working with the dude object in JavaScript, it'd be really nice to limit what we can set to those fields.  There are many solutions for this, such as the rise of TypeScript, but Schema Check is a lightweight way to enforce these values with a simple schema.

By importing schema check like so and setting a schema for the dude object, we can force the object to throw an error (or fail silently) when an invalid value is set to that property.

  var SchemaCheck = require('schema-check');

  var schema = {
    name: {
      type: 'string',
      regex: /^[a-z]+$/i  //Used by Regex.test() to check validity
    is_single: {
      type: 'boolean',
      is_editable: false //Poor chad - this status isn't changing any time soon
    cash: {
      type: 'number',
      allow_nulls: false //This can be true too if you want to 
                         //allow null to be a valid entry

  var options = {
    throw_error: false 
      //This will determine whether or not trying to set 
      //an invalid property type throws an error or fails silently

  SchemaCheck(dude, schema, options); = 5;           //Fails - name is still Chad = '123';       //Also Fails - because it doesn't match the regex.test
  dude.is_single = false;  //Fails - Chad is still single = 110;         //Succeeds, Chad is a bit richer now!

I have a lot more I want to do with the library.  At the moment it doesn't really support Arrays and there are extra restrictions I want to add as well (like Min/Max for numbers)

It's a work in progress, feel free to contribute to the GitHub repo and create PRs and Issues if you think of anything that should be added.

Sunday, July 3, 2016

All The World's A Game

All the world's a game,
And all the men and women merely players;
They have their PKs and their respawns,
And one man in his time plays many classes,
His act being seven stages. At first the neophyte,
Mewling and button smashing in wanton alarm,
Then the whining acolyte, with his light inventory
And shining face of wonder, crawling past monsters,
Unwilling to fight. And then the expert,
Intense like a furnace, a woe-filled blade
Made to conquer fiends. Then a raider,
Bags filled with strange trinkets and shrouded in epics,
Jealous of other's gear, sudden and quick to gank noobs,
Seeking to expand his reputation
Ever running his mouth. And then the veteran,
His house filled with grand loot and lined with treasure,
With eyes wizened by dragons and warlocks,
Full of strange tales of adventures past;
And so he plays his part. The sixth stage shifts
Into the quiet and skeptical sage,
Watching the spectacles of new ages from side to side;
His intense vigor, lost to a world too wide
For his excitement, and his boisterous voice,
Turning again to quiet wonder and solitude
He crafts on his own. Last scene of all,
That ends this strange and beautiful game,
Is the second desire for youthful remembrance,
Sans guild, sans friends, sans time, sans everything.