The Shoulder Rule

I’ve never heard a good name for this rule, so I call it “The Shoulder Rule”. You’ve likely experienced it. Simply, The Shoulder Rule states that you are likely to solve a problem on your computer that has been bugging you for a while as soon as you impose upon someone else to look over your shoulder. Inevitably, this generates mixed feelings: yes, the problem is now solved, but you’ve totally interrupted someone, wasted their time, and made them get up and walk, only to make use of exactly zero of their qualifications or expertise. Does anyone know this by a different name?

I never get mad when I am the one imposed upon by The Shoulder Rule. I don’t know what lies behind it, but I’ve seen it work well too many times.

Posted in Uncategorized

Final Stretch

I have 3.4% body fat to go before hitting my goal of 15%. I’ve already lost 5.5% or so. Given that it gets harder the lower I go, I suppose I’m about halfway there. I hit a four-week plateau at 18.9%, which totally obliterated my hope of reaching 15% by Daylight Savings Time, which is this weekend. I blame Soylent and too much exercise. Maybe when I reach my goal I will experiment with different DIY versions of Soylent, but for now I’m buying groceries (*sigh*).

I talked to my chiropractor (not all chiropractors are created equal, but Dr. B is amazing), and he helped me figure out a more moderate exercise routine. He emphasized that gains come from rest, not exercise itself. I’m not changing my weights workout, but I’m cutting way back on cardio: sprints only three times a week and elliptical only twice. Sprints will be five, 15-second sprints, with one-minute walks in between, possibly with some variation. Elliptical will be 15-20 minutes (down from 35) at 138-148 bpm (down from 145-155).

I haven’t been counting points for about two weeks, and the first thing I lost was my sleep schedule. Apparently, I really need a system to enforce my sleep schedule. What I didn’t lose was my dietary laws. Apparently, I am awesome at saying no to certain foods, even if I’m just cognitively motivated. My gym attendance suffered a little, but not badly. I still lost fat. I mostly became undisciplined with time and much less productive. In short, I think I have internalized my fat-loss goals but not my productivity goals. My new system will be skewed towards productivity.

As with my previous system, I will post my score, my letter grade, and my body fat to Facebook and on stickies each Monday, but this time the score is out of 100. I’ll be starting for real this Monday, and my new target date is Monday April 27th, which gives me seven weeks to make as much progress as I can. I think I’d at least like to see 16.5% by then, and 15% would be the most awesome thing. I’ll allow myself two corrections to this plan in that time.

Sleep (40/100)

  • Getting to bed means lights out, in bed, no need to get up or turn lights on (but meditation for 5-20 minutes is cool), followed by at least 3 hours of sleep, but probably more like 6 or 7. I earn 2 points every day (14 total) for getting to bed by midnight.
  • Getting up means out of bed, toothbrush in hand, and not getting back in bed for several hours. I earn 3 points every day (21 total) for getting up by 7:30a.
  • Getting a great sleep means going to bed early, getting more than 7 hours of sleep, and getting up by 7:15a. I earn 1 point for per day I do this, but I only count two per week (2 total).
  • Meditating well means at least 10 minutes of focused, positive thought that leaves me feeling content about the present and ambitious for the future. I earn 1 point per day I do this, but I only count three per week (3 total).

Exercise (40/100)

  • Doing weights means going to the gym and doing at least five different sets of a certain muscle group (chest/tri, shoulders/trap, back/bi, legs). I earn 3 points each day I do weights before dinner*, but I only count four per week, and only once per muscle group (12 total).
  • Doing planks means holding the plank position for at least a minute. I earn 1 point every day I do this twice, once before lunch* and once after dinner*, approximated on fasting days, and I earn 1 point per day, up to three days a week I do this a third time, between lunch* and dinner* (10 total).
  • Doing sprints means doing five, 15-second sprints (or something similar but harder) with about 1 minute of walking in between. I earn 3 points each day I do sprints before eating anything, up to three days (9 total).
  • Doing elliptical means a 2-minute warm-up, followed by at least 16 minutes averaging 143 bpm, with less than 1 minute spent outside the 138-148 bpm range. I allow myself one break in order to tend to tight muscles, but then it’s 20 minutes instead of 16. I earn 3 points each day I do elliptical before dinner*, up to two days (6 total).
  • Planning the gym week means doing weights for all four muscle groups and doing all sprints and elliptical exercises in a staggered order: S, E, S, E, S. I earn 3 points if I plan the gym week perfectly (3 total).

Fasting (10/100)

  • Fasting for the day means, for at least 24 hours after dinner* on a Friday or a Saturday, not eating or drinking anything with significant caloric value (black coffee is fine) and not doing weights or elliptical (planks and sprints are fine). I earn 9 points if I do this once a week (9 total).
  • Weighing in means using my bathroom scale to measure body fat. I earn 1 point if I weigh in within the last two hours of a day-fast (1 total).

Organization (10/100)

  • Getting out the door means being in my car, ready to go somewhere (typically work) to do something that takes at least an hour, and not going back in the house until I have done that thing. I earn 1 point each day I get out the door after before 9:00a, up to five days (5 total).
  • Finishing a card means completing a personal task that I had written in a card on Trello. I earn 1 point for each card I finish that legitimately takes at least 15 minutes, up to five (5 total).

Penalties

  • I incur a late to bed penalty of 1 point per hour past midnight I have not gone to bed.
  • I incur a late to rise penalty of 1 point per half-hour past 7:30a I have not gotten up.
  • I incur a late to eat penalty of 1 point per hour past 9:00p I keep eating.
  • I incur a late to meet penalty of 4 points if I inconvenience anyone by showing up late to a meeting, appointment, or commitment.
  • I incur a forgotten pill penalty of 1 point every time I forget to take some predetermined supplement.
  • I incur a forgotten reminder penalty of 1 point every time I forget to check my reminders at some predetermined time of day.
  • I incur a steps penalty of 1 point every non-fasting day I don’t see at least 3 solid lights on my FitBit.
  • I incur a dirty room penalty of 2 points every day I go to bed with a pile of things out of their place in my room.
  • I incur a wasted day penalty of 5 points every time I spend more than 3 hours out of any 8 hours playing video games or watching TV, movies, videos, etc., except for a movie that is more than 3 hours long.
  • I incur an alcohol purchase penalty of 20 points if I buy alcohol for anyone to drink.
  • I incur an alcohol day penalty of 10 points if I drink on a day that violates the 2-2-2 rule**.
  • I incur an alcohol excess penalty of 10 points per drink beyond two in a day, as per the 2-2-2 rule**.

Extra Credit

  • I earn a progress bonus of 1 point per 0.1% body fat lost from last week (difference of weekly minima), up to 10 points.
  • I earn an education credit of 1 point for every day that I complete a half-hour language-learning module, as long as I also did so the previous day, up to 7 points.
  • I earn a steps credit of 1 point every day my FitBit goes off because I took over 9000 steps.
  • I earn a maintenance credit of 3 points for giving myself a haircut, doing a load of laundry, and watering the plants.
  • I earn a sales bonus of 6 points if I sell something I had bought over a week prior.

* Meals only count if they contain at least 20g of protein and have nearly perfect ingredients.
** The 2-2-2 rule is no more than two drinks a day, no more than two days in any seven, and on no two consecutive days, where a normal or small beer, a quarter of a normal bottle of wine, or a normal shot of liquor is one drink, and a large beer is two drinks.

Tagged with: , ,
Posted in Personal Development

The Liar Class

I have always been an honest person. My commitment to honesty was further bolstered a year or so ago when I read Lying (on audiobook). I now can say that I will only lie (deliberately deceive someone when they reasonably expect not to be deceived) to people with whom I am at war. 

I’ve observed that honesty is a privilege; some people are in difficult situations where they cannot afford to be honest, or they don’t understand the long-term effects of lying. Whatever the causes may be, the effects are that honest people comprise what acts similarly to a socioeconomic class. Honest people do business with other honest people and try to isolate themselves from liars. It’s a higher class and a liar class.

I learned recently that a friend of a friend, let’s call him Fred, was concocting lies in an attempt to make a girl stay interested in him. My reaction was so dismissive and so complete that I surprised myself, something like, “Assuming this is true, I want nothing to do with Fred until I see him again in a few years and he comes off completely differently.” I realized today that the change Fred would have to undergo before I would reconsider him is akin to upward mobility: it’s totally possible, but it’s really hard, it takes a long time, and not many people end up making it.

Tagged with: ,
Posted in Philosophy

Parsimony

I had a brief but profound thought today about Occam’s Razor: its application can be deferred.

Normally, the razor is applied to find the best hypothesis to agree upon before engaging in conversation about it. Unfortunately, some disagreements are not readily resolved until engaging in some conversation. It may be best to entertain two equivalent hypotheses of different complexity until the point at which the complexity comes into use, the point at which the conversation could be expedited by switching to the hypothesis of lesser complexity.

In software, this is closely related to canonicalization. Take file paths, for instance. My home directory might be represented by any number of strings:

  • ~
  • /home/brandon
  • /home/../home/brandon

Using a single tilde is convenient, but it is not an absolute path, so depending on context the tilde or an absolute path might be preferred. Of course, there are indefinitely many absolute paths to the same directory, using two dots to go back up to the parent, but there is only one “canonical” path to any directory.

It’s perfectly fine to use non-canonical paths, but there will probably come a point where a person tries to understand the path and gets frustrated that it’s not in a simpler form.

Similarly, if you want to believe that things fall to the ground because of Newton’s laws working in concert with your invisible friend Bill, that’s fine, as long as there is nothing observably different than some other correct theory that does not involve Bill. We can start the conversation. We can talk about things falling. As soon as you take time out of the conversation to describe what Bill is doing to a falling object, however, then I can object, based on my time you are wasting, for not describing the falling object using a simpler form of the theory.

Not all conversations require full hypothesis-canonicalization up front, but don’t we all find them more enjoyable?

Posted in Philosophy, Software

Patents

I read a lovely paper on patents today, by Michele Boldrin and David K. Levine. The following excerpt specifically engaged me:

We do believe, along with many of our colleagues, that a patent system designed by impartial and disinterested economists and administered by wise and incorruptible civil servants could serve to encourage innovation. In such a system, very few patents would ever be awarded: only those for which convincing evidence existed that the fixed costs of innovation were truly very high, the costs of imitation were truly very low, and demand for the product was really highly inelastic.

They go on to recommend their 2008 paper for a more detailed explanation, but I’m just writing a blog entry here, so I’m going to speculate for now without doing more research: could patent length be calculated from these three factors so as to be optimal to innovation? It’s a question of how to relate the following variables:

  • CI: the cost of innovation, which should be high for patents to be long
  • CC: the cost of copying (or imitation), which should be low for patents to be long
  • ED: the elasticity of demand for the product, which should be low for patents to be long
  • PL: the patent length, calculated as a function of the previous values

Naively, we could use:

PL = CI / (CC * ED)

However, the units don’t make sense. I imagine that ED would be a unit-less ratio, and that CC and CI would be measured in a currency. Perhaps subtract one cost from the other and multiply by some factor that converts from money to time. This would make clear the need for a factor like:

  • RF: the recuperation factor, the amount of monopoly time it would require to recuperate some amount of cost

A less naive formula would then be:

PL = RF * (CI – CC) * ED

Okay, I’ll let the econ guys work out the details, but it’s fun to think about. If your invention only deserves six months of monopoly time, are you really going to file a patent?

Posted in Uncategorized

My Three Questions

My friend Josh made my day yesterday by quoting me in a forum discussion about science and religion. I have constructed a series of three questions to use in such debates (well, not so much “debates” as friendly conversations; they can be asked with a friendly tone, discussed calmly, and still discredit bad ideas). He used the first one, and Russell Glasser (of Atheist Experience fame) called it “elegant”. Thank you Russell, and I agree. I figure that if he or his people like it and want to use it, I should make proper attribution possible, and I might want to join the conversation to a degree:

  1. Which came first, trees or stars? It’s only six words but it captures so much. Any science-minded person (after pausing to rule out trick questions) should answer, “Stars, duh.” It’s a grab-bag for Christians though, and thus a great way of cutting through labels and seeing how individual people think. Lots of Christians don’t have an answer immediately and need to be reminded of the text of Genesis 1: on day three, God creates (among other things) trees, and on day four, God creates (among other things) stars. I picked these largely because of how little wiggle-room there is in the text: they are mentioned by name, not by something poetic like “great light to govern the day” for the sun. Also, talking about the sun invites discussion of light and photosynthesis, which I don’t think is as productive of a conversation (especially since “light” is created on day one) as where carbon comes from.
  2. What in the world is a firmament? This is a similar question but with a different intent. Trees coming before stars is just a problem of order, and in case the Christian defending the Bible has some funky idea about how verses are aligned poetically so as to make order irrelevant, the firmament is something that demonstrably does not exist. Pretty much everyone says “I don’t know”, so I typically follow with the (admittedly hand-wavy) hypothetical, “You know how people would respond to that question 1-3 thousand years ago? They would say, ‘Everyone knows it’s the hard shell separating the realm of the earth from the realm of the heavens.'” It’s a feature of a defunct cosmology. It’s the Bible lending explicit support to a scientific anti-fact. There is no firmament, at least as surely as we have sent probes beyond the planets of our solar system, which should definitely be on the other side of said firmament, and they didn’t hit anything hard.
  3. Why do we think that the Bible is perfect or whatever? Maybe “we” is not the best pronoun, but I used it while I was still a Christian but not a creationist, and I imagine that it makes the conversation more contemplative and less adversarial than using “you”. Assuming two questions is enough to establish doubt at the data level, this question should force that doubt deeper into the level of basic assumptions. The point is to ask this question when it’s already clear that there are problems, so that dodging it is emotionally harder.

 

Tagged with:
Posted in Uncategorized

Shape Inheritance

I’m really impressed with how deep an interview can go over the seemingly innocuous example of shapes inheriting from one another.

First, it’s easy to start it off in a way that weeds out incompetent people without wasting competent people’s time. We can start with, “I’m going to name four classes, and I’d like you to describe the relationships or interactions you would assume they have, just based on the name, okay?” The classes we name off, in alphabetic order for lack of a better one, are: Canvas, Circle, Rectangle, and Shape.

Hopefully candidates come up with the idea that Circle and Rectangle inherit a method from Shape that takes a Canvas argument, because that’s how classes named like that normally behave. There’s a bit of room for reasonable deviance here; candidates who have never done any GUI work may reasonably assume that Canvas is a specialized kind of Rectangle and therefore inherit from it. We should be prepared to suggest clarifications and see how long it takes them to be coaxed into understanding the relationship. I wouldn’t be surprised if this somehow turns out to be a really good metric of hire-ability, some constant divided by the time it takes them to understand the relationship among these four classes. Of course, some teams may be satisfied with just this, but let’s assume that we want top talent.

What’s great is that this question can go in a number of directions when we actually get to code (I’m assuming Java).

  • If we want to test their algorithm chops, we can tell them that Canvas has a method to draw a point at a coordinate and have them implement the Circle.draw(Canvas) method.
  • If we want to touch on concurrency, we can tell them that every shape has a ReadWriteLock and that the fields should be accessed and modified appropriately.
  • If we want to put a little pressure on their class design muscles (or just weed out any Java programmers who haven’t learned anything new for a decade), we can tell them to use a class parameter as the type of their coordinates, like  <C extends Number>.

The way to really see if we’re dealing with thinkers, though, is to throw Square in the mix at some point. The natural idea is that, since all squares are rectangles but not all rectangles are squares, that Square should inherit from Rectangle, and perhaps this is exactly what we want from immutable objects. However, a mutable square poses a problem, namely that it cannot be modified like any old rectangle and still be guaranteed to stay a square. If a square inherits methods from rectangle to set its length and width separately, it’s probably busted. Now we have to, what, meticulously override these mutators to call multiple mutators from the super-class? I don’t like it; it’s not elegant. Sure, Square doesn’t have to inherit from Rectangle, but wouldn’t it be nice to have that polymorphism for read-only algorithms? (Not sure if anyone who mentions contravariance right around now gets bonus points or undying scorn.)

The conversation (no longer really an interview if it’s still going strong at this point) now brings us to questions of how to balance composition and inheritance, how to communicate to programmers about mutability through API design, and the obligatory esoteric contentions like how to use the term polymorphism correctly.

Well, if we only have time for one interview question, this may be a decent choice because it is versatile and gets progressively more selective.

Tagged with: , , , ,
Posted in Interviewing