The advent of Silverlight 2.0

July 30, 2008

The time has finally come. Now a client-side framework that gives .NET developers the same power and flexibility as Flash has finally arrived. Silverlight 1.0 has introduced this technology to us, but it still required the developer to work with javascript and forced us to remain bound to its limitations. Silverlight 2.0 applications can be entirely written in any of the managed languages. Programming with Javascript is not needed. The framework will handle it for you. The client-side output for Silverlight is all based on the <Object> tag. This means that the source for the client application can appear to be as simple as an HTML file that has nothing but a reference to Silverlight and an <Object> tag. The way this works is that Silverlight 2.0 has introduced a new file type. This is called a ZAP (XAP) file. The zap file is nothing but a zip file with a different name. If you rename it zip, it will open with winzip and all the binary files will be presented. The binary files that are packaged in the zap file are a subset of the WPF framework and whatever assembly that you create for you Silverlight app. The feature set that is available to Silverlight 2.0 is amazing. Any type of Flash application can be built with Silverlight just as well. Goto http://silverlight.net and see all the samples, you’ll be amazed.


Tools on top of Tools….

June 30, 2008

It’s funny how we all invent various tools to simplify life, only to find that learning to manage and use a new tool only complicates things. I’ve recently spent a bit of time creating a new tool. The purpose of this tool is to simplify the task of tracking time and entering it into yet another tool. Throughout the design and coding of this tool, I found that its almost impossible to create a tool that will make everyone happy. I guess the lesson learned is that sometimes its just better to deal with tool(evil) that you know then to deal with the tool(evil) that you dont.


Going into the (Silver)Light.

April 29, 2008

By now everyone has seen Microsoft’s latest web technology, Silverlight. If you haven’t you got to go check it out. Many blogs I’ve seen have compared it to Macromedia Flash. But, I’ve got to tell you that it differences are just as great as its similarities to Flash. I’ve done work in Flash in the past and it is a great technology. But, Silverlight is in position to become new technology to dominate the client-side browser. There are a few reasons for this.

 

First, the learning curve for Silverlight is much lower for developers that already understand how to use the .Net Framework. Even thou Silverlight 1.0 only supports javascript , the XAML syntax is exactly the same as if you were creating a desktop WPF application. Once Silverlight 2.0 is out, the learning curve will be even less as that version will support managed C#.

 

Second, the IDE for creating Silverlight applications is Visual Studio. This is the same development tool that many developers use for building other windows applications.

 

Third, the event model in Silverlight is the same as ASP.NET. Flash uses an event model that is based on a storyboard that repeats on a specified interval. Silverlight has the typical OnLoad, OnClick, etc. In addition, Silverlight does have a storyboard control that you can use if you need the events to all fire as in Flash.

 

After doing a fare amount of research into Silverlight 1.0, I decided it give it a try. I wanted to see how well, if at all, it could integrate with my existing ASP.NET site. I found that it ties in very easily. For ease of use, I created an ASP.NET Server control that embeds all the client-side JS files and XAML files needed for my Silverlight application. Then all that I needed to do was to drop that server control on my ASP.NET page and set a few parameters.

 

My Silverlight app is very simple. I decided to make use of the WPF Ink class to create a Silverlight Signature Control. You can check it a live demo and find the source code for it here. One of the nice things about this control is that is demonstrates several things. With this sample you can see to following:

 

  • Creating an ASP.Net Server control
  • Working with embedded JavaScript resources
  • Embedding XAML for use with Silverlight.
  • Creating a Silverlight application

 

Enjoy.


Totally free asp.net web site in just 3 weeks

March 31, 2008

For the past 12 years I’ve been working as a software engineer, mostly building software for web applications. I’ve had many people over the years ask me “What is the URL for my personal site?”. Unfortunately, my response was always the same. “I don’t have a personal site”. It did make me think, how can I claim to be a decent software engineer and not have a web site of my own. So, my project over the last month was to build myself a personal web site. I started by thinking about what type of content, layout, and features I’d like to have. After I make that list, I started looking into designing a site map and flows for my features. Not too long after this did I realize that this was going to take me a bit of time. Then I discovered the Microsoft web site starter kits. I spent some time looking through the various templates until I finally found on that kind of fit what I wanted. So, I took the “Personal Site Starter Kit” as my base for my new site. I spent a few weeks modifying it to fit my needs and then added all the content. That’s it. There you have it. A fully functional completed web site in 3 weeks.

The next step was that I needed to host this site somewhere. So, the answer was to take an old desktop that I was no longer using and to install IIS and Visual Studio Express. This would be the system that would host my site. Since I only have Windows XP Professional and SQL Server Express running there, that means that the site will be limited to only 10 concurrent connections, but that’s fine its just a personal site and not a e-commerce system.

Now comes the issue of how to get it available on the Internet. The first this that I needed to do was to expose my web server outside of my firewall. There are a few ways to do this. You can move the entire server out site by placing it in the DMZ or open a port to the application that needs access through the firewall or you can do some port forwarding and filters on the firewall. I decided to just open port 80 through the firewall so that IIS can communicate with the world. This exposes the bare minimum needed, but it does have some limitations, but for my needs its fine. Another issue that we need to fix is with the DHCP server. We should only be opening port 80 to the web server. To do this, our web server is going to need to have a static IP address within the LAN. Changing this on my internal LAN is simple, the real problem here is with the external ISP. We could call them and ask to have a static IP on the WAN, but that would cost a lot extra. Fortunately, we can install a piece of freeware called No-IP that will solve this problem for us. This freeware runs as a service on the web server and keeps an eye on the servers IP address. When the ISP DNS server changes it, this software will update the domain name for our site with the new IP that our ISP assigned. Now were ready for Internet traffic.

Now comes the last piece. What name do I give this site? If I want to choose my own domain name, that will cost a bit to register it. However, there is a free solution to that also. There is a free site that allows you to create an account that will redirect all Internet traffic to your site. You get to choose the host name and you can choose from a list of domain names that they own. This site also integrates with the freeware that update the domain name for us when the ISP changes our IP.  So, for this last step, just create an account with no-ip.com and pick a host and domain name. That it!

So, you too can build a site free fully featured asp.net site in just 3 weeks.  Enjoy.

Links for this entry:

http://corbin.bounceme.net    (My personal site)

http://www.no-ip.com  (Freeware and domain account site)


The joys of video editing (WPF Intro)

February 29, 2008

One of my favorite past times that I enjoy the most is video editing. It’s been a long time hobby of mine. There are many different software packages out there that have tons of functionality that can make even an amateur appear like a pro. Recently, I’ve discovered windows media encoder. It’s a nice package that Microsoft gives away for free. For free, it does a decent job of editing, although many of the paid for packages are by far much better. One task that I found it can do that the other packages don’t is that is can do real-time screen video and audio captures. I’ve never played around with this stuff too much before, so I figured I’d research it a bit. I found that there is again other packages out there that do real-time screen capture, but the free ones had poor quality and generated large files. The paid for packages have great quality and decent file sizes, but they are also quite costly.

Any way, I figured I’d give the Microsoft media encoder a try. I’ve always wanted to try to create an online tutorial for some of the new and cool technologies out there, so I spent a bit of time creating a “Beginning WPF” tutorial. It’s only about 8 minutes long, but I think it gives a nice simple introduction to WPF and shows some of its power. So, if you’re up to learning a bit about WPF you can start the video by clicking the link below.

Beginning WPF” – by Greg Corbin (best viewed at 1024×768)

Enjoy. J


The latest technology

January 30, 2008

Technology changes so often that sometimes it can be overwhelming to try and keep up. This is most noticeable when dealing with software. Since software is made from nothing but thoughts, it is a technology that can have a lot of new concepts and techniques within a very short time frame. This is most obvious for people that work within the Microsoft technologies. Microsoft has been releasing new software platforms, frameworks, and APIs at a crazy rate over the last 10 years. Within that time, we’ve seen complete paradigm shifts from desktop client/server apps to distributed smart clients that live in the web. The technology to do this has also change drastically. We saw everything from the introduction of Xml to 5 released versions of the .NET platform. This leaves many software engineers struggling to keep up with the latest craze from Redmond. I find the best solution for this problem is to stay informed at a high level. If a new technology turns out to become a big hit, then it’s worth the time to really understand it in depth. The best way to stay informed it through technical web sites and magazines. The list of content that I regularly read is listed below:

                       Web Sites

                        http://www.asp.net

                        http://msdn.microsoft.com/asp.net/

                        http://msdn.microsoft.com/

                        http://www.codeproject.com/

                        http://sourceforge.net/

                        http://slashdot.org/

                        http://blogs.msdn.com/ie/default.aspx

                        http://www.dotnetrocks.com/

                        http://www.dnrTV.com/

                       

                        Magazine subscription

                        ASP.NET Pro             

                        Visual Studio.Net

                        MSDN Magazine

                        User Groups

                        http://beantowndotnet.org/

As you can probably tell from this list, I’m mostly interested in web development. The web sites I try to read at least 3 times a week and the magazine subscriptions are once a month. The user group is a meeting that occurs once a month. It’s a great place to interact with other .NET developers. This is something new to me, but highly recommended. Of all the sites listed above, my favorite is dotnetrocks. This site release a pod cast on every Tuesday and Thursday that discusses so .NET technology. Each pod cast is 60 minutes in length. I like to download them and listen to them whenever I’m offline. They are a great way to keep informed with the constant changes in .NET.

Anyway, the point I’m trying to make here is that you should have some strategy for staying up to date with the latest stuff. Without one, you’ll go crazy with the constant flood of new things.

 


Great Inventions

December 28, 2007

            Great inventions in history are very rare. Over the past century, there have been many inventions, but how many can we really say are great? I like to define an invention as great based on the overall impact that it has on the world. If an invention improves the lives of the majority of the people of the world, then I’d say it’s great. With this definition, I’d say that there are only about a dozen inventions within the last century that meets this requirement.  Most would agree that the automobile, airplane, and light bulb would meet these requirements. All three of these items drastically changed the world. The automobile and airplane made the world a smaller place and the light bulb brought an end to the stranglehold that the night has had on us since the dawn of time. Now how about the computer? Could we say that it meets the requirements of a great invention? I’d say yes. While the automobile and airplane made the world a smaller place, the computer has brought us all a lot closer. Everything from communications to financial transactions can be done between two people on the opposite sides of the world in an instant. Like the automobile, airplane, and light bulb the computer exists in every facet of our lives. We have them integrated in everything from coffee makers to internal deliberation devices that help extend some peoples lives. If we were to ask who invented these great things? Most people would easily identify the automobile, airplane and light bulb to Henry Ford, the Wright brothers, and Thomas Edison respectively. (They’d be wrong, but that’s another topic). But how about the computer? Who invent that? Some people would guess IBM, which it’s not. Most people would not be able to put an individual name to this invention. So who was it? The answer to this question is the source of intense controversy. In the early 1940’s, there was a lot of work happening to create the first digital computer. Many Scientists and engineers were working on this goal from all points of the globe. Many of them had similar ideas and concepts, but who was the first? Based on my reading, the first all digital computing machine was built by two men named, John Mauchly and J. Presper Eckert. It was called the ENIAC, which stood for, Electronic Numerical Integrator And Computer. The history of these two men and there great invention is amazing. It’s the story of enormous trials and sacrifices in order to give birth to the computer age. Unfortunately, for the two of them, the immense sacrifices required of them ultimately lead to the ruin, but not before their new invention had taken hold.

        I’d highly recommend that anyone working in the computer industry take the time to learn its history. When learning about the difficult tasks that the founding fathers of the computer age had to endure and solve, it tends to make some of the issues we face today seem trivial. Like all other fields of science, its much easier to see where the future of the field is going, if you know where its been.


Truth, Lies, and History…

November 27, 2007

      Over the past few months, I’ve digressed from my studies of computing and spent some time focusing on history. Specifically, I spent some time reading about the truth and myths in American history. The book I read help to confirm some of the truths that I’ve known about American history, but more important it helped to shed some light on many of the horrors that are well hidden with outright blatant lies. The reasons for hiding many of the horrors of American history aren’t so obvious. I’ve found thou, if you do enough digging and think through the facts of some of these hidden truths, you’ll always find some sort of motive for hiding it. This got me to thinking about how modern computing will be recorded throughout history. How will the history books of two hundred years from now present where the Internet came from? Will it present its true history starting back with the days of ARPANET and the DoD? Or will it be presented as the creation of a former presidential hopeful Al Gore? I think it will depend on the impact that it has on world over the next two hundred years. If it’s positive, then I’m sure there will be plenty of people lying claim to be the original inventor. The question still remains thou, who will it be? Based on looking back into American history, I’m going to hedge my bets with the people in power. They have always been the ones to write history. So, if you ever get a chance to travel to this future, don’t be surprised if your told about the great inventor Al Gore and his marvelous invention called the Internet.


MMC 3.0 - Build Snap-ins with C# and.Net

September 23, 2007

Microsoft Management Console no longer belongs in the realm of C++ developers only. Microsoft has released a new version of the popular MMC framework. This version fully supports managed and unmanaged code. The new MMC 3.0 SDK finally gives .NET developers the ability to create snap-ins. In prior versions of MMC, we were able to use some of the .NET framework, but all that code needed to be embedded into a C++ framework that provided a sort of communication bridge between MMC and .NET. With that architecture there was plenty of cases where .NET coding was limited in what could be done. The way it worked was the C++ snap-in hosted the .NET program in an ActiveX container. This is would cause all the .NET code to be in a sort of island that could not easily communicate with the outside MMC framework. All that is now behind us. Now that we have an MMC framework that is fully .NET compliant, we can ditch all the old C++ hacks in favor for the simplicity and power of C#.

To get started with writing snap-ins using C#, you will need 2 items. First you will need the MMC 3.0 console. Next you will need the .NET 3.0 framework. If you are working on windows Vista, you will already have these. The operating systems supported by this are Windows XP, Windows 2003, and Windows Vista. If you want your snap-in to work on anything older than that, then you’re out of luck. Once you get these pieces installed, I would recommend visiting the MSDN. There are several good samples that show how to write snap-ins using C#. There are samples that are as simple as a “Hello World” and there are some that are as complex as some of the Microsoft snap-ins.

Regardless to how you choose to use this, it is a great new technology that I would recommend you add to you portfolio. One last side note that I discovered is that this framework is even flexible enough to allow us to scrap winforms and use all the cool animation that WPF gives us. This is a great framework for creating any desktop administrative tool.


WPF - The downfall of the tyrannical form layout

August 3, 2007

Microsoft has done it again. I guess I shouldn’t be surprised any more. Dot Net 3.0 has been released and with it another new, cool, set of technologies. You guessed it; I’m referring to Windows Presentation Foundations or WPF for short. I always get so excited when something new and cool comes along. I enjoy digging my teeth into a new technology, especially if its one that have practical uses in the office environment. WPF gives us lots of practical uses in the real world. The fact that we can now define our form layouts the same way, regardless if it’s a web form or win form is an enormous benefit. The new language for defining this is XAML (eXtensible Application Markup Language). It has freed from the constraints of how a form must be laid out. No longer do we need to conform to the standard table, grid, or battleship gray rectangle button. WPF exposes the full flexibility of the DirectX graph engine for manipulating how controls and forms are displayed. The APIs for using this power is very simple. In many cases, twisting the layout of a control to bend to our will is simply a matter of using the right XAML attributes. With this power we now can wield a wonderfully new and exciting type of application. We also have to be cautious of this, for now we also have the power to create frightful abominations that would terrify the most open-minded developers. Lets now take a look at some code that shows how to uses this. The sample below shows a simple form that has a few standard buttons and textboxes. Remember for this sample to work, you will need to have .Net 3.0 framework installed.

 

blog6a1.jpg 

 

[CODE]

 

<Window x:Class=”XamlWindowsAppProject.Window1″
xmlns=”http://schemas.microsoft.com/winfx/2006/xaml/presentation
xmlns:x=”http://schemas.microsoft.com/winfx/2006/xaml
Title=”XamlWindowsAppProject” Height=”213″ Width=”262″>
<Grid>
       <TextBox Name=”test1″ Margin=”16,15.5,93,0″ Height=”23″ 

VerticalAlignment=”Top” Text=”Sample Textbox”></TextBox>
       <Button Content=”Click Here” Margin=”44,49,0,80″  

HorizontalAlignment=”Left” Width=”78″>
       </Button>
      <ListBox Margin=”127,59,5,57″ Name=”listBox1″>
        <ListBoxItem Name=”listBoxItem1″>ListBoxItem 1</ListBoxItem>
        <ListBoxItem Name=”listBoxItem2″>ListBoxItem 2</ListBoxItem>
        <ListBoxItem Name=”listBoxItem3″>ListBoxItem 3</ListBoxItem>
        <ListBoxItem Name=”listBoxItem4″>ListBoxItem 4</ListBoxItem>
        <ListBoxItem Name=”listBoxItem5″>ListBoxItem 5</ListBoxItem>
        <ListBoxItem Name=”listBoxItem6″>ListBoxItem 6</ListBoxItem>
      </ListBox>
  </Grid>
</Window> 

 

 

Now lets take that ordinary looking form and lets get freaky with it. In the sample below, you can now see that we’ve twisted the textboxes, change the buttons shape and opaqueness, and gave the form itself an unusual shape.

 

blog6b1.jpg 

 

[CODE]

 

<Window x:Class=”XamlWindowsAppProject.Window1″ xmlns=”http://schemas.microsoft.com/winfx/2006/xaml/presentation
    xmlns:x=”http://schemas.microsoft.com/winfx/2006/xaml
    Title=”XamlWindowsAppProject” Height=”213″ Width=”262″>
    <Grid>
    <TextBox Name=”test1″ Margin=”16,15.5,93,0″ Height=”23″
             VerticalAlignment=”Top” Text=”Sample Textbox”></TextBox>
      <Button Content=”Click Here” Margin=”44,49,0,80″
              HorizontalAlignment=”Left” Width=”78″>
        <Button.RenderTransform>
          <RotateTransform Angle=”45″ />
        </Button.RenderTransform>
      </Button>
      <ListBox Margin=”127,59,5,57″ Name=”listBox1″>
        <ListBox.RenderTransform>
          <RotateTransform Angle=”15″ />
        </ListBox.RenderTransform>
        <ListBoxItem Name=”listBoxItem1″>ListBoxItem 1</ListBoxItem>
        <ListBoxItem Name=”listBoxItem2″>ListBoxItem 2</ListBoxItem>
        <ListBoxItem Name=”listBoxItem3″>ListBoxItem 3</ListBoxItem>
        <ListBoxItem Name=”listBoxItem4″>ListBoxItem 4</ListBoxItem>
        <ListBoxItem Name=”listBoxItem5″>ListBoxItem 5</ListBoxItem>
        <ListBoxItem Name=”listBoxItem6″>ListBoxItem 6</ListBoxItem>
      </ListBox>
  </Grid>
</Window> 

   

Pretty Cool huh! The sample above is just a small taste of the multitude of ways that the graphical representation of the form can be changed. In this discussion, I only touched on one aspect of the WPF framework. For more details on what WPF can do for you, check out the Microsoft docs on it here.