01
Jul

Recently I entered myself into a mass-start ride that would be well over 60 miles long (70+ in fact) with over 5000 feet of climbing. While this may not seem like much to some of the ultra-cyclists out there, when you realize that the climbs are nearly all at a steep gradient (New Jersey is just a bunch of ridgelines) and that I have been working on my time trial position, something was going to break - and it did. My left knee started giving me problems at around mile 40 and I just rode through the pain.

My mother (a physical therapist) did a few simple checks and decided that my quad muscles were lopsided and one side of the leg was pulling the kneecap off center. Ok - not good but also not bad! After a fairly easy week though the pain had subsided off the bike because of the exercises I had been doing to strengthen the inner side, but on the bike the knee still hurt. I decided it was time for a cyclist’s opinion. Speaking with the person that has done my fit twice and is a good rider himself the conclusion was that there is something wrong with the way I was pedaling and/or sitting on the bike.

The problem could be one of many things…

  1. I had adjusted my saddle position to be farther forward and this was crunching the knee too much on the top of the pedal stroke due to the lower position. Fixes? Raise the saddle or sit back farther.
  2. I was pounding too hard on the pedals and not lifting enough on the upward portion of the stroke. Fixes include spinning lighter and spinning faster.
  3. Unlikely possibility but my left leg could be a different length. Fixes would include a refit with some shims or something.

I can hear the programmers wondering what the hell this post has to do with debugging code. If you are a learned programmer you should understand the benefit of the scientific method and having controlled changes. By limiting the number of things you change between builds a programmer can see how A affects B directly or indirectly without worrying about how C fits in. I take a similar approach to my health: when sick, eliminate something until the problem changes or is fixed and then work backwards adding things back on. Unfortunately I didn’t do that this time around!

What ended up happening is I bought new bibs (shorts with suspenders built in) that have a thicker padding than the ones I was wearing when the problem started. I also lightened my pedal stroke and sat farther back on the saddle. I just committed debugging suicide by changing three things about my fit and while it may not seem like a big difference remember that a 1mm change in saddle height can be the difference between excruciating pain and pure bliss for some riders. The effective changes include higher sitting height from the bibs and the saddle position, a different KOPS measurement due to changing the saddle position and spinning lighter meant that my quads would not be working against each other so much.

Where do I go from here? While the changes have eliminated the pain, I need to actually work backwards no until I get some sign of the pain reoccuring. This means sitting forward on my saddle with the new bibs as well as sitting at the back of the saddle with the old bibs. I have to mix it up completely until I can figure out specifically what triggered the pain. The problem is that it is time wasted towards a goal I don’t want to sustain (knee pain) and with a race in five weeks, my fit should be the last thing I am worried about.

Actually, that is quite unfair to say because CSS itself (language/syntax) is okay on its own. It is the standards body and the set of standards they decided upon that cause nightmares for millions of developers and designers each day. This should be no secret for anyone who has attempted to get a site to work 100% in each browser, that is without a single pixel off. While it certainly is possible, the hacks often required to do so have been passed down through the generations of the language.

height: 100% - in your dreams
You would think that making a div have a height of 100% would mean that it would fill whatever space it was within. Not true! It works so long as the parent div has an explicit height. Note that it doesn’t work on this page. Note that while the right div has a height of 100%, it doesn’t adjust to fill the space created by the left div. Note that if you do not have the Clear div in there, you won’t even see the wrapper’s background. In otherwords, it doesn’t grow with its own content. Good job on those standards!

To fix this we have to define some explicit heights. By giving the Wrapper div a height of 800px you will notice that not only does the height setting work all of a sudden, so does the background! View the new code here.

While this is nice and all, it sucks for anything that has fluid height. The real fix for this is to move the right column’s bottom div outside of the right column and create two more columns afterwards. But now that div is outside the height of the left column which could make for an awkward gap, especially if you have a background image that provides a border. Enter the hacks: by adding a negative margin we can move the div back up into the column above it. See the final page. Congratulations, we have now entered the realm of CSS hacks and from here on out there is no turning back.

Margins and Padding In Nested Elements
Why is it that margins and padding in nested elements always seem to affect their parent elements? Furthermore, why can’t I define an explicit width and then give it padding? Why must the padding always be changed with the width? This makes for unreadable CSS that forces you to do addition and subtraction on the fly to get the true width of the element.

This one is simple: attaching the site’s content to the top of the page. This is easy enough as demonstrated here. No real trickery is required; just set the body and html tags to have a padding and margin of zero on all sides. If you are working in ASP.NET you may need to set them for the form as well. Never-the-less the two CSS properties do as we expect them to, at least until we add some real content. Just by adding a simple h1 and p tag we have already corrupted the parent element’s placement on the page.

Why does adding elements with a top margin to a nested element change the positioning of the parent element itself? In some cases (and probably here too, I don’t have WebDev bar installed here) the entire body is moved down because of this top margin issue. Regardless of that, a child’s positioning should never affect the position of the parent except for in specific/explicit cases. An element’s margins and padding should always be relative to the container it sits in and sibling elements. But instead we have to deal with setting top margins to zero now because of the CSS standards.

XAML Rocks
Which brings me to my point - the CSS language isn’t broken, the standards we follow are. If you look at Microsoft’s implementation of similar features in XAML, you will see that the standards they use actually make sense for all of those involved. Let’s look at the first problem I mentioned: advanced column layouts with a bottom positioned element in the right column. In XAML we can use a Grid to create the two columns, but many will cry out that is too easy and "tables" shouldn’t be used for layout purposes. Instead we can use the Grid as we would use a Div in HTML. We use the HorizontalAlignment attribute to tell each Grid to "float" which creates the columns. Much to the web developer’s surprise, XAML does exactly what you tell it to do!

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<Window x:Class="BottomPositionedElement.Window1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Window1" Height="300" Width="600">
    <Grid Background="#2D2D2D">
        <Grid Background="#DFDFDF" Width="340" Margin="10" HorizontalAlignment="Left">
            <TextBlock>
                Some content would go here and stuff.
            </TextBlock>
        </Grid>
        <Grid Background="#8F8F8F" Width="200" Margin="10" HorizontalAlignment="Right">
            <Grid Background="YellowGreen" VerticalAlignment="Bottom" Margin="10">
                <TextBlock>Hello, world! I am a bottom positioned "div"</TextBlock>
            </Grid>
        </Grid>
    </Grid>
</Window>

My point is to raise the obvious question: If Microsoft can implement its own set of XML tags and write a standard for them that makes sense and works, why can’t the HTML/CSS standards bodies? To blame this on the browser manufacturers at this point is just silliness since IE8, Chrome, and FireFox all have similar isses. That is to say that they follow the standards but what you expect is not what you get.

07
Jun

This summer has been very good to me so far. I got my old job back and couldn’t be happier in that respect now that I have a title (Web Developer) and received a nice raise over the winter. I have also been very grateful to have the time to put a sublime amount of miles on my bike. I am fast approaching having it for a full year and have already put on well over 2000 miles. In fact, here are the stats:

Totals from 08 August, 2008
Time: 283h
Kcal (Calories): 111 161
Odometer (Miles): 2184.91
Max Speed: 42.5mph
Max Cadence: 130
Ride Time: 133h

Anyways, being able to put so many hours into being on the saddle and just enjoying the ride has taken a serious toll on my weight. On 25 February I decided that at 240 pounds, enough was enough and realized that I could be a serious cyclist within a year or two if I poured everything into it. No fancy tricks, no secret diets; nothing but extremely long hours on the bike whenever I could and reducing the consistency of junk food. It has been 103 days since that day and I have lost roughly 25 pounds. As you will see I didn’t lose it all at once; the first few weeks were really rough as I couldn’t always get on the bike but now that my diet is balanced and my body is used to consuming large quantities (faster metabolism) I can slack off a bit during the week due to work and still lose weight.

The ultimate goal would be 180-185 pounds and if I achieve that I will certainly reward myself with some nice Zipp 808s but I keep in the back of my head the knowledge that at a certain point I will stop dropping body fat and my weight loss will seriously plateau. The other problem is that it is already June and the Winter is fast approaching. I haven’t decided what I am going to do when the snow hits and I can’t ride every day, but I plan to seriously reduce the amount I eat every day when my metabolism slows down. The realistic goal right now is somewhere between 190 and 200 would make me very happy and I would be okay with 200 on the dot.

Weight Loss Graph from Excel - Lots of peaks and then major declines.

I have also seen some major changes to the basic physique of my body. Obviously my stomach has gotten quite flat but I have also lost quite a lot of muscle and fat on my arms which was a welcomed change from the days of throwing shotput and discus.

My bike has also changed a lot since I got it. I just recently installed new bar tape, got a new chain (Dura-Ace 7900!) and have dropped the handle bars about 1-1.5 cm from the stock position. The goal with that is to never be comfortable on the bike for weeks while there is still a more aero and powerful position to be achieved by dropping the bars further. Also, I love that pro look of a huge drop from saddle to bars.

I think the best part about this sort of “diet” program is that it is long lasting because I enjoy doing it not just for the fitness aspect but the simple enjoyment of riding and feeling good as well. If only I could solve the dilemma of having to work in a cubicle for 40 hours a week…

I am always chased or barked at by the small dogs. The smaller they are the more they want to eat me and the more they think they can. All the big dogs I run into are quiet and still, simply watching me as I pass them.

29
Apr
stored in: Cycling and tagged: , , ,

Here is a video of me (in the blue) finishing the Cape May Time Trial. I ended up with a 19:59 which over the 7.5 mile course comes out to a 22.5 mph average.

27
Apr

For awhile now (62 days) I have been trying to lose weight. While I have only lost 12 pounds overall, I have certainly gotten stronger. This past Sunday I entered a 7.5 mile ITT (Individual Time Trial) and got clocked at 19 minutes and 59 seconds which equates to roughly a 22.5mph average. This is a lot better than what I could have done 62 days ago!

But it isn’t enough. My improvement in the races is going as I want, but on the scale it isn’t. So rather than get really drastic with my diet (I have cut out sugar, soda, and soon pizza) I am deciding to just go on two bike rides every day that it is possible. Today I went for a total of 36.2 miles over two outings but that number will increase drastically once it cools off a bit (it was 90F today).

The point of this is two fold: get a lot more miles on the bike without needing to spend constant hours on it and lose weight faster. Last year I was able to gain strength quickly after I bought my bike by doing large amounts of miles in a single day. This caused my muscles to break down enough so that they rebuilt much stronger. Furthermore more hours on the bike means more calories burned and more burnage means more weight loss.

Me at the Cape May ITT
Cape May ITT

The plan for the near-distant future is to have two weeks, one in middle May and one in middle June to spend an insane amount of hours in the saddle. For the week in May I plan to be doing large single ride days of 60 miles or more and mostly in the hills. This will set me up nicely for the week in June when I will be in the Adirondacks and am faced with nothing but incredibly large rolling hills.

One of the major design decisions for Vodka 2.0 has been how to handle the installation of all the software necessary to run a site. At first I favored a desktop application based install since it would allow me to write in normal .NET code without any problems or hurdles that the web presents. The problem with this idea is that a desktop based install isn’t feasible for most people, certainly not for those on shared hosting.

A client application based installation is what I call an Exploding Installation because it takes a package and pushes files out of it onto the file system. Thus it is exploding itself onto the computer. This works really well for most cases, especially basic software installs like games, office applications, et cetera.

Where such an explosion doesn’t work well is for web based installations, which is where Vodka 2.0 is headed (see screenshot below). This is due to the fact that in most cases the average user isn’t able to set up the server in a way to make it work, or doesn’t want to. Originally the installation procedure was going to be based on an explosion: the user would upload the files, put in the site information (see screenshot below) and then the installation would unpackage the files necessary to run the site based on the information. This would work very well, except it leaves the original install files at the root directory of the server. Instead of this approach, an Imploding Installation does the trick because it not only erases over the install files themselves (big security bonus), it doesn’t require any work to setup. The goal here is to have the user upload the files, run the install and get to work creating content.

Vodka 2.0 Install

So how is this done? To support an implosion of the software, or rather a rewrite of key points of it the software needs to be modular in such a way that programmatic writes can be done over content areas. In the case of the Vodka install the site’s navigation needs to be rewritten and because it is based on ASP.NET MVC has to handle the shutdown and/or removal of the installation controller and views. Right now this is done by removing a simple text file from the server, although in the future it can be done by changing a portion of the web.config file and/or removing an extra “Install” library from the bin directory.

The best part about the implosion is that it is 100% clean. After an installation is completed, there is no evidence left that it ever took place, and no possible way for a user to rerun the installation.

11
Apr

I sure hope so. The Zune is a great device for many reasons, most important to me being that it works every single time I want it to. I use the Zune software everyday and while it does crash sometimes, it isn’t morbidly slow and isn’t bloatware. The problem, however, is that the Zune really hasn’t received the hardware treatment it deserves. No touch screen, a touch pad that is glitchy (specific spot on the pad), and lack of full graphics development (no shaders) really hold it back. Hopefully this Zune “HD” will fix all that…

Shots via Engadget

Zune HD 1

Zune HD 2

10
Apr
stored in: Games and tagged: ,

Looks like we have a platformer contest starting up here… any other entrants? This is the start of a game by ElementCy which apparently go for more of a Conker feel than the fast paced style of Tears.

10
Apr
stored in: Games and tagged: ,

Check out Zedox’s new platformer, Tears, in this video. I have been wanting a good, fast platformer for many months now. Remember kiddies, Sonic is always better than Mario.