4/12/10

4 Steps To Make Sure You Have Secured Your Hosting & Domain Account

Starting your own website or blog is not necessarily a complicated or difficult process. These days, registering a domain and hosting a site is fast, easy and relatively inexpensive. For a new website or blog, you can be up and running in a matter of a couple of days, assuming you’ve already designed and written your website.

For a new website, that’s great. You might have a few visitors trickling in at first. Maybe you went for the economical approach and opted for the cheapest hosting plan you could find. During those early days, you can withstand an occasional hour or two of downtime when other users consume all of the bandwidth – no one will scream at you.

However, once your traffic starts taking off and you establish a certain level of readership and a regular following – you’ll find that people depend on you for regular content. They depend on your uptime. You’ll also find that you’re more likely to get attacked by hackers looking to either sabotage your site or, even worse, hijack your domain – you need secure web hosting and to protect your domain.

If you haven’t seen Aibek’s interview on Foundora, check it out. He describes how the MUO domain was once hijacked and held hostage for $2000. Seriously. So here at MUO, we are now really big into security. You can check out Saikat’s list of browser security checks or Damien’s list of WordPress security plugins. However, what I want to touch on a bit today is your domain and hosting security.

Protecting Your Domain
At first, that domain name that you’ve registered seems ridiculously cheap considering that it represents what should eventually become your brand. The domain name is how people are going to learn about you, link to you, and recognize you. In time, it will represent everything that your website stands for. It’s going to serve on the front lines of your SEO battles. As your site grows, your domain name becomes the single most critical element of your business.
Private domain registration is your first wall of defense against domain hijacking. The problem with the early days of domain registration is that you had your private contact information tied to the Whois record – meaning anyone that searched for the registration records of your URL could identify where you lived, your phone number and your email address. With your email address, hackers may start to send phishing emails with the hopes that you’re gullible enough to bite.By now, you should know better than to click on such emails. Never, ever log into your domain account from a link within an email. Always go directly to the registrar’s website and log into your domain account directly. Even though it might double the yearly cost of your domain, private domain registration will also cut down on telemarketers. Before I started using private domains, I had SEO companies constantly calling to ask whether I wanted to use their services for my website. Avoid the hassle – hide your identity with private registration.

Protecting Your Website
There are a number of areas within your hosting account that you’ll need to double check to verify that you have a secure web hosting account. The most important is obviously the password that you use to log into the hosting account itself. Go into the account settings and change your password. Most hosts now feature a gauge that tells you how strong your password is.Choose a password that has capital and lower case numbers, letters, and even a special character or two thrown in for good measure. Try to follow the guidelines below for the best security.
• Never use the same password for your host account as you used for your domain registration.
• Never use the same password for domain registration as you use for your email account.
• Use a unique, strong password on all three systems – just make sure they are all different.

By avoiding the same password on different accounts, you significantly reduce the risk that if one account is ever hacked, the hacker will not have access to your other systems.

Another security concern to review on your site is folder permissions. Check folders within your public_html folder to ensure that they are either 755 or 644 for www readability. You should not find any folders that are set with 777 for permissions.Also, take some time to review the security tools that your web host offers. Sometimes there are some pretty cool utilities that you can use to further lock down your hosting account and private directories or files from prying eyes. For example, I’ve discovered that my hosting account offers a useful password protection feature on any select web directory that I choose.Finally, go into your admin panel for your MySQL databases and double check all of the passwords there too. They shouldn’t match any of your other passwords, and they should be ultra-strong passwords, just like all of your others.
In the end, the ultimate security in protecting your domain from being hijacked comes from the private domain registration service. For a small additional fee, you’ll have tremendous peace of mind knowing that scammers, spammers and other criminals can’t see or even hope to access your personal information. Beyond that tool, make sure to lock down your hosting and email accounts as well, and you’ll enjoy years of trouble-free website ownership.

What other tips do you have for protecting your domain from hijackers or hackers? Has your domain ever been hijacked? Share your advice and experiences in the comments section below Sphere: Related Content

4 Simple Steps To Achieving & Maintaining Inbox Zero In Gmail

With three email accounts, one for work, one personal and one for MakeUseOf, I find myself spending more time checking my email and trying to keep all the messages under control than actually getting much work done. Luckily, all three email accounts are Gmail or Google Apps accounts, and so in an attempt to organise one account, I followed several steps that can be applied to all three. Gmail provides several tools that will help you declutter your inbox and, more importantly, keep it that way.

Achieving Inbox Zero is actually a pretty simple task, and maintaining it can be done with minimal effort on your part, as long as you have a decent system in place.

These are a few simple steps that can help you put that system into motion and, in addition, keep your archive free of large attachments that take up space, which even with Gmail’s huge capacity, after a few years, it can begin to run out.

Set up filters
The first step when decluttering your inbox is to create filters. This is useful because the filters can be applied to all of the messages that are already clogging your inbox. While Gmail filters make it easy to create these filters, Syphir takes it all one step further, effectively putting your filters on steroids.

With Syphir you can filter out mass forwards, archive emails once they’ve been in your inbox for a certain amount of time, push back personal, Facebook or Twitter related emails during your work day so you don’t get distracted and keep your inbox clean and tidy.

A key way in which you can use Syphir to keep your email tidy and organised is to create a label system that will suit your own personal needs, jobs and projects. That way finding older emails will be a snap. Of course, if you don’t feel comfortable giving a third party access to your email, you can make do with Gmail’s native filter system.

Creating filters is very important when it comes to decluttering your inbox because once you have all of your filters in place, your inbox will stay organised.

Convert Emails Into Tasks
After setting up your filters, the next step is to address the emails that are still in your inbox.

I tend to keep emails in my inbox until I’ve handled the related issue or task. More often than not, the task can be forgotten, and as you receive more emails, you run the risk of completely forgetting all about it. Before you know it, your inbox is once again full of emails you have read, but have not dealt with.

To stay on top of things, convert your emails into tasks immediately using Gmail Tasks.

Each task will be accompanied by a link to the related email, so you don’t spend time looking for it if you need to refer to or reply to it.

Reply To Routine Emails Using Canned Responses
Replying to routine emails using Canned Responses makes it easy to clear out those emails that have you typing the same response over and over again.

Using features like Gmail’s canned responses makes it easier and faster to get to your final goal of Inbox Zero.

Use Priority Inbox To Reply To The Rest Of Your Emails
Now that your Gmail inbox is organised, and you’ve replied to your routine emails using Canned Responses, all that’s left to do is prioritise the rest of your emails.

Use Gmail’s Priority Inbox to figure out what order you’ll be addressing or replying to the emails you receive.

Clean Out The Archive
As a bonus step, if you find yourself running out of space in your Gmail account, you might need a quick and easy to get rid of the emails that are taking up too much space. There are several ways you can search for the largest emails in your Gmail archive.

The simples and and most direct method is to run the search has:attachment. If you would like to specify the kind of attachment, since a word document doesn’t take up as much space as an audio or video file, search for specific files using filename:mp3, filename:avi, filename: mov and so forth.

If you want to hand over the task to a third party service, authorise Find Big Mail and it will automatically root out all the large emails in your Gmail account.

FindBigMail will perform a search and categorise your emails by size using labels in your inbox, which you can can then sift through.

What do you do to keep your Gmail inbox empty? Let us know in the comments. Sphere: Related Content

3 Ways To Bypass The MegaVideo Time Limit

If there was ever a great website to stream series and documentaries, it isn’t YouTube. No offense. MegaVideo, from the same minds of file-sharing website MegaUpload, gets a slightly better shot.

It’s fun and easy to browse, has an incredible array of videos and sports one of the best web players I’ve ever seen. The whole shebang is integrated by default; dimming the lights, different aspect ratios and even downloading those videos to your computer.

Here’s the catch; it isn’t free. Not that it should come as a surprise to those of you who are already familiar with MegaUpload. Everything works fine at the start, but after exactly 72 minutes of viewing pleasure, the dreaded pop-up appears.

The 72 Minute Lock
The 72 minute mark seems to be a crucial point in many documentaries and TV series. It might be me, but the MegaVideo time limit seems to appear when it’s least wanted. You have watched 72 minutes of video today. It means you’re not about to finish that show.

You can finish your prescribed dose of waiting and enjoy your next 72 minute batch, or upgrade to a premium account at $9.99 per month to enjoy unlimited use of MegaVideo.

Below are three workarounds to bypass the MegaVideo time limit. All of these will work regardless of your operating system.

1. Using CacaoWeb or IllimituxCacaoWeb is a free, cross-platform application that removes so-called cyberlocker limits, as used by RapidShare and a batch of other file sharing websites. It also effectively removes the 72 minute time lock of MegaVideo.

CacaoWeb uses peer to peer (P2P) technology to make this work. Instead of downloading your video from the server to your client computer, you’re downloading small parts of the video via other users. That way, no one user should reach the time limit. Using CacaoWeb from Rapidshare works the same way.

Illimitux is from the same minds, and based on the same technology as Cacaoweb, but instead of installing a full-fledged application, it works by installing a Firefox add-on or Chrome extension.

2. Work Offline
This second workaround requires no third-party software except your web browser. On the flip side, it’s harder and less forward to use.

First, you buffer part of the video. This means you’re letting it load without actually playing it. When you’ve buffered the entire video, or a good enough part, switch your browser to Work Offline mode. While you’re still in Work Offline mode, you’ll be able to watch the video without adding to the time limit. Keep in mind that you have to disable Work Offline mode to continue browsing or buffering the video.

In Firefox, this is done by navigating to File -> Work Offline. In Internet Explorer, to Tools -> Work Offline. There currently appears to be no Work Offline alternative embedded in Google Chrome.

3. Watch Video on MegaStreaming or EzyWatchLast but not least, you can use MegaVideo embedded sites to surpass the time limit, by using a variety of techniques.

If you copy your MegaVideo URL to MegaStreaming, you’ll be redirected to a page with said video embedded. Here you can watch the video like normal or, depending on the video, even in HD.

Once you reach the limit, press the button at the top right, shown below. This will redirect you to a different page with the same video embedded and you’ll be able to continue watching.

So how does this work? Apparently, different players all have different time limits. By using two different embedded players, you can watch up to 134 minutes (72+31+31) instead of just 72 minutes.

An alternative website that also allows you to bypass MegaVideo’s time limit is EzyWatch. It does not share how it circumvents said limit.

EzyWatch looks more professional, but has regular performance issues; slow buffer times, videos that won’t load, and similar problems.

Do you know any other tools or websites that allow you to eliminate the MegaVideo limit? Have you used the ones above? Let us know in the comments!

COMMENTS:
- You could get a free Megaupload premium account instead: http://www.passwordsharing.com
- Or if you have dynamic IP, you can just restart your modem. Sphere: Related Content

10 Awesome Free Documentaries That You Can Watch Online

Do you love documentaries? Do you love watching them for free? Well, you’re in the right place.

Free documentaries come in a number of different styles and are made for a variety of reasons. Most of them aim to educate the viewer on a particular topic: war; environment; health. Documentaries can also be used to enlighten viewers and give them a new point of view. Mostly they serve to highlight our previous mistakes so they don’t happen again — which is why it’s important to watch them. Many documentaries these days also try to incorporate stunning visuals and sound to keep the viewer’s attention as they’re watching.

Here’s ten of the best free feature-length documentaries available to watch online.

Sicko
Michael Moore might not be everyone’s cup of tea, but Sicko is a timely insight into the world’s medical systems. If you’re not a fan of Michael Moore, rest assured that in this film he mostly holds off on his trademark angry interviews (not entirely, though). Instead, it’s a qualitative look at various medical systems around the world made largely by interviewing everyday people about their experiences with their own system. I found the insights quite revealing and would recommend this for anyone who wants to learn more about how health care works around the world.

If you’re into Michael Moore, check out Bowling for Columbine too.

Religulous
Religulous is a documentary about the ridiculousness of organised religion. Bill Maher doesn’t just single out one religion — he talks to people at many places of worship, including many smaller places like Truckers’ chapels. But, by pointing out the flaws and weirder practices, he essentially gets on the wrong side of just about every religion he discusses. He engages all manner of people in religious debate, including one guy who plays the part of Jesus for a religious theme park.

Keep your eye out for a notable interview with a senator which led to one incredibly stupid remark.

Earthlings
Earthlings is about how humans treat the other living creatures on this planet. Primarily it focuses on day-to-day business practices which profit from animals. As you might guess, looking at it from this perspective doesn’t paint us humans in such a great light.

The film features some gorgeous footage of nature, Joaquin Phoenix on the voice-overs and music by Moby.

Invisible Children
The film Invisible Children was made by three teenagers in 2003, who visited Africa in search of something worthy of attention. They eventually reached Northern Uganda and found the children suffering the effects of a 20 year war using child soldiers.

Home
Home is a great documentary about the earth and the delicate balance which sustains life on it. Even if you think you know all the movie will tell you, it still serves as a compelling reminder. The film was directed by Yann Arthus-Bertrand, produced by Luc Besson and features a voice-over from Glenn Close. Throughout the film, you can’t help but notice the amazing cinematography feature. It’s both beautiful and intriguing.

After The Fall
After The Fall is a film about the physical and emotional memory of the Berlin Wall 10 years after the fall of the Berlin wall. While interviewing people who lived in Berlin at the time, the film features beautiful visuals of Berlin to keep you watching.

Man With A Camera
The Man With A Camera is both a documentary and experimental art, so it’s come to be one of the first movies film studies students are told to watch. The idea behind Dziga Vertov’s film is multi-layered and intriguing: Ostensibly it’s a documentary about life in the Soviet Union; it’s a documentary of the filming of that documentary; and it’s a documentary of the audience response to the documentary. However, none of the original film is in this documentary. Very meta.

The Fog Of War: Eleven Lessons From The Life Of Robert S. McNamara
The Fog of War is a fascinating insight into the US government’s decisions regarding the Cuban Missile Crisis and Vietnam policy. Robert McNamara gives viewers 11 lessons we all need to learn from those decisions in order to avoid making the same mistakes. To enhance the haunting visuals, the film score was written by Philip Glass and it beautifully matches the powerful imagery.

Super Size Me
Super Size Me is an experiment in food and health. Morgan Spurlock won a Sundance award with this horrifying insight into the way junk food affects your body. He also takes time to explore how junk food is marketed to children and how our choices are influenced by junk food marketing.

The Corporation
The Corporation explores the concept of a corporation, the role of a corporation and how corporations came to have the powers they do. The movie also psychoanalyses corporations: if corporations have the same rights as “a person”, what sort of a person would they be?

Need More?
As an added bonus, you might like these free documentaries too.

National Parks: Yellowstone National Park
Prelude To War
The Road To Guantanamo
Home
OutFoxed
Orwell Rolls In His Grave
All Histories YouTube
YouTube Documentaries
The Best Places to Watch Documentary Movies Online
NFBFilms: Watch Documentary Films on Your iPhone for Free
BBC Documentaries: Download & Listen To 500 Free Radio Documentaries Online
TopDocumentaryFilms: Watch Cool Documentaries Online
WildlifeFinder: Watch Wildlife Videos Online
Let us know what your favourite documentary is in the comments!

COMMENTS:
- For those who want a regular feature, might I suggest that they check out some of the video sites that can be configured to send out regular recommendations like Metacafe, LetMeWatchThis, Veoh in addition to the above mentioned
- Just found it here to watch for free: http://www.zeitgeistmovie.com/ Sphere: Related Content

25 Cool Windows 7 Keyboard Tricks That Will Impress Your Friends

Anyone working professionally with a computer has their hands on the keyboard most of the time. Reaching for the mouse can be an annoying disturbance and personally I often turn over my mouse in such situations. An easy solution is to simply keep the hands on the keyboard and complete as many tasks as possible with keyboard shortcuts only.

Apart from making you work more efficiently and faster, you can also impress your friends or colleagues by being able to work without a mouse. This article describes some cool Windows 7 keyboard tricks to get you started. In the end you might never want to take your hands off the keyboard again.

For your convenience, more keyboard shortcut resources are attached at the bottom.

Note that some of these shortcuts will only work if Windows Aero is enabled. If Aero effects are disabled on your computer, it might not be powerful enough to support resource intensive graphical features. The visual effects may also have been disabled to increase overall performance. If you wish to enable Aero nevertheless, have a look at my recent article explaining How To Enable and Troubleshoot Aero Effects in Windows 7.

Aero Shortcuts
•[Windows] + [Spacebar] (Aero Peek)
Make all open windows transparent to view gadgets and icons on desktop
•[Windows] + [D] (Aero Peek)
Show or hide the desktop.
•[Windows] + [Home] (Aero Shake)
Minimize all but selected window. Reverse by clicking the key combination again.
•[Windows] + left arrow OR [Windows] + right arrow (Aero Snap)
Dock selected window to the left or right half of your screen.
•[Windows] + up arrow OR [Windows] + down arrow (Aero Snap)
Maximized and restores the selected window.
•[Windows] + [SHIFT] + up arrow OR [Windows] + [SHIFT] + down arrow (Aero Snap)
Maximizes and restores selected window in vertical dimension only.
•[Windows] + [Tab] (Aero Flip)
Launch 3D representation of open windows and click [Tab] key again to flip through them.

Windows & Taskbar
•[Alt] + [Ctrl] + [Tag] + left/right/up/down arrow
Flip window.
•[Alt] + [Tab]
Cycle through open windows
•[Windows] + [T] OR [Windows] + [SHIFT] + [T]
Move focus to front or back of taskbar. Press [T] again while holding the [Windows] key to cycle through items in the taskbar from left to right or, with [SHIFT] button held too, from right to left.
•[Windows] + [B]
Puts focus on the ‘show hidden icons’ button on the system tray.
•[Windows] + [1] THROUGH [Windows] + [9]
Launch first through ninth icon on taskbar, including items pinned to taskbar.
•[Windows] + [SHIFT] + [1] THROUGH [Windows] + [SHIFT] + [9]
Starts new instance of respective taskbar icon.
•[Windows] + [Ctrl] + [1] THROUGH [Windows] + [Ctrl] + [9]
Cycles through multiple instances of the respective icon.
•[Windows] + [Alt] + [1] THROUGH [Windows] + [Alt] + [9]
Opens jump list for respective icon

Multiple Monitors
•[Windows] + [SHIFT] + right arrow OR [Windows] + [SHIFT] + left arrow
Move selected window from one monitor to another. They will remain in the same relative location.
•[Windows] + [P]
Select presentation display mode

Magnifier
•[Windows] + [+] OR [Windows] + [-]
Activates Windows Magnifier to zoom in or out of screen.
•[Ctrl] + [Alt] + [D]
Switch to docked mode.
•[Ctrl] + [Alt] + [L]
Switch to lense mode
•[Ctrl] + [Alt] + [F]
Switch from docked or lens mode back to full screen mode.
•[Ctrl] + [Alt] + [I]
Invert colors.
•[Windows] + [Esc]
Exist magnifier views.

Other
•[Windows] + [G]
Cycle through desktop gadgets.
•[Windows] + [X]
Launches Windows Mobility Center. Especially useful if you’re working on a laptop

Can’t get enough? The following articles describe lots of additional keyboard tricks and shortcuts to make use of:
The Essential Keyboard Shortcuts to whip your Windows
How To Launch Any Windows App At The Touch Of A Button by Jorge
Speed up Firefox Browsing with Keyboard Shortcuts
The most Essential Keyboard Shortcuts for Firefox
Some Cool Keyboard Tricks That Few People Know About by Tina
The Essential Keyboard Shortcuts to Tame your Google Calendar
The most Essential Keyboard Shortcuts for Google Reader

Which cool keyboard tricks did we miss and which ones are your favorites? Sphere: Related Content

Taking A Closer Look At Windows Resource Monitor

What is your computer doing in there? On the exterior it is a mass of plastics and metals, roughly pressed together to provide your PC with a protective case. But is it protecting your PC from the outside, or is it protecting you from the strange and arcane things happening inside your PC?

Perhaps it is time to find out exactly what your computer is up to – particularly if your computer is behaving badly. There are many third-party tools that can clean, scrub, and protect your PC, but none of those will help you better understand what’s going on. A program that can help you understand what is going on ships with every Windows PC. It’s called Windows Resource Monitor. Let’s take a look at what it can tell us.

Opening Windows Resource Monitor
Of course, we need to open Windows Resource Monitor before we can do anything. Windows Resource Monitor is a feature that was added in Vista and carries over to Windows 7. As far as I can gather, the only way to open it is through the Windows Task Manager - so press CTRL-ALT-DEL and open it.
Once Task Manager is open, go to the Performance tab. In the lower right hand corner is a button labeled Resource Monitor. Click it, and you’re ready to go!

The Basics
Windows Resource Monitor will, by default, open up to the Overview tab. This provides general, but useful, information about your computer. The best way to start becoming acquainted with Windows Resource Monitor is probably the graphs on the right side of the Overview tab. There are graphs here for your processor, hard disk, network and memory. These graphs will tell you how much of each is being used.
A computer at idle should display each graph as nearly flat. There may be minor spikes in usage, typically due to background processes, but these spikes should be few and they shouldn’t significantly consume system resources.

Other usage scenarios will result in distinct patterns. For example, it is normal to see high disk activity and high network usage when you are downloading a file. It is also normal to see high disk activity while your virus scanning software is operating.

Sudden (or not-so-sudden), unexplained spikes are not normal. They may be the result of bloatware (unwanted programs that come pre-installed in your system), an inefficient antivirus program, a program that did not close correctly or even malware.

A Deeper Look At CPU Usage
Open the CPU tab of Windows Resource Monitor. When you do so, the graphs on the right will change. You’ll now be shown a graph for each core Windows detects (or two graphs for each core if you have an Intel processor with Hyper-Threading enabled). The total CPU usage graph remains, as well.

But the most important information here is not the graphs. What you’ll need to take a closer look at is the text information under the labels of Processes and Services. A process is an active application, while a service is a background application that conforms to special rules (it can run automatically on boot, it can run when no user is logged on, etc).
When it comes to checking out processor usage, however, you’ll organize both using the same tactic. Simply organize the processes or services by the average CPU value. Tada! You now know what programs are taking up your processor’s power. Please note that common processes and services can sometimes appear under odd names in Windows Resource Monitor. Be sure to Google an unknown program and identify it before you close it.

Analyzing Memory Usage
The way your computer uses its short-term memory (RAM) is important to overall performance. If you’re running low on available memory you’ll find that your computer’s performance becomes sluggish.

RAM usage can be found under the Memory tab. A new, useful line graph appears at the bottom of Windows Resource Monitor. This graph shows you how much memory is in use, how much is on stand-by (containing active data, but not actively in use) and how much is completely free.
Ideally you’ll want to see some free memory on this graph. The real problem, however, comes when your in-use memory fills up most of the graph. This means you simply don’t have any RAM left to use! You can free up memory by organizing processes by their Working memory share and shutting down memory hogs. If your system has limited memory, however, you may simply need to add more memory to your PC.

Hard Disk & Network Usage
Most users underestimate the effect their hard drive can have on overall system performance. The speed with which you can download files, install programs, transfer information, and open programs can all be affected by your hard drive’s performance. Sometimes a program, such an anti-virus scanner, will bombard your hard disk with requests for information.
Opening up the Disk tab will show you the Processes with Disk Activity display. This shows you all the active processes that are consuming your hard disk’s time. You’ll usually see a few common Windows processors, like System and svchost.exe, listed here. But you may also see other programs. This may clue you in as to why programs are loading slowly.

Finally, take a look at the Network tab. You will again see a Processes with Network Activity display, which is very useful for tracking down programs that are making unwanted network connections (although nasty malware is often programmed to dodge Windows Resource Monitor or disguise itself as a more innocent process). You can also analyze your active network connections using the TCP connections display.

Conclusion
Familiarzing yourself with Windows Resource Monitor is a great idea. It is a very effective program that can tell you a lot about why your computer is behaving well or poorly. You can track down runaway programs and close them, and you can also see if a hardware upgrade is necessary to use the programs you prefer.

COMMENTS:
- Ctrl + Shift + Esc will open Task Manager (XP, Vista and Windows 7) without having to go through Ctrl + Alt + Del. This appears to be disabled on some brand name machines, but will work for most people.
- You can also type Resource Monitor (or just resmon,as resmon.exe) directly into the searchbox in the Start Menu to open it directly, funny thing is lot of windows 7 users doesn't know about this built-in utiity. Sphere: Related Content
If you’ve thought about buying an Intel processor lately – or a computer with an Intel processor installed – you may have heard the term “Hyper-Threading” launched at your eardrums. You probably aren’t familiar with this term unless you stay up-to-date with the nitty-gritty of computer hardware.

Understanding Hyper-Threading is important, however, because it’s a major feature on some Intel processors. Like most major processor features, it can be twisted and turned by the sales reps you meet. I’ve had a Fry’ store employee tell me that Hyper-Threading effectively doubles the number of cores on a processor. Although true in a sense, it’s mostly an exaggeration.

Let’s take a look at what Hyper-Threading really means.

A Brief History Of Hyper-Threading
Depending on when you last bought a computer, you may remember Hyper-Threading as a feature that Intel introduced and then discontinued. This could understandably leave a sour taste in your mouth – why would Intel discontinue it if it wasn’t trouble?

The truth isn’t so grim. Hyper-Threading was for a time made available on certain Intel Pentium 4 and Intel Xeon processors. It was discontinued not because the feature itself was bad, but rather because the processor that used it turned out to be a bit of a misstep for other reasons. The Pentium 4 architecture was a minor disaster for Intel because it was incapable of going the direction Intel hoped (Intel wanted to have Pentium 4 processors with clock speeds of up to 10 GHz). As a result, Intel jumped back to designing processors based on the Pentium Pro family tree.

Hyper-Threading was gone, but not forgotten. Intel eventually found the time and resources to integrate it into another new processor architecture - Nehalem. This is the architecture that is the basis for all current Intel Core i3, i5 and i7 processors.

Nice Threads, Man
Despite all of the advancements we’ve made in the world of processors, they still have one major limitation – an individual processor core can only execute one instruction at a time. Let’s say, for example, that you have MS Office, Firefox and Skype all open at once. You feel like you’re multi-tasking, but in processor terms you’re not. The processor core executing data related to these programs executes one instruction at a time, but because it is so quick you don’t notice any delay.
But there is a delay. That delay is due to how the data from each program is fed to the processor. Each stream of data – or thread- in to the processor must be scheduled and executed by the core individually. Hyper-threading, however, makes it possible for each processor core to schedule and assign resources to two threads at once.

Imagine a worker on an assembly line. There two types of widgets coming to her, and she needs to do different things with each widget. However, sometimes there is a delay because the conveyor belt is too slow, or because the wrong widget was sent at the wrong time. Hyper-Threading is like adding another conveyor belt so there is now one dedicated to each type of widget. There is still only one worker, but now widgets can be brought to her more quickly and efficiently so she is waiting for work less often.

Not The Same As Doubling Cores
If you boot up a dual-core processor with Hyper-Threading and open Windows Task Manager you will find yourself staring at four graphs. This is where most of the confusion about Hyper-Threading doubling the number of cores come into play. I’ve even spoken with one poor fellow who thought he’d purchased a eight-core processor because he saw eight graphs in Windows Task Manager. That’s what the sales rep told him, so when he went home and saw eight graphs, he was hooked. Seeing was believing.
Two graphs appear in Windows for each core on a Hyper-Threading processor because Windows is detecting two logical processors for each core. The term “logical processor” sounds fancy, but a logical processor is by definition a processor that has no physical existence. Windows can send threads to each logical processor, but there is still just one core doing the actual execution, so a single core with Hyper-Threading is dramatically different from two seperate physical cores.

The Benefit Of Hyper-Threading
Alright, enough with the technical mumbo-jumbo. Now let’s get down to the most important part – how Hyper-Threading will impact the performance of the computer are thinking of building or buying.

In terms of day-to-day tasks like web browsing, email and word processing, Hyper-Threading won’t have much of an impact. Yes, Hyper-Threading is theoretically better at multi-tasking. However, today’s processors are so fast that basic programs are rarely limited by the speed of your processor. The way programs are coded can also be a limitation. You may sometimes find that you have numerous programs open, but only one of your processor cores is being put to much use. That’s because the programs are, for whatever reason, not having their work divided among the different cores available.
When you’re trying to do some heavy lifting, however, Hyper-Threading can be more helpful. The applications most likely to benefit are 3D rendering programs, heavy-duty audio/video transcoding apps, and scientific applications built for maximum multi-threaded performance. But you may also enjoy a performance boost when encoding audio files in iTunes, playing 3D games and zipping/unzipping folders. The boost in performance can be up to 30%, although there will also be situations where Hyper-Threading provides no boost at all.

Conclusion
As the performance boost figure of only up to 30% indicates, Hyper-Threading is not the same as doubling the number of cores on a processor. If a sales rep ever tells you that, be careful, because they’re either ignorant or happy to lie to you if they think it will help push hardware.

With that said, Hyper-Threading is a cool feature, and it’s worth having. It’s particularly good if you like to edit media often or you use your computer as a workstation for professional programs like Photoshop or Maya. Sphere: Related Content

15 Sites that do Amazing Things with HTML5

The forthcoming HTML5 update to the 20 year old HyperText Markup Language promises to bring the “web” experience to a whole new level, allowing the browser to do more from both a visual and data perspective. Even though HTML5 is still a good distance away from being fully deployed, that hasn’t stopped many developers from pushing it to the limits.

Check out these amazing websites which really give you a good idea as to the capabilities of HTML5 as a programming language, doing things in your web browser that were once only possible in an external program or plugin. I’ve tested them in Chrome and they should all work in an HTML5 compliant browser such as Chrome, Firefox 4, Safari or IE9. They are demos and HTML5 is still a work in progress, so if you have problems viewing them you might want to try in another browser. Enjoy!

Arcade Fire – The Wilderness Downtown
This is a great demo done by Arcade Fire and Google which feature different HTML5 Canvas tricks. I don’t want to spoil the surprise for you – enter your childhood address and enjoy the video and technical wizardry.

WebVenture
WebVenture is an HTML5 and Javascript implementation of the MacVenture gaming platform. You can now play Deja Vu 1 & 2, Shadowgate and Uninvited right in your browser! Other game implementations such as Wolfenstein 3D are being worked on, bringing gaming into your browser.

20 Things I Learned About Browsers And The Web
This site from Google demos a “book” styled approach to a description about how web browsers work and how many of the underlying technologies work. Impressive from a technical standpoint, it also is a good primer for readers who would like to know more about how the web works.

Collaborative Drawing
This demo uses the HTML5 websockets feature to allow viewers to collaboratively – at the same time – draw on the canvas.

SketchPad
SketchPad is a “paint” program for the web. It supports rudimentary drawing instruments and is done only in HTML5 and JavaScript.

Galactic Plunder
Galactic Plunder is a 2D Space Shooter implemented in HTML5. Not quite as feature filled as a normal side scrolling shooter, it is done entirely in HTML5 which is impressive in itself.

Video Effects
HTML5 allows you to to much with video on the web. In addition to letting you play it without your web browser, with no plugin, it allows you to manipulate that video. This demo shows how you can “Blow up” the pixels of a video while playing.

Multiple Window Ball
This demonstrates and effect also seen in the Arcade Fire video. HTML5 allows you to open multiple windows and have objects move between them.

HTML5Rocks(Google)
HTML5 Rocks is a slideshow which demonstrates many of the special features of the HTML5 language. If you are a developer it gives you sample code and lets you see the possibilities of HTML5.

8-bit Color Cycling(Like Old School Games)
If you were a gamer in the early 90s you will remember this effect fondly. Since computational power was limited, graphic designers used ‘tricks’ to emulate video in a static image. This canvas effect will show you how it was done and also includes many examples which are beautiful as well.

HTML5 Experiments from Hakim.se
This site lists many demos of games and other neat little gadgets to show off what you can do with HTML5. Good for inspiration and maybe a little time diversion.

Harmony
Harmony is a neat little drawing program that lets you use cool brushes to paint a picture. You can create things such as “fur” and “web” which are just cool to see in creation.

Twitter/Music Mashup
This neat mashup from @9elements pits music and rotating dots with twitter posts about HTML5. Hard to describe in practice, must be seen to understand!

Radiohead/HTML5 Mashup
Another neat mashup which pits Radiohead’s Idioteque with a drawing of Thom Yorke which is drawn as the song progresses. Another “seen to be believed” effect.

Want More?
HTML5Demos / CanvasDemos
These two websites are set up to give views a wide variety of demos of HTML5 and the HTML5 Canvas effects. Ranging from the mundane to the “cool”, if you are thirsty for more these are the places to go.

There are many demos of HTML5 out there on the internet now – and it is well on its way to becoming the new standard of the web. Do you have awesome demos you would like to share? Please post in the comments below! Sphere: Related Content

10 Websites That Can Help The Beginner Programmer With Sample Code Snippets

I believe a nicer and friendlier term would be ‘social coding’. Sharing sample code is one of the little limbs of the larger open source movement. Freed from the straitjackets of profits, free sharing of technical information is quite common.

Sample code that is freely available is also a great learning aid. For the beginner programmer it’s not a shortcut; as a programmer you won’t get far if you take that shortcut. Free sample codes could be hints on how you can structure your own commands and functions to program better. Developers can piggyback on free sample programs and reuse snippets in their own code to save development time, cost, and sweat.

Ryan helped us out with the Top 10 Professional Sample Code Websites for Programmers. As a newbie, I went searching out for more.

Snipplr
A well designed code library which you can source for reusable code and you can also store your own. The site has a code search engine and you can really dive into the library using the advanced code search across a range of programming languages from A-Z. Or you can directly choose a language from the list given at the footer.

The site also has a few plugins like the Firefox and Safari Bookmarklets which make storing and retrieving code easy (see the directory mention).

Stack Overflow
Stack Overflow is a collaboratively edited question and answer site for programmers. The stockpile of answered queries is a potential goldmine. You can use the tags or browse the lists of questions or use the search box. The site is visually very clean and with the kind of common experiences we have, you are sure to find some solution to your coding problems here. If not, go directly into the chat rooms which are arranged according to languages and platforms.

Hot Scripts
48,000 code samples in over 1,000 categories from Ajax to XML is covering a lot. The site’s focus is on web development and so you will find the latest HTML5 code samples too. The site also runs a blog with some nice articles on coding dos and don’ts. If you are stuck, try out the web development forum for a bit of programming guidance.

Koders
Koders.com is an open source code search engine. It searches 3,338,449,289 lines of open source code. 33 programming languages are covered for you to find and reuse the code you want. You can also filter your search by licenses. The site also serves as a code repository for opens source projects.

DZone
Another code source where you can upload your code examples and share them with the larger community. The site is basically arranged like a blog. You can browse through the tags which seem to suggest that the site covers quite a few languages with Java and Ruby dominating.

The site also publishes free PDFs called REFCARDZ which are very useful cheat sheets for learners and developers.

Dream.in.code
A large programming and web development community that gives you tutorials, podcasts, a discussion board, a blog, and code snippets to download and use. The site covers around 25 languages and a few lesser known ones in a category called Other Languages. Java gets the most content. The site also has a small video channel on programming.

C-Sharp Corner
The site covers C#, C++, ASP.Net, VB, Visual Studio, Windows related technologies like Silverlight, and also web development. The site has a pretty good section on video tutorials too. The beginner programmer can head to the Beginner section and use the coding resources on C#.

Source Code Online
Do a code search or submit your own code and share it with the community. The site has a listing called Top Code which is perhaps counted on the basis of page hits or downloads. Though some of the links seemed broken, a lot of the others worked out. The categories lean towards web development, but you have ones on C/C++ and VB.Net too.

Forrst
Share code, screenshots, and links with others. The only slight hitch is that it’s an invite–only community. But if you apply and manage to get in, the combination of designers and developers under one virtual roof could be a timesaver for collaborative projects like web apps and websites. The homepage design looks inviting enough.

Github
This is the site where I got the phrase ‘social coding’ from and I think it perfectly describes what these sites do. Though the site has a paid section, the public repository of code samples is free. Github is an online host for open source projects. It uses the Git revision control system. It’s quite similar to the well known SourceForge and BitBucket. You can manage your source code files collaboratively, network socially, share code snippets with others, tap the job board, and go for drinks at the meetups.

These resources prove that whatever platform or language you are working on, the web is a huge melting pot of likeminded programmers who don’t mind sharing snippets of their work. That’s a bump up for the community. Tell us about your favorite code website and if you also share your stuff online. Sphere: Related Content

7 Free Useful eBooks That Every Blogger Should Read

I have never been one to read books or PDFs on my computer screen. Give me a paperback book, or a printed page, and I can get through it quickly, but sit me in front of a screen and I just can’t make myself read it. Now with the advent of eReaders like the Kindle, and tablets like the iPad, reading a book off a screen isn’t as hard as it used to be.
There is no end to the wealth of free eBooks available online today, from literature to books on social media, to teaching yourself how to use Linux. There is one topic, blogging, with countless eBooks available, both paid and free, and it just takes a little bit of digging to find some of the best ones out there. This list of 7 books is a good place to start, with advice for both beginners and advanced bloggers alike.

Deep Secrets of Successful Blogging
It may be a few years old, but the wealth of information contained in Chitika’s Deep Secrets of Successful Blogging makes it just as relevant a book today as when it was first posted on their site.

Featuring the words of wisdom of 30 prominent bloggers including Chris Pirillo and Darren Rowse amongst others, the free eBook contains encouragement, advice and guidelines for the aspiring blogger. Get the free eBook here.

279 Days to Overnight Succes
279 Days to Overnight Success by Chris Guillebeau is available for free download in PDF format from his website. Not only useful for bloggers, the free eBook is a must-read for any writer, artist or modern entrepreuner who wants to create an online presence for themselves.
Guillebeau uses his own journey to becoming a full-time writer as a guideline for others to follow. The free PDF is available for download here.
If his style appeals to you, be sure to check out his earlier tile, A Brief Guide to World Domination available for download here.

Viral Copy
Viral Copy by Brian Clark of Copyblogger takes on a very straightforward approach and can truly be seen as an essential guidebook for any blogger to read.

From the art of writing headlines to link baiting to how to use humour in your writing, Clark leaves no stone unturned, on how to drive traffic to your blog. In fact, you can see him put his own advice to good use with the links used in the eBook, making it hard to read the book offline.
Viral Copy is available for downlaod here.

Make Money Online With John Chow dot Com
At first glance, Make Money Online by John Chow book probably sounds like one of those get-rich-quick scams but don’t be fooled. There is no hidden secret that will make you reach instantaneously. Instead, John Chow gives you an outline on how to drive traffic to your site, as well as giving specific recommendations on ad networks, and most importantly, how to monetize your blog. The book is best suited for beginners who are just getting started and don’t know much about how to make money in the blogging world.

While the book is available in paperback from Amazon, John Chow offers it as a free download on his site here.

Traffic Roots
You’ll find that a lot eBooks about blogging focus on one specific topic – traffic. And rightly so, because without an audience to read what you’re writing – it all starts to feel futile. Traffic Roots by Jens Berget covers important topics like Search Engine Optimization, Email Marketing, Keyword Search and much more in over 130 pages of advice, tips and tricks.

Traffic roots is another ideal title for beginners, and may also contain some interesting tips for the slightly more advanced blogger. Download the PDF here.

Beginners Guide to Search Engine Optimization
If your focus is to learn more about Search Engine Optimization, and need an introductory explanation, the Beginners Guide to Search Engine Optimization is a great place to start.

The guide covers the basic terms, explains how it all works, and tells you what you need to do to make use of these concepts on your own website.

There is no direct link to download the book, but rather can have it emailed to you by submitting your email here.

Viral Marketing
Getting people to your blog is not just about SEO and link building. You also have to know how to market yourself. Viral Marketing by David Meerman Scott has been available for a couple of years but is a good place to start to understand what viral marketing is and what it takes to get in on the game.

The title is available for download here, along with a few other interesting titles by Scott.

What eBooks for bloggers are on your virtual shelf? Let us know in the comments. Sphere: Related Content

10 WordPress Tutorial Sites To Brush Up Your Blogging Skills

It’s just not enough to blog and upload your posts. If you have just launched your own starter blog on WordPress, you will realize that it pays to go under the hood of the WordPress platform. Thankfully, the WordPress platform is not as daunting as overhauling a V6 engine on a Ferrari; though it might seem so at first.

What really tilts the scale in favor of WordPress is the incredible knowledge base on WordPress that’s out there. From tips, tricks to hacks, the number of WordPress tutorials mirrors the popularity of this CMS tool.

Why only newbies? The rusty developer or administrator can also polish their skills on the range of lessons on WP. One of the best places to start off for a newbie is quite obviously the WordPress Codex itself which goes through the who, what, where, when, why, and how of the platform.

After the kickstart, these ten websites could be of help for finetuning your WordPress blog and making it gallop like a Ferrari.

WordPress TV
The video blog is a visual how-to on things that are WordPress. It is also an official resource from WordPress. Along with the line up of videos in A-W categories, you have interviews and discussions related around the WordPress platform.

You also get to watch a lot of highlights from WordCamp, the international WordPress event for the WordPress community.

WPCandy
WPCandy covers WordPress from all possible angles – news, editorials, reviews, podcasts, interviews, and of course WordPress tutorials. Then, you have a section which reviews WP tools and themes. The tutorials section is a mish-mash of quick tips and detailed how-tos. If you prefer listening, there’s an entire podcasts directory to tap into. You can also send WPCandy your story ideas and even write for them when openings come up.

WpRecipes
This two year old blog is one of the nicest resources you can find on WordPress. The site features quick and concise fixes for setting up WordPress to run smoothly. Most of the posts contain code snippets for configuring WordPress. Do read the comments too as they are also sources for tips and tweaks. A small forum (redirected) and a Themes section round off this blog.

Digging into WordPress
A dedicated WordPress blog by Chris Coyier & Jeff Starr covers a lot of ground with topics from administration to design. The frequency of posts is around one a week. Interspersed between the WP tutorials are links to tutorials on other blogs. So, there’s no shortage of stuff to learn from.

Wp Engineer
You won’t get a tutorial every other day on this WP site too. The frequency is around one per week. But the 240 odd WordPress tutorials are quite illustrative. The easy on the eyes design of the blog also helps.

WordPress Tutorials
The site aggregates WP tutorials from a variety of sources and rates them too. Although the site has gone a bit dormant now, with the last post in February, it’s worth a look because it has a collection of nearly 500 odd tutorials.

WP Tavern
The blog is designed to be a talking point on WordPress. It is a WordPress fan site with lots of posts that cover the platform. The blog is just about two years old. Go right below to browse the archives. The site also has a fairly active forum with discussion threads on topics like plugins, hacks, themes, troubleshooting tips etc.

WP Topics
WP Topics covers WordPress news, developments, and tutorials like a news aggregator. Influential WordPress sites are tapped and you get to read articles on coding and design from some sites we have covered here and some which we have not.

WP Stack Exchange
You can also call this a WordPress Q&A service. It’s not tutorial related but it answers any doubts you might have as an administrator or a developer about configuring WordPress. Look around using the search bar or the tags if the query has already been asked on the site. Also check out the FAQ which gives some pointers on how to use this Q&A service.

SeekWP
SeekWP is a realtime search engine for WP tips and theme information. You can type in a keyword and use the dropdown to select Themes or Tips, or do an all inclusive search. It is a really nice shortcut to take because the WordPress universe is expanding each day.

With the above ten I have tried to cover resources which are solely on WordPress. There are some great sites that have separate sections on WordPress filled with instructive tips and tricks. For instance, our own website has around 50 WordPress posts (and climbing).

Just like me, if you are starting to tinker around with the platform, you will get an inkling of why WordPress is sitting pretty as one of the best CMS solutions around. Do let us know your favorite WordPress tutorial resource too. Sphere: Related Content

HTML 5: 8 Best Websites For Quality HTML Coding Examples

Ever since I first started learning about HTML back in the 90′s, I’ve always found it nearly impossible to find good, solid HTML examples on the Internet. It would have been nice to have a few websites that offer the latest, coolest dynamic website coding examples.

Well, a lot has changed since the 90′s, and the advent of dynamic web coding languages like PHP really make HTML old-school. Then again, you have to understand old-school HTML before you can understand the languages that dynamically create the HTML that browsers display.

Thankfully, there are now some awesome websites that do offer well-designed and useful HTML coding examples and tutorials. There are certainly still a whole lot of pretty crappy HTML-tutorial websites out there so I decided to pull together eight of my favorite websites. I should mention that MUO is probably the first place to start, with cool articles like Simon’s on basic HTML, Tina’s article on cool HTML effects, and Guy’s HTML tips to help your website load faster.

The following eight sites not only offer a good, solid foundation on HTML coding, but they also offer the best learning environment, with tools you can use to test out what you learn.

Top 8 Websites For HTML Coding Examples

HTML Dog
One of my favorite sites that I usually check first whenever I forget the basic syntax for HTML statements is HTML Dog. The site is well-designed, unlike 90 percent of the web design websites out there that look like they were built in the 1990′s and never updated. The format is simple and fast – just click on the tutorial topic on the left and you can read it on the right.
HTML Dog provides clear examples in white code boxes which you can copy and paste into your own HTML code. When you’re ready for more advanced coding, you can scroll down the left menu and explore the “HTML Advanced” or CSS areas.

W3Schools
Now, while HTML Dog is my favorite when it comes to checking basic syntax, W3Schools is the place I usually go when I want to get a bit fancy with my web coding. It’s one of the more popular resources for all simple and dynamic coding examples, from PHP through XML and Javascript – but you’ll also find an awesome section filled with basic HTML coding examples
The cool thing about W3Schools is that they’ve incorporated a useful split-screen tool where you can test out the code you learn in each lesson. Just tweak the HTML a bit, click “Edit and Click Me” and you’ll see the results in the area to the right. Very useful!

Quackit
Another site that’s on the same level as W3Schools in terms of usefulness and modern design is Quackit. Yes, the name is a little goofy, but the site provides volumes of helpful examples

LandOfCode
Another site that offers the useful split-screen tool for testing HTML code is LandOfCode. While the main site offers a fair number of HTML examples, the formatting of the site leaves a little bit to be desired. However, access to the useful split-screen HTML test area more than makes up for it.

This one is actually a little bit more advanced than the W3Schools tool because it has additional buttons that’ll let you view the results in a new window, not just in the display area to the right.

Ove Klykken
Another site that is actually pretty useful once you start branching out into the more advanced formatting areas is Ove Klykken’s blog.
While you’ll definitely find articles with basic HTML coding examples on the blog, the really cool thing about the site is the new, unique coding examples offered in CSS, such as a CSS photo gallery, rollover images or creating transparent images.

EchoEcho
A couple more websites that I wanted to touch on aren’t the best of the best – but they do stand above other HTML code sites because they’re well written, well formatted and cover the topic thoroughly. The first of those is EchoEcho.
This site is actually devoted to offering a lot more than tutorials – there’s a forum, articles and more. But the HTML tutorials area is really thorough and useful.

Java2s
The HTML/CSS section of the Java2s website is another example of valuable basic HTML information getting buried within advanced coding tutorials, but once you find it there are lots of useful HTML coding examples.

Webpages That Suck
Finally, because it’s always a good idea to learn how to code by seeing examples of how not to code, I have to give kudos to one of the most useful sites on the Internet that all students that are new to HTML should bookmark. The site is called WebPagesThatSuck.

Here, you’ll find examples of both good and bad web coding. Some of the daily web-design mistakes uncovered in the “Daily Sucker” section are pretty funny.

Do you know of any other really useful HTML example resources for web programmers that are just learning how to create webpages? Share your own resources in the comments section below.

(By) Ryan, an automation engineer on the East Coast (U.S.) who enjoys discussing the latest trends of online writing and freelancing. Visit his blog at FreeWritingCenter.com to read up on the latest online writing trends and freelance money-making opportunities. Sphere: Related Content

29/11/10

10 mistakes every programmer makes

Admit it, you've made mistakes like these…
By Julian M Bucknall

When you start programming, you get disillusioned quickly. No longer is the computer the allinfallible perfect machine – "do as I mean, not as I say" becomes a frequent cry.

At night, when the blasted hobgoblins finally go to bed, you lie there and ruminate on the errors you made that day, and they're worse than any horror movie. So when the editor of PC Plus asked me to write this article, I reacted with both fear and knowing obedience.

I was confident that I could dash this off in a couple of hours and nip down to the pub without the usual resultant night terrors. The problem with such a request is, well, which language are we talking about?

I can't just trot out the top 10 mistakes you could make in C#, Delphi, JavaScript or whatever – somehow my top ten list has to encompass every language. Suddenly, the task seemed more difficult. The hobgoblins started cackling in my head. Nevertheless, here goes…

1. Writing for the compiler, not for people
When they use a compiler to create their applications, people tend to forget that the verbose grammar and syntax required to make programming easier is tossed aside in the process of converting prose to machine code.

A compiler doesn't care if you use a single-letter identifier or a more human-readable one. The compiler doesn't care if you write optimised expressions or whether you envelop sub-expressions with parentheses. It takes your human-readable code, parses it into abstract syntax trees and converts those trees into machine code, or some kind of intermediate language. Your names are by then history.

So why not use more readable or semantically significant identifiers than just i, j or x? These days, the extra time you would spend waiting for the compiler to complete translating longer identifiers is minuscule. However, the much-reduced time it takes you or another programmer to read your source code when the code is expressly written to be self-explanatory, to be more easily understandable, is quite remarkable.

Another similar point: you may have memorised the operator precedence to such a level that you can omit needless parentheses in your expressions, but consider the next programmer to look at your code. Does he? Will he know the precedence of operators in some other language better than this one and thereby misread your code and make invalid assumptions about how it works?

Personally, I assume that everyone knows that multiplication (or division) is done before addition and subtraction, but that's about it. Anything else in an expression and I throw in parentheses to make sure that I'm writing what I intend to write, and that other people will read what I intended to say.

The compiler just doesn't care. Studies have shown that the proportion of some code's lifecycle spent being maintained is easily five times more than was spent initially writing it. It makes sense to write your code for someone else to read and understand.

2. Writing big routines

Back when I was starting out, there was a rule of thumb where I worked that routines should never be longer than one printed page of fan-fold paper – and that included the comment box at the top that was fashionable back then. Since then, and especially in the past few years, methods tend to be much smaller – merely a few lines of code.

In essence, just enough code that you can grasp its significance and understand it in a short time. Long methods are frowned upon and tend to be broken up.

The reason is extremely simple: long methods are hard to understand and therefore hard to maintain. They're also hard to test properly. If you consider that testing is a function of the number of possible paths through a method, the longer the method, the more tests you'll have to write and the more involved those tests will have to be.

There's actually a pretty good measurement you can make of your code that indicates how complex it is, and therefore how probable it is to have bugs – the cyclomatic complexity.

Developed by Thomas J. McCabe Sr in 1976, cyclomatic complexity has a big equation linked to it if you're going to run through it properly, but there's an easy, basic method you can use on the fly. Just count the number of 'if' statements and loops in your code. Add 1 and this is the CC value of the method.

It's a rough count of the number of execution paths through the code. If your method has a value greater than 10, I'd recommend you rewrite it.

3. Premature optimisation
This one's simple. When we write code, sometimes we have a niggling devil on our shoulder pointing out that this clever code would be a bit faster than the code you just wrote. Ignore the fact that the clever code is harder to read or harder to comprehend; you're shaving off milliseconds from this loop. This is known as premature optimisation.

The famous computer scientist Donald Knuth said, "We should forget about small efficiencies, say about 97 per cent of the time: premature optimisation is the root of all evil."

In other words: write your code clearly and cleanly, then profile to find out where the real bottlenecks are and optimise them. Don't try to guess beforehand.

4. Using global variables
Back when I started, lots of languages had no concept of local variables at all and so I was forced to use global variables. Subroutines were available and encouraged but you couldn't declare a variable just for use within that routine – you had to use one that was visible from all your code. Still, they're so enticing, you almost feel as if you're being green and environmentally conscious by using them. You only declare them once, and use them all over the place, so it seems you're saving all that precious memory.

But it's that "using all over the place" that trips you up. The great thing about global variables is that they're visible everywhere. This is also the worst thing about global variables: you have no way of controlling who changes it or when the variable is accessed. Assume a global has a particular value before a call to a routine and it may be different after you get control back and you don't notice.

Of course, once people had worked out that globals were bad, something came along with a different name that was really a global variable in a different guise. This was the singleton, an object that's supposed to represent something of which there can only be one in a given program.

A classic example, perhaps, is an object that contains information about your program's window, its position on the screen, its size, its caption and the like. The main problem with the singleton object is testability. Because they are global objects, they're created when first used, and destroyed only when the program itself terminates. This persistence makes them extremely difficult to test.

Later tests will be written implicitly assuming that previous tests have been run, which set up the internal state of the singleton. Another problem is that a singleton is a complex global object, a reference to which is passed around your program's code. Your code is now dependent on some other class.

Worse than that, it's coupled to that singleton. In testing, you would have to use that singleton. Your tests would then become dependent on its state, much as the problem you had in testing the singleton in the first place. So, don't use globals and avoid singletons.

5. Not making estimates
You're just about to write an application. You're so excited about it that you just go ahead and start designing and writing it. You release and suddenly you're beset with performance issues, or out-of-memory problems.

Further investigations show that, although your design works well with small number of users, or records, or items, it does not scale – think of the early days of Twitter for a good example. Or it works great on your super-duper developer 3GHz PC with 8GB of RAM and an SSD, but on a run-of-the-mill PC, it's slower than a Greenland glacier in January.

Part of your design process should have been some estimates, some back-back-of- the-envelope calculations. How many simultaneous users are you going to cater for? How many records? What response time are you targeting?

Try to provide estimates to these types of questions and you'll be able to make further decisions about techniques you can build into your application, such as different algorithms or caching. Don't run pell-mell into development – take some time to estimate your goals.

6. Off by one
This mistake is made by everyone, regularly, all the time. It's writing a loop with an index in such a way that the index incremented once too often or once too little. Consequently, the loop is traversed an incorrect number of times.

If the code in the loop is visiting elements of an array one by one, a non-existent element of the array may be accessed – or, worse, written to – or an element may be missed altogether. One reason why you might get an off-by one error is forgetting whether indexes for array elements are zero-based or one-based.

Some languages even have cases where some object is zero-based and others where the assumption is one-based. There are so many variants of this kind of error that modern languages or their runtimes have features such as 'foreach loops' to avoid the need to count through elements of an array or list.

Others use functional programming techniques called map, reduce and filter to avoid the need to iterate over collections. Use modern 'functional' loops rather than iterative loops.

7. Suppressing exceptions
Modern languages use an exception system as an error-reporting technique, rather than the old traditional passing and checking of error numbers. The language incorporates new keywords to dispatch and trap exceptions, using names such as throw, try, finally and catch.

The remarkable thing about exceptions is their ability to unwind the stack, automatically returning from nested routines until the exception is trapped and dealt with. No longer do you have to check for error conditions, making your code into a morass of error tests.

All in all, exceptions make for more robust software, providing that they're used properly. Catch is the interesting one: it allows you to trap an exception that was thrown and perform some kind of action based upon the type of the exception.

The biggest mistakes programmers make with exceptions are twofold. The first is that the programmer is not specific enough in the type of exception they catch. Catching too general an exception type means that they may be inadvertently dealing with particular exceptions that would be best left to other code, higher up the call chain. Those exceptions would, in effect, be suppressed and possibly lost.

The second mistake is more pernicious: the programmer doesn't want any exceptions leaving their code and so catches them all and ignores them. This is known as the empty catch block. They may think, for example, that only certain types of exceptions might be thrown in his code; ones that they could justifiably ignore.

In reality, other deadly runtime exceptions could happen – things such as out-of-memory exceptions, invalid code exceptions and the like, for which the program shouldn't continue running at all. Tune your exception catch blocks to be as specific as possible.

8. Storing secrets in plain text
A long time ago, I worked in a bank. We purchased a new computer system for the back office to manage some kind of workflow dealing with bond settlements. Part of my job was to check this system to see whether it worked as described and whether it was foolproof. After all, it dealt with millions of pounds daily and then, as now, a company is more likely to be defrauded by an employee than an outsider.

After 15 minutes with a rudimentary hex editor, I'd found the administrator's password stored in plain text. Data security is one of those topics that deserves more coverage than I can justifiably provide here, but you should never, ever store passwords in plain text.

The standard for passwords is to store the salted hash of the original password, and then do the same salting and hashing of an entered password to see if they match.

Here's a handy hint: if a website promises to email you your original password should you forget it, walk away from the site. This is a huge security issue. One day that site will be hacked. You'll read about how many logins were compromised, and you'll swallow hard and feel the panic rising. Don't be one of the people whose information has been compromised and, equally, don't store passwords or other 'secrets' in plain text in your apps.

9. Not validating user input
In the good old days, our programs were run by individuals, one at a time. We grew complacent about user input: after all, if the program crashed, only one person would be inconvenienced – the one user of the program at that time. Our input validation was limited to number validation, or date checking, or other kinds of verification of input.

Text input tended not to be validated particularly. Then came the web. Suddenly your program is being used all over the world and you've lost that connection with the user. Malicious users could be entering data into your program with the express intent of trying to take over your application or your servers.

A whole crop of devious new attacks were devised that took advantage of the lack of checking of user input. The most famous one is SQL injection, although unsanitised user input could precipitate an XSS attack (crosssite scripting) through markup injection.

Both types rely on the user providing, as part of normal form input, some text that contains either SQL or HTML fragments. If the application does not validate the user input, it may just use it as is and either cause some hacked SQl to execute, or some hacked HTML/JavaScript to be produced.

This in turn could crash the app or allow it to be taken over by the hacker. So, always assume the user is a hacker trying to crash or take over your application and validate or sanitise user input.

10. Not being up to date
All of the previous mistakes have been covered in depth online and in various books. I haven't discovered anything new – they and others have been known for years. These days you have to work pretty hard to avoid coming into contact with various modern design and programming techniques.

I'd say that not spending enough time becoming knowledgeable about programming – and maintaining that expertise – is in fact the biggest mistake that programmers make. They should be learning about techniques such as TDD or BDD, about what SLAP or SOLID means, about various agile techniques.

These skills are of equal or greater importance than understanding how a loop is written in your language of choice. So don't be like them: read McConnell and Beck and Martin and Jeffries and the Gang of Four and Fowler and Hunt & Thomas and so on. Make sure you stay up to date with the art and practice of programming.

And that concludes my top 10 list of mistakes programmers make, no matter what their language stripe. There are others, to be sure, perhaps more disastrous than mine, but I would say that their degree of dread is proportional to the consequences of making them.

All of the above were pretty dire for me the last time I made them. If you have further suggestions or calamities of your own, don't hesitate to contact me and let me know.

-------------------------------------------------------------------------------------------------------

First published in PC Plus Issue 300 Sphere: Related Content

A history of viruses on Linux

Brandon Boyce
27 November 2010 - 17:44

We recently gave you a brief history of viruses on the Mac and as requested by a user we wanted to give you a history of viruses on Linux. Given the tight security integrated into Linux, it is difficult to take advantage of a vulnerability on the computer, but some programmers have found ways around the security measures. There are several free options for anti-virus on Linux that you really should use, even if it isn't always running - a weekly or monthly scan doesn't hurt. Free anti-virus solutions include: ClamAV, AVG, Avast and F-Prot.

1996:
The cracker group VLAD wrote the first Linux virus named Staog. The virus took advantage of a flaw in the Kernel that allowed it to stay resident on the machine and wait for a binary file to be executed. Once executed the virus would attach itself to that file. Shortly after the virus was discovered the flaw was fixed and the virus quickly became extinct. VLAD was also responsible for writing the first known virus for Windows 95, Boza.

1997:
The Bliss computer virus made its way out into the wild. The virus would attach itself to executables on the system and prevent them from running. A user had to have root access for the virus to be affected, and to this day Debian lists itself as still being vulnerable to this virus. The threat to Debian is minimal though as users do not typically run as root.

1999:
No significant viruses were reported this year but oddly enough a hoax message went around stating there was a virus that was threatening to install Linux on your computer. At the time the Melissa virus was ravaging PCs worldwide and on April 1, 1999 (April Fools Day) a message went out warning that a virus named Tuxissa was running about secretly installing Linux on unsuspecting computers.

2000:
A rather harmless virus, Virus.Linux.Winter.341, showed up and inserted itself into ELF files; ELF files are executable Linux files. The virus was very small, only 341 bytes, and would insert LoTek by Wintermute into the Notes section of an ELF file. The virus was also supposed to change the computer name to Wintermute but never gained control of a machine to effect the change.

2001:
This was an eventful year for Linux viruses; the first was the ZipWorm, a harmless virus that would simply attach itself to any zip files located in the same directory it was executed in. Next was the Satyr virus which was also a harmless virus, it would simply attach itself to ELF files adding the string unix.satyr version 1.0 (c)oded jan-2001 by Shitdown [MIONS], http://shitdown.sf.**(edited as URL causes Avast to block page). There was also a virus released called Ramen which would replace index.html files with their own version displaying Ramen Crew at the top and a package of Ramen Noodles at the bottom. Later a worm by the name of Cheese came out that actually closed the backdoors created by the Ramen virus. There were several other viruses released this year that were relatively harmless.

2002:
A vulnerability in Apache led to the creation and spread of the Mighty worm. The worm would exploit a vulnerability in Apache's SSL interface, then infect the unsuspecting victims computer. Once on the computer it would create a secret connection to an IRC server and join a channel to wait for commands to be sent to it.

2003:
Another harmless virus showed up, it was called the Rike virus. The virus, which was written in assembly language, would attach it self to an ELF file. Once attached it would expand the space the file required and write RIKE into that free space.

2004:
Similar to the virus from the previous year, the Binom virus would simply expand the size of the file and write the string [ Cyneox/DCA in to the free space. The virus was spread by executing an infected file.

2005:
The Lupper worm began spreading to vulnerable Linux web servers. The worm would hit a web server looking for a specific URL, then it would attempt to exploit a vulnerable PHP/CGI script. If the server then allowed remote shell command execution and file downloads, it would become infected and begin searching for another server to infect.

2006:
A variant of the Mighty worm from 2002 named Kaiten was born. It would open a connection to an IRC channel and wait for commands to be sent and executed.

2007:
An exploit in OpenOffice led to the spread of a virus named BadBunny. This virus would infect Windows, Mac and Linux machines. The virus creates a file called badbunny.py as an XChat script and creates badbunny.pl, a Perl virus infecting other Perl files. There was also a trojan horse released by the name of Rexob. Once on the machine, it would open a backdoor allowing remote code execution.

2009:
A website for GNOME users to download screensavers and other pieces of eye-candy unknowingly hosted a malicious screen saver called WaterFall. Once installed on the machine it would open up a backdoor that when executed would cause the machine to assist in a distributed denial of service attack (DDOS). The DDOS attack was very specific and targeted a specific website, MMOwned.com.

2010:
The koobface virus, a virus that spreads through social networking sites targets Windows, Mac and, in a more recent variant, Linux computers. Once infected, the virus attempts to gather login information for FTP and social networking sites. Once your password has been compromised the virus will send an infected message to all of your friends in your social network.

This is by no means a complete list of Linux viruses but it does cover the major ones. It also points out that most of the viruses found on Linux are fairly harmless. That doesn't mean they don't exist though. Be sure to keep an eye on what your downloading and where you're going on the Internet and you will most likely stay virus free. An occasional virus scan wouldn't hurt either.

Sources:
hackinglibrary.ws
wikipedia.org
irc-security.de
securelist.com
f-secure.com
cnet.com
techrepublic.com
lwn.net
crenk.com Sphere: Related Content