Category Tips and Tricks

Creating a Fluid Two-Column Layout With a Single Fixed Width Column

Ever wonder if you can create a fluid layout with a fixed witdh column? Well, you can!

layout.html

<html>
  <head>
    <title>Fixed Left Column</title>
    <link rel="stylesheet" href="test.css" type="text/css" />
  </head>
  <body>
    <div>Left div</div>
    <div>Right div</div>
  </body>
</html>

test.css

.left {
	width: 300px;
	float: left;
	background-color: #CCCCCC;
}
.right {
	margin-left: 300px;
}

There are very few times in life that you can have things both ways, this is one of them.

Sending Email in ASP .NET

I can’t think of too many websites that don’t send automated email. Unfortunately, for ASP .NET programmers, there are several incorrect code snippets online which try to explain how to send email.

Here’s the code I use on the contact form for my personal website which does the trick quite nicely.

/* using System.Net.Mail; */
MailMessage newMail = new MailMessage();
newMail.To.Add(toAddress);
newMail.Subject = subject;
newMail.Body = body;
newMail.From = new MailAddress(fromAddress, name);
newMail.IsBodyHtml = true;

SmtpClient SmtpSender = new SmtpClient();
SmtpSender.Port = 25;…

Working With Custom Time Strings in C#

Let’s say we need to process some external data where the format and contents of the files are out of our control. To make matters worse, what if those same external files store tiemstamps in a foreign format that DateTime.Parse() does not understand?

It would be ill-advised to keep the dates in string format due to the level of robust date processing capabilities present in .NET.

Luckily, .NET provides a nice way to create custom date formats so any date string can…

Handling Foreign Key Constraints in SQL

Here’s a useful tip for handling foreign keys when creating database tables that I seem to forget every time I write SQL statements to create a table.

When using foreign keys you need to use the entire key as your foreign key, you can’t just use part of it.

This example could be easily solved by creating unique IDs but let’s just pretend our boss won’t let us.

create table Games (
	title integer,
	studio char(20),
	genre char(20),
	primary key (title, studio)
);

The…

Handling Strings Correctly in Java with StringBuilder

Strings are fundamental to any programming language and are used several times in virtually every program written. Understanding the way strings work in Java will ensure your code doesn’t contain any unnecessary performance bottlenecks.

Strings are Immutable

I’m sure you’ve read at one point that strings are immutable objects. But, what does that mean? And, how will this affect your program?

An object that is immutable can never have its value changed. This means that when you assign a new value to a string…

Thwarting Spammers With reCAPTCHA

One day, while going out to lunch, I checked my phone and noticed 20 new email messages from Wordpress asking me to review new comments to my blog. I instantly knew something was wrong because I don’t generally get that many comments in such a short amount of time. After reviewing all of my email messages, I confirmed that every last one of them was asking me to approve a spam comment. By the time I got back to my…

Using Root Cause Analysis to Improve Your Processes

Root cause analysis comes in handy when you need to identify why a problem happened so that you can take the appropriate actions to keep it from happening again.

Root Cause Analysis Techniques

Here are the two primary techniques we use at work. They are very straightforward and encourage group-wide brainstorming.

5 Whys

Most everyone defaults to this method, in fact, it is so natural that I bet you probably performed a 5 Whys analysis at some point today. You start of with…

10 Tips to Improve Your Leadership Skills

I have some friends in my old group who are having a really rough time with some of their managers at work and their horror stories really got me thinking about the responsibility of being a leader and what separates the awesome leaders from everyone else.

Working for a lame manager is no fun, so don’t be that guy! Here are 10 tips that will tangibly improve the quality of manager you are. Again, this is more geared towards technical…

Share the Awesomeness: Creating Cheap (and Easy) Technical Videos.

I really enjoy attending technical events, especially programming talks. Almost every major city in America has several User Group meetings where (in my case) programmers/techies who are interested in a specific language or technology can all get together and talk about the various projects they are working on, or invite people to come and talk about new technology that is being developed to improve the overall quality of the development process.

Unfortunately, most of the information shared at these meetings is…

Turning Off Post Revisions in Wordpress

If you’re like me and are the only one updating your blog (heck, at this point it’s pretty safe to say that I’m the only one reading my blog!) then, it might be beneficial – from a space/resources saving standpoint – to disable post revisions. It seems like Wordpress makes a post revision every time you click a button and it’s pretty easy to see how much of a waste all of that database space is. Currently, a few extra rows…