Thursday, June 30, 2011

The video game industry

It's amazing how large the video game industry is growing. I remember our Atari back in the 80s, and then in the 90s I had a Sega Genesis. But for some reason, a lot of people view the video game industry as this small piece of the entertainment sector that will never really amount to much. But these people don't realize just how large the video game industry is.

For an example, let's take the company Lucas Film. They are responsible for the 6 Star Wars films. Ever heard of them? By ANY measure you can come up with, the 6 Star Wars movies are some of the most successful movies of all time. Several of the 6 movies are in the all time top 10 highest grossing films, and all 6 are probably in the top 25 highest grossing films of all times. Well I read a statistic several years ago that said Lucas Film made about 2 billion dollars on the 6 Star Wars films.

Now, to put the video game industry into perspective - Lucas Arts, which is George Lucas' video game company, has made well over 10 billion dollars selling video games! So if you take 6 of the highest grossing films of all times, one video game company has exceeded that amount at least 5 times over.

Hopefully this helps you to realize just how large the video game industry is.

Wednesday, June 29, 2011

A complaint about SQL

So I would like to complain about SQL (Structured Query Language) - which is a common way of accessing a database on computers. My complaint stems from efficiency. One thing that has always bugged me is inefficient things, both in computers and in the real-world. I guess it's my fastidious side.

Anyway, you access data in an SQL database via a query string. For example, "select name, phone from Students where major = "business" and enrolled = '1'" The whole idea behind SQL was that non-computer-programmers could look at the code and have some idea about what's going on. But this is a very inefficient way of accessing the data. The data in the database as well as the database engine itself are in binary, and your program is in binary, so why do we have to convert everything into strings to access the data? We should be able to query the data in a binary way and eliminate the conversion.

The best way I can think to demonstrate this is with an example. Suppose I went down to my local restaurant and ordered lunch, but I had to speak to the cashier in Chinese, and the cashier had to speak to me in Chinese. Both of us are native English speakers, and the entire kitchen staff are native English speakers. But we're forced to translate into Chinese for communication. I know, this makes no sense. Well neither does SQL. That's my rant for the day.

The rechargeable battery myth

It's common knowledge that older rechargeable batteries have a limited lifetime. They can only be charged so many times before they won't "hold a charge" any more. This is often referred to as the battery "memory effect." This was a well known problem with Nickle-Cadmium (NiCad) and Nickle-Metal Hydride (NiMH). But for some reason, a lot of people believe this is not a problem with Lithium-ion batteries. This is the "myth" that I'm referring to, that Lithium-ion batteries do not suffer from this problem.

Unfortunately, Lithium-ion batteries do suffer from this problem. The good news is they are less susceptible than NiCad or NiMH, but the problem does still exist. If you don't believe me, find a 5 year-old laptop with Lithium-ion batteries and see how good a charge they hold - chances are they only hold a fraction of their initial charge. I won't get into the technical reasons behind why rechargeable batteries suffer this problem. But I wanted to debunk this myth about Lithium-ion batteries.

There's nothing you can do to prevent this from occurring to a battery, but there are several things you can do to slow it down. I've read a lot of crazy things on the Internet such as freezing and thawing your batteries to "restore" them to working order. These various "techniques" sound far-fetched to me. But one technique that does work is to be mindful of your battery, and how and when you charge it. The best thing you can do is run the battery almost until it's dead, then fully charge the battery back up. The worst thing you could do is run the battery for a few minutes and then charge it again.

One of the most common battery-powered devices are laptop computers. So the best way to maximum the life of your laptop battery is to run the battery until it is very low; then and only then do you charge the battery. And don't stop the charge cycle until the battery is fully charged. If you want/need to run the laptop off AC power before the battery is discharged, then remove the battery while running off AC power. By doing this you will extend the life of your battery.

Bad news for LCD TV owners

I'm afraid I have some bad news for owners of LCD TVs (and computer monitors). Especially if your panel is slightly older. The expected lifespan of your TV/monitor is probably far less than you would like it to be.

To some people a TV is a consumable, something to be replaced every couple of years. Think of all the extra money spent in America replacing several year old TVs, not to mention the eventual landfill space. Of course, manufactures love these people as it increases their profit. Think of your parents or your grandparents, how long did their TV last? 15 years, 20 years, or longer? But there is no way most newer TVs will last that long. In fact, I would expect the average lifespan to be about 5 years.

What's the problem you ask? It has to do with what's called the backlight system. Most LCD TVs use cold cathode fluorescent lamps (CCFLs) as the backlight. In a nutshell, a CCFL is a small fluorescent light, just like the ones you see in garages and warehouses. But CCFLs, like any light bulb, burn out in time. Once a CCFL burns out, the image on the TV screen goes black. You can replace the CCFLs with new ones, effectively "changing a light bulb" to fix the problem. But very few TVs are designed for this work to happen. When manufactures build TVs they do not design a way for these backlights to be changed. So what you're left with is a TV with a burned out light bulb that is useless.

This is just bad design in my opinion. Would you buy a car that the engine could not be serviced? Would you buy a bag vacuum cleaner without replaceable bags? No, of course not.

The good news is TVs are starting to come with LED backlights. LEDs are solid-state electronics that have a much longer lifespan. Also, LED TVs are thinner, lighter, produce less heat, and consumer less electricity than CCFL TVs. So if you're in the market for a new TV, I would strongly encourage you to get an LED TV. They cost more, but in the long run it will save you money.

Useful utility - HardwareMonitor

It has been a while since I posted a new "useful utility" but I recently found another great program called HardwareMonitor. It's from the same great people who brought you CPU-Z. What's great about this program is the system information it shows you. Most computers have sensors in them; sensors to detect temperature, voltages, fan speeds, etc. Whereas these sensors can track useful information, the problem is there is no easy way to see the output from these sensors. That's where HardwareMonitor comes into play.

HardwareMonitor finds all the sensors in your system and then displays their output in real-time. I was shocked to see how many sensors are in my computer. For example, my CPU has a thermal sensor per core. My video card has both a thermal sensor and a voltage sensor. My motherboard has tons of voltage sensors, fan speed sensors, and additional thermal sensors. Heck, even my hard drive has two thermal sensors on it.

This information is very useful if you're trying to track down a hardware problem. Beyond that it's just cool information to see. Enjoy!

Free from Microsoft

Everybody loves getting something for nothing. But I bet you never realized how much great software Microsoft gives away for free. And when I say free, I don't mean a free 60-day trial. Here are some of the highlights.

AntiVirus:

Microsoft Security Essentials is not only a free antivirus program, but it is the best antivirus program period. I like it more than any other antivirus program, free or otherwise.

Compilers:

Microsoft Visual Studio Express Edition is a completely free version of their flagship compiler. You can't compile every type of Windows program with this version, some of the more esoteric areas of Windows (like Office development) aren't included. But for general use it's pretty full featured.

The Windows Driver Kit is definitely not the most downloaded file from Microsoft. It is intended for developers writing device drivers for Windows. But it does include a C/C++ compiler which can compile more than just kernel code. Visual Studio Express is going to be a better all-around choice, but between the two of these I'm sure you could compile most any program.

Operating Systems:

That's right, Microsoft gives away free versions of Windows. The first I've talked about before, Windows PE. The download is called WAIK, inside of which is WinPE and all the tools and instructions necessary to create a WinPE CD. Whereas WinPE won't make a great general-use operating system, it can run a lot of Windows programs and is a great platform for diagnostics and maintenance. Let's say you run Ubuntu on your system and there is a new BIOS you need to update your system with, but the update program only runs under Windows - how do you install the update? Simple, you boot your system temporarily to WinPE and install the update.

Hyper-V Server 2008 R2 is another completely free version of Windows. This is the "core" version of Windows meaning it doesn't have a graphical Explorer like other Windows. But it is a full-blown copy of Windows.

Whereas Virtual PC 2007 isn't technically an operating system, it is a PC emulator for Windows. This means you can run any operating system virtually on Windows; DOS, Windows, Linux, OS/2, Mac, etc.

Office:

Microsoft Mathematics is a fairly powerful mathematics package. Think of it as a graphing calculator on your computer. Great for students, engineers, scientists, etc.

The Excel, Word, and PowerPoint viewers allow you to view and print Office documents without having to buy and install Microsoft Office. But unfortunately you cannot create or edit documents. But if all you need is to view documents, then these are perfect.

There you have it, 10 free programs from Microsoft which are all very useful.

Tuesday, June 28, 2011

Registry fragmentation

Most people know that fragmentation slows down a computer so you occasionally need to run a defragmenter. But did you know that the Windows registry can become fragmented in two different ways, and there are very few programs to defragment either type?

First, in case you are not familiar with the term fragmentation, basically the data is stored in different locations or fragments. It would be as if your pants were in your closet, your shirts were in the closet in another bedroom, your shoes were at the house across the street, etc. Because your clothes are in different locations it will take you longer to get dressed. In the same way, when computer data is fragmented it slows your computer down.

As I said, the Windows registry can be fragmented in two different ways. The first is the registry files can be fragmented just like any other file stored on the hard drive. Unlike other files on disk, registry files cannot be defragmented via normal means because the files are "locked" while Windows is running. The most common way to defragment the registry hives is to use SysInternal's (a.k.a. Microsoft) program PageDefrag.

The other type of fragmentation requires an understanding of the internal structure of the Windows registry hives. As I blogged about recently the Windows registry is a type of database. Data is constantly being written to, read from, and deleted from the registry. The way the registry is designed, when data is deleted the registry hive does not become smaller. Instead Windows tries to reuse that space in the future, but this ultimately will lead to fragmentation. A key point here to realize is the Windows registry never decreases in size, it only increases in size. Even if you delete most of the data in the registry, the file does not get smaller - and running PageDefrag will do nothing to help with this problem. But there is a way to reclaim this wasted space and defragment the registry at the same time. I recently wrote a program to do just that called HiveDefrag.

If you are like me you are probably wondering if either of these programs make any difference. So I ran some tests to find out. I took a computer that has been used for a long time (the longer a computer has been used the more likely the registry is fragmented and the slower the machine will be). I timed how long from power on until Windows was loaded and idle (i.e. all the startup programs had finished loading). I ran these tests multiple times and averaged the times to get the most accurate results.



I was surprised that PageDefrag had absolutely no effect on the machine's performance whereas HiveDefrag had a noticeable improvement. Yes, 4 seconds may not sound like much, but that was a 13% improvement.

I cannot guarantee every computer will benefit this much, but clearly this shows HiveDefrag can improve your system performance more than PageDefrag can. I would recommend every Windows user run HiveDefrag once a month to keep their system running at peak performance.

Compression Software

Everyone's heard of Zip (or more accurately PKZip). It's become the ubiquitous compression standard. But it's far from the only one, and as it turns out not necessarily the best one either. Recently I was curious how PKZip compares to some of the other newer compression algorithms out there. So I tested it against RAR and 7Zip.

Before I get into the results I wanted to talk about how I tested. I created 5 data sets, and then used each of the three programs to compress the data. I looked at the resulting file size to determine which compressed more. I also timed the compression since speed is another important factor.

Binary Files

For my first test I took 289MB of binary files, i.e. EXEs and DLLs. These files typically compress well.

PKZip: 124MB and 39 seconds.

RAR: 105MB and 55 seconds.

7Zip: 85MB and 92 seconds.

Text Files

For this test I used 26MB of text files. Again, these typically compress very well.

PKZip: 6MB and 2 seconds.

RAR: 5MB and 4 seconds.

7Zip: 3MB and 10 seconds.

MP3 Files

I took a large folder of MP3 files. MP3 files are already compressed and typically do not compress well.

PKZip: 284MB and 33 seconds.

RAR: 283MB and 91 seconds.

7Zip: 283MB and 84 seconds.

JPG Files

As with MP3 files, I took a directory of JPG files. Also as with MP3 files, JPGs are compressed and typically don't compress well.

PKZip: 10MB and 1 second.

RAR: 10MB and 2 seconds.

7Zip: 10MB and 2 seconds.

Miscellaneous Files

For the last test I took a large directory tree of miscellaneous files (54MB in size). This should provide a good overall sample.

PKZip: 14MB and 5 seconds.

RAR: 14MB and 6 seconds.

7Zip: 8MB and 12 seconds.

Conclusions

In every test PKZip was the fastest. Also, in every test except the JPG test 7Zip had the highest compression. And in almost every test RAR was right in the middle for both speed and compression amounts. So which is the best compression tool to use? That's hard to say. PKZip is nice and quick, and it's become extremely common. 7Zip has very impressive compression levels, and it's totally free. RAR is hard to pin down. On the one hand you could say it did not shine and any one category. But on the other hand you could say it was a middle ground, the best of the two of them.

For me personally, I'm probably going to trade off between PKZip and 7Zip. I may start to use 7Zip more now that I've seen how impressive it's compression levels really are. But it will be hard to stop using PKZip altogether since it's so prevalent.

Extending battery life

So you own a laptop/netbook but you're a little disappointed with the battery life. I mean, who wouldn't want their laptop to run longer on a charge? Well there are some simple things you can do to allow your computer to run longer on a single charge. Some of these are obvious, others not so much.

Remove the CD/DVD from the drive. A lot of laptop owners keep a disc in their drive at all times. Unless you're actually accessing the disc take it out. Spinning the disc takes a lot of energy. Yes, most disc drives stop the disc when it's not being accessed, but every once in a while Windows will spin the disc again. This is wasted energy.

Turn down the screen brightness. This one is pretty obvious. The dimmer the screen the less energy it's using. Of course, brighter screens are easier to read. So it's all about finding a balance - the dimmest screen level you're still able to comfortably read.

Turn down the volume, or better yet mute the sound altogether. Playing sounds requires energy, and most of the sounds in Windows aren't necessary. Do you really need a click every time you select a folder? Another option is to disable the sound scheme in Control Panel. This will shut off all the "Windows" sounds but will keep sound enabled for other apps like the web.

Change your desktop background color. Did you know the color of your desktop affects how much energy your computer is using? Darker colors require more energy than lighter colors. So black requires the most power and white requires the least. Consider setting your desktop to a lighter color, light gray, light blue, etc.

Disable unnecessary processes. Every running process takes CPU time which translates into energy from the battery. So the more processes and services you can disable the better. Of course, don't disable anything you need. Perfect programs to remove which aren't required (and in fact can degrade your system performance) are so called "speed launchers." Adobe uses them, Apple uses them, Office uses them, etc.

Check your power options. The sooner your computer enters standby the more power it saves. The sooner it shuts down the monitor the more power it saves.

Disable your screen saver. I know what you're thinking, the screen saver saves me energy, why would I want to disable it? Well as it turns out screen savers use more energy than they save. Most screen savers display some sort of animation which requires CPU power, which again requires battery power. Even if the screen saver displays a blank screen, this is wasted power (see above item on desktop color - black uses more energy than white). Instead of a screen saver set your power options to turn off the monitor.

Disable Windows animations. Animations are things like when a Window slowly moves to the taskbar, or a combo box or menu slides open, something fades into or out of view, etc. These animations require CPU power, so disabling them will extend your battery life. If you're running Vista of Win7, disable the aero desktop. If you disable theses animations you might even like Windows more. You might be surprised how much more productive you can be on a computer when you're not constantly waiting for little animations to dismiss the dialog you closed.

Reduce hard drive access. Spinning a hard drive and accessing the data requires a lot of energy. So do what you can to minimize disk access. Every once in a while plug your computer in to the wall and run a defrag. Eliminating unnecessary startup programs will go a long way to reducing disk access as well.

Beware of graphically intensive applications. Playing games or watching movies both use a lot of energy. Most computer owners take video for granted. They assume since TVs have been around for generations why couldn't a computer display video. As it turns out video is one of the most intensive tasks for a computer. Even watching small videos on youtube requires a lot of energy. I'm not saying don't do it, but be aware tasks like this will drain energy from your battery.

Databases

One thing I've learned over the years is many people have a fear of databases. Even computer experts and developers seem to have a fear of databases. It's even to the point that if you are someone with database experience you can command extra pay because you have "skills" others lack. But there's nothing scary about databases - in fact you use them all the time without realizing it.

When you think of a database you probably think of things like SQL and Oracle. These are databases in the truest form, but there are so many other forms of databases out there. First, what is a database? The dictionary definition of a database is "a structured set of data held in a computer, especially one that is accessible in various ways." I don't know how helpful that is. Let's look at a database in terms of properties.

  1. Structured data that is related in some way

  2. Stored in digital format on a computer

  3. Easily to search and retrieve data


I would argue that anything that meets the above criteria is a database. In #1, "related" means the data relates to itself (yes, I know I defined a word using another form of it). For example, a list of fruits, meats, and nuts is related in that they are all food. However, a list of street addresses and dinosaur names is most likely not related. Anyway, let's look at some "unexpected" databases.

The NTFS file system (indeed probably most file systems) is a database. The data is the actual files, folders containing the files, and info about the files such as dates and times. This data is structured and is related. It is stored in digital format on a computer. And it's easily accessible. By the criteria above a file system is a database. Another database is the Windows registry. Again, related data stored in a structured format on a computer for easy access.

Most people don't think of the file system or the registry as a database, but they are. In fact, if you look at the code for either of these areas the code looks surprisingly like the code from a "true" database. Given these are databases, as a user are you "afraid" to look at your files or browse the registry? Probably not. So maybe programs like SQL and Oracle will seem a little less daunting in the future.

Trojans

Over the past 2 months I've probably repaired or reinstalled a dozen computers belonging to family or friends. Most of these were infected with viruses and/or trojans. I noticed something interesting about how several of the trojans worked. I wanted to share this info so others would be informed and know what to watch out for.

These trojans were redirecting Internet requests without the users knowledge or consent. And I'm sure the reasons for the redirection were malevolent. They used 2 different ways to achieve this redirection.

Hosts file

The "hosts" file is an old seldom used file in Windows that allows users to redirect traffic. The file is located in %WinDir%\system32\drivers\etc. A "clean" hosts file should have one entry as follows: "127.0.0.1 localhost" This means the name "localhost" will resolve to 127.0.0.1. If there are other entries in this file chances are a virus or trojan put them there. You should remove them.

Proxy

The other method I found was by forcing the system to use a proxy. By using a proxy the virus/trojan can redirect traffic as it sees fit. To check your proxy settings go to Control Panel | Internet Settings | Connections, then click on LAN Settings. If the box for Proxy is checked, then a proxy is enabled. You should disable the proxy.

Both of these are clever methods in that they work regardless of the type of browser you're using. Internet Explorer, Firefox, Chrome, etc. would all be redirected without the user even realizing it. And since the hosts file or proxy settings are perfectly valid in certain circumstances, no virus checker would scan for these. So it's up to you to check your own system.

General electronics repair tips

Today I wanted to give some general repair tips for electronics. I've previously mentioned the two most common reasons for failure are lead-free solder and bad capacitors.

Lead-Free Solder:

Unfortunately diagnosing lead-free solder is not easy. Probably the correct way is to investigate each and every solder joint on the circuit board. You could use a multimeter to check it electronically and/or a visual inspection using magnification. But this can be time consuming considering the number of solder joints on a board. Obviously the first step is to verify the board has lead-free solder. This can be done is several ways:

  1. Visual appearance - lead-free solder has a flat or non-glossy appearance whereas leaded solder is shinny.

  2. Age of the item - the older it is the less likely it is to have lead-free solder. Before the mid 2000s and it's probably more likely to be leaded, after the mid 2000s and it's more likely to be lead-free solder.

  3. Symbols - look for lead-free symbols (like "RoHS") on either the board itself or the case. If you find this symbol it for sure has lead-free solder, but the absence of this symbol does not necessarily mean leaded solder.


IF the board uses lead-free solder and IF you can't find anything else wrong with it, then lead-free solder is likely the problem. But how do you fix it? I know the theory, although I don't speak from personal experience. Ultimately you need to remelt the solder to repair the cracks. So you need to subject all or part of the board to heat - up to 260 C (500 F). The official way to do this is using a hot air rework station. But this is a specialized tool that few people own. If you own a heat gun you can use that. You can even put the board in the oven, or if the board is one-sided you can put it onto a griddle. You need to heat the affected part of the board up to 260 C then back down. Too much heat will damage the board. Also, be aware some of the components on the board (like plastics) may burn, so you might need to cover them with foil to shield them from the heat.

Bad Capacitors:

A bad capacitor can be easier to identify and relatively easy to repair. Often times you can visually detect when a capacitor has failed. It may bulge on the top, even start to leak from the inside (see pictures below). Unfortunately not all bad caps bulge, so you may need a special cap tester. But if you see a bulging cap you know it's bad. Replacing a bad cap is fairly easy, all you need is a soldering iron and the replacement part. To get the replacement part you need to know two things, the rating and the voltage. These will be written on the side of the bad capacitor. For example 830uF 25V. This is 830 uF (or microfarads) at 25 volts. When you order replacement parts get the exact same farad number, as for the volts you can get the same or a little higher. You can try your local electronics shop (e.g. RadioShack), but I'll tell you right now the chances they will have exactly what you need are slim. Instead order online, digikey.com and mouser.com are both great sites specializing in these parts. And these replacement parts are cheap to. Cost depends on the rating of the capacitor, but each component will probably cost you less than a dollar. So you could replace all the capacitors in a piece of electronics for only a few dollars.

Both of these repair techniques work with solder and soldering tools like irons. I suggest you watch some of the videos on youtube by "CuriousInventor" - he has great tutorials.



Taking apart electronics

Yesterday I mentioned common reasons for failure in electronics. Before I give general tips on how to diagnose and try and repair them, I wanted to give some tips on working with electronics.

First, you'll need to be able to take apart the electronics, which can be more of a challenge than you think. Many newer electronics are not designed to be taken apart easily. If you're lucky, your item has screws holding it together. If not, you have plastic tabs holding it together. The tabs are a pain to get apart, you need to slowly pry them apart using a small screwdriver. And in doing so you're pretty much guaranteed to scar the plastic in at least one place.

Once you have the item opened up, you need to be comfortable with electricity. Most people have gotten a shock from a switch or light in their life. It's not fun, but it's not dangerous - mainly because it's alternating current. However most electronics use direct current which is more dangerous. Also, some electronics have high voltage and/or high current inside of them which is dangerous as well. Obviously, if you're not comfortable then don't proceed. Trying to fix a $500 TV is not worth serious injury.

When working on electronics, sometimes you need to work on them while they are plugged in and turned on. Obviously this means live electricity. But DO NOT ASSUME an unplugged piece of electronics is safe to work on. I know of two potential dangers. First is the aforementioned capacitors which can hold a charge. It's not uncommon to find capacitors rated to 150V inside electronics like a TV or stereo, which means that capacitor could potentially hold 150V of electricity inside it, even when the device is off and unplugged. However, if you use a screwdriver to short out the two leads this discharges the capacitor and makes it safe. The other danger I'm aware of is what's called a flyback transformer which is found on tube TVs and computer monitors. This is in the form of a suction cup attached to the back of the tube. I guess the flyback transformer can hold thousands of volts. Again, it must be carefully removed and shorted out if you plan on working on an old tube TV or monitor.

Me, I've very new and inexperienced when it comes to electronics repair, but I am comfortable working around electronics and electricity. But since I lack experience I've given myself 3 guidelines.

  1. I will not work on old TVs and computer monitors because of the flyback transformer.

  2. I will not work on microwave ovens, they contain both high voltage and high current which is an extreme danger and could very easily kill you.

  3. Whenever I work on electronics, I will short out any capacitors to remove any lingering charge.


The last tip is buy and learn how to use a multimeter. A multimeter is an essential tool in electronics repair. You can buy them for as little as $10, a decent meter in the $50 range, and a good meter runs $100 or more.

Failing electronics

One thing that interests me lately is repairing electronics, or at least trying to. I thought it might be interested to blog about the various projects I attempted and their outcome.

Before I talk about the projects I've been working on, I wanted to elaborate on why electronics seem to have shorter lifespans. Many people have noticed that electronics lately seem to die within about 5 years. Why is that? A lot of people probably have a VCR at home from the 80s that still works fine, so why is it their DVD player from just a few years ago has died? The answer to that is complicated. I'm sure part of it is because most electronics manufactures don't manufacture their own products anymore. As I talked about in previous posts, just as Dell doesn't actually make their computers, the same is true of Toshiba and their TVs, or a DVD player from LG. It's just the way the industry works these days.

But I think the 2 single greatest problems resulting in electronics failure are bad capacitors and lead-free solder.

  1. In 2006 the European Union started enforcing the RoHS (Restriction of Hazardous Substances) directive. As the name implies, the intent is to reduce the amount of hazardous substances in electronics. One of the changes required is the use of lead-free solders. Most electronics solder is a mixture of tin and lead. But the use of lead-free solders has caused to a lot of problems. Lead-free solders are a lot more brittle, over time they crack which can break the electrical connection. Even if the electronic device doesn't move (like a TV mounted on the wall), the expansion and contraction as the device heats up and cools is enough to cause cracking. Another problem caused by lead-free solder is called tin-whiskers. The solder joint actually begins to grow tin crystals which look a lot like microscopic whiskers or hairs. If these whiskers come in contact with a nearby piece of metal, it can cause a short. There is a reason why they added lead to solder in the first place, the lead prevents these problems from occurring. Admittedly they are getting better at the recipes of lead-free solder they use. Electronics manufactured around 2005 - 2007 seem to be most susceptible. Only time will tell if the new lead-free solder formulas work better.

  2. The second common failure point for electronics is a bad capacitor. A capacitor is a small electronics component. The problem here is a certain type of capacitor called an electrolitic capacitor. If you've ever looked at a circuit board, they look like small cylinders with a shiny metal top. From what I've heard the problem is a few years ago a bunch of Chinese companies started producing very inexpensive electrolitic capacitor which, because of their price, were quickly adopted by manufactures and made their way into most electronics. But these electrolitic capacitors were inferior to higher cost Japanese electrolitic capacitors and would fail in time. But no one knew this at the time. If you tested a Chinese capacitor and a Japanese capacitor, they both checked out. But the Chinese capacitors had a high failure rate in the 3 - 5 year range.


Next time I'll talk more about these two problems, and even how to diagnose and fix them.

Memory leaks - part 3

Last time I talked about UMDH to find memory leaks in the user-mode heap. This tool probably covers 95% of memory leaks, but there are other ways to leak memory. I wouldn't be surprised even people who are very familiar with UMDH haven't heard of today's utility. It's a tool from Microsoft called LeakDiag.

LeakDiag is like UMDH in that it takes snapshots of a running program and differences them to show you potential leaks. Whereas UMDH only looks at the user-mode heap, LeakDiag looks at the user-mode heap and so much more. LeakDiag can analyze 6 different areas:

  1. Virtual memory (VirtualAlloc, VirtualFree, etc.).

  2. Heap memory (the same as UMDH).

  3. MPHeap memory (the multi-processor heap).

  4. COM memory.

  5. COM private memory.

  6. C runtime memory.


You might be asking yourself, if LeakDiag does more than UMDH, why would you ever use UMDH? As I said earlier, most memory leaks occur in the user-mode heap, and UMDH is specifically designed for the user-mode heap so it does a better job at finding and displaying those leaks. So I would recommend using UMDH first, but LeakDiag is a powerful tool to be aware of in case you need it.

Disillusioned with Dell

It use to be if a friend or family member was in the market for a computer and they asked me what brand to buy, I would say without hesitation Dell. However, I no longer recommend Dell. The problem is one of quality. The computer business has become increasingly competitive, and in order to stay competitive Dell (as well as all other manufactures) has been forced to cut corners whenever possible. Unfortunately, these cost cutting measures have resulted in a loss of quality as well as poor business decisions.

Increasingly I've run into Dell computers with hardware problems. Granted all manufactures have problems every now and again, but lately it seems like Dell's are having more problems.

Dell has also made some poor business decisions. My wife's laptop recently started displaying a boot error about the AC power plug. Something to the effect of the power plug is not connected to the machine even though it clearly is connected. After researching the problem I discovered what has to be one of the dumbest "features" added to a laptop. Most laptops have a 2 prong power plug - positive and negative. Well Dell has gone to a three prong plug. No, the third prong is not for ground; the third prong is a communications line between the laptop and the power supply. The intention being the laptop communicates with the power cord to ensure the power cord is a genuine Dell power cord. If it's not, you get this message. Are you serious Dell!?! So if we buy a 3rd party power cord we run into this problem. Ours isn't even a 3rd party, it's a genuine Dell. But apparently the propriety chip inside the power cord goes bad after time. Dell's intention was to force people to buy genuine Dell parts, but this decision only annoys and frustrates users. Great business decision Dell. :(

So what manufacture would I suggest? Without a doubt I suggest building your own computer from quality parts if you know how. Then you'll get top-quality name brand components. But what if you don't know how to build your own computer? Well HP is currently number one and I haven't had problems with them. However, HP is rather expensive. I've had great experiences with Acer lately, they are growing fast, and from my experience make great machines with great prices.

Memory leaks - part 2

In my last post I introduced UMDH and talked about how it uses snapshots to find memory leaks. In this post I'd like to talk more about how to use it and more importantly tips for improving accuracy.

The output from UMDH is organized with the largest leak at the top and the smallest at the bottom (measured by bytes leaked not the number of times the leak occurred). This is great because if you start at the top and work your way down you'll get the most bang for your buck.

An output entry from UMDH contains several things like the total number of bytes leaked, the number of times the allocator was called without being freed, and most importantly the call stack of the allocation. If you don't have an accurate call stack then check your symbols and make sure you ran the gflags command I mentioned in the last post.

UMDH's greatest attribute, it's ability to capture memory leaks, is also it's greatest weakness. It captures so many memory leaks that you'll get tons of false-positives. This is because Windows is doing stuff under the covers you're not aware of, and this shows up as potential memory leaks in UMDH. My rule of thumb is if the call stack doesn't contain any of my code, I ignore it. Also, just because my code is in the call stack doesn't means it's valid either. So I won't spend too much time investigating a problem. It just takes practice to be able to know what's valid and what's not.

By far the best tip for improving accuracy is to run the program for as long as possible, and separate the time between snapshots as long as possible. What this does is make your memory leaks larger which means they are higher up in the UMDH output file. For example, if your program is a service, take a snapshot Friday before leaving work and take the other snapshot on Monday morning. Also, make sure the program is doing something during this time period. The more it's doing the more likely it is to leak, the larger the leak the easier it is to detect.

Memory leaks - part 1

I wanted to do a short series on detecting memory leaks. Microsoft has released several great tools for the detection of memory leaks, the first we'll look at is UMDH (user-mode dump heap). I'll start off my saying these posts are probably most beneficial to developers. You'll need the symbols and eventually the source code to find and fix memory leaks. If you don't have these at most you can use UMDH to confirm a given program is leaking memory.

To use UMDH you'll need umdh.exe and gflags.exe, both of which are included with WinDbg in the Debugging Tools for Windows. The first thing you need to do is make sure your symbols are correct and loaded. Create a local symbol folder and download all the symbols for both Microsoft and your code into it. Set the environment variable _NT_SYMBOL_PATH to C:\Symbols (or whatever your path is). Also, set the environmental variable OANOCACHE to 1. This forces COM and OLE to not reuse previously allocated memory which causes false positives with UMDH.

Next we need to enable stack traces. To do this use the command "gflags.exe /I myapp.exe +ust" Replace myapp.exe with the name of the application you're interested in. Do not put the full path to the executable, just the filename. When you're done you can disable stack tracing with "gflags.exe /I myapp.exe -ust"

You're now ready to actually run your app and check for memory leaks. UMDH detects memory leaks by means of snapshots. When you run UMDH it takes a "snapshot" of all the memory allocations of that process. You can then compare two snapshots and it will display the differences. To take a snapshot use the following command: umdh.exe -p:XXXX -f:snapshot1.txt (where XXXX is the process Id of the process to check). After you've taken two snapshots you can compare the two with this command: umdh.exe snapshot1.txt snapshot2.txt -f:results.txt

Next time I'll talk about how to analyze the output. I'll also talk about tips to maximize the accuracy of your results.

System Security

About a year ago a family member's email account was hacked. I thought I knew a lot about security before that, but this incident taught me even more, which I thought I'd share. First is my list of general security recommendations.

  1. Absolutely positively do not use Internet Explorer. Most viruses are targeted at IE, so don't use it. Not only that, but IE has been proven to be the slowest, most resource intensive, and has the least standards compliance of all the browsers. I suggest Firefox as my first choice or Chrome as a close second.

  2. If you decide to use Firefox (excellent choice), use the Add-Ons section to add "AdBlock Plus" to enhance the security even further.

  3. Run Windows Update to make sure your system is fully patched and updated.

  4. Make sure your firewall is turned on. In Control Panel look for Windows Firewall. Make sure it's enabled. Also, check the Exclusions tab, each exclusion is a potential security hole, consider removing the exclusions.

  5. Part of me has a hard time suggesting AntiVirus software. Often times this software is so invasive it's almost as bad to run the software as it is to have a virus. If you're careful about what you do on your computer, you can get by with no AV program. At home I've gone 15+ years with no antivirus software and I've never gotten a virus. However, if you'd feel safer with software in place, I suggest Microsoft Security Essentials. It's free, it's fast, it's pretty darn good. What I like about MSE is it has a simple clean user interface, and I love the fact you can set the program to not actively scan your system if you so desire. This means it won't slow your system down all the time, only when you decide to run a scan.

  6. Download and occasionally run SpyBot Search & Destroy. This program scans for malicious programs that many antivirus programs don't scan for.

  7. Download and occasionally run RootkitRevealer. This program scans your system for rootkits which are incredibly devious viruses that are impossible to detect with normal antivirus programs. I've heard great things about the rootkit detector IceSword, but I've never used it myself so I can't recommend what I've never used.

  8. If your DSL or cable modem connects directly to your computer, consider buying a small home router like those from LinkSys, D-Link, and NetGear. Having a router between your computer and the Internet is an extra layer of protection. If you have a home router, check for updated firmware from the manufacture. These routers can have security holes, so check for updates to make sure you're fully protected.

  9. It never hurts to have longer more complex passwords.

  10. Whenever logging into a web page, always check for a secure connection. On the page where you enter your password, if you do not see "https://" at the top, do not login. If it only says "http://" without the "s" then do not login, someone could capture your password. This is true for any logins on the web, whether it's your email, utilities, forums, bank, etc.


Those are my general guidelines and recommendations for avoiding problems on your computer. Now my family member's email was compromised through no fault of their own. It got me to thinking about what they could have done differently to protect them more from this happening.

  1. Do not use a web browser to check your email. You might be tricked into giving up your password on a "phishing" page. This is most likely how the account was compromised. Instead use a program on your PC to check your email (more on that later).

  2. Move all of your email and addressbook info from your online account to your computer. That way if someone does hack your account, there are no emails or contact info for them to exploit.


So as I said, I suggest using a program to check your email. You could use Microsoft Outlook, but I would recommend against that. Just as most Internet viruses target Internet Explorer, most email viruses target Outlook. Instead I suggest Thunderbird, from the same makers as Firefox. When you set up Thunderbird have it delete emails from the server after it downloads them. This will ensure there are no emails online, everything is stored on your PC.

As computer security continues to improve, that makes it harder for people to hack into your system. By far the "weakest link" in the system is the user. It's far easier to trick the user into compromising his security than it is to forcibly hack into a system. But this also means you as a user need to be mindful of what you're doing. You cannot forget about security concerns and trust the computer to protect you. You must take an active role in your own security.

Computer hardware failure

Recently a hard drive in my secondary system at home died. This got me thinking about all the hardware I've had fail over the years. Anyone who's worked with computers for a long time has probably experienced some sort of hardware failure. I've worked with computers since 1994 and I've seen more than my share of hardware failures in that time. What's interesting to me is to look at what components failed and to realize there seems to be a pattern. I'll start with the most reliable and go to the least reliable.

Motherboards: In all my years working with computers, I can't think of a single instance in which I had a motherboard failure. When I build computers I always use genuine Intel motherboards, but I've had plenty of work computers with other brand motherboards and never have I seen a motherboard fail.

CPU: As with motherboards I don't think I've ever seen a system in which the CPU failed. I have seen two systems which didn't have adequate cooling and the CPU would overheat and the system would shutdown to protect itself. But I don't consider this to be a fault of the CPU itself.

Cards (video, sound, network, modem, etc.): Again, I don't think I've ever seen a card fail. Admittedly nowadays most motherboards come with sound, network, and to a lesser degree video onboard so having add-in cards is less common. But back in the day you had discrete cards such as video, sound, network, modem, scsi, etc. My sister had a modem die on her, but they had a lightning strike a telephone pole in their neighborhood so I don't think it's the fault of the modem.

RAM: With I think one exception I've never found a bad stick of RAM. I had an old 486 which after several years started having bad memory errors.

Floppy Drives: Granted you never see floppy drives anymore, but from my experience these drives are (were) pretty robust. You would think for a device with physically moving parts susceptible to dust they would have failed frequently. I don't think I ever had one fail. Occasionally you had to open them up and blow the dirt out, but the drive always worked.

Power Supplies: Power supplies have proven to be a component with a higher failure rate. I've probably had to replace 4 or 5 of them over the years. What's interesting to note is all the power supplies that I've had fail were "cheap" power supplies. Nicer power supplies are rated as "80 Plus" meaning they are at least 80% efficient. To achieve this greater efficiency they have to use nicer components, which has the added benefit of making them more reliable.

Hard Drives: Hard drives have an alarming failure rate. I mean on the one hand they have are complex devices with incredibly tight tolerances, physically moving parts, and are expected to run 24/7 - so I can understand a high failure rate. But on the other hand people entrust vast amounts of data to them expecting it to be safe forever. I think most users do not backup their data. A hard drive death is often times quick, one day the hard drive works, the next it fails. But sometimes the drive dies slowly, the number of bad sectors increases over time. Something interesting I've noticed about failed hard drives, never once have I had a Seagate drive fail. I've had failures from IBM, Hitachi, Fujitsu, Quantum, and Western Digital - but never a Seagate.

Optical Drivers: I think the component with the highest failure rate has to be optical drives (CD and DVD drives). My experience is these drives seem to have an average life of about 3 years before they fail. A typical death is usually slow, the drive starts failing to read discs, usually starting with home burned discs. The failure rate increases until eventually it won't read anything.

Now obviously my experience is no guarantee of a pattern. Just because Seagate hard drives have never failed for me doesn't mean this will be true for everyone. But I think it does show a trend.

So what's the take-away from this post you ask? Well I'd say the next time you're building a computer, consider buying nicer components, especially when buying the power supply and hard drive. If you try and save money when buying the power supply and hard drive you may end up regretting it. If money is an issue, consider buying a smaller Seagate hard drive versus a large hard drive of another brand.

VirtualPC and Ubuntu

As I discussed last time, I have settled on Virtual PC as my virtual machine emulator. But again that's not to say Virtual PC is without its share of problems. While installing Ubuntu I've run into a minor little problem... the fact that you can't install Ubuntu because the virtual machine keeps crashing.

After researching this I've found the problem and a solution. But I feel like I'm caught in the middle of a battle between two giants. The crux of the problem is Virtual PC does not support 24-bit color, only 8-bit, 16-bit, and 32-bit. This is no doubt because Windows uses 8, 16, and 32-bit color depths. But Ubuntu is Linux which apparently uses 24-bit as the high instead of 32-bit. Because Ubuntu is trying to use a color depth not supported by Virtual PC it results in a crash inside the virtual machine. But I said I feel like I'm caught between two titans. I feel like Microsoft should fix this, they should add 24-bit color support (after all VirtualBox supports it). But I also found an interesting blog post from a Microsoft developer on the VPC team. In it he said Microsoft's virtual video card reports that it does not support 24-bit color. This means there is a bug in Ubuntu, it's not correctly detecting the lack of 24-bit support. So which giant is going to fix the problem first, Microsoft or Ubuntu? And in the mean time I'm stuck in the middle.

Even with the bug, I have found a way to work around the issue. First, when installing Ubuntu you need to disable hardware-assisted virtualization support. This will allow you to install Ubuntu without a crash. Once installed you can change the UI settings to use 16-bit color instead of 24-bit. And the final gotcha is GRUB, the Linux boot loader. The new version of GRUB uses a graphical mode which, surprise surprise, is in 24-bit color. In Ubuntu add a package to your system called "StartupManager" This program allows you to set the color depth used by GRUB. After you make all these changes you can reenable hardware-assisted virtualization support.

Using virtual machines can be a huge time saver, but at the same time when you run into issues like these virtualization can be nothing but a headache.

Virtual machines

I think I was slower than most people to use "virtual" machines, I've only just started within the last few months. I think my main problem was the fact that I had so many machines in my office. At one point I had something like 15 physical machines in my office. With that many physical machines, you don't need virtual.

Since I am "discovering" virtual machines for the first time, I wanted to try many of the more common virtual machine programs to see which is the best. I decided to test Microsoft Virtual PC, Oracle VirtualBox, and VMWare Player - all free emulators. Here's my mini-review of the three.

Virtual PC - Virtual PC wasn't the fastest, and it does have issues. For example, installing Linux requires special steps because Virtual PC doesn't support 24-bit color. Also, it doesn't support 64-bit OSes. All that said, it was my favorite of the three. What I really liked about Virtual PC is the clean UI. There is something to be said for a clean simple UI. I also liked that Virtual PC doesn't install a virtual network adapter as the other two programs do. Virtual PC feels the least invasive of the three.

VirtualBox - VirtualBox was by far the slowest, but it also had some powerful features. Unlike VPC it allows you to expose more than 1 CPU to the emulated PC. It also supports a 64-bit environment. My biggest gripe with VirtualBox is the UI has a very "Unix" feel to it. There's nothing wrong with Unix-looking UIs, except when I'm on Windows I want all the UIs to look like Windows.

VMWare Player - Player was the fastest of the three. It also had some impressive features. I did find the UI difficult to navigate at first, it lacks the flow the other two have. It also has a "skinned" UI which in my opinion is a detraction. Why does every company these days feel the need to "skin" their apps? What's wrong with a consistent look and feel. When every program looks and functions differently it has the effect of reducing productivity.

All and all these three programs were pretty good, I could live with any of the three. But ultimately I chose Virtual PC based largely on it's clean easy to navigate UI.

Monday, June 27, 2011

Useful utilities - GIMP

Today's useful utility is the GNU Image Manipulation Program (or GIMP for short), which is a free image-editing utility. Gimp is on par with Adobe Photoshop, except Gimp is free. But I will warn you, Gimp is not for the faint of heart. Image editing is a very complex task, it's not like opening an image in paint. You need to become comfortable with layer, masks, etc. So Gimp, just like Photoshop, has a steep learning curve. But once you learn how to use Gimp you can do some very powerful things.

Here's a quick and dirty example of what you can do with Gimp. Here's a random picture I found on the Internet. As you can see it's all washed out, the picture was over exposed. The second image is after I edited it with Gimp.





You can see the image is much better. The background is still washed out, but the subject in the foreground is not. My editing of this image was very quick, I'm sure if you took more time editing you could clean it up even more.

In addition to image editing, Gimp can be used to create images from scratch. Here is an image I recently created as an icon/logo for a program.



If you've been looking for a powerful image editor, I strongly encourage you to download Gimp and be patient during the learning process. If you're just looking for a program to remove red-eye from your photos, you probably want to look elsewhere as I think Gimp will overwhelm you.

Gimp is available for just about every platform, Windows, Mac, Linux, 32-bit, 64-bit, etc.

The best pancakes

Off the topic of computers again I wanted to share another great cooking tip. This one is on how to make the best pancakes you've ever had. This isn't a recipe, but a technique or process you can apply to any recipe, even box recipes like Bisquik.

The first tip is the order and how things are mixed. Place all the dry ingredients into one bowl, which in most cases will probably be one ingredient - the dry pancake mix. In a second bowl mix all the wet ingredients. Now pour the wet on top of the dry and mix by hand for at most 10 seconds. DO NOT OVER MIX. Yes, the batter may appear to be lumpy, this is all right. The lumps will cook out in the end, I promise. The second tip to excellent pancakes, after your short mixing period is to walk away and let the batter sit for 5 to 10 minutes. If you follow these two simple steps I promise you'll have the best pancakes you've ever made! This method works great for pancakes, waffles, and muffins.

If you're curious the science of why this works then read on. The key is what happens when you mix flour and water. Flour + water + agitation = gluten. Gluten is very elastic, very chewy. This is why when you're baking bread you kneed the dough for a long time, you're creating gluten for a nice chewy bread. But you don't want chewy pancakes. So do the minimum amount of mixing, and definitely do NOT use an electric mixer. Another thing this does is properly distribute the liquid particles through the dry particles. Most pancake recipes have oil and water - even if only in the form of an egg which is a self-contained package of water and oil. By mixing the oil and water ahead of time you ensure better pancakes in the end. The final tip was to let the batter sit before cooking. This tip allows the flour to fully absorb the water and changes the texture of the batter. Flour and water without agitation interact differently and does not form gluten. But it takes time to absorb the water which is why you need to let the batter rest. When you stop mixing the batter will be slightly runny and slightly lumpy. After a 5 or 10 minute rest you'll be surprised how much the batter has thickened. You will end up making the thickest most flavorful pancakes, they won't be flat. As a final tip, you might need to reduce the heat just a little bit so they cook through without burning.

Friday, June 24, 2011

Computer manufactures

We all know which companies sell computers, e.g. Dell, HP, Acer, and Apple. But do you know which companies manufacture computers? They're the same right? If you buy a Dell laptop surely Dell designed and manufactured that laptop. Well the answer is in most cases no! Just about every company you associate with computer hardware did not actually produce that hardware. So who does make them? Here is a list of the largest computer manufactures:

  • Quanta

  • Clevo

  • Compal

  • ASUS

  • ECS

  • Foxconn

  • Inventec

  • Arima

  • Winstron

  • MSI

  • Uniwill


I'm guessing the only ones on this list you've ever heard of are ASUS and possibly MSI. These companies all have one thing in common, they are Taiwanese manufacturing firms called an Original Design Manufacturer (ODM). Like an OEM they manufacture a product for another company, but what's different is they play a greater role in the "design" aspect. The amount of involvement the end company plays in the design of a product varies greatly. At most, companies like Dell give a list of specs to the ODM who designs the computer for them. And at the opposite end of the spectrum the ODM does all the design work and companies like Dell pick and choose products from the ODMs lineup to sell as their products.

Another surprising fact is these ODMs are not prevented from working with competitors. For example Quanta (the single largest laptop manufacture in the world) designs and builds laptops for Dell, HP, Compaq, Apple, Acer, and Gateway just to name a few.

It kind of makes you think, is that Dell laptop on your desk really so different from that Apple laptop on another desk? Is that $1,000 HP laptop really better than that $500 eMachine laptop? There's a good chance the same person/team designed them and they may have been built in the same factory.

This extends beyond the computer industry. Televisions, stereos, refrigerators, etc. are all designed and built by ODMs. Something to keep in mind the next time you're looking at spending more for a name-brand item versus less on a brand you've never heard of before.

Firefox extensions

If you're reading this using Firefox then I have a few browser extensions I want to make you aware of. If you're reading this using Chrome, Safari, or Opera... well these extensions won't help you. And if you're reading this using IE then you need to stop using it and go with a superior browser. [Totally random, but recent web statistics show IE's market share is at an 11 year low.] Here are two add-ons for Firefox which I consider indispensable.

Adblock Plus - Firefox has a built-in pop-up blocked, but this takes it one step further. Ads that are embedded in the page that do not pop-up, this add-on blocks those too. And this add-on does an incredible job. I rarely see an ad of any type when browsing with Firefox. No ads and no pop-ups, this is the way the Internet was meant to be.

Flashblock - I've grown to hate flash. I think it goes back years ago (and still today), I hate when you visit a site and all of a sudden video and/or audio starts playing on your system and you can't stop it. Or you're trying to read a page of text (like on cnn.com) and there's some animation on the side which is very distracting. My hatred of flash is so deep that for as long as flash has existed I refused to install it. I would never install flash, in fact I would go so far as to disable it on systems which came with it preinstalled. Well that's all about to change. This really cool add-on only plays flash content if you approve it. When you view a page with flash content all the flash items appear as play buttons. They only run if you click the play button. So by default no flash item plays, only if you run it does it work. I like to think of this as the best of both worlds, I get to see flash content but on my terms not the web page designer's terms.

How to cook chicken

In addition to computers and technology, another interest of mine is cooking. I really enjoy cooking, probably because I really enjoy eating. So I thought I could blog tips and tricks I've learned over the years for others to enjoy.

There's nothing more repulsive than under cooked chicken. So when I cook chicken I have a tendency to over cook the chicken which unfortunately leaves the chicken a little dry and tough... but that's better than underdone. Well it turns out there's a simple way to thoroughly cook the chicken without drying it out... it's called a brine. A brine is basically a salty liquid which you will soak the chicken in. The ratio is 1 cup broth or stock, 1 cup water, and 1 tbsp salt (you may need to heat it slightly to get the salt to dissolve). Make enough of this brine to submerge the chicken in. You can also add additional flavorings to the brine such as whole peppercorns, rosemary, garlic, honey, etc. Soak your chicken in the brine for at least several hours, or up to 3 or 4 days. I find it's best if you soak it for 1 to 2 days. I place the chicken and the brine into a container and place it into the fridge. What happens is the salt promotes osmosis which allows the water (and the flavorings) to go into the chicken. But here's the magic, the chicken does not come out salty like you would expect. All the salt stays in the brine; because there is already natural salt in the chicken and the osmostic action will not allow more salt to enter the chicken so long as the brine is less salty than the chicken is naturally (so don't add more salt than the recipe calls for). Because of all this extra water that was added to the chicken, you can thoroughly cook the chicken and it won't be dry and tough. Cool huh! I use a brine anytime I cook chicken or turkey.

I'll quickly share one more tip for cooking chicken. If you're going to BBQ the chicken, right before you place the chicken on the BBQ brush the outside of the chicken with olive oil. You can also occasionally brush the outside with olive oil during cooking. I can't really explain how this works except it makes the chicken taste really good. If you've ever been to a function that was catered, and that caterer BBQ'ed chicken which tasted really good - I'll bet you he brushed the outside with olive oil. I picked this tip up from a caterer.

There you go, two of my tips for cooking incredible chicken.

Bed Bath and Beyond

Ok, today's post has absolutely nothing to do with computers, but it's some tips which you might find helpful. I love the store Bed Bath and Beyond. Lots of cool stuff, I mainly love the kitchen gadget section. If you spend anytime at this store then you're probably aware they have a lot of coupons. They give out 20% off one item coupons like there's no tomorrow, and they also have $5 off minimum $15 and $10 off minimum $30. Well here are 4 great tips to help you save the most money at Bed Bath and Beyond.

  1. These coupons never expire. Yes, I know the have an expiration date on them, but Bed Bath and Beyond will take them even after they've expired. So anytime you get one, keep it. I have a fat stack of like 50 of them at home.

  2. The 20% off coupons, you can use multiple coupons when buying multiple items. Each coupon is good for 20% off a single item. If you're buying multiple items you can give them a 20% off coupon for each item you're buying.

  3. If the item you wish to buy is not available in the store but Bed Bath and Beyond sells it on their web page, go into the store and ask an associate to order the item for you. They will order it and they can apply the coupon if you give it to them. You cannot apply the coupon if you order it from the convenience of your home, but if you go into the store the coupon will work.

  4. The last tip is knowing when to use which coupon to maximize your savings. If the total is between $0 and $15 use a 20%. Between $15 and $20 use a $5 off. Between $20 and $30 use a 20%. Between $30 and $50 use a $10 off. And anything above $50 use a 20%.


These tips should help you save lots of money at Bed Bath and Beyond. Basically you should save at least 20% off anything you buy there. I guess the only exception is the relatively short list of excluded products and brands the coupons don't apply to.

USB flash drives

USB flash drives are one of the coolest and most useful new pieces of technology to show up in the last decade if you ask me. Now you can easily carry gigabytes worth of data on a fast read/write format. But one of the most annoying thing to me is Windows will not let you format USB flash drives with the NTFS format. Hello Microsoft, it's 2010, we want NTFS not some flavor of FAT. I personally enjoy having NTFS security on my files on a device which is very easy to lose and someone else find. The good news is there is a way to format USB flash drives with NTFS and here's how you do it.

1. The first option is to use a different version of Windows. Not all versions of Windows enforce this restriction. WinXP does but Win2K does not. I'm not sure about Vista or Win7. But if you have easy access to a different version of Windows give that a try.

2. If that doesn't work then you can change XP to allow NTFS. Open up Device Manager. In the tree look for the "Disk drives" section. Under the disk drives find the USB flash drive in question, right click and select Properties. Click on the Policies tab. Finally change the setting to "Optimize for performance." You can now format the drive using NTFS using WinXP.

I should point out that Microsoft made it difficult to format USB flash drives with NTFS for a reason. The NTFS files system has a lot more read/write operations that FAT. Even if you view files and don't save them it does update info in NTFS. In fact, I believe that even if you have an Explorer Window open on that drive and do nothing, it will still occasionally write to NTFS. And since USB flash drives are a limited number of write cycles before they fail your USB flash drive will last longer with FAT than NTFS. But the way I look at it, these drives capacities are growing so fast that the drive will become obsolete size-wise before the drive fails.

UltraEdit

Today I wanted to talk about another useful utility - UltraEdit. However, I'm not going to put this one under the standard "useful utilities" header that all the others have gone into. The reason being is UltraEdit unlike all the other utilities is not free. This one costs money, but to me this program is totally worth it.

UltraEdit is probably the best most powerful text editor you can find. I wouldn't even describe it as Notepad on steroids because that way underestimates what UltraEdit does. It has a built in hex editor - I love the ability to perform hex search and replaces. It colorizes code and web files to make them easier to edit. It edits files of any size, I've worked on 4GB files before. Just tons of features. They are up to version 16 and the last version I licensed was 5, so I'm sure there are tons of new features I'm not aware of.

I discovered UltraEdit in college around 1997. A friend of mine had a copy of it and I was very impressed with it. I think I originally pirated a copy of it from him and used that (my ethics as a poor college student weren't the best). After about a year or so I felt guilty because this was a very good program and I used it a lot. So I decided to become a legal owner and purchased a license. This continues to be one of the most used programs on my system.

They have a demo you can download and try for free. Give it a try, you might find it so useful you want to spend the $60.

Useful Utilities - Virtual CD programs

A while back I needed a good virtual CD program. I ended up downloading at least a dozen virtual CD programs and tried them out. Most of them were junk, but there were some good ones in there. Here are my two favorites:

ISODisk -ISODisk is the epitome of a simple program. Very clean UI, the ability to mount multiple ISO images, and even rips discs to ISOs. However, despite all this I did not end up using ISODisk for my needs at home because ISODisk lacks one significant feature - x64 support.

WinCDEmu - WinCDEmu is the virtual CD program I ended up using. Whereas the program is not as simple and as clean as ISODisk, it does support x64. Another feature I really like about WinCDEmu is the source code is freely available. In the future I'm hoping to modify WinCDEmu and give it a clean UI. But in the meantime WinCDEmu is a pretty good program.

There you have it, if you're looking for a virtual CD program you might want to give one of these a try.

Useful Utilities - System Information

Today I'd like to talk about 3 small utilities which provide you useful information about your system.

CPUZ - CPUZ is an excellent little program that gives you tons of information about your CPU, RAM, and motherboard. It identifies your CPU including manufacturing technology, cache sizes, cores, voltages, etc. It also provides info about your motherboard including northbridge and southbridge chipset info. And lastly it identifies your RAM, how much, how many slots, what size stick in each slot, etc.

GPUZ - GPUZ is not written by the same people as CPUZ, but clearly by the name they are going for name recognition. GPUZ does a great job of identifying your graphics processor. It can tell you the manufacturing technology, number of shaders, DirectX support level, memory size, clock rates, etc.

DiscInfo - DiscInfo is a simple little program that displays info about optical drives. It will show you a huge list of what the hardware supports, so you can see what types of discs the drive can burn. It also shows you the drive firmware so you can see if there is a newer firmware available from the manufacture. Below is a screenshot of the hardware capabilities of my DVD drive.



Download these 3 programs, they are all small simple programs but they provide very useful information.

Useful Utilities - IrfanView

Picture viewing/editing programs are a dime a dozen. But most of them seem to fall into one of two categories. Either they are very simple programs with limited capabilities like Windows Image Viewer or Microsoft Paint, or the image viewer is incredibly complex and powerful like Photoshop or Gimp. Sometimes you need simple and sometimes you need complex. But often times you want something right in the middle. Enter IrfanView.

IrfanView is the image viewer/editor that I use the most. It's fast and simple yet has some very powerful features. It handles pretty much every image format, I've never found an image this program won't open. It has batch processing capabilities, slideshow, fullscreen viewing, as well as a good number of effects and editing that can be done to the image. For me this is the perfect program to replace the horrible Windows Image Viewer. Give it a try, you might be pleasantly surprised.

Thursday, June 23, 2011

Netbooks, notebooks, and laptops oh my!

As I posted about several weeks ago, laptop's share in the computer market is steadily increasing. But not only are their numbers increasing, but the variety and diversity among "laptops" is increasing as well. Now you see terms like netbooks, notebooks, laptops, and tablets. What do all these mean, and what are the differences and similarities between them? Let's start with the easy ones.

Notebook - As far as I know notebook is merely another name for laptop. The two terms are used interchangeably.

Tablet - A tablet is a portable computer which is all screen and no keyboard. For example the iPad and HP's Slate are both tablets. Tablet computers should always have a touch screen and probably some form of handwriting recognition. To muddy the waters a little there are computers which can be either a tablet or a laptop. They are laptop computers (including keyboards), but optionally the screen can be turned and closed to cover the keyboard and become a tablet.

Netbook - Netbook is the newest category of portable computer. What differentiates a netbook from a notebook has been changing slightly over the years. When they were first released, a netbook always had a smaller screen (8" - 9"), an Intel Atom CPU, and at most 1 GB of RAM. What's interesting to note is the 1GB of RAM limitation which is still in affect is not a hardware restriction, it's a Microsoft restriction. Before Microsoft would license their OSes on these machines they placed a restriction of at most 1 GB of RAM. I know this was originally to justify selling XP instead of Vista, but now that Win7 is out I'm not sure why the 1 GB limit is still in affect. Anyway, those were the first generation of netbooks. But since then the line between netbook and notebook had become less clear. Netbooks screens are up to as large as 10" whereas notebooks are down to 11". Probably the determining factor is the CPU which is still Intel Atom (or Via Nano or AMD Neo). Also, as I said the 1 GB RAM limit is still there.

The proliferation of portable categories is interesting. Neither desktops nor servers has splintered like this, and I wouldn't be surprised if portable computers continue to expand both in numbers and types.

Useful Utility - WMIExplorer

If you've never heard of WMI then today's useful utility will probably not benefit you. It's called WMIExplorer and it allows you to easily browse the entire WMI namespace. WMI or Windows Management Instrumentation is a way of accessing a lof of information about a computer. You can access hardware information, software information, even real-time events as things happen. If you poke your head around WMI you might be surprised all that's in there. The problem is, you can't poke your head around WMI. You can write a program to easily enumerate any one area, but there are hundreds of areas. That's where WMIExplorer comes in handy. This program allows you to easily browse the entire WMI landscape and see what you can find.

If you're writing a program and you're going to access WMI for some piece of data, a tool like WMIExplorer is invaluable.

Wireless on my desktop?

Time for another good rant. One thing that has long annoyed me about Windows XP is by default the Wireless service is set to automatic. So on my desktop system which does not have a wireless card, there is an extra service running all the time. This seems like a waste to run this service on systems without the hardware. Surely Microsoft could detect wireless hardware and stop the service if none is found.

I totally understand why Microsoft chose to let it run. Many users have laptops, and most laptop users connect wirelessly, and most computer users are not savvy enough to troubleshoot wireless connection issues. But it feels like desktop users are punished to support laptops.

BTW, if you have a desktop and want to correct this, go into Services in Control Panel and set the "Wireless Zero Configuration" to manual or disabled.

Cheap Atoms

Last time I mentioned new cheaper processors like the Intel Atom. But why exactly is the Atom so cheap to manufacture? Admittedly I don't work in hardware so I can't say for sure, but here's my educated guess.

I figure processor manufacturing has 2 major "costs" associated with it; research and development and actual production costs. For R&D costs the CPU must be designed (and presumable tested "virtually"). The Atom should be cheaper because it's a significantly less complex design. According to Intel's Ark site, some Atoms have as few as 47 million transistors. Compare that to a Core 2 Quad which may have as many as 820 million transistors. Obviously the Atom is less complex and therefore should be easier to design and test.

The second area is actual production. CPUs are manufactured on circular wafers. The wafers are approx. 1 foot in diameter. The CPUs are built through lithography bit by bit. The interested thing is, the costs are basically the same regardless of what is being manufactured. If the wafer contains Atom processors, quad processors, RAM, etc. the costs are basically the same. But here's where the size comes into play. The Atom is about 26 mm2 whereas the same quad core about is 214 mm2. So this means a single wafer will yield approximately 2,800 Atoms or 340 quad cores. So in terms of production costs one Atom costs 1/8th the cost of a quad core.

Processors powerful enough?

I know not everyone will agree with me, but I think computers have become more powerful than the needs of the average user. I think most people use a computer to surf the web, check email, word processing, and maybe watch movies/videos. None of these tasks require a quad core processor running at 2 GHz and 4 GB of system memory. In fact, you can do all these tasks with a significantly less powerful machine.

Don't misunderstand me, there is a place for powerful machines. If you play 3D games, edit videos and/or images, run CAD programs, write code, etc. you have need for a powerful system. But in my opinion anyone who buys a Core iX system and only checks email and surfs the web on it wasted money. I personally love the trend Intel and AMD are making. Introducing less powerful processors which use less electrical power and are cheaper to manufacture. The Intel Atom is a prime example. This processor is powerful enough for what most people do with a computer, yet uses around 10 watts of electricity. They use so little electricity in fact the CPU is passively cooled. Yes the Atom was designed for netbooks but I'm glad to see manufactures created nettops to bring this hardware segment to home computers.

It's like Intel and AMD are moving in two different directions. On the one hand they are creating newer faster more powerful CPUs. At the same time, they are creating CPUs with as much power as those from a few years ago but that which use 1/5 or less the electrical power. Not that Intel and AMD were waiting for validation of their market strategy from me, but I approve.

Useful Utilities - Wireshark

Today's useful utility is Wireshark, a free and very powerful network packet sniffer. It was probably about 5 years ago I needed a packet sniffer to analyze some network traffic at work. So I searched the Internet and downloaded about 10 packet sniffers. Some of these were totally free but many of them were limited trails of a full product. But most of these programs were difficult to use and/or didn't work very well. Only two programs caught my eye as worth using. One was Packet Monitor from AnalogX (previously discussed) and the other was Etherreal. Etherreal was by far the more powerful and capable program, Packet Monitor's main benefit was a very clean UI. Etherreal has since changed its name to Wireshark.

Wireshark has sort of become the defacto standard for packet sniffers. In the last two years multiple customers with issues have sent me packet traces of their issue, and these traces have always been from Wireshark. So if you've never used Wireshark you might want to download it now and play with it a little bit, you never know when you're going to be given a Wireshark file or asked to capture some activity using Wireshark.

Ubuntu

About two years ago was my first real exposure to Ubuntu. In college I used a lot of Linux (Red Hat as I remember), so I'm no stranger to Linux. But this was the first time I used Ubuntu.

Even though Ubuntu has become real big as of late, it's still in its infancy. Over the past year I've gotten to watch Ubuntu evolve at a pretty fast pace. For example, less than 1 year ago Ubuntu setup was an awkward but functional text-based setup. Now it's a slick GUI setup.

One of the things that has really stood out to me is how much Ubuntu seems to mimic Windows. The Ubuntu release that corresponded with Windows 7 (Ubuntu 9.10) made UI changes very similar to those in Windows 7. It truly feels to me like Ubuntu is playing catch-up and trying to copy Windows. This can be both good and bad. On the one hand it makes switching from Windows to Ubuntu easier, users do not have to relearn the fundamentals of a new OS. But at the same time, these users are leaving Windows for a reason and for Ubuntu to copy Windows almost defeats the purpose of leaving.

Don't get me wrong, Ubuntu is cool and fun. I just wish they would find their own path instead of following Microsoft's path and making every change (and every mistake) that Microsoft makes.

Blue Screen of Death

The "Blue Screen of Death" or BSOD is a dreaded crash of Windows. I remember about 2 years ago I had an epiphany when I suddenly realized exactly what causes a BSOD of death and why Windows can't continue. I would like to share this with you in case you don't realize.

Ultimately it boils down to an unhandled exception; but it's more than that. First, what is an exception? Well as the name implies, it's an exceptional condition that has occurred outside of the expected flow of execution. Take for example the following line of pseudo-code:

x = 6 / 2;

Obviously x equals 3. But what about this:

x = 8 / 0;

What does x equal? The answer is undefined. It doesn't equal anything because you can't divide a number by 0. So how does a computer handle this? Well it can't return a value to x because that would be wrong. Even if it returned a value of 0, there would be nothing to differentiate between this and "x = 0 / 8;" This is where exceptions come in. The computer "raises" an exception telling the program that an unexpected event occurred.

As developers, we can account for exceptions when they occur. We can add special code to our program to "catch" these raised exceptions and recover from them. If however the programmer does not add code to handle exceptions, the exception raises all the way up to the OS which kills the program and reports the error to the user. If you've ever seen Dr. Watson, this is the program in Windows that handles exceptions that the programmer didn't handle.

That explains exceptions, but it still doesn't explain BSOD. Windows is divided into two parts, kernel level and user or application level. Basically everything you see and interact with is user level, and some of the under-the-covers stuff like drivers are kernel level. An unhandled exception in a kernel level program results in a BSOD. So user level is to Dr. Watson as kernel level is to BSOD.

This also explains why if you get a BSOD, 99% of the time the solution to the problem is to find the offending driver and download an updated version and hope the problem was fixed. About the only time this doesn't work is if the BSOD was ultimately caused by a hardware failure.

Windows Explorer tip

I wanted to share a little tip I learned many years ago - how to unload Windows Explorer without exiting Windows. This might seem like an odd thing to want to do, but over the years I've found reasons why. Maybe Windows Explorer has locked a file that I want to delete, or maybe Explorer has a USB flash drive locked and won't let me eject it (this seems to happen a lot), or maybe there's a serious memory leak in Explorer and you need the process to free all that memory. As a developer I've found reasons why I need to take Explorer out of the picture when debugging a problem in my code. So there are reasons to want to unload Windows Explorer. But typically when you exit Windows Explorer, Windows itself exits.

This tip is pretty easy. You need to bring up the "Shut Down Windows" dialog. You can do this by clicking Start then Shut Down. You can also click on your desktop then press Alt+F4. Once you see the "Shut Down Windows" dialog press and hold Ctrl+Shift+Alt then click the cancel button. Windows Explorer will disappear but Windows will not exit.

After you're done you can reload Explorer by pressing Ctrl+Shift+Esc at the same time. This will bring up Task Manager. From Task Manager you can run a new task of "explorer.exe" This will reload Windows Explorer and you can resume where you left off.

Useful Utilities - Freezerware

Today's useful utilities seems a little self-serving. That's because it's utilities written by me. Over the years I've written tons of little programs for my own use. After the number reached several dozen it dawned on me that others might find these programs useful as well, so I created a web page and provide them for download. Initially all the programs were command line tools, but eventually I added some GUI programs.

If you're wondering about the name "Freezerware." It's a combination of Freezer (my nickname) and "ware" as in freeware and software. Over the years certain programs have proven to be more popular. Those tools are:

ARP++ - ARP++ is the Windows Add/Remove Programs but on steroids. Years ago I discovered some programs install such that you cannot remove them with Windows ARP. Still other programs hide themselves from Windows ARP. ARP++ shows you all programs it can find installed on your system, and let's you uninstall them all.

Briscola - In high-school a friend taught me an Italian card game called Briscola. It's a lot of fun, but sadly I couldn't find any versions of it for the computer. Well that's not true, I found one version in Italian only. So I decided to write my own version. Give it a try, the rules are included in the help file.

PasswordSpy - PasswordSpy uses a design flaw in Windows to reveal passwords behind the "****" It works in most programs and on most versions of Windows, but sometimes there are passwords you cannot reveal using this tool.

ZoomIn - ZoomIn is, as the name implies, a screen magnifier. It's nothing more than the Microsoft tool of the same name (included in the Platform SDK) with a lot of improvements and fixes. I added features like a grid, RGB color display, the ability to copy or save the result as a BMP, etc.

Thank you for letting me toot my own horn. Look over the tools, there are a lot and hopefully you'll might find some that are useful.

Wednesday, June 22, 2011

Top 15 Sega Master System Games



One of the things I really enjoy is retro or old-school gaming. I thought it would be fun to post my favorite games from retro gaming consoles. And what better place to start than the Sega Master System (SMS).

Technically the SMS wasn't the first gaming console I owned as my family had an Atari 2600. But the SMS was definitely the system were I fell in love with gaming. Not a lot of people played the SMS, by far the Nintendo Entertainment System was more popular. This was a shame too because the Sega has vastly superior hardware. I owned maybe 20 SMS games, but with friends and rentals I've probably played about 100 SMS games. Here are my top 15 SMS games.

15. Rastan

Rastan is a side-scrolling platform game. You use a sword or an axe to hack and slice your enemies.

14. Miracle Warriors

This is an early role playing game (RPG) on the SMS. I never owned this game but I borrowed it from a friend. I regret I never finished this game, I only completed about half the game.

13. Y's: The Vanished Omens

Another RPG for the SMS. This one is looks much better than Miracle Warriors. Again, I didn't own this game but borrowed it. This game definitely is challenging, but it's fun.

12. Penguin Land

This game probably doesn't make a lot of people's "top game lists." It's very unique game, probably one of the first puzzle games out there.

11. Kung Fu Kid

This game is short and easy to beat, but it's so fun it keeps me coming back for more. But aren't those the best games, the ones you can't put down?

10. Fantasy Zone II

I think I rented this game back in the day. A very simple game, but it's fun to shoot enemies, collect money, and buy upgrades. Hours of fun to be found here.

9. Astro Warrior

Astro Warrior is a horizontal scrolling shooter on the SMS, and one of the best. It has simple power-ups. The only problem with this game is the difficulty. If you die you start over with no power-ups and you're as good as done.

8. Alex Kidd in Miracle World

This was the first Alex Kidd game, and in my opinion the best. This is platforming at its best on the SMS.

7. Wonder Boy

Another side-scrolling platform game. It has a lot of levels and gets very difficult towards the end.

6. Space Harrier

Space Harrier is one of Sega's arcade classics. Obviously the SMS version is nothing compared to the arcade, but this game does a great job of showing what the SMS hardware can do. In a day when consoles had a hard time doing 2D games, this game pulls off 3D.

5. R-Type

I never played arcade games as a kid, I chose to save my quarters and buy games for home consoles. R-Type is a classic side-scrolling space shooter.

4. Zillion

Zillion is part maze, part puzzle, and all action. It's hard to describe this game, other than to say it's a lot of fun. I use to spend hours drawing maps of the underground base.

3. Wonder Boy in Monster Land


This installment of Wonder Boy ventures away from pure platforming and adds story and RPG elements. It's a great game, but I have to admit the last castle is very hard... probably too hard. I don't think I ever beat this game.

2. Golvellius: Valley of Doom

What can I say about Govellius, except WOW! This game has great graphics and awesome sound. This game might have the best sound of any game on the SMS. I'm told this game is like Zelda on the NES, but I can't confirm that because I've never played Zelda. But it doesn't matter, Govellius is an awesome game with a large map to explore.

And my favorite Sega Master System game is...

1. Phantasy Star

Phatasy Star is ground breaking in so many ways. It's credited as adding sci-fi elements to RPG games. It also introduces 3D first person perspective in the dungeons, years before Castle Wolfenstein on the PC. The story line pulls you in and the game play keeps you hooked. This game is huge, spaning 3 planets. The graphics and the music are incredible (for the time).