“I’m gonna have me some of these”
The Wordiest Word
With Markov chain based random word generation, I essentially have tables of the probabilities for letters sequences. With this I’ve always wanted to know what the most English word was. The word with the highest probability of each letter following its predecessors.
I finally bit the bullet and produced it; well them, because it varies depending on the corpus & depth used. All in all it’s not that impressive, just kind of cool to know. I don’t know what I was expecting, some amazing word that would rock my socks off.
Without further ado, here they are:
| Corpus | Depth | Wordiest Word |
| basic_english_words | 1 | st |
| basic_english_words | 2 | st |
| basic_english_words | 3 | struction |
| basic_english_words | 4 | statement |
| basic_english_words | 5 | store |
| unabridged_english_dictionary | 1 | prerererererererere… |
| unabridged_english_dictionary | 2 | press |
| unabridged_english_dictionary | 3 | press |
| unabridged_english_dictionary | 4 | preconcer |
| unabridged_english_dictionary | 5 | preconcertification |
-1 racoon
After the keets were taken out by a racoon, we bought a trap. We left store bought corn in there for weeks, but the racoon has standards and prefers local organic stuff. So instead it destroyed some of our corn plants not 10 feet away from the trap. As with the keets, leaving 80% the food untouched. Their modus operandi: destroying everything and taking a couple of bites is extremely enraging.
The day I found our half eaten corn cobs on the ground, I decided it was time for the big guns. I opened a can of super fancy French canned fish we reserve for special occasions.
I reluctantly shared a tiny bit of it with the trap, and special occasioned the rest myself.
It had been many nights of failure, but this stuff is potent, and so the very same night, the racoon was trapped. Proving once again that French food is to die for.
Notice how it pulled inside 30′ of the string I had attached to the trap’s handle and proceeded to gnaw and pee on it. It’s only fair that it would spend all night being a jerk under the circumstances.
I had setup the trail cam next to the trap,
[mejsvideo mp4=”http://ben.akrin.com/videos/DSCF0604.AVI.mp4″ ogg=”http://ben.akrin.com/videos/DSCF0604.AVI.ogv” webm=”http://ben.akrin.com/videos/DSCF0604.AVI.webm” poster=”http://ben.akrin.com/videos/DSCF0604.AVI.jpg” width=”640″ height=”360″]
and now I know there’s 2… So far though, second one seems to have wisened up to what the trap means, or maybe the stench of pee and fear hormones isn’t an enticing accompaniment to a fancy diner.
The Secret World of Leaves
Some sort of eggs under a zucchini leaf.
There’s a Japanese party at the currant plant.
I have no idea what is going on there, at a first glance, it looks like ants are gathering sunflower seeds (this is a sunflower plant); yet upon closer inspection, other insects are involved and and the seed looking things could be their cocoons. Maybe some aphids the ants are raising?
I found several of these neatly folded birch trees leaves. Some halfway done and tied up with some web. I opened one up but whatever natural cycle this is was already over and there was nothing in there but refuse of some sort. I love the idea that some insect is making a little sleeping bag with available material.
Petals are leaves come on, a bumble bee got in and the other insect decided it wasn’t welcome in that flower any longer.
Slow-mo Bird Song
I love recording birds in slow-mo to hear the complexity of their calls. My brain can’t process them at actual speed.
[mejsvideo mp4=”http://ben.akrin.com/videos/slomo_bird.mp4.mp4″ ogg=”http://ben.akrin.com/videos/slomo_bird.mp4.ogv” webm=”http://ben.akrin.com/videos/slomo_bird.mp4.webm” poster=”http://ben.akrin.com/videos/slomo_bird.mp4.jpg” width=”640″ height=”360″]
PHP file upload to a Google storage bucket
Download
Google setup & use
1- Create a storage bucket for the script to upload into
Go to the Google Cloud Console, click on “Storage”, “Browser”.
“Create Bucket”
Give it a name and click “Create”.
2- Create a service account for the script
Expand the “IAM & admin” section, click on “Service accounts”.
Click “Create Service Account”.
Give it a name, check “Furnish a new private key”, JSON, and click “Save”.
Save the JSON credentials file which you are prompted to download into a safe location.
3- Grant “Object Creator” permissions on the bucket to the service account
Go back to the storage bucket you created
Edit its permissions
The JSON credentials file you just downloaded contains the email for the service account you created, copy it.
And paste it into the “Add members” field, select the permission to be “Storage Object Creator”. This service account doesn’t need permissions for anything else than dumping files in there. Not even viewing them.
Optional: if you want the files uploaded by the script to be publicly viewable, add the permission “Storage Object Viewer” to the user “allUsers”. Accounts are all referred to by email in Google land, but there exist special keywords such as “allUsers”.
Done with the Google setup 🙂
4- Running the script
If you haven’t already, download the script at the top of this page. Decompress it and edit the config at the top.
$credentials_file_path is the full path to the JSON credentials file you got from Google when you created the service account. It should be a secure location.
$destination_bucket_name is the name of the bucket you created
$access_token_cache_file_path is a location where Google’s OAuth tokens are cached, it too should be a secure location.
Run the script with only 1 argument being the file you want to upload. The script can also be included and used outside of CLI, in that case simply call the upload( $filename ) function. 
The script returns the URL to the file in the bucket.
Counter Measures
The fauna has taken a huge bite out of our work this year. A woodchuck ate the garden, crows ravaged the blueberry plants, deer went after young fruit trees & currants, finally a racoon simply killed all the keets and didn’t even eat them. One animal after another has gone after our work and voided much of it, this is the first year this happens to such a scale and it is making us feel besieged.
It’s interesting just how much brutal competition there is in nature. I used to think of nature as an idealized garden of Eden, but it’s closer to a ruthless competition which often ends in death. I despise man’s expansionist dominance over nature, yet living closer to nature means participating in the competition. Hawks circles over our baby, ticks & mosquitoes suck our blood, raccoons take out our flocks, deer reap the fruits of our sweat. I’m fine with letting nature get its share but nature is perfectly fine taking it all. I don’t enjoy exerting human dominance but I can’t let that go, it’s time to be more aggressive.
The little fuckers parade around the chicken coop like they own the place
Unfortunately not at a set time at which I could throw them a little welcome party
A trap does stay up all night, notice to pull string in case the skunk gets in there
Well at least I caught something with the box the trap came in
Keets
The chickens were “gifted back to nature” last Winter. No egg production and a new baby in the house brought this shortcut we didn’t like taking.
I’ve updated the list of traditions and cultural artifacts I understood since moving to Vermont for the occasion. It made me understand how so many religions have the concept of sacrificing animals to deities, and the idea of offerings to gods in general. I heard the coyotes come from the next hill over the same night and rejoice at the bounty. I never had issues with coyotes, coincidence? I think not. Everything happening at night feels supernatural. It’s not the first time we take animals deep into the forest to be cleaned up, and this was likely a frequent occurrence in the lives of humans when religions popped up.
We’re populating the coop this time with Guinea Hens. Apparently they’re like guard dogs, but they also eat ticks, and snakes, and they require little feeding.
An HTML5 canvas Flood Fill that doesn’t kill the browser
I took the longest time implementing the fill toolÂ
on Mandalagaba. How hard could it be? Recurse through pixels looking for a color and update them to a new color.
While this method certainly works and is easy to implement, it is also extremely slow. Slow in a way that hangs the browser, yielding infamous messages from the browser.
Here we’ll take a look at various Javascript flood fill implementations along with their drawbacks. Jump to #4 if you are only interested in the best one.
2018-10-04 – edit – added fill algorithm #5 which proposes an alternate approach to filling pixel by pixel. Depending on your project it may or may not serve your needs better.
In all cases, the code is available in the example iframe, look for the function flood_fill.
1. Simple Recursive
Not much to explain here, we simply recursively call the function on adjacent pixels when they match the color we are trying to fill over.
Click to change color / pop-out link
It’s reasonably fast but the problem with this one is that any fill area slightly large yields too much recursion which breaks subsequent JS. This Canvas box is 200x200px and at 300x300px, Firefox complained about:
It’s easy to see how this implementation will not satisfy a reasonably featured paint program. Even if your browser let you stack more function on the heap, I would bet it would lead to slowness.
2. Iterative
We simply take the previous idea of looking at adjacent pixels and filling them, and make it iterative instead so the function calls don’t get stacked to a ceiling.
Click to change color / pop-out link
The problem with this is is that is is sloooow. So slow it stalls browser. Most of time is spent having to keep track of pixels_stack. Recursion doesn’t have that need but as we’ve seen, it has other issues.
3. Recursive-Iterative (AKA catch-your-breath iterative)
This is a twist on #2 which every so often, recurses on itself via a setTimeout to let the browser catch it breath a little. It also yields a cool visual effect.
Click to change color / pop-out link
I really like the visual effect, and it makes the slowness tolerable. But the issue is that Mandalagaba has a network engine and allows for re-rendering of one’s work. So synchronization is a big deal, and you know what makes synchronization easy? Not having to worry about it.
So as long as I can help it, my life is a lot easier if the operations the users can perform are atomic. Operations need to be able to be processed one after the other counting on the fact that the ones that came before have completed.
The first 2 solutions are atomic but suck; this 3rd one, however cool it may be, isn’t.
4. The Holy Grail
I’m not sure where this algorithm originated from, but I’ve gotten to know it on this web page which explains it very well (with GIFs!). It is iterative and goes about finding pixels to fill in a much smarter way.
Click to change color / pop-out link
That’s it, no drawback here 🙂 I’ve tested it on large canvasses and this is what is implemented on Mandalagaba. Now of course, in a real application there is a ton more complexity dealing with smoothing edges and blending alpha. I only wanted to expose boiled down versions of these algorithms so they are easier to wrap your mind around.
5. The Holier Grail?
While #4 is fastest algorithm for filling pixel by pixel, I found myself in the need to have a fill operation in for form of a path which is filled with the native HTML5 canvas capabilities. This algorithm is a bit different from all the other ones in that it doesn’t go through every pixel and fills it. What it does is pathfinding to draw the outline of the shape of be filled, and then simply calls the native canvas fill() function. It does come with certain drawbacks and so I wouldn’t recommend it unless you specifically need this sort of approach.
Click to change color / pop-out link
Feel free to ask questions in the comments.
Haying Fever
I’m getting good at changing implements
[mejsvideo mp4=”http://ben.akrin.com/videos/haying_fever.mov.mp4″ ogg=”http://ben.akrin.com/videos/haying_fever.mov.ogv” webm=”http://ben.akrin.com/videos/haying_fever.mov.webm” poster=”http://ben.akrin.com/videos/haying_fever.mov.jpg” width=”640″ height=”360″]
A nightmare if you’re allergic to pollen

Stuck in the mud once more… The truck will pull it out.
Take 2, with board to help not sink in. We need more culverts.
Off we go! later suckers, me & my tractor have got some fields to mow.
Black gold
Room flooring
This is a bedroom a kid will grow up and become a teenager in, I laid tongue and groove pine because I could use the hardest of woods, there will be holes through it. I figured it’ll be easier to be ok with the damage if it’s not super expensive wood. The result looks great but it will wear faster. I love the angles in that room, Robin has not been in it for weeks, we’re keeping it a surprise and will have a ribbon cutting ceremony in a couple of days.
A first in 3 years
A nicely finished room, no visible insulation, studs or vapor barrier. It is incredibly satisfying to work on finishing a room. Since we now have enough space in the house, all the others will follow. We are done making temporary arrangements.
A guide for the circular is incredibly useful for making rip cuts.
Finer work is super satisfying
I opened the windows and discovered the view a few weeks ago, giving them a nice frame makes it all the more enjoyable.






































