Saturday, May 30, 2015

A heavier barbell

I have run out of weight plates and reached the limit of my barbell in the deadlift.


My deadlift is now at 212 lbs and I'll need new equipment to increase it!  While not super impressive, it's 50 lbs heavier than when I started.

And here's where I'm at in all my barbell exercises.
Deadlift: 212 lbs
Squat: 145 lbs
Standing Press: 82 lbs

Saturday, April 25, 2015

A better barbell

Let's start with the obvious: I'm cheap.  Or perhaps frugal.  And lazy; we shouldn't forget that.  I want to build some strength and don't want to bother driving to or paying for a gym, let alone waiting for equipment or listening to the awful music.  However, my standard weights and barbell pose a few problems:
  1. The weight plates are too small to do deadlifts, about 8 inches in diameter less than Olympic weights, so the bar lays too close to the floor. 
  2. It takes forever to change weight plates with the screw locking mechanism.
I have a history of hurting my back with squats and deadlifts at the gym.  The last time I tried them I was out of the gym for 3 months.  This time I'm following Starting Strength by Mark Rippetoe and, surprisingly, his advice and instructions are more cohesive and useful than the "training" I got at my last gym.  I highly recommend this if you plan to gain strength with free weights.

But my weights aren't the greatest.

To fix the height-off-the-ground problem, I built a simple platform using a single 4x4 (cut to 1 foot sections at Home Depot), a cheap rubber mat, a 3/4" x 1.5" piece of wood, and some scrap MDF:

 
This was a pretty simple project.  My only mistake was gluing the 4x4's together before screwing them to the MDF.  The glue seeped out and pooled on my workbench.  I made two of these:



These platforms work great and also help keep my deadlifts honest.  I can see if the bar inches forward during my lifts by their placement on the blocks.  If you read Starting Strength, Mark will tell you many times that there is a tendency to move the bar forward before, during, and after your lift, and I can see easily when this happens, prevent it, and learn to lift correctly.

In the picture above you'll also notice how I modified my bar.  First, I got Lock Jaw collars to replace the barbell screw locks.  These save me many valuable seconds in a workout set since I can take the lock off in about 1 second instead of 10.  While this is good, when changing weights they kept getting caught on the spiraling screw mechanism.  My solution, again too cheap to buy a better bar, was to cover it up with duct tape.  Now my weights move fairly smoothly and the bar looks bad ass.  As a bonus, there is less space between the bar and weights so there's less slop in their connection.  I'll soon be adding one or two more layers of duct tape to make this even smoother and create a better fit between the bars and the weights.

That's it.  A simple project, but it made a huge difference in my happiness working out with these weights.

Friday, September 5, 2014

What babies know

I've been postponing this post for a long time since I was expecting the list to grow.

There are many things a baby doesn't know, like how to walk, sing, and do long division.  Here is the list of things that my baby didn't know how to do which I wasn't expecting:

1. Sleep.  I kinda knew this one.  But my kid had to be taught how to sleep.  I suspect he would of learned on his own given more time, however.

2. See moving object.  When my son started to be able to see me, he could recognize faces.  If I was in front of him, he'd pay attention.  However, if I moved my head by a few inches, his eyes stayed affixed to my previous location for at least a second.  Once I stopped moving, he would notice out of the corner of his eye a face and then turn to my direction and look again.  It's like I didn't exist when moving, but once stopped a new me materialized.

3. Binocular vision.  This one was cool and it was exciting to see him change.  Even when my son could see me, he often only looked with one eye, or perhaps one eye first and then the other.  While one eye looked at me, the other was free to wander and see other things.  Over time, he learned to move both at the same time and converge on the me he wanted to see.  I don't know if he can see in stereo yet, but he can certainly judge distance.  And I suspect that he could have learned to use both eyes independently like a chameleon, but the advantages of stereopsis and binocular summation are too enticing.

4. Left/right independence.  When my son could first grab things, he used his right arm.  Then he tried his left.  I could see him intently trying to acquire the toy but every time he tried to move his left arm, the right one would go instead.  If his left hand was in the right position, his right hand would make a grasping motion.  It's like his brain had learned how to do a "grasp" but didn't know there was a "left grasp" vs. "right grasp" yet.  The little guy got it eventually; he did try really hard.

And that's it.  Everything else you'd expect.

My son never really cried until last week when he saw a baby cry and get lots of attention; now he does it frequently.  So I guess learning to cry is another one.

Monday, June 9, 2014

C# Resize Image / Fit Image

After spending a good 10 minutes trying to find a program that can batch resize images from the command line by someone that looks trustworthy (enough to install on a shared server), I gave up and decided to write my own.

Here is the code in case it helps anyone.  This is C# and it compiles for .NET 2.0.  You'll need to add The assembly reference System.Drawing to your project.
ResizeImage.exe <filename> <maxWidth> <maxHeight> 
For example, calling "ResizeImage.exe hello.jpg 100 100" will decrease the width of hello.jpg to be 100 pixel or less and the height to be 100 pixels or less, maintaining its aspect ratio.  If hello.jpg is already smaller than 100x100, there will be no change.

You can batch resize many images by using a batch file.  For example, this will resize all images in a specified directory, including all subdirectories:
@FOR /F "delims=" %%A IN ('dir %1 /s /b') DO @"ResizeImage.exe" "%%A" %2 %3

For example, "BatchResize.bat c:\images 100 100" will resize all images in c:\images\...


using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;

using System.IO;


namespace ResizeImage
{
    class Program
    {
        static void Main(string[] args)
        {
            if (args.Length != 3)
            {
                Console.WriteLine("Please use arguments: ResizeImage myfile.jpg 640 480");
                return;
            }
            string fileName = args[0];
            int width = int.Parse(args[1]);
            int height = int.Parse(args[2]);
            if( width <= 0 || height <= 0 )
            {
                Console.WriteLine("Invalid width ("+width+") or height ("+height+")");
                return;
            }
            try
            {
                System.IO.FileStream fs = new FileStream(fileName, FileMode.Open);
                Image originalImage = Image.FromStream(fs);
                fs.Close();
                Image resizedImage = ResizeImage(originalImage, width, height);
                if (resizedImage != null)
                {
                    originalImage = null;
                    resizedImage.Save(fileName);
                    Console.WriteLine("Converted: " + fileName);
                }
            }
            catch( System.IO.FileNotFoundException )
            {
                Console.WriteLine("File not found: " + fileName);
            }
            catch (System.Exception e)
            {
                Console.WriteLine("Exception: " + e.ToString());
            }
        }

        static Image ResizeImage(Image image, int maxWidth, int maxHeight)
        {
            // Get the image's original width and height
            int originalWidth = image.Width;
            int originalHeight = image.Height;

            // To preserve the aspect ratio
            float ratioX = (float)maxWidth / (float)originalWidth;
            float ratioY = (float)maxHeight / (float)originalHeight;
            float ratio = Math.Min(ratioX, ratioY);

            // New width and height based on aspect ratio
            int newWidth = (int)(originalWidth * ratio);
            int newHeight = (int)(originalHeight * ratio);
            if (newWidth >= originalWidth || newHeight >= originalHeight)
                return null;

            return (Image)(new Bitmap(image, new Size(newWidth, newHeight)));
        }
    }
}

Sunday, May 18, 2014

Schrödinger's Poo

Definition: the state of the interior of a child's diaper immediately before being changed, where it is in the quantum superposition of being both clean and poo-filled.

This deviation from my regular highbrow material should make it obvious that I recently had a child.

Tuesday, September 3, 2013

Phones are dangerous

Many people believe the ban of phones and other electronic devices on planes is a bit ridiculous.  I'm one of those people.  Apparently the flight attendant on American Airlines are as well.  On a domestic flight last night, as the airliner was landing and we were all in our seats with our electronic devices turned off, the flight attendant was using an AT&T branded American Airlines cell phone, possibly a Galaxy S3.  She was using an seat assignment app but also launching other apps until she heard me comment on her blatant disregard of her own instructions.

Airplanes fly through thunderstorms, radio waves, satellite communications, and all other sorts of radiation throughout each flight.  Cell phones work on planes, which means the radiation from cell phone towers can get through the hull regardless of whether or not cell phones are used.  The thought of an iPod messing with the sensitive equipment is a bit hard to believe.  Requesting that Kindles be turned off is just ridiculous, as its on state is no different than its off state when its wireless features are turned off.

The situation becomes more suspicious when you consider the different approaches by different airlines.  Some planes have WiFi onboard.  Some have a mini cell tower.  Over-the-ear headphones are banned on some airlines while ear buds are allowed.  iPod's cannot be used but the in-flight entertainment is fine.

I suspect there are three reasons for turning off cell phones:
1.  The cell phone network was not designed for phones to see more than a few cell phone towers and the communication protocol was not designed for rapid cell switching.
2.  Each cell in the cell phone network has limited capacity and allowing people to call/text when they land or at the airport could conceivably prevent the pilot from using the network if their radio dies.
3.  It's safer for the airline to tell people to turn off electronics if their could be a problem, then to crash and be the first to determine there is actually a problem.

I also suspect there are reasons for restricting music:  It limits the ability to hear important instructions.

I could even make a stretch and say hard objects like laptops/tablets would be physically dangerous in a crash and should be stowed when crashes are most likely.

Maybe it's just easier to create a strict ban of all electronics.  But creating a false reason just engenders disbelief and resentment.

Monday, August 12, 2013

Science: the new religion

Why are drugs sold by actors in lab coats?  What makes a fruit super?

I live in a country where science is paraded, used as tool to spread personal or corporate beliefs, and generally assumed to be correct.  I live in a country where people pit science against religions.  And I wonder, do I live in a country where science has become a religion?

Picture this.  If you take a man, give him 4 years of seminary school and an apprenticeship, put a robe on him, stick him behind a pulpit and let him talk, the people of his congregation will often accept what he says as Gospel.  He can control the crowd and influence their decisions.  If he says that science or a different religion is wrong, he is believed.

If you take a man, give him 4 years of college and some research study, put a lab coat on him, stick him behind a camera and let him talk, the people watching their televisions will often accept what he says as law.  He can control a viewership and influence their actions.  If he says that religion is wrong, he is believed.

It is not infrequent to have a conversation with someone who believes something because a scientist said so on TV or in a magazine, was picked up in a newspaper article, or because a semi-related study drew some conclusion.  Do humans share a common ancestor with gorillas?  Does fish oil give you healthy fatty acids?  Does stretching before exercise increase injury?  Does a belly jiggling machine help you lose weight and build muscle?  The answer to these questions may all be yes, or no, but defending them because a scientist says so is not a good reason.  You can find a scientist that is biased towards either.  It is the same as believing a priest because of his position.  The fallacy is the same.  And I wonder if the people in the crowds are the same - would the person who blindly worships science today have blindly followed a religion if born to different circumstances?

I see this a lot in new age religious text.  How quantum mechanics or some strange property of light is used to justify their beliefs.  The same holds true for health magazines.  The mere fact that they are inspired to use science as a way to validate their claims (when the science rarely applies) implies that people are more likely to believe it - if you invoke the word of science, your argument has weight.  However, reality is more like this: http://xkcd.com/1240/.

I believe that messages should be considered - thought upon, weighed, compared with personal experience of reality, and then dismissed, accepted, or challenged - regardless of who they come from.  For ideas that are not worth the effort, or you don't have the information to judge, then keep them separate from yourself, keep them as other peoples' ideas.

Science is great, and the scientific method is both obvious (now) and incredibly useful.  But there is a difference between believing particular statements of science and believing that the scientific method helps us understand our natural world.  The first is either faith or conclusions based on judgment of prior experience and the second is a judgment of principles.

Religion can be great and incredibly useful.  But there is a difference between believing the teachings of a religion and believing that a religion helps us know truth.  Again, the first requires faith or judgments based on experience.

Perhaps because of my background in science, I prefer judgment based on personal experience to faith - a belief based on faith should only be as strong as your trust in the guarantor of the idea, based on your own past experience.  This can be applied equally to science and religion.

Believing what we experience is infinitely more important than believing what we've been taught.  Prejudices, hatred, and cultural wars are borne of teachings and thoughts.  But experience is borne of truth.


ADDENDUM:
After writing this entry and letting it ruminate in my mind, I read the chapter entitled "We've got it all backward" from Steve Hagen's Buddhism is not what you think.  In the chapter, Hagen states that people have it backwards: we think that religion is about believing in a set of beliefs and that science is about knowing reality; In truth, religion is about helping people experience reality and science is about cultivating a set of beliefs.

Beliefs are the fuel and output of science.  Scientists create beliefs (theorems), develop experiments to test the beliefs, and reject beliefs that do not hold up to testing.  Science does not create reality, but creates models of reality that are believed for a while and then replaced.

Religion is about reality.  About knowing the truth.  The problem with religion today is that it is often distilled into a set of beliefs, and these beliefs are then taught and believed.

Using this idea, which matches a theory I've been working on for a some time, I would say that the problem with science (or, more accurately, the problem with people) is that the public seems to believe the beliefs of science, much as today's religious believe in the beliefs of the religion.