A few months ago Google rolled out Google Mobile Sync. This syncs your Google calendar and contacts to your mobile phone. On Windows Mobile, you don’t even need any software for it. It runs right through the built in Active Sync interface in Windows. Syncing happens very quickly, and it is very smart about resolving conflicts when both the mobile and on-line calendars change. I was surprised to see that Sync also pulled the photos from my phone that are associated with contacts and put them into GMail contacts as well.

Bonus Tip: When you’re using Google calendar, or a widget, use natural language to enter your events. “Lunch with Jim 12:30 Tuesday at Quiznos” Google will figure out and fill in the date, time, event and location and set up the appointment automatically.

My new computer with Vista-64 arrived yesterday, and now that I’ve got the majority of my data copied over and programs installed, I’m compiling my thoughts on both Vista and the 64-bit environment.

The first thing that I noticed is that you need to be careful to look for the 64-bit downloads for the software that you’re installing. I ended up downloading and re-installing things several times after I ran a program and realized that it was running in 32-bit mode.

How can you tell if something is running in 32-bit mode? Open up task manager and look at the processes tab, in the image name column look for a *32 after the name of the file. If it’s there, then it is running in 32-bit mode. I’ve also noticed that programs that run as services, such as backup and AV programs, run their configuration applications in 32-bit mode, but if you look at the all process tab, I’ve found that the underlying engine that actually does the scanning or backing up runs in 64-bit mode.

Here are some of the programs that I use regularly and their 64-bit status.

  • Firefox – The 64-bit version is called “Minefield” You can have this and Firefox installed simultaneously, and they share extensions, preferences, history and cookies. This is convenient so you don’t have to maintain two separate copies.
  • JungleDisk – You’ll need to download the 64-bit version of JungleDisk. Every part of the application runs in 64-bit.
  • Adobe Flash – Flash is not yet supported in 64-bit browsers, both Minefield and Internet Explorer. The good news is that it runs just fine in the 32-bit browsers running in Vista 64.
  • AVG Anti-Virus – The free version of AVG runs in 64-bit mode. Note that only the scanning engine does this, not the front-end configuration application. Also, there’s no need to dig around for a different installer, the 64-bit one is included in the normal Windows installer download.
  • PicasaPicasa does not yet have a 64-bit version for Windows. I have had no problems running the 32-bit version, however.
  • GIMP – The GIMP has an experimental 64-bit version. The installer actually requires you to check a box that reads “I promise I won’t bother the developers if I can’t get this to work” before it lets you install it. I haven’t done a lot of work in GIMP yet, but I have yet to run into any problems with it.
  • VLC – The free Video Lan Client (VLC) does not have a 64-bit version yet. I have had no problems running the 32-bit version, however.
  • Itunes – Itunes has a 64-bit version, you’ll need to do some digging to find it through Apple’s site. Here’s the link to Itunes 8.1, the newest available at the time of this post.

As for drivers, I was able to locate 64-bit drivers for my printer, scanner, bluetooth adapter and video card from their manufacturers’ without any problems. All of this hardware is under 3 years old. I would expect some problems finding updated drivers for hardware that is older.

Although it got a bad rap to start, I’m quite impressed with Vista overall. Some of my favorite features that I’ve found so far include:

  • Start menu search – Open the start menu and start typing. Windows will immediately show you what matches your search from both programs on the start menu and your documents folder. If the one at the top of the list is the one you’re looking for, just press enter, otherwise select it from the list on the left side of the start menu.
  • Windows Flip 3D – Instead of switching between windows using Alt-Tab, try Win-Tab. If you’ve got Aero Glass Enabled, you’ll get a cascaded preview of each open window to flip through. A nice effect, and it can help locate the window you want when you’ve got a lot of windows open.
  • Aero Glass – The top-of-the-line theme for windows. It includes translucent window borders, minimize and maximize animations and glowing window controls. Normally I’ve immediately turned off all of the eye-candy on a new install of XP, even reverting back to the Windows 2000 style taskbar, but Microsoft got it right this time. The animations and other eye candy do not seem to effect the performance, and with a decent graphics card, are actually handled in the GPU and not in the main processor.
  • User Account Control – Although many people are annoyed by just how often this pops up, I find it an excellent tool for securing your computer. The theory behind it is that any time a program wants to make changes to a protected area of the system (install a program for example) Windows will alert you to this and require you to enter the password for the administrator account. This is an excellent way to keep malware from installing itself automatically in the drive-by download fashion. It’s unfortunate that so many people turn it off.

Syntax is structure of the programming language. It can be thought of as the verbs, nouns and parts of speech that make up English, or a foreign language. Syntax can typically fall under 3 different categories: High level, low level, and graphical.

High level is what is most common today. This includes languages such as C, Visual Basic, PHP and others. These languages use human-readable elements such as if, then, else, while and return to control the flow of a program. Many of these languages share enough common elements that a programmer familiar with one language can often look at code written in a different language an often have an understanding of what it accomplishes. However, each of these languages is unique and many of them are designed around a particular task or programming concept. A thorough understanding of this underlying concept can help a programmer to make a decision on which language to use to accomplish a particular task.

A graphical language is a high level language that is often represented in a flowchart form to facilitate human readability. Flowcharts are mainly made up of decision branches, and function blocks, not unlike ones that are used to describe a process in a user manual. These languages are typically programmed using drag and drop. Grab the block you need and drop it in the appropriate place on the screen. Each block often has a few parameters associated with it. For example a decision block will have a two input values and a comparison operator, not unlike an if statement in a text based language. From this block you can then branch to a yes or no function block. Function blocks, like decision blocks, also have inputs. A block that performs and addition function, for example, would have two inputs for the values being added, and one output for the result. These languages often become very complex to follow because it is often difficult to place comments within the flowchart structure to help another programmer understand exactly what is happening, unlike comments in a text based program which can be placed nearly anywhere. Additionally, as the program becomes more complex, the flow of the program can become very difficult to follow as it will quickly begin to cover several pages, and connecting blocks between these pages can often be a challenge depending on exact language used.

Another example of a graphical language is ladder logic. It is typically used in industrial control systems, and is based directly on electrical schematics that look a lot like rungs of a ladder. This design was intentional, as an electrician familiar with common electrical symbols could very easily transition to programming in a ladder language, as the symbols and functions of the symbols was essentially the same. Over time, the language has evolved to add instructions and symbols that do not have an electrical counterpart. Ladder based languages also have the distinction of running continuously, unlike the text languages also discussed in this section. Again, this design is intentional as it is modeled after electrical schematics and components, which behave like a continuously running program, as long as the machine is turned on.

Low level languages are ultimately what is run on a processor, and the other two types of languages discussed here are ultimately turned into a low level language before they are executed. Low level languages often use mnemonics that help to make the language readable to programmers. A few lines from a typical low level language might read as follows:

LD A, 10
INC A
JP A,Z

In the above example LD, INC and JP are all opcodes, and are actual instructions that the processor carries out. The values following the opcodes are parameters for each code. In this case A is a register, 10 is a constant and Z is a label to jump to. Each of these opcodes is turned into a binary value that is the actual sequence of bits that the processor must see to carry out the command entered. Even though this has been made easier to read through the use of mnemonics, at first glance it is not entirely clear that this code loads the value 10 into register A, increments the value in A by 1 and then jumps to label Z if A is not zero. Programming in an assembly language requires a good understanding of the actual architecture of the processor, how memory is laid out, what functions it can perform and how to combine the rather primitive functions provided into more common functions such as if-then-else statements.

There are two basic ways that a program can be executed: continuously and event driven. The execution style is dictated by the programming language, and is almost always event driven.

In event driven code, nothing runs until there is a triggering event. This is often the user clicking a button, pressing a key, following a link on a web site, or it could be a machine generated event, such as data arrives on a port or a set amount of time has elapsed. In any case, once the triggering event happens, a portion of code is executed. In a calculator, for example, when the user presses the equals button, the corresponding portion of the program to add, subtract, multiply or divide is carried out.

Continuously executed programs run every line of code, from top to bottom, and then immediately begin executing at the top again. Every line of code has a distinct output that is updated on a more-or-less continuous basis, as long as the program and processor run sufficiently fast. The most basic type of this program is often referred to as “bit banging” and is often used in the programming of industrial equipment. It is called bit banging because these types of programs look at inputs from multiple single bit sources, often push buttons, position sensors or selector switches and based on the states of these inputs, turn on or off a single bit output. The code can often be broken down into several lines of if-then-else statements such as “if A or B are ON then turn ON C else turn OFF C.”

Interestingly, these two different styles of program execution, even though they are defined by the programming language, can be written in such a way that they behave as they other type of program. Consider the following lines of pseudo-code that are written in an event driven language:

Event (User Click)
While (1)
If A or B Then C Else D
If A and B Then E Else F
End While
End Event

The above program will execute continuously, even though the programming language is event driven. Strictly speaking, this code would “hang” the processor as it would be stuck in an infinite loop that only deals with inputs A and B. In reality, there is a supervisory program (an operating system in a computer, for example) that oversees everything that is going on and will pause the execution of this program and give processing time to other programs to keep everything running as expected.

Like the above example, a continuous execution program can be written to appear to execute as though it were event driven. Here is another pseudo-code example written in a continuous language.

If A then B
If B then C
If C then D

Even though all of these lines of code are executed over and over, the only way to get to D is to first trigger A, which triggers B and so on, in an event driven fashion.

One other interesting note, excluding the newer multi-core processor systems, any given processor can only execute one command at a time, and can only execute commands sequentially. The speed of a processor allows it to appear to handle multiple tasks at one.

After several years of programming in various languages for several different platforms there are several things I’ve come to realize about programming. I’ve broken it down into 3 separate topics, each with their own discussion. Each discussion will be added over the next few days.

The heart of any program is the algorithm that actually performs a task at hand. There are often plenty of auxiliary functions that typically must also occur in a program, but what makes each and every piece of software unique is how these functions are tied together to perform a task. Often the algorithm is the piece of code that requires the most debugging, the most attention to detail, and most importantly, a new and often creative idea. Auxiliary functions frequently are written by a third party, or in the case of many high level languages, may actually be features of the language itself. In PHP, as an example, there are functions available to query a database, write HTTP headers to a browser, read data from a web page or sort an array. All of these functions typically require no more than a line or two of code for them to perform a lot of work more or less automatically.

Let’s apply these functions to a basic model of the Google search engine. Things start off with a web crawler, an auxiliary function that gets a web page. The crawler then finds links on the page, opens them and continues on indefinitely.

The crawler feeds its data to Google’s algorithm called Page Rank. This is the core of their process. It counts up the number of links to a given page, and what context the page is linked to. Note that there are no pre-defined functions to handle this task, thus it is the main algorithm because it contains the new and creative idea mentioned above.

Next we move back to some auxiliary functions. The data that is generated by Page Rank is then stored in a database, another built in function in many programming languages. Then, when a user does a search, the database is queried and returns a response that contains pages that match the user’s input. Finally, this data is then sent to the user’s web browser, all of which can be handled by various functions that are already built into a programming language.

Please understand that this is a very simplified analysis of Google, and it was intentionally designed to show how an algorithm is a small part of an overall program, but is what makes every program unique.