Dave's Notebook

Selenium Grid Setup

SeleniumGridSetup

My experience with setting up Selenium Grid was frustrated by the lack of information available about exactly what I needed to do to get this working.

I’ve actually had this working for a while now and I’ve set it up, or helped others set it up now, several times.  So, I guess it is time to write a post about it so I can just send people here when I need to explain the setup.

Read More

Responsive Web Design Conversion

Several weeks ago, I started the process of converting this blog to a responsive design.  At this point it is mostly done.  But it is done enough that I can tell you the process that I went through to get the site converted. I was surprised by how easy the process was.  But I guess I was lucky because the theme I started out with already was following a number of best practices. So, to start out with, if you want to move your site toward responsive web design, there are some prerequisites that you’ll need to pay attention to.

Read More

Magic Strings and Magic Numbers

This past week a very old (last time I did work for him was in 2007) client of mine contacted me because their program suddenly started exhibiting a problem.  It seems that if a user enters a date anytime in 2015, the program displays an error message indicating that they need to enter a date greater than today and less than two years from today.

When I went to replicate the error in my debugger, I discovered this bit of code:

1
2
3
4
5
6
7
8
9
10
11
if (Year < 100)
{
if (Year < 15)
{
Year += 2000;
}
else
{
Year += 1900;
}
}

Read More

String and StringBuilder

A couple of weeks ago, we discussed Value types and Reference types where we said that a reference type points to the value it represents and a value type is the value it represents. This has implications when we work with the assignment operator because when you assign a reference type and change the content of what it is pointing to, both variables get changed because they are both pointing to the same location in memory.  If you do this with a value type, only the one you change sees the change because you are working with a copy.

Read More

Value Type vs Reference Type

It is amazing to me how few programmers understand the fundamentals of how variables work.  Not just in .NET or C# specifically, but in every language they work in.  It amazes me for two reasons.  First, I don’t think I could program if I didn’t understand what was physically happening as a result of the code I was writing.  Not knowing how the variables relate to the memory that they use would be, to me, a major limitation.  But it also amazes me because I don’t think anyone can program intelligently until they do know what is happening. So, I’ll start from the outside and move in to what’s happening in memory.

Read More

Raking Leaves and Writing Code

So, today I had the task of removing the leaves from my yard, which gave me a lot of time to think because it is a pretty solitary job, even if you have people helping you, because much of the time I was using a leaf blower.  It is pretty hard to hold any kind of conversation when you are using a leaf blower.

And  as I was running the leaf blower, I was thinking about what I was going to talk about today.  And then it struck me, why not just talk about cleaning up the leaves?  I mean if John Sonmez and Scott Hanselman can talk about stuff that isn’t necessarily programming related, why can’t I?

But then I realized, I could talk about cleaning up the leaves in my yard AND talk about programming at the same time.

Think about it.

Read More

C# Properties Get and Set

My son is learning to program.  Last week he asked me to explain C# properties get and set and, as it turns out, it looks like many others are asking for the same.  So, I’ve decided to spend the time on this post, explaining getters and setters in about as much detail as one can expect. So here it goes…

Read More