NMP Blog

NMP Consulting is a technology firm, headquartered in the Columbus area, but providing services worldwide.

JQuery UI Widget Size

May 25th, 2010 by Chris Sunami

I’ve become a convert to a new programmers’ tool called JQuery –a library of user-friendly javascript functions that allow for some very advanced effects that overlay seamlessly over a standard HTML page.  However, I did encounter an issue when using the UI widgets –a set of effects such as a calendar (date picker) a pop up dialog box, checkbox buttons and so forth.  The widgets looked great on the demo site, but when I integrated them into my site, they were huge, oversized bulging monsters.

When I found the fix for shrinking them back to the right size it turned out to be pretty easy, but oddly enough I haven’t seen it mentioned elsewhere, so here it is:

Open the stylesheet for the jQuery theme you are using.  Find

.ui-widget

and add “font-size:10pt” to its parameters.  This adds a baseline size to all jquery widgets, and everything else in the style sheet is calculated in relationship to that size.

Just for reference, here’s what it looks like in theme I’m currently using, “Start”.

/* Component containers
———————————-*/
.ui-widget { font-family: Verdana,Arial,sans-serif; font-size: 10pt; }

Get Your Facebook Privacy Back

May 18th, 2010 by Dan Hill

With all of the news about the the privacy changes at Facebook, the Untangle team has create SaveFace to help you get your privacy set back to more restrictive settings, so that all your information is not available to everyone.  It will set your privacy settings so that only your friends can access your information.  It is easy to run and keeping your settings private is generally a good idea.

PDF Files have Critical Security Vulnerability

April 6th, 2010 by Rick Shantery

It was released today on several sites that PDF files, and their corresponding readers have a critical vulnerability that would allow an attacker to compromise a computer, even with many of the normal protections in place that block things such as Javascript.

Foxit Reader (NMP Recommended) and Adobe Reader both have fixes for this vulnerability. Go to http://www.foxitsoftware.com/pdf/reader/ and download and install the latest version.

For Adobe Reader users, make the following preference change:

From the Edit menu go to: Preferences -> Categories -> Trust Manager -> PDF File Attachments and then uncheck ‘Allow opening of non-PDF file attachments with external applications.’

This is a problem that could possibly affect all platforms and Operating Systems, whether Windows, OS X, or Linux.

Bitdefender Update Causes a Boot Failure for some Windows Users

March 23rd, 2010 by Dan Hill

A problem with the Bitfender virus scanner mislabeled Windows system files as viruses and quarantined them.  Therefore, without these files being available during the boot process, the computers fail to boot.  This only seems to affect 64bit versions of Windows and they have made a patch available, which should be installed as soon as possible to avoid this issue.  Information on how to get around the boot problem can be found on their website also.

Corporate Password Policy

February 20th, 2010 by rogue

When setting up a office/corporate network environment, users may complain that it is frustrating to have to change their password every so often, or have to come up with difficult passwords. Despise the user’s arguments, although valid, remember the security risk that it poses. If you have simple passwords, maybe something common that all users share, it’s easy for unauthorized access into the system. If someone guesses or gets hold of one user’s password, it may be possible to guess the rest. Protect your data and files – enforce a password policy on your network, with an expiration on passwords. Use requirements such as at least one capital letter, and a number or special character to increase security. Your data is YOUR data – so make sure it’s safe from prying eyes!

Best Programming Practices #2 – Parameters

January 28th, 2010 by Chris Sunami

This may seem like a no brainer, but it is often done wrong.

Set your parameters once and once only.  In other words, if you have ANY value that will be used more than once in your program, set a variable to that value and use the variable in the body of the program.

In other words:

variable1 = 40

width=variable1

rows=variable1

NOT

width=40

rows=40

Sure it’s one extra step now.  But if you ever change that value (and you probably will!), you’ll be able to change it in one place rather than hunting and searching for the fifty different places where you hard coded the value into your program.  It also means that you only have to worry about typos the first time through the program, not after each value change.

And of course, it goes without saying that you should keep all your parameters in one, easy-to-find place.  Your future self will thank you.

Go Green With Computer Recycling!

January 13th, 2010 by Jen Eckelberry

Don’t throw your old electronics in the trash. Many electronics contain substances that can be harmful to the environment, and they should be recycled and disposed of properly. In the Columbus area, your company can use a service with free pickup and recycling services such as Possitivity (http://www.possitivitygreen.com/), or use the internet to find another environmentally responsible way to recycle your personal electronic waste.

Best Programming Practices #1 – multiple files

December 29th, 2009 by Chris Sunami

When I first started out as a programmer, I didn’t have much of a concept of best programming practices. If anything, I saw them as barriers in the way of doing what I really wanted to do. And although there are plenty of people on the web willing to yell at you when you don’t follow good programming practices, there aren’t so many good explanations for beginners on what makes those practices good. So this is the start of a series of quick tips on good programming practices and what makes them good.

Tip #1: Divide your program up into multiple files.

This used to drive me crazy when I first started as a programmer. I would go in to work on a program and find five hundred separate little files, which would force me to hunt laboriously through them in order to find what I wanted. I disliked this practice so much, I would often rewrite other people’s programs to put all the little files into one big one. But guess what? There were good reasons behind it all:

  • Debugging:  If something goes wrong with your program –and it will– it’s much easier to disable one included file at a time then to search through a single massive program.
  • Reusability: Some portions of your code will be used over and over again, either within the same program or in a wholly separate project.  Save that code as a separate file, and you can use it anywhere, no cutting and pasting involved.
  • Structure:  A properly named and organized system of subdirectories can make the organization of your program clear at a glance.

Of course, the key to making this tip work for you is organization.  It isn’t helpful at all to look through five hundred mysteriously named and ordered subroutines.  But if each separate file has a name that clearly identifies what it does, and is placed in a folder with other similar files, it eliminates a lot of the fruitless searching.

PHP MySQL Dump or Export

November 3rd, 2009 by Chris Sunami

I searched all over for this information, and never found it in a easy-to-use format:

Here’s the situation.  You have php access to a MySQL –or other SQL variant– server.  You don’t have phpMyAdmin, you don’t have command line access.  You would like to export some of the data, but not necessarily all of it, because perhaps the full database is too large.

The SQL command that makes this simple is: “SHOW CREATE TABLE table_name

Use that as your query, and the output will be the complete SQL command for creating a table.  The only other thing you need is to turn the data output into insert statements, which is trivial.

Here’s a complete script –notice how short it is:

mysql_connect($sql_host, $sql_user, $sql_password) or exit(mysql_error());
mysql_select_db($sql_db) or exit(mysql_error());
$result=mysql_query("SHOW TABLES");
echo mysql_error();
while ($row=mysql_fetch_array($result)){
$tableName=$row[0];
$query2="SHOW CREATE TABLE $tableName";
$result2 = mysql_query($query2);
$row2=mysql_fetch_array($result2);
echo "$row2[1];\n";
$query3      = "SELECT * FROM $tableName";
$result3 = mysql_query($query3);
while ($row3=mysql_fetch_array($result3)){
$header_array=array();
$line_array=array();
foreach ($row3 as $key=>$value){
if (!is_numeric($key)){
$header_array[]="$key";
$line_array[]="'$value'";
}
}
echo "INSERT INTO $tableName (".implode(", ", $header_array).") VALUES (".implode(", ",$line_array).");\n";
}
}
}
mysql_close();

The Clampi Virus and other Malware

September 22nd, 2009 by Rick Shantery

There is a rash of news recently about an old virus, the Clampi virus. It is designed to run and do little until the user logs into an online banking site. It then captures the username and password of the person logging in and sends it off to the malware writers who use the information to withdraw money from the victim’s account.

This is really nothing new.

Viruses and other malware of this type have been around for a long time. Either through programs that do similar things, including capturing keystrokes, to “Phishing” attacks, which are specially crafted e-mails that trick users into visiting websites that look legitimate, but actually are fraudulent copies of the genuine site.

The removal instructions for this virus are the same as for most others, turn off system restore, boot in safe mode, run scans, and clean out the registry of the data the virus inserts. Since most new malware uses dynamic naming, that is the name of the program file for the virus is random, you can’t immediately identify which file it is.

Due to multiple vulnerabilities within Windows itself, it is often too late once the victim has visited the website to protect the computer. It is better if it is blocked before it enters your business network.

NMP has a security product, the NMP Expanse, that will intercept and block viruses, spyware, trojan programs, phishing attacks, spam, and other bad data from ever reaching the inside of your network. Best of all, it can be installed without having to reconfigure your network. It can sit quietly and filter all of the traffic going both in and out of your network.

While you still need software on your desktop to protect your system, it is most effective to block the attacks before they ever reach your computer.



nmp consulting • 4002 north hampton drive • powell ohio 43065
info@nmpconsulting.com • phone 614.358.5814 • fax 614.437.1249
Columbus / Central Ohio area

Blog powered by WordPress