Microsoft Most Valuable Professional

Chris Pietschmann

An MVP From Wisconsin

A Free Open Source Ribbon Control for Windows Forms!

I just stumbled upon a really nice looking Ribbon control built for Windows Forms, and it's Free, Open Source! This control isn't perfect, but it does work nice and looks great.

Go check it out: "A Professional Ribbon you will use" by Jose M Menendez Poó

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Categories: General
Posted by crpietschmann on Friday, October 31, 2008 3:42 PM
Permalink | Comments (0) | Post RSSRSS comment feed


A Couple VB.NET Language Tips for C# Developers

Originally, I started out as a Visual Basic developer, and have since moved mostly to C#. However, when doing consulting work, I do need to cross back and forth quite often. Here are a couple VB.NET tips that you probably aren't aware of if you're mostly a C# developer. Some VB.NET developers may not even know about then either.

Null Coalesce

Null Coalescing is really simple in C#:

// If "someValue" is Null then set "i" to 0 (zero)
// otherwise set it to the value of "someValue"
int? i = someValue ?? 0;

But what about VB.NET?

<code:VB>

Dim i = If(someValue, 0)

</code>

Granted the VB.NET Null Coalesce is a method call, but at least there's still an equivalent available in the language. Also, I believe this is something that was introduced in VB.NET 9.0.

Ternary Conditional Operator

This is the ability have a complete If..Else..Then statement on a single line and have it return a value. This is really simple in C#:

// This performs the same logical operation as the Null Coalesce example above
int? i = (someValue == null ? 0 : someValue);

How about in VB.NET?

<code:VB>

Dim i = If(someValue = Nothing, 0, someValue)

'' The above can be simplified, since if the first parameter is equal to "Nothing"
'' then the "true" (second) parameter is return, otherwise the
'' "false" (third) parameter is returned.
Dim i = If(someValue, 0, someValue)

'' Also to further simplify, you can just pass in the "false" (second) parameter
'' and if its equal to "Nothing" then the "false" (second) parameter is returns,
'' otherwise the value itself is returned.
Dim i = If(someValue, 0) 

</code>

Lock Statement

You may be familiar with the lock statement in C#, especially if you're used to worrying about concurrency.

lock (expression)
{

    ...Some Code...

}

At first it appears to not exist in VB.NET, but they just named it SyncLock instead:

<code:VB>

SyncLock (expression)

    ...Some Code...

End SyncLock

</code>

 

Please, excuse the bad syntax highlighting for the VB.NET code, it seems that my instance of BlogEngine.NET doesn't like to highlight too many blocks of code within the same post.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Categories: General
Posted by crpietschmann on Friday, October 31, 2008 12:27 AM
Permalink | Comments (0) | Post RSSRSS comment feed


I Still Believe in Programming Language Independence

Four years ago I posted about an idea of having the IDE (Visual Studio) do auto-conversion of your code from one programming language to another so give developers more language independence. I recognize that the only languages, perhaps, that would lend themselves to this are C# and VB.NET. They aren't completely equal yet, so it would still be difficult at this time, since each has a few features that the other doesn't.

Just imagine being able to open any solution within Visual Studio, and be able to edit it in your prefered language, no matter if it's originally written in C# or VB.NET. You would no longer be required to memorize syntax and feature differences between both languages; the IDE would convert it automatically for. This would reduce some of the issue of needing to bring in new employees or consultants that are familiar with one language or the other.

Also, this doesn't seem to be that far out of reach, even how the languages stand today. The main thing that would need to be written would be a compiler that compiles VB.NET to C#, and C# to VB.NET. It could contain some heuristics that could gracefully convert ceratin language specific features to their equal equivalent in the other language and back again as needed.

Wouldn't this be awesome?

On a related note, I need to point out Script#. It compiles C# code into JavaScript, and allows you to write strongly typed C# code to build your JavaScript/Ajax applications. Granted this tool is only 1 way it is, in a way, the first half of what is needed for programming language independence, at lest between C# and JavaScript.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:
Categories: General
Posted by crpietschmann on Friday, October 31, 2008 12:14 AM
Permalink | Comments (0) | Post RSSRSS comment feed


You Can Watch PDC'08 Sessions Online!

If you couldn't attend PDC'08 (like me) then you'll probably be interested in learning that you can go watch all the PDC'08 Sessions online for Free! This is awesome!

Go Watch PDC'08 Sessions Online: https://sessions.microsoftpdc.com/public/timeline.aspx

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:
Categories: General
Posted by crpietschmann on Wednesday, October 29, 2008 6:17 PM
Permalink | Comments (0) | Post RSSRSS comment feed

WPF Toolkit adds Ribbon Control to .NET 3.5 SP1

The first release of the new WPF Toolkit was released today. This toolkit includes a new Ribbon control as well as the following: new WPF DataGrid, DatePicker/Calendar, and VisualStateManger. The coolest feature of this Toolkit (IMO) is the new Ribbon control. In .NET 4.0 there will be a ribbon control baked in, but thanks to the WPF Toolkit we have access to utilize the new Ribbon control today in WPF with .NET 3.5 SP1!

Download the WPF Toolkit October 2008 Release: http://www.codeplex.com/wpf/Release/ProjectReleases.aspx?ReleaseId=15598

Ribbon Feature Walkthrough: http://windowsclient.net/wpf/wpf35/wpf-35sp1-ribbon-walkthrough.aspx



Here's some sample XAML markup for a complete Ribbon Tab with Button Groups defined:

<r:Ribbon>
    <r:RibbonTab Label="Banking">
        <r:RibbonGroup>
            <r:RibbonButton Command="me:AppCommands.Cut"/>
            <r:RibbonButton Command="me:AppCommands.Copy"/>
            <r:RibbonButton Command="me:AppCommands.Paste"/>
        </r:RibbonGroup>

        <r:RibbonGroup>
            <r:RibbonButton Command="me:AppCommands.AddNew"/>
            <r:RibbonButton Command="me:AppCommands.Clear" />
            <r:RibbonButton Command="me:AppCommands.Delete"/>
        </r:RibbonGroup>

        <r:RibbonGroup>
            <r:RibbonButton Command="me:AppCommands.DownloadStatements"/>
            <r:RibbonButton Command="me:AppCommands.DownloadCreditCards"/>
            <r:RibbonButton Command="me:AppCommands.Transfer"/>
        </r:RibbonGroup>
    </r:RibbonTab>
</r:Ribbon>

Currently rated 4.7 by 3 people

  • Currently 4.666667/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:
Categories: General
Posted by crpietschmann on Tuesday, October 28, 2008 5:49 PM
Permalink | Comments (2) | Post RSSRSS comment feed

Free the Airwaves! FCC vote on "white spaces" scheduled for Nov. 4!

FreeTheAirwaves.com

On Nov. 4 the FCC will be voting whether to open up the "white spaces" (the unused airwaves between broadcast TV channels) or not. These airwaves need to be opened up so we can further change the way we communicate. The airwaves that WiFi operates on are open airwaves. We need more "open" airwaves to further open the possibilities of communication. Don't let the FCC sell it off to a telecom that wont use it. We need the FCC to open it up so we can all use it!

Also, here's a video that explains further what the "white spaces" are and why we need them to be opened to the public:

I've already signed the Free The Airwaves petition, but haven't spread the word yet. So, here's a reposting of an email I recieved today:

This Election Day, there's more than one important vote going on. And there's something we need you to do to get ready!

While you're casting your ballot at the polling place on November 4, the Federal Communications Commission will be voting the same day on rules governing "white spaces" -- the unused airwaves between broadcast TV channels.

Last week, after months of testing, the FCC announced that white spaces devices could operate without interfering with TV broadcasts or wireless microphone signals.

The science speaks for itself, but that's not going to stop the broadcasting lobby from trying to derail the technology before the rules are event written. Since last Friday, the National Association of Broadcasters has been trying to stop the vote from taking place. We can't let that happen.

Thanks in part to your efforts, we're less than two weeks away from a vote that could transform the way we connect to the Internet.

We can't let up now.

You've already signed out petition at www.FreeTheAirwaves.com. Now we're in the final stretch and we need your help again.

Call your Member of Congress and let him or her know it's time to open "white spaces" for everyone:  https://secure.freepress.net/site/Advocacy?alertId=285&pg=makeACall&autologin=true&JServSessionIdr001=rppctdj0p4.app43b

Just as Wi-Fi sparked a revolution in the way we connect to the web, freeing the "white space" airwaves could help unleash a new wave of technological innovation, create jobs, and boost our economy.

But it can happen only if the FCC moves forward. Encourage your friends to sign the petition and call your Member of Congress today.

Thanks,
FreeTheAirwaves.com

Email sent by Google Inc., 1600 Amphitheatre Parkway, Mountain View, CA 94043, sponsor of Free the Airwaves.


Please go show your support for this now! This could change the way we communicate.

And, Yes, I did contact my congressman,  F. James Sensenbrenner, Jr.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:
Categories: General
Posted by crpietschmann on Friday, October 24, 2008 2:12 PM
Permalink | Comments (0) | Post RSSRSS comment feed

Is this necessary?- Chris Pietschmann, MVP, MCSD, MCAD, MCP

Recently when looking at the analytics logs for referring urls to my website, I noticed one from Hanselmen.com. It's actually a click-through from a comment I posted on his blog way back on April 21, 2006. His blog post that I commented on is titled "Scott Hanselman, 11 Successful Large Projects, 3 Open Source Applications, 1 Collossal Failure".

In Scott's post, he talks about how placing your tech related certification acronyms after your name in your email signatures and such is rather meaningless. He states "Folks go to school for 20+ years to put PhD after their name. I could go take a cert test now, but should it be displayed so prominently?"

My comments as posted:

I think it's ok to put one or two after your name, but no more than that. And only use them in places where you're not already stating your certified; Like on your resumt and cover letter. It's a good thing in emails and/or blog comments to show your cert. But, I do agree that it doesn't compare to a Phd.
- Christopher Pietschmann, MCSD

Now, reflecting back on this thought now that it's October 2008... What the heck was I thinking? It is absolutely meaningless for me to place "MCSD" after my name in the signature of the blog comment. 

Today my opinion is a bit different, so I thought I'd post on this to point out my change in opinion.

You need to think about context when placing certs after your name. Basically, the only places it's usefull are in email and letter signatures. However, keep it simple by listing only 1 or 2:

Chris Pietschmann, MCSD

Or even better, add a second or third line to your signature that lists the most prominent certs and/or credentials.

Chris Pietschmann
Microsoft Certified Solution Developer

Or

Chris Pietschmann
Microsoft MVP - Windows Live Platform

Here's the email signature that I've started using lately. Just my name, followed by notable "titles", with nothing appended to my name. And, notice that I'm only listing my Microsoft MVP award since it's the most relavent and doesn't get devalued by listing other non-relevent credentials.

Chris Pietschmann
President - Simplovation LLC
Microsoft MVP - Windows Live Platform
http://simplovation.com
http://pietschsoft.com

Doesn't it look much better/usefull than the following?

Chris Pietschmann, MVP, MCSD, MCAD, MCP

And, finally, here's some rules to use when listing your certs by your name:

  • Only include 1 or 2 credentials/certs. Any more will just clutter things up.
  • Always make sure it's necessary/relavent to list them in the first place.
  • Never list your certs after your name when you comment on blog posts!
  • If you have a PhD, then you better put it after your name!

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Categories: General
Posted by crpietschmann on Monday, October 20, 2008 9:06 PM
Permalink | Comments (0) | Post RSSRSS comment feed

VEToolkit: Virtual Earth Toolkit Open Source Project

A couple weeks ago I started the new VEToolkit (Virtual Earth Toolkit) Open Source project. This project spawns out of the need for more helpers to make Virtual Earth Map development much simpler, and follows inspiration from the Ajax Control Toolkit. This is a JavaScript library, so it's all client-side code; just like the Virtual Earth AJAX API itself. The project is also meant to play nicely with any client-side, JavaScript library you want to use within your application (such as jQuery, Prototype, etc.)

Below is a list of "helper" methods that the project currently includes at the time of writing this post:

VEToolkit.Drawing.DrawCircle
- This method returns an array of VELatLong objects that represent a circle drawn to the specified radius around a given center point.

VEToolkit.Math.CalculateBearing
- This method calculates the bearing (or direction) from 1 VELatLong coordinate to another.

VEToolkit.Math.CalculateDistance
- This method calculates the distance between 2 VELatLong coordinates using the specified unit of measurement (Miles or Kilometers).

VEToolkit.Math.CalculateMidPoint
- This method calculates the mid point (or center point) between 2 VELatLong coordinates.

VEToolkit.Math.GetPolygonCentroid
- This method calculates the approximate centroid (or center point) of a given Polygon's points.

VEToolkit.Math.IsInPolygon
- This method returns true or false specifying if the given VELatLong point is within the bounds of the given Polygon coordinates.

 

Also, here's a list of the current JavaScript-based "Extender" controls in the works:

VEToolkit.ContextMenuExtender
- This extender provides easy to use Context Menu functionality for Virtual Earth.

VEToolkit.DragShapeExtender
- This extender allows you to easily link up functionality that allows you to drag-n-drop specific Shape's that are plotted.

VEToolkit.MiniMapExtender
- This extender provides easy to use functionality for controlling the position of the MiniMap. For Example: Auto-Align MiniMap to the Top Right Corner of the Map.

 

Project Homepage: http://codeplex.com/VEToolkit

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Posted by crpietschmann on Thursday, October 16, 2008 9:10 PM
Permalink | Comments (0) | Post RSSRSS comment feed

And, the Community Coding Contest Winners Are...

The final stage of the Community Coding Contest (the judging/voting) is now finished and the winners have been announced. Even though there were only 6 entries submitted, they are all really cool projects. I really encourage everyone to go check them out. Also, the 1st and 2nd place winners were neck and neck for some time during judging/voting, and the 1st place winner slid ahead in the end by only 2 votes! We almost had a tie!

Community Coding Contest Website: http://communitycodingcontest.org

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Categories: General
Posted by crpietschmann on Thursday, October 16, 2008 11:57 AM
Permalink | Comments (0) | Post RSSRSS comment feed

JavaScript: Null Coalesce using the || Operator

I recently purchased "JavaScript: The Good Parts" by Douglas Crockford, and I found this little gem on page 21, although he listed in in the section Objects - Retrieval.

It is possible to use Null Coalescing in JavaScript by using the || operator!

// Note: only this code example is quoted from the book
var middle = stooge["middle-name"] || "(none)";
var status = flight.status || "unknown";

Since JavaScript returns a boolean value of true when your looking at a variable that is not set to null or undefined, you can use the || (or) operator to do null coalescing. Basically, as long as the first value is not null or undefined it's returned, otherwise the second value is returned. This really simplifies the process of getting object property values when you need to use a default value if it's not set yet, and keeps you from needing to use an if statement.

Below is an example of what I used to do Previous to learning this trick:

var middle = (stooge["middle-name"] != null ? stoog["middle-name"] : "(none)");
var status = (flight.status != null ? flight.status : "unknown");

This new trick makes the code much easier to read, and checks for undefined also so I no longer need to worry about the value being equal to undefined in some rare circumstance.

 

Reference:
JavaScript: The Good Parts by Douglas Crockford. Copyright 2008 Yahoo! inc., 978-0-596-51774-8.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Categories: JavaScript
Posted by crpietschmann on Tuesday, October 14, 2008 9:00 AM
Permalink | Comments (3) | Post RSSRSS comment feed

About the author

I'm Chris Pietschmann, go to the About Me page to learn more about me.

Search

Sponsors

Web.Maps.VE - ASP.NET AJAX Virtual Earth Mapping Server Control

Recent comments

Disclaimer


This work is licensed under a Creative Commons Attribution 3.0 United States License, unless explicitly stated otherwise within the posted content.
© Copyright 2004 - 2008 Chris Pietschmann