The Loveliness of Being Alone

I

The night descends quickly
its purpose tearing through my mind
A picture of once unspeakable beauty
now marred and maligned

That blossoming withered hope
an empty bed nurses tenderly
What was joyous, righteous, set me free
no more than bitter memory

Her name and form are no more
for she will not abide
To be present and presence still
she stirs as with the tide

Her image undulates not grasped
from in to out of view
To seize, perceive, but to clasp
a name to put to you

II

Read more »

What I’m not really saying

her eyes fixed on me.
hands feet smile now set me free.
she hears my body.

I Like Terms

I am the process of a moment spread out across a blanket of hours

You are fleeting, downsized and up-classed

We are like terms that have lost their way, but found themselves

._.

Understanding

Jet-black beauty streaks
Down her face just like before
Now knowing, she smiles

Getting Back To My Roots

This spring has been a great opportunity to get out into my yard and do some much needed maintenance.   In the past I would have hired someone to come out and take care of these things for me, but this year I have been consciously seeking out home maintenance activities that I can find enjoyment in.

It has been almost two months now, and I’ve been making regular visits to my yard, working away bit by bit, stopping when my yard waste container is full.   As I’ve been weeding, dead-heading, raking, and trimming, I have realized something quite amazing.  Each time I take on work in the yard, I feel a strange sense of calm come over me, and I unintentionally end up losing hours in it.  Put simply, I love it.

This is somewhat uncharacteristic of me, so I have been meditating on why it is that I find myself so feeling so fulfilled while working in the yard.  Certainly it could just be that I’m getting older and more mature, but I find such explanations to be unsatisfying.  The truth that I have come to realize is that it gives me an opportunity to view life from a completely different perspective, one of plants and bugs. Read more »

Implicit Types (var) in C#

After some thought I’ve come up with two simple rules to go by when using implicitly typed variables to make sure that you don’t end up seeing their nasty, code obfuscating side.  But I’m getting ahead of myself, first the important question that someone is bound to not be asking right about now:

What are Implicit Types?

// Explicit
List<string> userNames = new List<string>();

// Implicit
var userNames = new List<string>();

Implicit types in C# are basically placeholder types that the compiler figures out for you. They may hold any type to begin with, but once they are assigned a value of a certain type, that type is noted by the compiler and will error if you try to assign a different type later.

// Okay! quote is being assigned a string value
var quote = "Things that try to look like things often do look more like things than things.";

// Compile Error! Cannot convert source type 'float' to target type 'string'
quote = 4.0f;

Read more »

Canvas Element Positioning Performance

C# and Silverlight provide a rich set of layout controls that can be used in constructing elegant user interfaces, including a do-it-yourself Canvas class that allows you to manually position elements on it’s surface.

Positioning Elements in Code

With a Canvas you’re almost always going to want to have some code that positions the child elements.  To move things about, the property you are concerned with is not, as you might expect, a Position or Left/Top property on the child element, but rather it is a property of the Canvas that can be set on a child element.

There are two ways I have seen used to set the Canvas.Left or Canvas.Top property on a child element, and in some cases you’ll want to distinguish between the two.

The first way is to call SetValue on the Child element with the DependencyProperty you want to set, Canvas.LeftProperty or Canvas.TopProperty.   The second way is to call Canvas.SetLeft or Canvas.SetTop and pass in the UIElement to set it on.

Read more »

Silverlight 3, LINQ, and Bing! Oh, my!

In my last post I talked about Silver Shorts and showed off my example Bing Image search application.

For this post I want to go over the code that I created for doing a Bing image query, to demonstrate just how powerful and concise Silverlight 3 C# code can be. To truly appreciate this, I suggest checking out the code, which totals about 225 lines for both the Image Search utility AND the Test Application.

To get started, let’s enumerate the requirements I came up with for the project:

  1. Image Search
    • Bing Image query based on textual search terms
    • Transform XML results into custom classes

We’ll refer back to these requirements as we build the code to make sure we stay on track.

Read more »

Project Silver Shorts

Last week I decided to install the Visual Studio 2010 RC for the purposes of messing around with C#, Silverlight 3, and all the new WPF goodness that came with it.  I only intended to dabble for a day or so, but ended up having my entire week consumed in what seemed like a moment.

If you have Silverlight installed, you can view the end result of my first experiment after the page break.  It is a simple Bing image searcher that displays thumbnails of the results on a canvas.

What is Project Silver Shorts?

More than anything Silver Shorts is an idea, a codename for a collection of demos in C#, most of which have yet to be written, targeting Silverlight 3, that are intended to be Short.  As I stumble and bumble my way around .NET, finding new and interesting things to do with it, I will make my experiments available with full source code on GitHub (skip to the bottom if all you care about is code.)

For the developers in the audience, let’s take a look at a simple LINQ query I have fabricated to summarize the goals of Silver Shorts while simultaneously showing off how neat LINQ is.

var blogPosts =
   from exp in user.Experiences()
   where exp.IsAwesome
   select new BlogPost()
   {
      Title = exp.Concept,
      Content = exp.Details,
      CodeUrl = exp.GitUrl;
   };

To be painfully and obnoxiously clear, this code example is not part of the actual demo program, it is only here to look pretty and be a conversation piece.

Read more »