]]>https://edcashin.wordpress.com/2016/01/18/moving-the-blog/feed/0edcashinDan John’s 5 for the Bare Minimum Workouthttps://edcashin.wordpress.com/2014/12/07/dan-johns-5-for-the-bare-minimum-workout/
https://edcashin.wordpress.com/2014/12/07/dan-johns-5-for-the-bare-minimum-workout/#respondSun, 07 Dec 2014 01:48:12 +0000http://edcashin.wordpress.com/?p=2]]>Dan John is a strength and fitness guru, an autodidact with professional experience informing a passion for learning. He has broken down movements into categories in a way that makes it possible to think about the bare minimum workout: What’s the least you could do and still have a chance of being reasonably fit?

Not that I think the bare minimum is the ideal workout—I just realize that sometimes circumstances conspire to make it really hard to find time to work out. When excuses abound, what’s a workout that’s so easy and effective that none of the excuses seem good enough?

Aside: This is a world champion doing a kettlebell swing with an 88 pound kettlebell. You will see some people doing swings that go above their head, but those are recent inventions by people who don’t seem to know the difference between a kettlebell snatch and swing.

Here’s the snatch, the original movement where the kettlebell swings above your head. Notice the control that is mandated by the form:

For the bare minimum workout, we’re going to rely on the big systemic stimulus that you get from doing many squats. Dan John presents this idea in “Mass Made Simple,” but don’t be afraid that squats will necessarily make you into The Rock if that’s not what you’re after. I think of it as a strong suggestion to your body that it use food to make you more healthy and strong, not … the opposite.

One set of each. (A set is a sequence of repetitions of a movement. E.g., if you’re doing pushups, a pushup is a “rep”, and if you do 10 in a row, that’s a “set of ten”.) Ideally you’ll do over ten reps of squats, so you have to figure out a weight that will start to feel difficult after ten reps.

The key with this workout is that it’s something you can do ridiculously quickly in your regular clothes. Doing the maximum weight is not the priority—Completing any somewhat difficult physical activity is. If you are so pressed for time that you have to do this workout, it will keep you going until your life settles down.

For each set, you just do enough to start to feel like it’s difficult, not nearly enough for you to fail to perform a repetition.

You might notice the absence of the loaded carry in the workout. It’s just deferred to the rest of the day. For the loaded carry, look for any excuse you can to carry heavy things (children, jugs of water, chairs, ladders, books, etc.) in your regular life. Make a habit of finding opportunities to carry heavy stuff. It’s pretty fun and takes no extra time.

So we’ve talked about the squat and hinge. Let’s talk a bit about the pull and push.

The pull is probably best performed with a pull up, which is like the movement in the video below but with the grip facing the other way. Chin ups (like the grip in the video) are good too.

I have been wanting to try out a few technologies for a while and tried them all out in a demo that allows concurrent distributed users to edit the same web form. All the users see edits happening in real time. The code is on github, and the README there has more detail than I supply here. The demo works, but the README mentions things that a real-world shared form would need added or at least considered.

The amazing thing about this experience was that all these technologies worked wonderfully, without a hitch. They were pretty easy to put together. One reason is that each has great documentation, although the Gorilla WebSocket module’s best documentation is external to it, in a blog post by its author, Gary Burd:

While driving, I listened to a bunch of conference talks and tutorials on WebSockets. I found out that about half of the presentations dwell on fall-back strategies, ways of supporting users with lame browsers or lame web proxies. It turns out that there are a few libraries created expressly to provide transparent fall-back mechanisms when the client can’t use WebSockets.

Both have a two-part implementation: There is a client-side JavaScript library and a server-side part.

There isn’t any Golang server-side Socket.IO or Sock JS implementation that is “blessed” by either of the two projects or even stable at this time. It leaves me wondering whether I could put Sock JS in the client and just provide support for long-polling AJAX in the Golang server as the sole fall-back mechanism.

Knockout JS was the most fun part of this experiment. It does dynamically tracked dependencies between data in the running JavaScript and data in the DOM, allowing two-way binding between the DOM and the “ViewModel” in the JavaScript runtime. You can manipulate the ViewModel based on messages coming through the WebSocket, and the data in the DOM gets automatically updated. It is loads of fun to see in action. The Knockout JS site has interactive tutorials where you can try it:

]]>https://edcashin.wordpress.com/2014/04/19/trying-websockets-with-gorilla-and-knockout/feed/1edcashinShared Form DemoPython Review Surpriseshttps://edcashin.wordpress.com/2014/03/13/python-review-surprises/
https://edcashin.wordpress.com/2014/03/13/python-review-surprises/#respondThu, 13 Mar 2014 00:44:11 +0000http://edcashin.wordpress.com/?p=99]]>I had to use Python for work again after a long time off, and during the time off from Python I had gotten used to Go. A few of the things I had forgotten or never known about Python surprised me when I returned to it.

No Assignment Operator in Closures

It’s not like I make closures all the time, but I do take lexical scoping for granted when I’m in a high-level language. This is a habit left over from perl. In perl, you can create a closure without any special knowledge or techniques, just because lexical scoping works the normal way.

If you try the same in python, though, it won’t work, because the innermost subroutine gets its own namespace—so far so good—using an outer-scope variable as an R-value works as expected—OK—but because assigning to a variable inside that namespace creates a completely new variable, you cannot just use the assignment operator on a variable from the outer scope.

Using the += operator means you’re assigning (creating a new variable) but also reading (a variable in the new namespace that hasn’t been created yet), so you get an error. So because the variable appears as both R-value and L-value, Python won’t assume you’re trying to use the variable from the outer scope that already does exist, even though it would have done that if the variable only appeared as R-value.

There are ways to use the assignment operator and create a closure, but not without using some Python techniques that would likely baffle your peers. I doubt this is a big deal, but it was a surprise about Python for me.

User-Requested Name Mangling

There is a name-mangling feature you get when you use two leading underscores and at most one trailing underscore in the variable name. The Python Tutorial states that this feature allows a class to protect itself from its descendants when there’s a method it needs to rely on for its own integrity. There’s no other way in Python for the base class to prevent derived classes from overriding it. (Strictly speaking, it doesn’t prevent it. But it does make accidental overrides less likely.)

]]>https://edcashin.wordpress.com/2014/03/13/python-review-surprises/feed/0edcashinBuilding gccgo on Solaris 11 x86_64https://edcashin.wordpress.com/2014/02/02/building-gccgo-on-solaris-11-x86_64/
https://edcashin.wordpress.com/2014/02/02/building-gccgo-on-solaris-11-x86_64/#respondSun, 02 Feb 2014 13:43:41 +0000http://edcashin.wordpress.com/?p=91]]>I wanted to jot down what happened Friday night. I tried out gccgo on Solaris 11, and it seems to work. It turns out if you want to use Go (the toolchain) on Solaris, you can use the Go language support that is part of recent versions of gcc.

]]>https://edcashin.wordpress.com/2014/02/02/building-gccgo-on-solaris-11-x86_64/feed/0edcashinSquat-centric Workouthttps://edcashin.wordpress.com/2014/01/29/squat-centric-workout/
https://edcashin.wordpress.com/2014/01/29/squat-centric-workout/#respondWed, 29 Jan 2014 00:09:47 +0000http://edcashin.wordpress.com/?p=51]]>In the spirit of Crossfit, I’d like to name this workout. I can’t think of a good one, yet.

The focus is really increasing the reps for squats. The inspiration is Dan John. Even though the focus of the article I’m drawing on was gaining mass, and that’s not my goal, it’s generally true that high-rep squats are a powerful stimulus. One of my goals is to have a safe workout that has a high impact-to-time-spent ratio, and I think this workout hits that mark.

My rep count is lower than those in the article, but I plan to go a bit higher as long as it doesn’t get tedious. Here’s a link to the Dan John article:

The pullup is a great exercise, but often when describing my workouts to friends, they say they cannot really do a pullup. For that I think the best option is probably to use bands for assisted pullups. Here’s a video to give you the idea.

The squat I’m talking about is the one that strength expert Mark Rippetoe recommends. It’s at least as low as the video shows, and it’s somewhere between a powerlifting squat and an olympic-style squat. When using saw horses as a poor-man’s squat rack, there is an extra initial movement to get the bar to the standing position. The towel protects my clothes.

The getup is kind of an active rest that keeps the workout pleasant, helps coordination and balance, and is also a Dan John favorite. Here is a video showing the movement. I am not nearly so particular about how I do this movement, so long as I start out lying on my back, wind up standing up straight, and go back down to lying, with the weight fully extended the whole time.

]]>https://edcashin.wordpress.com/2014/01/29/squat-centric-workout/feed/0edcashinImageNo, Mom, That’s SMShttps://edcashin.wordpress.com/2014/01/19/no-mom-thats-sms/
https://edcashin.wordpress.com/2014/01/19/no-mom-thats-sms/#respondSun, 19 Jan 2014 04:33:55 +0000http://edcashin.wordpress.com/?p=21]]>Today my mother got her first smartphone. I want it to be as simple and pleasant as possible for her to take this leap, but she’s going to be on my plan, so I covered some basics. Here’s what I told her. I’d like to know if I lied, so comments are encouraged. But I already know that this version of the facts is AT&T specific.

The Parts

We get service from AT&T, our carrier. Other carriers include Sprint, Verizon, and T-Mobile. The cell towers talk to our phones. AT&T makes everything outside our phone work for us. Because of the way our plan works, we need to consider three different services that AT&T provides.

The Three Services

voice – The voice service is a shared, limited number of minutes for calls. My wife will use most of these. Calling each other on our cell phones doesn’t count toward the limit.

SMS – This is an old, limited way to send text messages. It is expensive compared to sending text messages over data. Mom doesn’t text, so I’ll get into details later about how she can send texts over data.

data – Mom will have 300 MB per month of data usage. When her phone accesses the Internet via the cell towers, that’s using the data plan. If she just uses navigation and occasional web browsing, the 300 MB will seem large. If she watches videos or listens to music when out and about, it won’t be enough. For that, she can use wifi (see below).

Using the Phone

This will be a refurbished Samsung Note II, nice for her because it’s larger and because of its stylus. Also its Google integration will be useful to her, I think, for navigating, her main reason for upgrading to a smartphone.

I only covered two uses of the phone, and she asked about a third.

calling – In the AT&T store, she tried calling me while I stood outside. I had her use the speaker phone, too.

navigation – We used Google Maps to see Boulder, Colorado, and to get directions and start navigation. She liked it.

bridge – She asked whether she could play (the card game) bridge on the phone, and I said that there were probably a bunch of bridge games in the Play Store. This led to a discussion of apps and the Play Store.

I told her that AT&T only provides a few apps. By far, most of the apps she’ll get are from independent third parties. I told her a story about how I looked for a nice French-English dictionary app last night. I found some free ones, some great looking ones for $24.99, and one that I almost got for $5.49, but I finally remembered Google Translate and noticed that it has gotten a whole lot nicer since I last used it, and it’s free.

Google

We talked about Google a bit, and I summarized by saying that they release things early and then note the reaction of consumers before launching again, bigger and better, or pulling the plug. They offer useful things for free and figure out some way to make money off it at leisure, while addicting everyone to Google. Often I will curse Google when a familiar app or service suddenly changes, but usually things generally move in a direction of general improvement.

]]>https://edcashin.wordpress.com/2014/01/19/no-mom-thats-sms/feed/0edcashinWidgets Wouldn’t Show Next Alarmhttps://edcashin.wordpress.com/2014/01/14/widgets-wouldnt-show-next-alarm/
https://edcashin.wordpress.com/2014/01/14/widgets-wouldnt-show-next-alarm/#respondTue, 14 Jan 2014 13:04:16 +0000http://edcashin.wordpress.com/?p=10]]>Several android widgets have a helpful feature: They show the next alarm that’s set to go off. I like to see what the next alarm is. It’s reassuring when I have something to remember to look down and see that the phone has it covered.

Back when I was running stock Samsung AT&T phone software, it drove me crazy that the alarm was difficult to silence, because every time I tried to pick up the phone to turn it off, inevitably the phone would spend time rotating the screen before it would respond. Because there was so much stuff on the stock install, it was sluggish and frustrating.

So back then I got used to using a third-party alarm app. Later, I was using CyanogenMod 10.2 but hadn’t used their clock app. I was still using the third party app. After a while, because the thrid-party app was uglier than CyanogenMod’s clock app, I got curious, and I found out that the CM alarm is easy to silence.

So I transitioned to the CM cLock, one alarm at a time. But during that time, I noticed that my next alarm wouldn’t show up in the widgets that were supposed to display the next set alarm.

Finally I found out that only by uninstalling the third-party alarm application could I get the next alarm from the stock CM clock app to show up in the widgets. I’m posting this only because I would have liked to have found an account like this back when I was frustrated.

When you have a huge assortment of machines working together, you want them to be working independently as much as possible for the sake of performance, but you still have to coordinate them. The smartest folks who have thought long and hard about how to do that wind up using a distributed state machine approach, so that there’s effectively a single virtual machine running on top of the whole cluster. It would be easy if it weren’t for handling failures. So you see Google and others using Paxos to implement the state machine.

I spent a couple years learning all about Paxos in the hopes that I’d figure out how to explain it to people easily. Along the way, I did improve in my own understanding and even in my ability to talk about Paxos, but I noticed several failed attempts others had had at making Paxos accessible.

It turns out that Ongaro and Ousterhout of University of California, Berkeley, have created a more understandable implementation of a highly available distributed state machine. It’s called “Raft”, and the paper is a good read. Moreover, there’s a Go-language implementation of Raft. Fun!

The distributed key-value store, etcd, is also written in Go and uses Raft. I had been wanting to run Go software on my Android phone, and etcd seemed like an interesting way to try that out.

The first order of business was learning how to best get the etcd binary for arm onto the cell phone. The options were:

Note that no peers are specified and that I’m deleting the data directory to start the cluster from scratch. This is only safe because I know there’s no state to preserve from a previous instance of the cluster. Before starting etcd on Raspian, I had to flush the firewall rules with iptables - F.