Thursday, May 11, 2017

Life at the Sea

I'm thoroughly enjoying my little working adventure out here in Monterey, California. The views, flora and fauna along the beach are truly amazing. On the animal side of things, I've seen quite a few harbor seals, many of them fairly close up. Just be thankful I have no way to capture, and relay their smell. Heck, I even saw a california squirrel and what may be western bluebirds. The plants are even more interesting, with many of seemingly torn right from the pages a Dr. Seuss book. I'm not even sure where to begin with identifying many of them.

Good times!

Wednesday, May 10, 2017

Weekly Discoveries

The first clip in the bunch, referring to standing desks, was in honor of my new work setup. "'Can't I just work at it and mind my own business?' ... 'No, you being right means everybody else is wrong. That's what your standing desk is saying to the chair people'". The video is just too perfect.

Roo Pane's Open Road makes me want to throw a bag in the back the car and hit the road. Who's up for an epic road trip?

Feeling Good by Gryffin & Illenium does indeed make me feel good. It's the perfect example of a song and artist I'd never hear on the radio.

SonReal has a number of clever and wholly inappropriate songs, but No Warm Up has to be my favorite. If you're looking for an anthem to go with your cocky, overconfident shenanigans this is your tune. I fully intend to utter first try, no warm-up next time I do something unexpectedly great.

The artist known as Wax is downright super human when it comes to rapping. While This One's On Me is more family friendly and upbeat than many of his songs, it's worth taking the time to watch New Crack just to see his skills. Even if he's reciting the entire song from memory, one still has to ask, how'd he do that?. So amazing.

Watch all the discoveries here or click play below:

Tuesday, May 09, 2017

What a View - From Snow Capped Moutains to Shining Sea

We truly live in a remarkable time when I can, in the span of a few hours, snap all of the photos below. I'm sure time travel was just as plausible to our ancestors as what I trivially did today.

At one point, I actually apologetically interrupted the person sitting next to the window, asking if I could snap a few photos of the snow capped mountains. The site was just too amazing to pass up. It seemed like only a few minutes before we were flying over perfectly manicured squares of flat farm land. The gal in the window seat was glad oblige, and she spent a few minutes gawking at the mountains, too.

Anyone want to guess where our final destination (the beach) is located?

Monday, May 08, 2017

One Week of Standing - Life with a Standing Desk

Shira surprised me with quite the birthday gift: a Jarvis standing desk. I'd never used a standing desk before, and was skeptical to say the least. I was actually shocked to find that once the desk was properly aligned, typing on it was totally natural.

For the first few days of using the desk, I found I was playing a mental game of tug of war. I'd get a noticeable sensation suggesting: uh, we're trying to work, shouldn't we be sitting right now?, and then another part of my brain would chime in: but this is comfortable; let's do this standing thing!, and back and forth my brain would go. I also noticed some soreness in my core; dude, I was getting an ab workout from programming!

A week in, and the voices in my head have calmed down (or at least moved on to other matters). And my ab soreness has subsided (oh well). Most importantly, I find that for quite a few tasks, standing is by far more comfortable than sitting. It doesn't make logical sense, but there you go.

I guess I was expecting a standing desk to be at a minimum an acquired taste. Or maybe a trend like minimalist running shoes, where you need to build up certain muscles before you can enjoy the benefits of the new setup. But that doesn't seem to be the case: standing Just Works.

The assembly of the Jarvis desk was OK. The instructions were hard to follow and printed densely on a sheet of paper. On top of that, there was an additional sheet of paper that contained instructions that superseded a single step of the original instructions. We got through it, and I'm not worried about the desk collapsing. However, there's serious room for improvement here. A far better solution would have been to include a single sheet of paper that was nothing but a QR Code / URL, that directed users to a web page. Once there, users should be able to view high resolution photos and watch a video that steps through the entire assembly. It's not hard to do, but it does take a change in philosophy from the old school paper instructions route.

Shira opted to get me a desk model that has 'memory,' which makes switching between sitting and standing a breeze. I've got nothing to compare this to, but my sense is that this feature is key.

Bottom line: if you've never done the standing thing, you owe it to yourself to give it at a try. Remember: sitting is the biggest killer in America:

Friday, May 05, 2017

A Few Binder Clips, A Little Less Clutter

Shira gave me a standing desk for my birthday, which I hope to review soon. When I was setting it up, I tried using large binder clips to help reduce clutter. I like to have a notebook, stack of index cards and a wired hands free device at the ready. Here's how I clipped everything in:

In order to access the notebook and index cards, I need to twist and pull them off.

After about a week of use I'm sold: my desktop is less cluttered, yet my essentials are at the ready.

Hurry for binder clips!

Thursday, May 04, 2017

Weekly Discoveries

Yuna's Unrequited Love is a great example of a song's voice over that pulls me in. I'm not even sure why I like it, but it just feels so right.

Forget Let It Go, my kids movie anthem of choice is Shakira's Try Everything. If the philosophy He Who Fails The Most Wins had a theme song, this is it. Besides, I was trying to think of a catchy tune for our 9 month old to rock out to, and this one came to mind.

If haunting Armenian Folks Music is your thing, I've got you covered with this tune.

Speaking of kids music, ARJ's Weak has an unusual distinction: the first time I heard it was on the Disney XM radio station in my car. I've got preset programmed to it so that I can quickly find kid friendly music. Who knew that a song about giving into peer pressure to drink and do drugs would be a Disney favorite? I suppose as kids you don't appreciate most of the meanings behind most songs you hear. Now I know what my parents must have felt when a song that clearly had a subtext about sex came on, and we'd be rocking out to it as a kids.

Vance Joy's Fire and the Flood was stuck in my head for two days straight. I'm sure Shira appreciated me mumbling the the same 6 words over and over again (in my defense, I was doing it with such feeling!). Finally, I did a listening session of Vance's music and got it out of my system.

I'm going through a John Craigie phase: everything he sings, I love. His quirky, funny music is done so very well. Some favorites include The Silver Lining of Trump as President, The Chuck Norris Song' and Let's Talk This Over When We're Sober And Not at Burning Man. He's one clever musician.

On the non-music side of things, this tarp setup is quite interesting: it basically turns tarp into a tent using a single clever fold. With a big enough tarp, this seems quite functional.

Check out all the discoveries here, or click on the video below:

Tuesday, May 02, 2017

3Shrinking Files on Android: From Photo to 3 Digit Code in 2 Clicks

I recently added the ability 3shrink content that has no URL, such as a photo, PDF or sound clip. I was itching to get this working on Android, and here's why. Consider this sketch:

It seems reasonable that I'd want to associate a photo of the scene so I could compare them later. After sketching the scene I snapped a photo and used the new 3shrink capability to automatically turn it into a code. I then scribbled the code on the photo, QU3. At a future date, I can visit: http://benjisimon.3shrink.com/qu3 and see my the photo that inspired this sketch:

In other words, I now the ability to seamlessly go from a photo to a 3 digit code on my Android device.

To make this functional, I needed to enhance the AutoShare'ing 3shrink solution I previously created. The first step was to enhance the top level 3shrink Tasker action:

I've added a new leading 'If' condition that checks to see if %asfile1 is set. If it is, then I know that the AutoShare command was invoked with at least one file. %asfile1 contains a full path to the file, which is exactly what I need later on in the process.

I then updated the low level 3shrink action to check to see if the content being shared is a file that exists:

If it is, I do a Tasker HTTP POST of the content. One gotcha I found with the HTTP POST is that %HTTPD doesn't appear to be set. I overcame this by storing the result of the POST in a text file and then reading that text file into a variable. Incidentally, the content returned by the POST is the 3 letter code that corresponds to this file.

And that's pretty much all there is to it. I snap a photo, hit the share button and a few moments later, I see my magic code:

See the original photos over at http://blogbyben.3shrink.com/ck4.

Monday, May 01, 2017

Strolling Along Holmes Run

Yesterday I was itching to take a hike, but Shira and the little one were less excited about the sweltering prospect. So we compromised: we hit a section of Holmes Run that begins at Columbia Pike and heads South East'ish.

After doing an hour's worth of out and back on the trail, I realized just how brilliant this route is. The trail takes you along a beautiful wooded stream (technically, a 'run') so it feels like hiking, yet, it's nicely paved, so we could casually push our little one in a stroller. It was an ideal compromise and a destination to remember next time you're looking for an especially simple 'hike.'

One word of caution: this section of Holmes Run passes through the stream about 5 times. For most of the stream crossings, I just powered through with the stroller - with the water being no higher than our umbrella stroller's wheels, and my feet getting soaked. But there was at least one stream crossing that required we stop, take the little one out of the stroller and carefully carry everything across. In my opinion, these water obstacles provide far more fun than difficulty.

You'll notice a shot of some kids playing along the water. We stopped and asked what they were doing, they proudly explained they were fishing. When I asked if they caught anything, they proudly held up a plastic bag filled with water and hefty sized minnows. Someone needs to tell these kids that they're doing it wrong. They're supposed to be indoors playing video games, not outside soaking up nature. All they needed was a cane pole, and you'd have a scene out of Huck Finn.

We also passed two fly fishermen while walking the trail. I asked if they had caught anything, and they had, including a 'Rainbow' each. Even I could see a few fish while making the stream crossings, so Holmes Run definitely has life in it. I'll have to head back with my Dad for an afternoon of fishing.

Thursday, April 27, 2017

Using art to change the world, one discarded wrapper at a time

I can't resist heaping praise on this sort of project:

early in the morning, with a pen, a painting board, and no paper, I cycle in the alleys of Dali Old town and collect wasted paper. Once I find some paper or cardboard, I dismantle the wrappers, flatten it, and draw the architecture in front of me directly on it. After that, it will be nailed to the wall exactly where I picked it so that it could be seen by more people.

I mean, what's not to love? It's low-tech, low-cost and high-impact. The creator is literally turning trash into something beautiful and using art to fight pollution.

I love that this project ignored scalability and Just Did It. You could easily sit around wondering how you can use art to change the world, or you can get on your bike, find some trash, and actually change a small part of the world.

See the results here, they're truly wonderful:

Thanks to this talk for the lead to this project.

Wednesday, April 26, 2017

No URL? No Problem. Adding local file support to 3shrink.com

3shrink does a great job of linking online resources with offline media. For example, shrinking a lengthy Google Mail URL into a 3 letter code that gets hand written on a TODO list. But what if the resource isn't yet online? Say, a photo I've just snapped with my cell phone, or a PDF I've downloaded to my local computer.

To support this use case, I'd need to add the ability to upload arbitrary files to 3shrink. So that's what I did.

The first step was detecting a file upload. Because I plan to use this functionality with Tasker, I based this functionality on its HTTP POST Action. Here's the code that powers the detection:

function is_upload_request() {
  return (g($_SERVER, 'REQUEST_METHOD') == 'POST' &&
          g($_SERVER, 'CONTENT_TYPE')   == 'application/octet-stream' && 
          geek_val()                    == GEEK_KEY);
}

Most of that's pretty standard, except for the geek related code. I setup 3shrink so that if the URL parameter geek is provided, then the system operates in a command line friendly way. In this latest version of 3shrink, I've extended this in two ways: first, geek can be provided as either a URL parameter or a cookie, the latter being more convenient for the HTTP POST Action. And second, I only allow uploads from requests that know the value of GEEK_KEY. So while anyone on the web can 3shrink a URL, only those who have requested the key from me (please do!), can perform file uploads.

Once I've detected and upload, storing the data in S3 and generating a URL to it, was surprisingly straightforward:

function do_upload() {
  $in_fd     = fopen("php://input", 'r');
  $buffer    = tempnam("/tmp", "upload");
  $buffer_fd = fopen($buffer, 'w');
  while($data = fgets($in_fd)) {
    fputs($buffer_fd, $data);
  }
  fclose($in_fd);
  fclose($buffer_fd);
  $info      = finfo_open();
  $mime_type = finfo_file($info, $buffer, FILEINFO_MIME_TYPE);
  $name      = md5_file($buffer);
  $s3 = upload_s3_client();
  if(!$s3->doesObjectExist(UPLOAD_BUCKET, $name)) {
    $s3->putObject(['Bucket'      => UPLOAD_BUCKET,
                    'Key'         => $name,
                    'SourceFile'  => $buffer,
                    'ContentType' => $mime_type]);
                    
  }
  return $s3->getObjectUrl(UPLOAD_BUCKET, $name);
}

I'm suing the finfo library offered by PHP to effortlessly determine the mime type, and the Amazon PHP library to push the data to S3. I'm basing the name of the file on its contents, which means that multiple attempts to shrink the same file always returns the same 3 letter code.

I know that PHP isn't a particularly sexy language, but I'm impressed at how effortlessly I was able to implement offline storage, including mime type detection. Much of what makes this code especially cool isn't visible. For example, the PHP library code is managed by composer, and authentication to Amazon is powered by IAM roles, and is therefore automatic. Library management and authentication aren't typically hard, but they're do contribute to the friction in getting work done. And in the above solution, much of that friction has been eliminated.

To integrate uploading into the shrinking process was almost too easy:

if(is_upload_request()) {
  $content = do_upload();
} else {
  $content = g($_GET, 'i');
}

That's because the result of do_upload is a URL that the rest of the 3shrink process can work with.

With the code in place, here's how it can be invoked using curl:

curl -s -H 'Content-Type: application/octet-stream' \
     -b geek=xxxxxxxxxxxx \
     --data-binary @foo.jpg \
      'http://projx.3shrink.com/shrink'

With this foundation in place, the next step is to enhance the AutoSharing capability on a mobile device to allow uploading of files. When that's done, I should be able to effortlessly snap a picture and moments later, have a 3 letter code that represents that picture.

Tuesday, April 25, 2017

Grow!

The weather continues to mess with our heads, what with yesterday being 55°F and this weekend calling for nearly 90°F temps.

But the local flora isn't kvetching; it's spring, time to grow!

Monday, April 24, 2017

Weekly Discoveries - Political Rap, Hiking in 3D and Star Wars Awesomeness

I suppose it's more of a re-discovery than discovery, but Sade's No Ordinary Love is a song that transports me back to college every time I hear it. I don't even have a specific memory I associate with the song, it just brings me back to that time for reasons that are beyond me. So powerful.

I get that Oddisee's, Like Really is a political protest song, and an impressive one at that. But it's going to take quite a few more listens before I full process it. The opening lyrics are clear enough, though:

how you past due on payments, and I'm seeing you on vacation
how you gonna make us great when we were never really that amazing
take it back what, I don't find hanging black lives entertaining
...

Agree or disagree with the commentary, it is poetically delivered.

I always enjoy Joe Brewer's outdoor exploits, but one of his most hiking videos is especially interesting: he shot it with a 3D camera. The result is that as the video is playing, you can rotate the perspective, looking essentially in any direction. Is this a leap in film making, or just a gimmick? Time will tell, I suppose.

Bad Lip Reading productions are always pretty awesome, but they've outdone themselves with this Star Wars film: Not The Future. Yes, the lip reading is creative, but more than that, they've made an actually watchable and listenable tune. So well done! For more goodies, check out Bushes of Love and Seagulls!.

Check out out all the videos here:

Friday, April 21, 2017

The $2.00 Cell Phone Projector

The $1.00 iPhone Projector project was just too cool not to experiment with. The idea is simple: you take small box, fit it with a lens, and setup your cell phone behind it so that it projects onto a wall. The original instructions call for using a magnifying glass as the lens and Legos to create an adjustable cell phone mount.

I used the materials I had on hand, which was an random Amazon box, a $2.00 wallet Fresnel lens, duct tape and a few paper clips.

Even with my crude and hasty build, I ended up with a 'projector.' Here's me projecting a random photo of a sunset onto our basement wall:

With a better lens and more carefully constructed case, I'm sure I could get far better results. Just experimenting with using Legos as a DIY building material is probably worth the effort of doing this right. Ultimately, I'm not sure how functional this project would be even in its cleanest form, but it holds a surprising amount of promise.

Happy Hacking!

Thursday, April 20, 2017

Gotcha of the Day: Using Tasker's HTTP POST Action and PHP to upload a file

I plan to enhance 3shrink to support generating 3 letter codes in response to an upload. Before making this change, however, I wanted to understand how Tasker's HTTP POST Action works with respect to files. That way, I could be sure that any change I made to the core of 3shrink would play nicely with Tasker.

Tasker's HTTP POST Action is surprisingly finicky to use. The trickiest part: when you select a file to upload, Tasker injects a relative path to the file in the UI. Say, DCIM/Camera/20170330_005914.jpg. However, without the leading /, Tasker just assumes that this is an arbitrary string. And if you just add a leading slash to the path, you'll end up with a Tasker error about the file not being found. What's required is to have a valid absolute path in place.

After much playing, I learned that a valid absolute path begins with /sdcard, not /storage/emulated as some the file dialog box initially indicated. (At least that's how it works on my LG G6)

The other piece of the puzzle: you'll want to set the appropriate Content-Type for your file (using application/octet-stream is a fine catch-all).

Here are the correct settings:

On the PHP side of things, you can access this data by reading in the stream associated with php://input. Here's some sample code that slurps in the file from the web and writes it locally as capture.data. Notice that I'm doing a bit of checking here to insure that the Content-Type is set as I expect it.

<?
/*
 * A chunk of PHP code to catch an incoming file that's been posted
 * by Tasker's HTTP Post action
 */

if(isset($_SERVER['CONTENT_TYPE']) && $_SERVER['CONTENT_TYPE'] == 'application/octet-stream') {
  $out_fd = fopen(__DIR__ . "/capture.data", "w");
  $in_fd  = fopen("php://input", "r");
  while($data = fgets($in_fd)) {
    fputs($out_fd, $data);
  }
  echo "saved: " . filesize(__DIR__ . "/capture.data") . "\n";
} else {
  die("malformed request");
}
?>

If all goes as planned, Tasker should happily push the file, and your PHP script should happily pull it in. Enjoy!

Note: for uploading a queue of files, it's far smarter to use the FolderSync and the its Tasker Plugin.

Wednesday, April 19, 2017

Weekly Discoveries and the Role of 'Likes' in Art Appreciation

I'm not quite sure where my head was at last week, but musically I started off down tempo, and got even more somber from there with Syml's Where is my love. Things did pick up again with Big Wild's Aftergold, which is definitely a toe tapping beat.

Rone's Gravity is a fantastic creation. While it appears to be made up of little more than a single actress who does a whole heck of a lot of jumping, the results are nearly magical. It seems to me a great example of passion and effort over budget and computer effects.

And speaking of budget, Real Estate's Crime is a hilarious example of a (seemingly) budget driven video creation. Just mix un-dead extreme sports enthusiasts, an online ceramics sculpture business and old timey values and you've got a winning video, right? Right, indeed.

On the non-music side of things you've got Jay's road to art self discovery. It dovetails well with an art appreciation video I've posted before. At the end of the day, both videos share a similar message: when you focus primarily on the technical mastery of art, you're missing out on so many other important aspects.

In Jay's video he talks about how a simple drawing garnered an unusually high number of 'likes.' This opens the door to another interesting discussion: how much should 'likes' matter? Was Jay selling out because he adapted his drawing style to what people wanted? Or, was he rightly adjusting his style to best communicate with his audience? Clearly, chasing likes is a very bad idea. But using them as feedback that you're connecting, seems like a great idea. In Jay's case, 'likes' opened his eyes to the fact that a seemingly inferior drawing style could resonate more with his readers.

View all the videos here.

Friday, April 14, 2017

Weekly Discoveries x2

Between preparing for, and enjoying Passover, I managed to get behind in posting weekly discoveries. Not to worry, I've got two weeks worth right here. And there's definitely some real gems to be found.

Lots Holloway's Is Anything Real Anymore is both a wonderful song and a terrifically creative video. It's amazing what can be done using little more than simple cartoon drawings. This makes me want to re-read Blah Blah Blah, and work on my visual literacy skills.

I love the comment from this video: BUT HOW DOES HE BREATHE. Seriously, what an amazing performance.

If you have a straw and 5 minutes, you can create your own Oboe. So yeah, I did this, and it was definitely fun. Loud and annoying, but fun.

I discovered my new favorite rapper Oddisee in a most unusual fashion. I was watching his NNGE video and caught site of what looked like the Fort Washington. Indeed, it was. Apparently Oddisee is a local, along with being a wonderful artist.

I'm loving Chord Overstreet's Hold On. It's just a simple, beautiful, singing.

I don't quite get it, but I stumbled on a number of Minecraft powered Music Videos. Is this really a thing? Either way, it seems like another creative way to use video games, so that's a win in my book.

Check out all the videos here and here, or below.

Thursday, April 13, 2017

The Long Reach of Passover

Today was spent catching up from being out for the first and second day of Passover. After comparing Seder experiences over Skype with an Israeli customer, I switched my focus to a group chat with another client. In the chat, a programmer from India informed the group that he had to drop off in a bit to attend Passover Dinner.

I had a moment of panic as I thought my previous conversation had leaked into the group chat. But that wasn't the case. Then I thought maybe I was misreading the message from the programmer. Nope, he really did write that he was heading off to Passover Dinner.

I had so many questions.

Sure, it's totally possible that he was Jewish. But if so, why call it a dinner and not a Seder? And why celebrate it after the rest of the Jewish community had celebrated theirs? I kicked off a private chat and politely asked what he meant.

He informed me that he was part of the Eastern Orthodox Church and that they celebrate Passover. I asked if they'd be eating matzoh at the dinner, and he explained no, they'd be eating a local adaptation: Pesaha Appam. It was unleavened bread, but made with rice.

According to the Wikipedia page, some groups burn the left over bread, just like the Torah requires you burn the left over pascal offering. Though he laughed at the idea that there would be any left overs.

A little research on the topic took me to this article

There are two states in the world where millions of people attend a Seder. One is Israel; which is the other? No single state in American has this scale of Seder-goers and Britain certainly does not come close. The answer lies in south-western India.

In case you are imagining some massive secret Jewish population, that is not the story in Kerala; the Sedarim there are organized by Christians. The state is home to around four million St. Thomas Christians, also known as Mar Thoma Nasranis and every spring they hold a family-based celebration involving unleavened bread, reading the Book of Exodus and praying. Sound familiar?

Who knew?

I explained to him that for me, Passover was not one night, but 8 days long and that we'd go all 8 days without eating unleavened bread. Not to be outdone, he mentioned that for 50 days prior to Easter they eat no meat or fish. I guess I'll stick with my 8 day regimen, thank you very much.

Incidentally, India has some fascinating Jewish History, including Jews that have been there well over 1,000 years.

Whether you celebrate the holiday for 1 night or 8 days, may it be a time of peace and joy. L'Chaim!

Friday, April 07, 2017

Sketchbook #2 - Be Positive and Other Lessons Learned

Here's sketchbook #2, as motivated by Art Before Breakfast. Here's a few observations about this go-around:

First, by the 3rd drawing in the book something clicked and I full embraced Danny Gregory's philosophy about "bad drawings." Sure, it's cheeky to write well that turned out terribly on the page, but it's not especially useful. Instead, I'm embracing Danny's approach that a bad drawing serves to teach you something. Rather than thinking: "wow, that drawing of a chair is horrendous," it's far more useful to think "look at that, I never realized that the chair is twice as tall as it is wide--who knew?"

This dovetails well with the thought that's been kicking around in the back of my head: why even bother drawing? If photo realism is what I'm after, then why not just use the camera in pocket? No, drawing (like photography in many respects) is about seeing the world in a new way. I've learned something about a chair I'd never known, even though I've stared at them my entire life. Being annoyed with myself until my drawings look "good" is just silly: my drawing aren't going to be photo-realistic, but they can be vehicles for learning things right now.

Second of all, you'll notice some drawings of our newest family member. For privacy reasons, I can't post his photo. But, I feel comfortable sharing these drawings, because fortunately, they look nothing like him. Or, put another way: despite what my drawings suggest, we are not providing foster care for a space alien.

Finally, if Danny Gregory is the voice of Yes You Can in the back of my head, Teoh Yi Chie is the voice of Here's How. For example, his tutorial on how to draw a Chinatown Street Scene is awesome: he emphasizes a few key guidelines that you can apply to your drawing with relative ease. It's just the right level of information to be informative without being overwhelming.

I've stitched up Sketchbook #3 and it's currently sandwiched between a few text books. In another day or two, I'll be ready to dive back in and start sketching again.