Camaro Cosmetic Changes

I finally ordered a set of of lower body accent stripes for my Camaro.  I purchased them from Big Worm Graphix.

This is the final cosmetic change I had planned when I first bought the car.  I think they give the lower body a sharp, dynamic look.  What I especially like is that they darken up-facing areas on the car that are normally brighter than the rest of the body due to reflected sunlight.

I put these decals on myself.  It was a little nerve wracking, but I believe I did a decent job.  We’ll see how long these last.

20160726_180540 20160726_180558 20160726_180619 Also new to my car in these photos are yellow rubber lug nut covers, which I ordered from AliExpress.  I just came across them one day and figured they were cheap enough to try.  I liked the look of them, so I kept them on.

I think that about wraps up all the exterior cosmetic modifications I’m going to make on the car.

Second Attempt at Weight Loss

Back in 2013 I spent a couple of months trying to get my body weight under control.  For various personal reasons I gave up, and the progress I made over those few months didn’t stick.

At the end of last September I decided to give it a second serious attempt using the same method (calorie counting).

These past few days have seen me hit my first major goal: to hit 200 lbs and be no longer considered “obese” (just “overweight”).

The chart below shows my progress since last October.  It doesn’t show my peak weight, which was 265 lbs (measured a coupled of months before I started actively trying to lose weight).  By the end of this calendar year I should be at or around my target weight.

weight loss chartIn the chart above, the red trendline shows projected weight loss assuming no weight loss during the Christmas season (as evidenced by the plateau early in the graph), and the orange trendline shows projected weight loss assuming I manage to continue losing weight through “Chocolate Season”.

Using the power of science, I cut through the bullshit of “weight loss techniques”. Almost everything you hear about it is wrong.

The first rule of battle: know your enemy.  What is fat?  Why do people get fat?  This is pretty simple: fat is stored energy.

As long as you are alive, your body is using energy.  In fact, your body needs to use energy just to stay alive. Even if you do nothing but sleep 24 hours a day, your body burns energy just to keep itself from dying.  Everything you do with your body — walking, running, sneezing, etc. — requires extra energy on top of what is needed just to stay alive.  The more your body does, the more energy it needs.

Where does your body get this energy?  From food.

What happens if your body takes in more energy that it needs? The body stores that excess energy as fat for later use.

What happens if your body takes in less energy than it needs? The body “eats” fat to get the energy needed to make up the difference.

So, you don’t get fat because you eat fat, or because you eat carbs, or whatever.  That’s not how body fat works.  In fact, you could literally eat three McDonald’s Big Macs (and nothing else) every day and still lose weight.  You don’t get fat because of the kinds of food you eat.  You get fat because you are taking in energy at a greater rate than that which your body is burning it at.  It’s like pouring gasoline into a car while it is running: the car’s engine doesn’t burn gasoline as fast as the pump puts it in, so, eventually the gas overflows.  In the human body, this “overflow” becomes fat.

Knowing this, the solution to the question of “how to lose weight” becomes clear: take in less energy than your body needs so as to force it to burn fat to make up the difference.  That’s it.  No pills, no restrictions on food by type, no body wraps, no nothing — just eat less food than your body needs to stay alive and to do whatever it is you do every day.

Ok, fine.  So we now know how the body gains and loses fat.  However, if we want to lose fat, how can we be sure we are taking in less energy than our body needs?  To do this, we need to turn to the fundamental tool of science: measurement.  We need to start counting calories.

We measure food energy in Calories.  To achieve our goal of weight loss we must first determine how many calories our body needs every day.  Thankfully an average number has already been figured out.  Typically, the average, moderately active person needs 2,000 calories to maintain their body weight (that is, to neither gain nor lose fat).  If you are overweight and you change your diet to take in around 2,000 calories a day, you will eventually lose weight until your body hits an equilibrium point where it no longer creates nor burns fat.

Now that we have a target, the next step is to measure our daily caloric intake.  This is where we have to start doing some work. I use a website (and smartphone app) called MyFitnessPal to track my calories.  It has a large database of foods and their calorie amounts, and with it you can keep a daily record of the calories you are taking in.  You could also use google to find calorie counts for any food you eat and just write it all down on paper.  Whatever works for you.

One point of caution: measurements are not useful if they are inaccurate.  You have to be careful with sites that have user-generated calorie databases, like MyFitnessPal.  People sometimes enter in the wrong numbers (either by accident, or because they think they can cheat by doing so, or whatever), and the calorie counts for pre-packaged foods can go up or down with time as manufacturers change their recipes (“new and improved!”).  So, just be careful.  With practice, you can learn to spot strange numbers (e.g. only 100 calories for a palm-sized slice of cheesecake?  No way!)

Armed with knowledge of how many calories you need to be a healthy weight and with the ability to measure how many calories you eat in a day, you can now work toward achieving your goal.  This is where it gets difficult, since you need two things:

  1. the discipline to record the calories of everything you eat every day
  2. the discipline to make changes in what you eat so you don’t take in too many calories every day

If you fail at either of those two things, you will likely fail to lose weight.  You absolutely must know how many calories you are taking in and you absolutely must keep that number at or below the level required to be the weight you want to be.  These are unbreakable laws of mathematics and physics.  People can “wing it” without tracking the numbers — and most do — but “winging it” fails more often than not because of underestimation of the numbers involved.  If you want results that are absolutely guaranteed by both the human body and the very nature of the universe (no exaggeration), you must use the math and the correct numbers.

Science can help you here, too (specifically, psychology and behavioral science), but that gets a bit more complex to cover.  Maybe I’ll make a future post about that.

Atari 2600 Programming

atari 2600When I was a kid, our family had an Atari 2600 Video Computer System, as did many of our friends and relatives.  We had a good number of games, and many great memories were made playing them.

A few years back I got a book (Racing the Beam: The Atari Video Computer System, by Nick Montfort and Ian Bogost) that talked about how those old games were programmed.  It was quite fascinating.  The approach to programming the Atari 2600 is quite a departure from what I do every day as a software developer.  I gained a lot of respect for the old Atari game programmers; they performed incredible feats of coding.

More recently, on a whim, I decided to read up on Atari 2600 programming about a month ago.  Here’s a little bit of what I’ve learned:  To run games, the Atari 2600 uses a MOS Technology 6507 microprocessor (a variant of the MOS Technology 6502, a generic 8-bit microprocessor which was first produced in 1975 and is still used in hundreds of millions of devices to this day).  This is the central processing unit: the chip that executes the software written by Atari programmers.

The central processor interacts with two other chips.  One is the MOS Technology 6532, another generic chip designed to provide RAM (only 128 bytes — your computer probably has at least eight billion bytes or more), a couple of I/O ports for interfacing with peripherals (e.g. joysticks), and a timer. The other is a custom chip called the Television Interface Adapter (or TIA), nicknamed “Stella”.  The TIA is responsible for generating the signals that are sent to a TV in order to generate images and sound.  The TIA was designed to keep costs down, and cost-cutting measures led to the chip exhibiting some very peculiar behaviors which required arcane knowledge and carefully timed commands to effectively control.

After learning about programming the 6507 to control the TIA, I’ve discovered that the Atari’s reputation for being notoriously difficult to program games for is not overstated.  First of all, in 1975 we didn’t have computers powerful enough to provide layers of abstraction between the programmer and the hardware which act to simplify programming tasks. The Atari requires coding in an assembly language — literally the lowest level of programming possible in a computer (sometimes called “bare-metal” programming because of the programmer’s metaphorical proximity to the physical hardware).

To illustrate the difference between modern software development and programming in assembler, imagine that you want to write a poem on a piece of paper.  Modern programming is like you grabbing a pencil, then manipulating that pencil to write the desired words on a piece of paper.  With assembly programming, if you want a pencil, you can’t just grab one — you have to first chop down a tree to get some wood, mine some graphite out of the ground for the lead, etc.  Programming in assembler for the Atari’s Stella chip is like you having to time those axe and pick swings in step with your heartbeat or you die.

The ultimate testament to the skill of the original Atari programmers is the fact that the games for the Atari 2600 could not be longer than 4096 bytes.  The entire text of this blog post you are reading takes up a little bit more than that!

So, I decided to try my hand at doing a little Atari 2600 programming myself. I followed a tutorial by Andrew Davie to get started.  Unfortunately, some of the code examples had bugs in them that made learning Atari programming very frustrating at times — I had to debug code that I was in the process of learning!

Here is my first Atari 2600 program (hosted on Google Drive — please leave a comment if there’s a problem with the link).  All this program does is display a Canada flag.  It might not seem very impressive, but if you’re familiar with Atari programming you’ll know it’s no trivial task.

canflag0 screenshotThis zip file contains the compiled ROM that you can load up and run in an Atari emulator like Stella (named after the Atari’s custom chip).  If I had the hardware, I could literally burn this ROM file into a writable Atari cartridge and run it on an actual Atari 2600 machine.

Also included is the source code to which I’ve added copious amounts of comments to make it easier to follow (feel free to tinker with it), and a symbol dump file generated by the program that compiled my code which shows exactly how each command in the source code is converted into numbers that the 6507 can understand.

Also, if you’re interested, here is a PDF of the 1979 Stella Programming Guide.

Edit: Spiceware has also put up an excellent programming tutorial as multiple topics on the AtariAge forums.