Andrew Que Sites list Photos
Projects Contact
Main
    Got in a 10 mile bike ride today.  It's been a little difficult lately with all the rain we've been having.  I'm not a huge fan of getting soaked while riding--although I've had that happen a couple of times.
    I thought Job was full of whining, I had herd nothing yet.  Psalm a painful read--and four and a half hours of it.  Most of the psalms were poems/prayers which were to be sung as song.  Most were about the same: God is really powerful, man is insignificant and unworthy of God's attention, and the only reason said author obtained anything is because God made it happen.  Perhaps there is more beauty when these verses are read in their native tongue, but New International Version sounds like the work of a suicidal middle schooler completely devoid of talent.
    Only one Psalm stood out as something noteworthy was one everyone knows: psalm 23 (Yea, though I walk through the valley of the shadow of death).  Perhaps that why everyone knows this one.  I don't often hear psalm 58:10 "The righteous shall rejoice when he seeth the vengeance: he shall wash his feet in the blood of the wicked." Then there is psalm 136:10 "to him who struck down the firstborn of Egypt.  His love endures forever."  Pretty loving to kill firstborns.  But then, my morals are not derived from the Bible, so what would I know?  Maybe this is what they mean by "tough love".
    This is a random compilation of grass.
    I made it through the book of Job.  Maybe I'm just being cynical but that story just seemed really whiney.  The first part of the story most people know.  God is going to prove a point to Satan by taking everything away from a faithful servant by the name of Job to prove that Job won't turn away from God.  So that happens and Job doesn't turn away.  Instead, he goes on and on about how he wishes he was never born, how being dead would be better and how his life sucks.  Job argues with some others about this for most of the 105 minutes the recorded version of the book lasted.  It was like an Emo concert with no interments.  But the book does stay to it's one point: Job complained about how his life sucked but he didn't say anything but about God--so I guess there's that.
    An interestingly creepy statue.
    The optometrist wanted to dilate my pupils to have a look in my eyes today.  I always get the speech about how you can drive home afterwards and I have no idea how this is possible.  Indoors, I have to ware sunglasses and outdoors I have to tie something over my eyes.  I had Tazz give me a ride and spent the ride with a neck tie over my eyes.  Once home, I drew all the shades, put a box in one window and ware two pairs of sunglasses.  I did this for an hour or so before I just decided to go to bed until evening after the drops wore off.  I'm clearly not most people, but being told it's safe to drive after having pupils dilated I think is something optometrist should tell everyone.  They should at least warn people to try it once with someone to give them a ride and see if they can do it because if I hadn't had a ride the first time, I'm sure I wouldn't have made it home.
    Random flower

1 comment has been made.

From Ericasaurus Rex

Earth

January 22, 2008 at 6:13 PM

Pretty flower!
    I did a perspective test today because I was wondering how objects changed size over distance.  It was quite simple: I took several pictures at a fixed location of an object at various distances.  Then, I measured the object's size in pixels and plotted these.  It was very quickly apparent that the object's size is inversely proportional to it's distance, so s = c/d where s is size, d is distance and c is some constant.  Oddly enough, in all the articles I read about perspective online, I never found this equation.  Once I had this, it made sense.  I guess no one was really all that interested in the math.
    The obvious question about this is why I cared in the first place.  Well, I do have a project in mind.  But for the moment, I have nothing else to show for it.  Hence, the spiel about perspective.

August 11, 2007

Some Indepth CSS

It took me awhile, but I finally figured this one out. By photoblog has an image in a floating DIV tag on the left of each article. Often I've wanted to have a large link box in the article. I wanted the size of this link box 90% of the remaining space in the article. Very quickly, I ran into all kinds of problems.

First I tried using a single DIV tag.

Some random text
This is the DIV tag set to 90% the width.
More random text

What's happening here is that the red DIV tag set to 90% isn't paying attention to the floating DIV.

Since these are not the droids we're looking for, I tried a DIV tag that was floating left.

Some random text
This is the DIV tag set to 50% the width.
More random text

This DIV tag floats to the left and is 50% of the total cell, but it is not centered. You'll also note the line "More random text" comes before the floating DIV tag. The text hasn't been moved in the HTML.

The solution is a bit complicated, but functional. First, a DIV tag is made that has a left margin of 300 pixels to compensate for the floating DIV. Inside this DIV, an other DIV is placed that takes up 100% of the width. This tag will now occupy all the room from the end of the image to the edge of the outer most DIV. A third DIV is added that is set to 90% and centered.

Some random text
Centered DIV tag
More random text

It's pretty easy to see what is happening here with the borders turned on. The red DIV is the first tag with the margin. The yellow DIV tag fills the padded red tag. Because of the padding, this yellow tag is now compensating for the blue image DIV. Inside the yellow tag, the third purple DIV tag is setup to take 90% of the parent tag and is centered.

The only problem left is with Internet Explorer, which won't center the DIV tag. This is corrected with adding a "text-align" to the second DIV (the yellow one).

Some random text
Centered DIV tag
More random text

On browsers other then IE, this last example will be identical to the one above.

Finally, without borders, here is what the result looks like

Some random text
Centered DIV tag
More random text

The end result is this:

div.FramedLandscape
{
  padding-left: 320px;
}

div.FramedPortrait
{
  padding-left: 220px;
}

div.Framed_1
{
  width: 100%;
  text-align: center;  /* <-- This is for IE */
}


div.Framed_2
{
  width: 90%;
  margin: 0 auto;
}

div.Framed_3
{
   border:     4px solid rgb(0, 0, 255);
   padding:    5px;
   font-size:  large;
   text-align: center;
   background-color: #000000;
}

div.Framed_3:hover
{
  background-color: #004080;
}

div.Framed_3 > a
{
  color: #ffffff;
}

...
  <div class="FramedLandscape">
    <div class="Framed_1">
      <div class="Framed_2">
        <div class="Framed_3">
          Some framed text
        </div>
      </div>
    </div>
  </div>   <div class="FramedLandscape">
    <div class="Framed_1">
      <div class="Framed_2">
        <div class="Framed_3">
          Some framed text
        </div>
      </div>
    </div>
  </div>

A lot of DIV tags needed, but it's fairly simple.

    I did it again... this time, I wrote a Javascript implementation of the game Snake.     I decided to do this implementation using a table of 2,500 cells (50x50) and do the motion by setting the cell's background color.  It was straight forward to code, but has some strange side-effects.  It takes a few moments to load in Firefox and several seconds to start the first game.  This is all because of the number of cells in the playing field table.  In IE, the game consumes a lot of CPU power.  My guess is that IE is re-rendering a good deal of the screen each time the table is changed.  At 2,500 cells, this takes a bit of CPU power.  I improved the speed by only drawing the shake head and removing the tail.  There isn't anything else special about the game.  Thought about creating some basic AI to navigate the snake to each of the points using a path-finding algorithm.  But I'm not really all that interested at the moment. 
    Pictured is Park Ave. two years ago.

1 comment has been made.

From Ericasaurus Rex

Earth

January 22, 2008 at 6:13 PM

Pretty!
    Now that the summer semester is over, I'm back to reading the Bible.  Today I learned about how God gets mad when you marry outside the group (book of Ezra) and that to solve this "problem" the men got rid of their wives.  And you have people in powerful positions like George Bush saying "we need common-sense judges who understand that our rights were derived from God."  Well if the Bible is the word of God, I think we'd be better of with judges who think our rights were derived from the Communist Manifesto--at least that wasn't so racist.
    Random log in the Rock River