07 June 2007

CSS Tip #1

If you have a div that needs to go the height of the entire page the way a body tag can. For instance, if you wanted one background image for the body tag and another for a div tag, like having multiple borders. I ran into this issue when setting:


#bg2
{
height:100%;
width:700px;
margin-left: auto;
margin-right: auto;
}


the height gets ignored on most browsers, make sure to include:

html, body
{
height:100%;
}

body
{
width:800px;
margin-left: auto;
margin-right: auto;
}


so if you have html head../head body div id="bg2" .../div /body /html

Labels: , , ,

06 June 2007

Great Video

For anyone that knows anything about UNIX an utterly hilarious video:

05 June 2007

Ubuntu experiment



On 5/13/07 on a www.fatwallet.com post i saw a Compaq c551nr going for $399 at BestBuy. I had been meaning to get a laptop to attempt to use exclusively for Ubuntu, and with feisty fawn being released i couldn't help myself and i got it, (i exchanged it the next day because it had 1 stuck pixel that i couldn't rattle back). I have always run Ubuntu as a secondary operating system with windows being primary. I hope that i can totally convert over "but, we'll see." I will post my Ubuntu progress as i work with it.

Labels: , , , ,

Dirty Bit Pattern?

I'm not really sure if i would decree it a design pattern (and i don't want to get into an argument as to what is one), but...

I was over at Mark's house and reviewing some code for "the video game" that we WILL create and he was showing me how the scene graph works for local transformation matrices. In video games you multiply one matrix against another against another until you position your one vertex. Well instead of doing those multiplications down the line every time something doesn't move. Instead you have a local transformation matrix you multiply by and as a vertex moves it tells its children to set their transform matrices to dirty so they know to update next frame.

This brings the story to me... It made me think the "dirty pattern"

Lets apply this to a class that represents a database object.

If the class is updating any object (reflected in a database) the class should set a "dirty" bit to know whether it should do any database changes at all. Furthermore if this class has changes it needs to make to other database classes, it can pulldown(instantiate) those classes, change them, and have them set their diry bits.

Labels: , , ,

04 June 2007

FLV Player

If you're looking for a great, free, opensource FLV player for your website check out FlowPlayer at http://flowplayer.sourceforge.net

I've tried a couple of others but have not found one to be more compatible and script-able as this one. It seems to have a very clean implementation.

Labels: , , ,

YATIDK #2

Continuing the trend of yet another thing I didn't know (but probably should have):

I had always done:



Object o = ...

if (o.Type() == typeof(string))

{

   blah...

}



when i could have been doing:



Object o = ...

if ( o is string)

{

    blah...

}


Labels: ,

YATIDK #1

YATIDK = YetAnotherThingIDidn'tKnow
New segment for this blog where i talk about stuff i didn't know, but should have.

I already knew that if you have a multi-line string as so:




string s = @"Lorem ipsum dolor sit amet, consectetuer adipiscing
elit. Aliquam sit amet velit. Morbi sit amet sem. Pellentesque
suscipit, risus et laoreet convallis, tortor elit aliquet mi, quis aliquet magna
sem eget quam."
;




you place @ in order to read everything between " including CR

... anyway apparently if in that string you have "bob" in quotes the way you handle it is ""bob""
i.e.:



string s = @"Lorem ipsum dolor sit amet, consectetuer adipiscing
elit. Aliquam sit amet velit. Morbi sit amet sem. Pellentesque
"
"bob"" suscipit, risus et laoreet convallis, tortor elit aliquet mi, quis aliquet magna
sem eget quam."
;




its cleaner than changing to single quotes, concatenating multiple strings etc.
Now I Know...

Labels: ,