Archive for the ‘Programming’ Category

09.23
08

Getting the number of lines in a text file

by Terry Pearson ·

This may be something trivial, but it saves me some time…

Today I wrote a quick VB Script that will count the lines of a text file. This could be useful if you need to quickly verify that some program is outputting the right number of lines to a target file. You can also place it in your windows path location. Then just type “lines filex” from the command prompt to instantly tell how many lines exist in a file (where filex is the name of your file).

Windows Scripting File Icon

files.vbs

I have tested the script on XP Pro SP2 and Vista Home Premium Service Pack 1

Anyway, I find it useful while working on test cases at work. Sometimes, its the little things that save you lots of time.

To use the script, simply drag and drop any text file to it. It will pop up with the number of lines.

02.29
08

MySQL Server Has Gone Away problem solved

by Terry Pearson ·

I was just looking at RobsNotebook.com and came across a really good solution to a common problem with Wordpress.

Lately, I have been getting a lot of error messages on my blog that said “MySQL server has gone away.” I looked through the Godaddy support forums hoping to find a solution. Unfortunately, I did not.

But then I found RobsNotebook.com and they had a page dedicated to this problem. It turns out that it is caused by the SQL connection being open for too long. Essentially, Wordpress does not close the connection every time.

Godaddy’s (or insert your own host here) configuration of MySQL tells it to time out after a certain period, and that can happen in the middle of your call to the database.

RobsNotebook.com has provided a php file that you use in wordpress and just replace your existing file. He made it so easy that it takes only about 5 minutes to put in the solution.

P.S. I verified that the php page was correctly coded and had no “funny business” on it, but as the file could change at any time, it is always good to look through it for yourself whenever you download and use PHP from the net.

01.19
08

My List of Accomplishments… And you should be proud of me!

by Terry Pearson ·

I think that sometimes I know exactly how Wally feels in this Dilbert Cartoon! If you ever had one thing lead to another with an upgrade, you will know exactly what I mean.

I guess you could say this is kind of like “Feature Creep,” only one might call this “Upgrade Creep.” What started as a simple software install, soon progresses to a mother board altering 13 ring circus.
Why does upgrading a computer take so long?

01.11
08

Hiring the best programmers

by Terry Pearson ·

In case you are in the market for hiring programmers, or you are a programmer looking to improve your resume (a.k.a. cv), you will benefit greatly from reading Inter-sections.net’s article on finding good programmers.

I have included their bullet points below, but for more details, check out the whole article. It was written well, and contains a lot of good advice.

Positive indicators:

  • Passionate about technology
  • Programs as a hobby
  • Will talk your ear off on a technical subject if encouraged
  • Significant (and often numerous) personal side-projects over the years
  • Learns new technologies on his/her own
  • Opinionated about which technologies are better for various usages
  • Very uncomfortable about the idea of working with a technology he doesn’t believe to be “right”
  • Clearly smart, can have great conversations on a variety of topics
  • Started programming long before university/work
  • Has some hidden “icebergs”, large personal projects under the CV radar
  • Knowledge of a large variety of unrelated technologies (may not be on CV)

Negative indicators:

  • Programming is a day job
  • Don’t really want to “talk shop”, even when encouraged to
  • Learns new technologies in company-sponsored courses
  • Happy to work with whatever technology you’ve picked, “all technologies are good”
  • Doesn’t seem too smart
  • Started programming at university
  • All programming experience is on the CV
  • Focused mainly on one or two technology stacks (e.g. everything to do with developing a java application), with no experience outside of it