Samsung Blackjack Update

by mgordon 30. January 2008 06:43

A year ago, I purchased a Samsung Blackjack through my carrier, AT&T.  I had previously been using a Cingular 3125 and had greatly enjoyed being able to voice dial with my BlueTooth headset and was very disappointed to discover that voice dialing would not work with Windows Mobile 5 and the Blackjack.  At the time, I did some research and found there was a throng of Blackjack owners who were putting there hopes on an upgrade to Windows Mobile 6 that Samsung and AT&T were going to provide at some point in the future.  For months, I've periodically checked around to see if an upgrade had been released.  Lo and behold, I checked, yesterday, and found that an upgrade was available on Samsungs site, here.  I quickly installed the upgrade, but found that Voice Command 1.6 running on Windows Mobile 6 STILL would not support voice dialing.  Guess I'll have to upgrade to the Blackjack II to get that functionality back :-(

Regarding the upgrade, I found it to work as advertised and adds the ability to edit Word, Excel and Powerpoint files on the device.  However, the directions instruct you to install the modem drivers (they allow your PC to talk to the phone without Activesync) and then use Activesync to back up any data from your device.  After installing the drivers, connecting and disconnecting the phone - attempting to get the device to connect through Activesync slowed my PC to a crawl and required a reboot to remedy.  I'd suggest you perform any backups PRIOR to installing the modem drivers to prevent this problem.

Tags:

General | SmartPhone

Convert Linq Result Set to DataTable

by mgordon 16. January 2008 07:43

I'm in the process of evaluating Linq by converting an existing data layer from using Subsonic to to using Linq queries.  One challenge with this, of course, is trying not to change method signatures in the process.  I have some methods that return DataSets and was stressing over having to modify all the logic that called the methods to consume a return type of var, or a collection of entity classes instead.  Thankfully, while looking for possible solutions to the problem, I stumbled over this article from CoDe Magazine that contains code for an extension method that converts a Linq result into a DataTable.

Tags: ,

.Net | Linq

Evolution of the Delegate

by mgordon 15. January 2008 16:04

When .Net was introduced, one of the most powerful language features has been delegates which provide a way to pass around, not only data values, but also chunks of implementation and logic.  Consider how often you need to add a button to a web form or windows form and have some code execute when the button is clicked.  In Visual Studio, you can simply double-click on the button in the designer and the IDE will generate a new method for you, and wire that method to the event.  The generated code contsructs a delegate and passes it to the button so it can be called by the button at the proper time.  In effect, it tells the button, "When you're clicked on, execute this chunk of code".

Delegates have come a long way since the 1.0 days.  Consider the following code for a Windows Form class.  In this example, we'll look at the evolution of the delegate.

  public partial class Form1 : Form    
  {        
public Form1()        
{            
InitializeComponent();             

         //DotNet 1.0 and 1.1 - had to specify the implementation in a separate method            
this.button1.Click += new System.EventHandler(this.button1_Click);                        
        //DotNet 2.0 - Anonymous Methods.  Can declare implementation inline.            
this.button2.Click += delegate            
{
                MessageBox.Show("Clicked Button 2");
        };             
        //DotNet 3.5 - Declaring implementation inline using Lambda Expressions
        this.button3.Click += (sender, e) => MessageBox.Show("Clicked Button 3");
    }
    private void button1_Click(object sender, EventArgs e)
    {
            MessageBox.Show("Clicked Button 1");
    }
} 
  I've created a form in Visual Studio 9 (Orcas), dropped three buttons on it and implemented event handlers using three different syntaxes.  If you were to double-click on Button1, you'd get the implemenntation demonstrated for that button, above.  A separate method is created and your event handling code is written in that method.  This is a bit verbose and anyone reading the code may have to scroll around to follow the picture since the delegate and the method it calls are in two separate places.

For Button2, I've created the delegate using the anonymous method syntax introduced in .Net 2.0.  With it, you don't need to declare a separate method containing the implementation.  Instead, where the delegate is declared, you can also specify the implementation.  This makes the code both more brief and also keeps the delegate declaration and its implementation located together, making the code more readable.

In the latest .Net release, Lambda Expressions were introduced.  While the name may sound scary and complicated, they're really nothing more than a third syntax for specifying delegate implementations.  As you can see in the implementation for Button3, I've specified the familiar parameter list of (sender, e).  Also, I didn't need to specify the types of the parameters though you could if you wanted to.  The compiler will figure out the types for us based on the context of the expression. As Scott Guthrie explains in this post, the parameters' types are also known by the intellisense engine so we can get intellisense on the parameters. The parameter list is then followed by a "=>" symbol and finally the implementation itself.  Once again, more concise and far more readable than the previously introduced syntax.

I can barely imagine what LINQ queries would look like had the latter two syntaxes not been introduced for delegates (especially the Lambda Expression syntax), but this doesn't mean the improvements are only useable in Linq queries.  As I've demonstrated, they are useful and even preferable any time a delegate is required. 

Tags: ,

.Net | Productivity

What Motivates You?

by mgordon 8. January 2008 04:44

I'm currently working on a project that began in March of last year.  A friend of mine is managing the project and after he brought me on, we decided to try and make things as pleasant and as fun as possible for the project team.  I purchased a couple of novelties that we awarded developers when they broke the build or were deemed the most productive.  We blazed through requirements and watched features get implemented swiftly.  I was having a ball and it seemed the whole team was enjoying working on the project. 

Around mid summer, though, something happened.  Several, previously unknown, requirements were uncovered and while they were added to the project, the timeline was not adjusted.  I marveled that in the space of about a week both motivation and productivity dropped noticeably.  I felt my own attitude about the project begin to change and in asking myself why I identified a few things that motivated me and a few that did not.

What Motivates Me

  • An opportunity to learn new technologies is always a motivator.  Looking back, I've always been willing to put forth the extra effort and spend the extra time to stay as productive as possible while learning about new tools, languages or language features.
  • Trust.  When a task has been delegated to me and trust has been placed in me to get the task done, I've always risen tot he challenge.  In fact, any gesture that communicates, "I believe in you and your abilities." is bound to motivate me.
  • Organization.  When a project is well managed and organized so that I can concentrate on what I do best (design and build software), I find I have more energy and apply myself better to the tasks at hand.  

What Robs Me Of Motivation 

  • Repetitive tasks.  Copy / paste, boiler plate code...yuck.  Can't we automate this task and move on to something else??
  • Micro-managing.  I think of myself as a professional and I don't think its too much to ask to be treated that way.  Ask me if I can perform a task.  If I tell you I can perform it, let go of the task and give it to me.  I'll give it back when it's completed.  I promise.
  • Surprises.  Whether it's formal or not, there is always a plan.  When I start a project, I may not know precisely what the finished product will look like and I may no be able to tell you precisely when it'll be finished but you can bet I have a plan.  I need to know what constitutes a finished product and have some idea of how long the task will take.  When the environment in which I'm working or the projects requirements are in a constant state of flux, it drains me of energy and motivation.  Will the section of code I'm working on, right now, just be thrown away?

I'm sure you have your own similar experiences.  What has motivated you, in the past?

Tags: , ,

General | Productivity | Contracting

About the author

Mitch Gordon lives and works in the great state of Georgia.

RecentPosts

Month List