Management Mentality

January 28th, 2009 / No Comments » / by Ryan

This happened a while ago but I wanted to share it because it was so funny and accurately portrays the disconnect that often occurs between “the management” and “the developers”.  Referring to the project timeline estimate, “the management” responds with:

“It’s easy, right?  Copy. Paste. C++. Done!”

If only it were so easy, of course I’d probably be out of a job if it was.

When CSS Doesn’t C

January 22nd, 2009 / No Comments » / by Ryan

First off let me declare that I would not call myself a CSS “master” by any means.  I’ve had 2 incidents recently where CSS (Cascading Style Sheets) don’t appear to Cascade correctly and it is very, very frustrating.  Here’s a quick mockup of my code (abbreviated for brevity):

<div id="wrapper">
    <div class="rating">
        <a href=""><a/>
    </div>
</div>

And my CSS looks like this:

#wrapper a { position: relative; z-index: 1; }
.rating a{ position: absolute; z-index: 5; }

The problem I was having is that my <a> tag was getting the style applied from the ‘wrapper’ element instead of the ‘rating’ element.

The following rules for cascading order are taken from the w3.org, section 6.4.1:

  • Find all declarations that apply to the element and property in question, for the target media type. Declarations apply if the associated selector matches the element in question.
  • The primary sort of the declarations is by weight and origin: for normal declarations, author style sheets override user style sheets which override the default style sheet. For “!important” declarations, user style sheets override author style sheets which override the default style sheet. “!important” declaration override normal declarations. An imported style sheet has the same origin as the style sheet that imported it.
  • The secondary sort is by specificity of selector: more specific selectors will override more general ones. Pseudo-elements and pseudo-classes are counted as normal elements and classes, respectively.
  • Finally, sort by order specified: if two rules have the same weight, origin and specificity, the latter specified wins. Rules in imported style sheets are considered to be before any rules in the style sheet itself.

The first simply states that the element should only have the styles applied to it if the selector matches, and mine does.  The second doesn’t apply because both of my style elements are author defined and though they are in 2 separate CSS files, they are considered the “same origin”.  The third states that a more specific selector will override a more general one.  I would say that both of mine are equally “specific”.  And the fourth claims to sort by the order specified, which should apply because my ‘rating’ class is declared after the ‘wrapper’.

As far as I can tell I am meeting all of the criteria listed above, the only thing I can think of is that maybe the elements are weighted differently because the ‘wrapper’ is an ID where the ‘rating’ is a class, though I would have thought the fact that the ‘rating’ element is inside the ‘wrapper’ element would resolve that.  In the end I quit searching for rhyme or reason and threw “!important” on my ‘rating’ class and that straightened things out.  Thank goodness for tools like Firebug so you can immediately see how the styles are being applied.  I can only image how long something like this would have taken to track down in the olden days.

And if anyone out there is a CSS master and knows the ins and outs of why this is happening, please feel free to leave a comment.

The Dr. Delivers

December 30th, 2008 / No Comments » / by Ryan

Got this in the mail yesterday.  Thank you Dr. Pepper and Guns N’ Roses!

Behind Schedule

December 22nd, 2008 / No Comments » / by Ryan

There are a few different methods for estimating the time to complete a software project.  Boiled down, they all basically mean the same thing: your project is going to take longer than you think it will, so you’d better over-estimate.

The method that seems to apply the best to my projects is to come up with a realistic estimate of how long you think it will take, without being optimistic or overly pessimistic, and then double it.

With that being said, I am way behind schedule.  I didn’t exactly follow this method when I set my goal to have my project finished by Thanksgiving.  I was purely optimistic and didn’t double.  This last month has been so busy that I haven’t even touched my project since before Thanksgiving.  Luckily, this is just a personal project and I don’t have an angry client breathing down my neck.

The New Look

December 1st, 2008 / No Comments » / by Ryan

I decided that it was finally time to get serious.  I had been letting it slide up until now because traffic to this site was pretty non-existent.  But I’ve got some things in the works and didn’t really want to risk the world wide embarrassment of having my traffic surge to 2 or 3 visitors a day while not even bothering to change the look of this site from the default.  Thanks to sixrevisions.com for compiling a big list of great free WordPress themes for me to wade through.  And a special thanks to blogohblog.com, not only for offering this theme for free, but for being considerate enough to also include the Photoshop .psd file needed to recreate the site logo.

Now I’ve got to re-think how I’m using categories and tags so the site is more intuitive.  Which, unfortunately, will require me to go through all of my older posts and recategorize and add tags.  Fortunately, I think there are only 7 old posts thanks to my previous cleaning. Woot!