Wednesday, March 14, 2007

I Bought A Mac


I have always been a long time PC user and developer on the PC platform and recently made the switch to a Mac. Throughout my entire life I have owned desktop PCs and PC laptops, even though I have used Macs and am familiar with them, I have never owned one. Late last year I began considering switching to a MacBook Pro as my primary development platform.

The development that I do is in .Net, Java, and C++. All three are developed on a PC running the various variants of Microsoft Windows operating systems. When Apple introduced the MacBook Pro in February 2006, I seriously began to think about switching from PC to Mac as my primary machine.

To switch to the MacBook Pro as a development environment for PC Windows based projects, specifically .Net I needed a way of running Visual Studio. Microsoft had not yet decided to port Visual Studio to OS X. If they did do so, there would be quite a few developers who would be willing to purchase it (myself included). Although this would be an interesting scenario and expansion of Microsoft’s development lineup, it would not be more than a dream on my part.

There were two choices that I could use running a .Net environment on a MacBook Pro: install and run Windows XP by booting directly; or run Windows XP on a virtual machine. I knew that I could use Boot Camp as an option (http://www.apple.com/macosx/bootcamp/) but did not want to have to reboot the system every time I needed to open Visual Studio. The other option was to use Parallels Desktop and run the environment virtually. I was apprehensive of the performance I would experience while running .Net under a virtual instance of WinXP, but I decided to go ahead and try. If it didn’t work I could download Boot Camp and run .Net through a native instance of WinXP.

The Mac purchase experience inside of an Apple Store is vastly different than within a Best Buy, Circuit City or CompUsa. Apple has targeted the Apple Stores to clearly be a boutique shopping experience, with ample examples of their products on display for users to try before buying. The sales associate that I met was a little taken aback by the fact that I knew exactly what I wanted.

The purchase went smoothly and I took delivery of a base model MacBook Pro and retail copy of Parallels Desktop. Installing Parallels went smoothly and after installing WinXP and Visual Studio, I was able to open a project that I am working and compile it with no incident.

.Net on Mac works…now if only Microsoft would come out with Visual Studio for the Mac and a .Net framework.

Labels:

Saturday, March 03, 2007

Google Office Suite


Google has released a Premiere Edition of the popular we based applications costing $50 per account per year. This service which contains the similar features found within a desktop application such as: spreadsheet, word processor, calendar and mail has a storage space of 10GB of email storage. The launch made me begin thinking about how much we already operate in an interconnected world and to speculate as to what the future would be for such a world.

The model for the distributed application harkens back to the days of mainframes and dumb terminals. The mainframe terminal model would force the application to reside within a mainframe, and minimal to no processing would take place on the terminal. This allowed the expensive cost of computing power, application operation to stay within the big iron of the mainframe.

As the cost of the computer hardware began to decline and the PC began to spread to the desktop, so did the applications. The application no longer stayed on the mainframe, but moved to the desktop and the low cost PCs. The mainframe now was slowly moving to the background. When I read about the Google Office Suite the move is back toward dumb terminals and servers that store the applications and data.

I do not think that the Google model is bad. There are some instances were it would be a good thing to have in place: universities, and individuals who do not wish to invest in an expensive software applications. The best way to illustrate the benefits of the Google service would be to look a small to medium sized company.

A company with a few dozen employees may not have the ability to hire a dedicated IT employee. What will usually happen in these companies is that one employee will assume the role of help desk and IT network manager. This is not the ideal solution. Some companies solve their IT needs by hiring a consultant to allow them to have IT services but without the expense of a dedicated employee.

Google’s Office Suite allows companies another solution. They can use the office suite to reduce their IT costs, and since it is a fixed office location the application works perfectly for them. An internet connection would still be required, but with business Internet connectivity available for as low as $50/month this is far cheaper than multiple licensed copies of Office. This is not the ideal solution for a company that has people consistently traveling though. Those workers will still need the ability to travel and work disconnected from the office.

Labels:

Wednesday, February 07, 2007

Managed and Unmanaged Code


Recently I was talking to a young programmer and the topic of managed versus unmanaged code came up. The programmer did not know what the difference between the two. It took me a few seconds to process what he just said before beginning to enter into an explanation of the difference. The young programmer was having difficulty in understanding what I was saying and kept insisting that he knew many languages (Javascript and VB.Net) and has never heard of this.

The discussion led me to wonder how many other programmers do not know the difference. I then decided that the best thing to do was to write a short overview of the differences. This is not a complete description of all difference, but more of a general overview to help those that might not know the difference.

What is Managed Code?

Managed Code is what the Visual Studio 2005 compiler languages VB.Net and C# create. This code is then compiled into an Intermediate Language (IL), which is subsequently run n the Common Language Runtime (CLR). The CLR can handle code that is written in VB.Net, C#, or J#. It accomplishes this because each of those languages compiles down to IL.

The CLR will verify and load the IL, and if it is okay run it. Then the code is compiled to machine code just in time when the methods are called. This method of using a JIT compiler is similar to what is implemented in Sun’s Java. The JIT compiling allows memory, security, and threading to be managed at runtime.

What is Unmanaged Code?

Unmanaged code is that it will compile directly to machine code. There will not be any intermediate steps, and will compile directly to machine code. The compiled application will not have any of its resources managed for it, and will depend upon the operating system to provide them.

As an example, if the application requires memory it must dynamically ask for more from the operating system explicitly. Any programmer who has written in C++ knows that memory leaks can be a major source of bugs in their code. The programmer is responsible for management the memory that his program uses, or does not use.

Microsoft Visual C++ is a very powerful tool which allows the programmer the ability to write in both managed and unmanaged code. Visual C++ provides the ability to chose a CLR application which is managed, or a ATL, MFC, Win32 project for unmanaged applications. The benefits and power of being to write both managed and unmanaged code are immense and quickly apparent for the experienced programmer, while not so for the inexperienced programmer..

Labels:

Tuesday, January 23, 2007

To Upgrade to Vista or Not?


I have been asked this question over the past few months by various people. The answer that I usually give is no. Although new technology and software that make our life easier to use is a good thing, there can be some draw backs. The upgrade to Microsoft Vista is something that I would recommend that a user do not do on an existing computer. If you are purchasing a new computer then feel free to purchase it with Vista, but with a caveat.

That caveat is: the new machine should have the following minimum specifications:
  • 2 GB RAM
  • An independent graphic sub-system.
  • 15.4 inch display
  • Core 2 Duo
Some people may say that the specifications are overkill, but the recommendation that I give is for a system that is usable day-in and day-out, not one that will simply boot Vista. The argument stands that do effectively use an operating system that will be housed within .5 to 1 GB of memory, you need an additional 1 GB for the applications that may run.

If your PC or laptop comes with it, then upgrade. If they do not then stay with Windows XP until there is a need to upgrade your machine.

Thursday, July 27, 2006

Pushing Volts Along a Highway

There has been recent press discussion about the movie "Who killed the electric car," focusing on the demise of the General Motors EV1. I was always a large fan of the EV1, and personally thought that it would have helped the environment and reduce our dependence on foreign oil. It would not be too far fetched to invision a world with nuclear reactors generating power for the cities, and electric cars and trucks keeping society functioning.

People do have problems with a nuclear reactor nearby and immediately become NIMBY (not in my backyard) at the proposition, but if you tell them that on a 100 degree F day that they cannot run their air conditioning I think they would quickly change their opinions. The GM EV1 has problems. It had a very limited range, two seat capacity and would only be leased to customers, not purchased.

The EV1 despite its problems, was still a car that would have been perfect for the short trips that the majority of Americans drive each day. The market didn't exist partly to the lack of marketing on GM's part, and the low price of oil. People were not going to pay $500/month for a car when others could be purchased or leased at the time for $300/month, and give a substantial increase in comfort level.

Long after the remaining EV1s have been crushed by GM, and destroyed forever we have a new electric car that pushes the envelope in range, styling and efficiency. It is the Tesla Roadster from Tesla Motors. The sleek two seater has a top speed of 130mph, a sleek carbon fiber body, and range of 250 miles. This is far greater than any previous electric car that will be practical for replacing a segment of the automotive market.

The Tesla Roadster is new and may little has been proven regarding its longevity, but it will be available in 2007 for $100,000 and cost zero in gas costs. This is relative like many things in the world, since it doesn't require gasoline fuel, but electric fuel. If you live in an area that gets a reasonable amount of sun, you may be able to equip yourself with a solar panel system , generating additional power to charge a Tesla Roadster.

The car is very fast and in a recent test drive of a prototype given to the Governor of California, it proved to win him over. The car will initially be available in major markets in California, and may reach other areas. One problem that I see now is the extreme colds that can be found in various areas that will adversely effect battery life. Despite the company saying that the batteries are heated, they will still lose continuous power if they have to run a heater to keep the batteries warm in a cold climate. This isn't a problem if you take into account that even if the range drops to 100 miles, the car would still be more than practical.

I think that the cost of $100,000 will be the only detrimental aspect of the car. The world will still have to wait for an alternative electric car for the masses. If an electric car would cost $25,000 if could possibly find its way onto many highways and roads around the country.

Labels:

Wednesday, July 26, 2006

Apple Mighty Mouse

Apple has once again come out with a masterpiece of design and engineering. They have taken the simple mouse and pushed it to another level with the introduction of the Mighty Mouse.

Some of the features of the Mighty Mouse are:
  • Touch sensitive top shell for left and right button activation.
  • Bluetooh wireless.
  • Laser tracking.
  • Force sensitive side buttons.
  • Works on one or two AA batteries.
The cost through the Apple store is $69.00.

Wednesday, July 12, 2006

C# Blog

Checking permission to view a page

As we start to build the blog, we also need to know whether someone is authorized to view a page that requires administrative functions. This is going to come into play a little later when we create a simple section to add a blog entry.

Remember this is the .NET framework, so we are not going to have a lot of code to write. All we will need is the following:


if (Request.IsAuthenticated == false)
{
Response.Redirect("login.aspx");
}

This checks the that the request being made is authorized, if not send it back.



Creating a blog entry


So now we have a database a database for posts. This is not useful until we add two pieces of code to handle creating a blog entry and displaying a blog entry. Let's first quickly put together a page to handle adding a post.

We can quickly create a connection to the database for the blog by using a data source control. This is one of the key features of .NET we rapidly build what we need to build.