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

bucket_upload_1.0.php.gz

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.

Voilà: