Archive for April, 2009

Virus Protection

Thursday, April 30th, 2009

There’s been a lot in the news lately about viruses –both the kind that attack computers and the kind that attack people.  Are the two types of viruses really anything alike?

One similarity is that sensible precautions can reduce your risk.  For human beings that includes handwashing and taking vitamins.  For computers, one of the most important things is to stay up-to-date with security patches.  For instance, with the recent Conficker computer virus scare, most machines were safe as long as they had current operating systems, and had installed all the latest security patches.

Another similarity is that the wrong medicine is worse than none at all.  When you get sick, you want the best medical care possible.  But when it comes to protecting their computers, far too many people rely on software that is ineffective, out of date, or, in the worst case scenario, just a front for malicious spyware that is often worse than the viruses themselves.  So don’t install just anything –make sure you have something that really works.

One last similarity:  Most people can’t afford to get sick, and most businesses can’t afford to have sick computers.  So, if you think you have a virus –the computer kind, not the human kind! –or if you just want to make sure you don’t get one, feel free to get in touch with us, your experts at NMP Consulting.

Is it time to update your website?

Tuesday, April 21st, 2009

Have you evaluated your website lately to make sure you’re staying current? If not, it might be time to bring your site up to date. Here are some ideas for where to start:

1) Have a friend or colleague take a look at your website and tell you what they think works well and what they think could be improved. For example, is it easy to use? Is your contact information and/or address accurate and easy to find? Do you have any new goods or services that are missing? Is there outdated information on the site? Does the look and feel reflect what your company is about?

2) Spend some time reviewing competitors’ websites. What do you like/dislike about their sites? Are there any ideas that you can apply to your site? Is your site ‘keeping up’ with your competitors?

3) Use a major search engine to try and find your website. If it is difficult to find, you might want to consider adding some website optimization techniques and keywords to your site to up your ranking on search engine returns.

SQL Subqueries

Wednesday, April 15th, 2009

Chris Sunami  is the lead Web and Internet Applications Designer for NMP.

Databases are so much more than online spreadsheets.  They are at the root of nearly every piece of dynamic content found on the web.  Blogs, message boards and wikis can all be run from databases.  Even some of the static pages on our own NMP website float invisibly and seamlessly over the foundation of a SQL-based* database.

Today’s tip is about SQL subqueries.  With enough server-side programming, it’s possible to create powerful applications that never use a subquery at all.  But it’s far faster, more secure and more elegant to take advantage of this useful tool built into SQL at a foundational level.

In sum, anywhere you would ordinarily place a tablename in a SQL query, you can replace that table with a second SQL query, thus creating a new virtual table that has only the specific info you asked for.

Here’s how it works:

Let’s start with an ordinary query involving two tables:

Q1:SELECT table1.field1, table1.field2, table2.field3 FROM table1, table2 WHERE table1.field4=table2.field4"

Now let’s look at another generic query:

Q2:SELECT table3.field2, table4.field3 FROM table3, table4 WHERE table3.field5=table4.field5

With subqueries, we can substitute a query like Q2 in place of one of the tables in Q1 –like so:

Q3:SELECT table1.field1, table1.field2, alias.field3 FROM table1, (SELECT table3.field2, table4.field3 FROM table3, table4 WHERE table3.field5=table4.field5) AS alias WHERE table1.field4=alias.field4

What we did was enclose the subquery in parentheses, and then give it a name (”alias”) by using the “AS” key word.  Then, anywhere we needed to refer to that subquery, we did so by using  the name we gave it.  Simple, but also very powerful.

* The SQL family of databases includes MS SQL, MySQL, PostGreSQL and many others, all based on the SQL database language.