Why doesn’t my CSS work?

It seems that I am always banging my head against the CSS wall screaming “What is wrong with my CSS code?” and “Why doesn’t it work?” Today I came across the blog CSSNewbie and they had a nice article on the top five reasons why CSS doesn’t work.

The basic reasons are:

  1. Missing bracket
  2. Missing semicolon
  3. Misspelled Class or ID
  4. Misspelled Properties or Value
  5. Bad CSS Value

Guess which one haunted me?

#1 of course!
What I didn’t know is that CSS loads until there is an error and then it stops.  I had a CSS file that I linked to in the <head> section of my page and after it I had some style tags with some additional CSS definitions.  I saw that half of my CSS stylesheet worked and the other half didn’t, but the commands listed after the included stylesheet worked.  So I was very confused.

It turns out that the CSS stylesheet stopped loading after the parse error, so only the commands defined in the beginning worked.  But when it got to the new style tags, it read those just fine.

To find the error, I used a CSS Validator.
Specifically, I went to:

W3C CSS Validation Service
http://jigsaw.w3.org/css-validator/

and gave it the URI to my CSS stylesheet.
They found the error.

Good Luck!

Posted under Coding, Internet, Programming, Software

This post was written by drknuth on February 18, 2009

Tags:

Flight of the Conchords: The Humans are Dead

A fun song about the robotic takeover…

Posted under Fun, Robotics

This post was written by drknuth on February 15, 2009

Tags: , , , ,

Video from the Future

Comedian Eugene Mirman (who can be seen frequenting the Flight of the Conchords set) sends us a video message from the future using a new technology called the “Time Bag”

Enjoy…

Posted under Fun

This post was written by drknuth on February 15, 2009

Tags:

Multiple Submit Buttons on Forms

I recently encountered the challenge of including multiple submit buttons on an html form.  Wading through the noise on various blogs and help sites was painful.  I finally found the following solution that works, and decided to post this little tutorial…

<form name=myFORM type=post action=default.html>

<input type=’submit’ value=’Open Default Site’ onclick=”this.form.target=’_blank’;return true;”>
<input type=’submit’ value=’Open Special Site’ onclick=”myFORM.action=’special.html’; return true;”> </form>

Note that the default action of the form is defined in the first line by:
action=default.html
Both buttons are of type Submit, but they have different values, which reflect what the buttons actually say.

The command in the first button
onclick=”this.form.target=’_blank’;return true;”
instructs it to follow the default action, which is to open default.html in a new window (indicated by target=’_blank’).

The command in the second button
onclick=”myFORM.action=’special.html’; return true;”
instructs it to take on a new action, which is to open special.html

You can keep adding additional submit buttons this way.

Posted under Coding, Internet, Programming, Software, Solutions

This post was written by drknuth on February 14, 2009

Tags:

Charles Darwin and MCMC

Today is Charles Darwin’s 200th birthday, and I would like to celebrate it by drawing some connections between his theory of evolution and recent advances in machine learning.

It took the genius of Charles Darwin to break with the common belief that species were constant and unchanging.  His voyage on the Beagle was essential in forming these ideas as he encountered fossils of extinct forms and the effects of dramatic earthquakes in the Andes, and was led to realize that the Earth changes and that species change.  This idea of long-term change is hard to come by.  It even evaded Albert Einstein when he derived the expansion of the universe from his theory of general relativity and decided to introduce a correction term in the mathematics to ensure that the universe was constant as he knew it to be.  Einstein called this his biggest blunder.  Yet it was exactly this belief of constancy that Charles Darwin was able to shed.

What few people realize is that Western capitalism has embraced Darwinism and use the arguments of survival of the fittest to defend deregulation in the market.  This competition does work well… as long as you actually have competition.

In the area of data analysis and machine learning, which are my areas of expertise, we rely heavily on computer algorithms that search vast high dimensional spaces for solutions to problems.  The best algorithms employ techniques that are central to evolution.  These methods are called Markov chain Monte Carlo (MCMC)  techniques, and in some specific cases these algorithms have direct relation to genetic evolution and are called genetic algorithms.  What makes these algorithms work is precisely what makes evolution work.

These algorithms rely on a fitness function that enables us to measure the fitness of a hypothesized solution to a problem (we call this a sample).  We often start with many samples scattered throughout the space and let them explore via mutations.  In some algorithms, we take good samples and duplicate them and let them explore further, or we may even combine characteristics of a pair of samples to create a new one (as in genetic algorithms).  After hundreds of thousands of iterations, the algorithms are able to find the solutions to the problem.  These solutions would be impossible to find via brute force search or guessing.

The analogy that holds here is that of organism as sample.  Anyone who has actually done these simulations can understand that you can obtain solutions worthy of creation simply by iterating hundreds of thousands of times under the force of a selection pressure.

Happy Birthday Charles Darwin, and thank you for the insights that have advanced machine learning in the last two decades.

Kevin Knuth
Albany NY

Posted under Biology, Evolution, Intelligent Systems, Robotics

This post was written by drknuth on February 13, 2009

Tags: , , , ,