Computers

Logitech is here at CES and when I need new computer gaming peripherals, they’re the first place I turn.

One of the new gadgets they have here is the G602 Wireless Gaming Mouse, and it’s awesome.

Here’s my video review, recorded on the CES 2014 show floor at the Logitech Live booth.

It has tons of thumb buttons, which will be perfect for toggling weapon groups or overheating in EVE Online, and it fits in my hand perfectly.

If I don’t win one here at the convention, I’m definitely buying one when I get home.

Two weeks ago I discussed a thought exercise that will help you get in the right frame of mind for doing some computer programming.

Today, I want to help you get an Integrated Development Environment (IDE) set up, so you can follow along with my examples in the coming articles.

The Language: Java

jv0h

The programming language of choice is Java. Java has several advantages for us than other languages:

  • Java has fantastic documentation.  Sun / Oracle, who controls the Java Language, has a large library of documentation on functions, interfaces and other important bits.  There are also loads of tutorials.
  • Java is Object Oriented.  This means that all of our Java code has to do with things, rather than more abstract ideas like memory locations, pointers and other stuff that makes my head hurt.
  • Java is platform independent.  This is the biggest reason for Java’s success.  You write code once, and you can run it anywhere: Mac, Windows, or Linux.  I’ll go into more detail on this later.
  • Java is everywhere, primarily due to the points above.

So, we’re using Java because it’s the biggest thing in programming right now, it’s very approachable, and it won’t matter what computer you’re using to follow along, the code is identical for everyone.

The IDE: Eclipse

eclipseSo, here’s what you want to download: Eclipse.  Eclipse is an IDE, and the package I’ve linked to includes the packages for working with Java and using GIT to keep backups of your code.  GIT is also how I’ll be giving you sample code, via GitHub.com.  Don’t worry, you don’t have to make a GitHub account to access my code, but you will need one to upload code if you ever want to send me your code.

 Here’s why I like Eclipse:

  • Real-time compliation level errors:  Normally when you write code and you typo a variable or function name, mismatch some curly brackets ({}), or whatnot, you don’t find out until you attempt to compile your code.  Eclipse examines your code as you type, and gives you error and warning flags when you type variables you haven’t declared or mistype function names.  This is a huge time saver.
  • Eclipse integrates Git, so you can keep remote backups of your code up to date with just a few clicks of your mouse.
  • Eclipse has support for several programming languages, so if you ever want to branch out from Java, you don’t have to learn a new IDE along with a new language.

Homework

  1. Download Eclipse and install it.
  2. Bookmark the Java 7 API Reference, Java SE Tutorials, and GitHub.
  3. Comment here with ideas for what sort of program we should make
  4. OPTIONAL: Make a GitHub account, and post your username.

Whenever you meet someone new, one of the first questions that comes up is “What do you do?”

For me, the answer is programming.  For some, that brings to mind the classical TV/movie trope of Mountain Dew, thick glasses, a pocket protector and walls of unorganized computers and blinking lights.  For others, I instantly get slotted as someone who knows how to program VCRs and can fix their computer.

My hope for this series is to dispel some of the stereotypes surrounding programming, confirm others, and give you a chance to learn some programming skills of your own, if you’re so inclined.

Programming 101: PB & J

If you’ve ever been to a summer camp, or leadership training or anything that required team building, you may have done the PB&J exercise.

Everyone sits in a room facing a table, which has a jar of Peanut Butter, a jar of Jelly, a loaf of bread and a knife.  Usually the team leader sits at the table, and calls out the most confident person in the room.  That person sits in the front of class, with their back to the table, and has to give instructions to the person at the table, and get them to make a PB&J.

The twist is, the person at the table pretends be an alien and has no idea what a PB & J is (let alone a sandwich), is mute and can’t give feedback, only follows the instructions of the person who  has their back to the table, and follows them to the letter.  The person assembling the sandwich doesn’t know how to open the jars.  Doesn’t know how to use the knife.  Doesn’t know how to untie the twisty-tie holding the loaf of bread together, has no idea what “spread” means, etc.

OM NOM NOM…

If you’ve never seen this, it’s hilarious, and usually ends with the assembly person covered in PB & J, a mess all over the table, and a hungry audience.

Continue Reading

Today’s post has nothing to do with models, and everything to do with the machine you’re (likely) viewing this blog on.  If you’re a Mac owner, congratulations on choosing a platform that gives free upgrades to the Operating System (OS).  That’s pretty dang handy.  If you’re a Linux User, your OS is not the limiting factor in your computer speed, so go play with your root – this article isn’t for you.

Why should the rest of you listen to me?  I have a Computer Engineering degree from Purdue University, and all my family members make me program their DVRs.  So there.

A Foundation

A computer is like a kid doing math homework.  The book containing the problems and instructions is the Hard Drive: permanent storage.  The pencil and paper are the computer’s RAM: it’s the (temporary storage) space used to execute the instructions.  The kid’s brain is the processor: interpreting the instructions and generating output, step-by-step.

Those are the three primary components of a computer: Hard Drive (permanent storage), RAM (temporary storage) and processor (executes instructions).  If any of those components gets bogged down, or becomes insufficient compared to the other two, the computer slows down.

Operating System

Firstly, if you’re reading this far, I’m assuming you have a Windows Operating System (OS).  If it’s XP or Windows 7, skip ahead.  If you have Vista, get a box of Kleenex.

Vista was a great idea, executed horribly; primarily due to it’s RAM management.  Whenever a program gets started up, it requests some room in the computer’s RAM.  This takes a small, but not insignificant amount of time.  The PC has to check how much RAM is available, what sections are free, and if there’s not enough room, it has to juggle multiple programs.

Vista took the following approach to RAM:  If Vista requests about half the RAM, it won’t have to rely on the hardware (the physical chips on the circuit boards) to manage RAM – Vista can manage the RAM space in software.   IE, Microsoft took control away from the circuit builders, and tried to do everything on it’s own.

While that’s a great idea, the problem becomes apparent when you realize that a processor can only execute one instruction at a time.  This means that Vista has several thousands of extra instructions it has to get through every time a program starts or is running.  That wouldn’t be a problem if the processor was faster and could handle the necessary volume, but of course, that’s not the case.

What ends up happening is that the computer is perpetually stuck in rush hour traffic on the highway.  The processor speed (road size in the rush hour analogy) hasn’t changed, but all of a sudden, there’s 10 times the traffic, and stuff just gets backed up.

How do you fix this?  You don’t.  Neither did Microsoft.  They just said “oops” and released Windows 7, which is essentially Vista, but without the custom RAM management.  They went back to letting the chips handle the musical chairs.  So, if you have Vista – upgrade to Windows 7 (or downgrade back to XP if you can find a copy).

Sorry.

Task Bar Party

Look down at the task bar, in the bottom right of the Windows screen.  There’s a small section that has icons in it, usually one per program running.  Often, there’s a button on the left side of the section, expanding it.  If there’s more than about 4-5 icons in there when your computer is sitting doing nothing, you are probably suffering from a RAM bottleneck.

Computer programs are selfish and conceited.  When most programs are installed, they add themselves to a list of programs that are executed whenever a computer starts up (cleverly enough, this is called the startup list).  They do this so that their major functions are pre-loaded into the Operating System.  That way, when you choose to start the program, it loads faster, thus looking like a nice, quick, easy-to-use program.

Great idea, right?  Sure, if it’s only 1-2 programs.  Unfortunately, every program does this, and over the course of a few months or years, your computer is struggling to maintain 20-30 pre-loaded programs and their functions, as well as whatever actual tasks you’re doing while on the computer.

Going back to the kid doing math analogy, it’s like asking the kid to do his homework while someone paints on his worksheet with a paintbrush, and another person is setting it on fire, and a third is trying to eat it.  There’s no way he’s going to get anything done – he’ll have to keep re-starting the math problem over and over and over again.

How do you fix this?  Try this.

Or, use my 5 step process:

  1. Click Start (then click RUN in XP)
  2. Type “msconfig” (without quotes), hit enter
  3. Select the “Startup” tab
  4. Click “Deselect All”
  5. Click Exit (Restart when prompted)

Ta Da!

Hard Drive Bottleneck

This is the last of my solutions, and one that is sometimes hard to diagnose.  While your Hard Drive may have plenty of space, if it has to work too hard to retrieve the data you want, then this can result in a slow PC.

Imagine you are tasked with maintaining a record, and all you have is a pen and paper.  As the record is told to you, you write it down.  However, the person who is telling you this record keeps amending what they mention earlier.  Now imagine that you cannot go back and correct your previous entry.  Instead, to keep track of changes and updates, you must add an addendum each time a change or update occurs.  Over time, you have a mangled, tangled mess of original data, changes and updates to that data, and some how you have to remember how it all relates to each other.  It would be a nightmare.

That is a Hard Drive’s world.  It cannot insert data into the middle of a record, instead, it can only attach it to the next available chunk of free space, and then map that small update to where it should be long in the original group of data.  So, if you have a folder of mp3s that you’ve been collecting for years, those mp3s are not all lumped nicely on the Hard Drive like they are on your desktop.  Instead, they are scattered all over the Hard Drive, because they were put where ever there was enough room.

To fix this problem, one must de-fragment the Hard Drive.  This is a long, grueling process, and is best done overnight.  When a Hard Drive is defragmented, it looks at all the data on the disk, and figures out what chunks belong together.  Then, it uses the computer’s RAM as temporary storage, and starts shuffling chunks of data until they bits and pieces are grouped better.  This means the Hard Drive is no longer having to jump all over it’s records to play a single song or display a document.

Disk defragmentation is easily started by doing the following:

  1. Right-click on your Hard Drive, and select Properties.
  2. Find a “Hardware” or “Tools” tab.
  3. Click on the “Defragment” button.
  4. Click the “Defragment Now” button.
  5. Go to Bed.

I highly suggest defragmenting 3-4 times a year.  If you download lots of stuff, or if you’re a writer or video gamer, defragment more often.

Conclusion

The two most common causes of slow PCs are too many programs running during startup, or a messy Hard Drive.  So long as you keep those two issues under check, your PC should run as fast as it did when it came off the assembly line.

If you have any questions regarding Computers, feel free to ask in the comments below!