Deprecated: Function set_magic_quotes_runtime() is deprecated in /home/tangible/public_html/textpattern/lib/txplib_db.php on line 14
Tangible: Page 2
Aug 19 2007

Hey, I'm in CPAN...

....and I didn’t even know it!

A few weeks ago I helped Gozer with some CSS to style some error_log output in a web page in a not-completely-ugly sort of way.

Well! He’s gone and released the module on CPAN and given me credit for the artwork.

Thanks Gozer!

Aug 12 2007

Presenting: XULApps.Net

After reading David Boswell’s post on Finding XUL Applications in which he laments the lack of a central repository for links to XUL applications, I decided to jump in and create XULApps.Net

I put in a bunch of XUL applications, but I know that there are more out there.

If you have created or know of an XUL application, reference site, or blog that isn’t in the directory, you’re welcome to visit the site and add it to the appropriate category.


Aug 07 2007

Get a div to expand around floated content

Floated elements are a common element of many pages, and dealing with them can be a bit tricky.

The Problem

When your parent div contains a floated element that has a height greater than that of the non-floated elements in the parent div, the floated element will expand past the border of the parent div.

Here’s a simple page with this problem

Here’s the source code:

            CSS Demo: 
            Expanding divs to surround their floated contents
            div {
                padding: 1em;
            #container {
                border:   1px solid black;
                background-color: #ccc;
                padding:  1em;
                margin: 1em;
            #floated_div {
                float:  left;
                width:  200px;
                border: 1px solid red;
            #content_div {
                width:  150px;
                margin-left: 250px;
                border: 1px solid blue;
        <div id="container">
            I am the container div.
            <div id="floated_div">
                    I've got a lot of stuff in me, and will 
                    overflow the boundaries of the container div.
                    Lorem ipsum dolor sit amet, consectetuer 
                    adipiscing elit. 
                    Suspendisse eleifend lorem id sapien. 
                    Nam eget odio. In 
                    diam. In quis massa non lorem sollicitudin 
                    Praesent enim purus, nonummy in, varius 
                    ut, consequat a, 
                    nisi. Etiam at turpis. Praesent porttitor eleifend 
                    Aliquam erat volutpat. Fusce porta blandit dui. 
                    rutrum est in urna. Nullam condimentum arcu a 
                    nulla. Mauris 
                    suscipit accumsan urna.
                    Nunc erat lacus, euismod quis, malesuada quis, 
                    at, tortor. Vestibulum placerat scelerisque arcu. Ut 
                    ultrices mi ac augue. Mauris condimentum molestie 
                    Integer sem. Lorem ipsum dolor sit amet, 
                    adipiscing elit. Nulla facilisi. Integer ac sem. Sed 
                    purus, mattis eget, sodales et, semper ac, sapien. 
                    ipsum neque, pretium at, placerat nec, sodales non, 
                    Cras magna risus, lacinia eget, sagittis sit amet, 
                    id, quam. Cras quis diam. Cras varius metus et est. 
                    ullamcorper, massa a rutrum porttitor, tellus nibh 
                    tortor, vitae pulvinar nulla ante eu magna. Lorem 
                    ipsum dolor 
                    sit amet, consectetuer adipiscing elit. Curabitur 
                    elit at est. Duis at libero id lorem ultricies accumsan. 
                    gravida volutpat nibh.
                    Proin hendrerit accumsan arcu. Maecenas aliquam, 
                    urna eget 
                    ornare facilisis, justo felis ultrices enim, vel porttitor 
                    tellus lorem a metus. Class aptent taciti sociosqu ad 
                    torquent per conubia nostra, per inceptos 
                    hymenaeos. Nulla 
                    ante. Suspendisse potenti. Sed feugiat imperdiet 
                    arcu. In 
                    tellus eros, pretium at, ultrices sed, fermentum eu, 
                    Donec nisl mi, egestas et, malesuada at, varius quis, 
                    Proin dignissim mattis libero. Sed tellus quam, 
                    dapibus eget, 
                    mollis quis, vehicula a, massa.
            <div id="content_div">
                I'm an unfloated content div.  
                <br />
                My parent div will expand to fit around me.

The parent div has a background that I’d like to have extend behind the floated content, but the way it is right now, it won’t work.

The Solution

The solution is surprisingly simple. If you add a div with clear:both as it’s style just before the parent div closes, the parent div will expand to fit the floated div.

See the solution

Why does it work?

When you specify clear:both as the style on an element, that element will clear all divs above it to the left and the right. This forces the clear:both div below the floating div’s lower boundary.

Since the clear:both div isn’t floated, it forces it’s parent div to expand to fit.

Comment [18]
Jul 29 2007

A Google Search Feature I'd Like to See

1 US pint = 2 US cups

Currently, Google will do certain calculations, conversions and information look-ups when you type them into the search box.

For instance, you can ask it to convert pints into cups, or miles to kilometers.

There are similar features for getting the population of cities, the current weather, movie listings and word definitions.

I’d like to see Google do some date math so that I can ask it things like “today + 14 weeks” and it would give me information about that day.

Perhaps there’s another search engine or tool out there that does this already? If you know of one, please post about it in the comments.

Comment [1]
Jul 18 2007

Apps - Process Explorer

When a file is in use by another program wouldn’t it be nice to know what program it is instead of randomly shutting down applications until you find the right one?

Well, today’s your lucky day.

Download the Windows SysInternals Process Explorer program and save it somewhere sensible like C:\ProcessExplorer\ There’s no installer, so where you save it is where you’ll be running it from.

Run the application, then go to Find -> Find Handle or DLL… and then type in the filename for the file that’s being used by another program.

Click search, and you’ll get a list of applications that are accessing the file.

Now you know which application you need to close to make changes to your file.

Comment [2]
May 07 2007

Shaking off Tiredness

Maybe you had a bad night’s sleep, or you’ve just been stressed out for a while. For whatever reason, you’re not feeling very alert and it’s making for a very long day of newbie mistakes and clock watching.

A lot of people use coffee, red bull or other caffeine-rich drinks to deal with this feeling. I find it leaves me feeling shaky and occasionally nauseated.

Whenever I feel like I’m danger of performing a keyboard face plant at my desk, I have sushi for lunch…but not just any sushi: salmon & avocado sushi made with brown rice, and goma-ae (a cooked spinach salad with miso-sesame dressing) on the side.

Why? It’s a highly nutritious meal and provides a good dose of healthy fats, protein and complex carbohydrates. The brown rice contains B vitamins, which help to increase energy levels.

After a meal like this, I feel a more alert, less physically tired and able to take on the rest of my daily tasks without drifting off into the middle distance too often.

How do you take care of yourself on days like this?

Comment [4]
May 02 2007

Testing the Unknown

One of the guidelines to follow when writing functional tests is to use real-world data in your tests.

So, how do you write real-world tests for an inherited application that deals with a subject matter on which you have insufficient knowledge?

You don’t. Really!

Selenium IDE to the rescue!

The Selenium IDE is a fantastic Firefox plugin that lets you record everything you do in your browser and then lets you replay, step through or edit the recording.

When faced with functional testing an application in an obscure-to-you field, you can have someone who knows what the application should do run through a bunch of activities with Selenium IDE recording every move they make.

Then you can go back through the recorded test and start building up a test suite.


Apr 30 2007

xkcd Takes on Regular Expressions

Some of you may have seen this already, but hey, I just found out about it today, so I’m posting it. Click for the full-sized version.

Regular Expression Heroics

Apr 02 2007

Gmail Down? Try this...

If you’re having trouble logging into Google Mail, clear your cache!

If you’re using Firefox, go into Tools->Clear Private Data…

Then select only “Cache” and clear it.

Load the Gmail page and try logging in. It should work now!

If it doesn’t, it’s probably either:

  1. an issue with the Gmail server you’re connecting to, or
  2. you’ve got an anti-virus or firewall program that’s interfering with logging in.

In any case, the Google Troubleshooter can probably help you figure it out

Mar 22 2007

CodeIgniter - Initial Impressions

About a week ago I joined the CodeIgniter community and was warmly welcomed.

Since then, I’ve been playing with CodeIgniter and so far, so good.

I have tried other frameworks in the past, most notably was Ruby on Rails. It took me over an hour to get the environment set up properly, even using InstantRails. When I tried to follow along with the “Create a Weblog in 15 minutes” screencast, I constantly had to pause it and rewind to catch up or just to understand what was happening.

On top of all of that, my host of choice will not host Rails apps…period.

CodeIgniter was a totally different beast. Since I already had XAMPP installed on my machine, installation was a snap. All I had to do was unzip the archive and pop it into a web directory. Done.

Then I tried following the Hello World Screencast and the Create a Blog in 20 Minutes Screencast and was able to follow along with each of them without pausing. I really did have a basic blog in 20 minutes. Fabulous!

The online forums are very friendly and I’ve been able to get past any of the snags I’ve hit just by doing a quick search.

So kudos to you, CodeIgniter. You just beat out Ruby on Rails as far as I’m concerned.

Comment [2]

Previous Next