Annoying CSS issue and solutions

We know that using CSS and DIV elements is the most versatile way to layout a web page. But when you drop tables you lose the browser’s native ability to resize elements properly when the user changes the window size, views on a mobile device, or changes the font size.  Eli details some of the common problems on his blog.

One situation I was getting annoyed with is setting up a horizontal link bar, much like you’d find in the header of many websites.  If you set all the elements to float left, you have to manually specify a height of the overall horizontal UL or DIV that encapsulates the floating elements. This is fine, except if you don’t know if the floating elements will fit inside a page width.  You might want the floating elements to spill over to the next line, and appropriately push the content of the page down.

I haven’t figured out how to do this using just DIVs and CSS. But I found if you wrap the horizontal bar in a table/tr/td, the table will automatically expand to contain all the floating elements, effectively giving the whole thing a proper height. This way you can set a background on the table and it will always be shown.

View the HTML example of this problem: Floating Element Test

No Comments Posted in technical
New TypeMatrix 2030 Ergonomic Keyboard

I recently purchased and received my new TypeMatrix 2030 USB (2009 model) keyboard!  For those that don’t know, TypeMatrix is a company that produces what I believe to be the best, most comfortable and most logical keyboards that one can buy.  The version I bought is Dvorak, since that has been my preferred typing layout since around 2003.

2030usb_us_qwerty_640x264
The TypeMatrix 2030 USB (2009 Model) – Shown with Qwerty layout

What is even more pleasant is that… Continue Reading »

3 Comments Posted in crap i write
DJMP.org Hacked!

I’ve been cleaning up a lot of crap over the past few days that was the result of an exploit on the site. Basically, most if not all “index.php” files in the directories of the site had various lines of advertising & link code inserted into them. They were inserted into hidden HTML elements so they couldn’t be seen unless you viewed the source.
At first I tried to figure out how the exploit was executed… Wordpress? Gallery2? I wasn’t too sure so I removed all the spam links and javascript code and thought I removed access to the Gallery applications. But that wasn’t enough, as the next day I checked it, all the index files had been tampered with again. “Did someone get my password? How could this happen!” I thought. Then I realized there was still an old Gallery2 directory ready for exploiting. So I got rid of that promptly and cleaned up the whole site again.
I even re-installed Wordpress to the latest version. My next steps are to install a backend for the site which would alert me via e-mail if certain actions occur.

No Comments Posted in crap i write
CityMove.com Launched!

The website I have been hard at work developing for the past couple of months at RustyBrick.com has been launched to the public! I worked on many different parts of the site, most notably the Post Job process and Submitting Reviews, as well as a fair amount of the back end.

CityMove is a website where people who need to move can find well-rated movers, who then submit bids on your moving job after you “Post a job”. You can then investigate the movers who bid and check their review and ratings, and finally pick the one you think is best.

Feel free to browse around the website here: www.citymove.com

Post a job on CityMove.com

No Comments Posted in crap i write
Using Google Speadsheets to Track Utility Usage

I’m trying out Google Speadsheets (GS) to track my monthly utility usage (I’ve also started using Mint.com to track my monthly expenditures after my brother’s recommendation). GS allows you to post your charts as an img anywhere on the web. I’m not sure yet if the image reflects the latest version of the data or if you have to repost the image each time.

I moved into the apartment Dec 21, 2008 so the data starts there.

Electricity usage:

I multiplied the dollars per kilowatt-hour by 1000 to make megawatt-hours so it would show up better on the chart
Oil usage:

You can view the spreadsheet publicly here: http://spreadsheets.google.com/ccc?key=pzQuiahdpJwqOCivSTN0BPA
You can’t edit it, but you can save a copy to your own account as a template for your own usage.

1 Comment Posted in technical
Safari Bug in JavaScript Popup Calendar by Matt Kruse

One of the most widely used (and oldest) javascript popup calendars on the web is Matt Kruse’s CalendarPopup, posted at http://www.mattkruse.com/javascript/calendarpopup/. Matt provides plenty of examples and different ways to use this handy script, which provides the user with a visual way to input a date into a form control.

However, the script hasn’t been updated in a long time, and has a long-running bug that shows up in Safari on Mac OS and Windows. The bug occurs when the user clicks to show the pop up calendar, and then clicks outside the calendar box (as if to cancel it) — the calendar is supposed to close, but it doesn’t.

Here is the solution to that bug to help all of you Google searchers out there trying to get the calendar div popup to hide when the user clicks somewhere else on the page.
In the “PopupWindow.js” file, on Line 240:

var t = e.originalTarget;

I do not think Safari supports “originalTarget” for an event, at least not in this case. In Safari ‘t’ will be undefined. After this line, add:

if(t===undefined){
t = e.target;
}

I don’t know if this works in browsers earlier than Safari 3.0, but I tested it in Firefox 3, IE 6, and Safari 3.

You can download the full combined JS source with the fix already included on my website here.

By the way, as a developer primarily working on Windows, I never thought there was a point in using the Safari browser on Windows. However, I had to test something recently in the browser so I installed it and started using it. I’m now glad I did, because it generates & logs strict HTML and Javascript errors in the error console that other browsers, like Firefox, just ignore.

3 Comments Posted in technical
Tech Talk 2

Tech Talk

By MICHAEL BUTLER

Tips & Tricks for making your computer go faster

It seems that whenever I listen to complaints from family and friends relating to their computers, they describe it as being “as slow as molasses” or “slower than a
glacier melting”. Yet, when the computer was new, it seemed to perform more quickly. How come the computer slows down over time?

Continue Reading »

6 Comments Posted in technical
Tech Talk 1

Tech Talk

Cool gadgets for the 2008 holiday season

The economy troubles may be slowing consumer spending, but that won’t stop electronics lovers from wishing for the latest gadgets this holiday season. Here is a list of some high tech electronics in demand this season.
Continue Reading »

No Comments Posted in technical
Printing over Remote Desktop & Terminal Services

For a while I didn’t understand why some printers would print over remote desktop and others wouldn’t. After some troubleshooting with an HP LaserJet 1022 (a host-based USB printer) I discovered these helpful tips:

  1. If the printer supports Postscript or PCL, it should work over remote desktop without any additionally configuration, as long as it can print locally.
  2. If that doesn’t work or if the printer uses a custom language like GDI, if it is called “host based”, or if it is generally cheap, install the driver on the remote desktop server. Then, add a new local printer to the RDP server and pretend it is connected on LPT3, and choose the correct printer driver/model. This will force windows to load the driver, albeit to a non-existent port.
  3. If it still doesn’t work, try making it a shared printer on the client side. Make sure printing is allowed in the Windows Firewall control panel.

On the RDP server, you can also check the Application or System Event Log (Right click My Computer -> Manage). Any printer related errors or warnings are recorded there.

No Comments Posted in technical
Microsoft Certified

I’m now considered a Microsoft Certified Professional, since I’ve passed the “Installing, Configuring, and Administering Microsoft Windows XP Professional” Exam at a local testing center.
I had already been working with installing and configuring Windows XP for a couple of years now, so I knew a lot of the material already. It wasn’t easy though, there were a lot of networking questions and arbitrary questions about the unattended / automated installation options.

No Comments Posted in technical