Friday, February 20, 2009

When will I ever learn ....

I think that if the song Blowin' in The Wind was written today, it would have included in the lyrics:

How many times must man loose his code
Before he uses source control?

The answer, my friend, is blowin' in the wind
The answer is blowin' in the wind


Now I am a true fanatic when it comes to source control at work, but the moment I walk through the door at home, it all seems to leave me and I "just want to get it done" and not worry about source control.

Well, once again that laissez–faire attitude towards source control has bitten me again. No, nothing catistrophic, just that somehow I've lost 75% of the AI code I was writing for Switcheroo.

Arrrrrrrrgggggggggggg!

Maybe now I'll start using source control at home? A thousand times burned, forever shy?

Do not count on it, I just want to get it done.

Sunday, February 8, 2009

Fancy fonts in XAML (Silverlight and WPF)

Outline, Shadow, Embossed and Engraved text in XAML.

Here are a few quick and easy ways to spice of your text in XAML.

To use these tricks, you need to have the ability to exactly place the text. For that you need to use a Canvas Layout control.


<UserControl x:Class="SilverlightApplication2.Page"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Width="320" Height="200">
<Grid x:Name="LayoutRoot" Background="White">
<Grid.ColumnDefinitions >
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Button Margin="3">
<Canvas Width="800" Height="60">
<TextBlock FontSize="36"
Canvas.Top="2" Canvas.Left="10">Outline</TextBlock>
<TextBlock FontSize="36"
Canvas.Top="2" Canvas.Left="12">Outline</TextBlock>
<TextBlock FontSize="36"
Canvas.Top="4" Canvas.Left="10">Outline</TextBlock>
<TextBlock FontSize="36"
Canvas.Top="4" Canvas.Left="12">Outline</TextBlock>
<TextBlock FontSize="36"
Canvas.Top="3" Canvas.Left="11"
Foreground="White">Outline</TextBlock>
</Canvas>
</Button>
<Button Grid.Column="0" Grid.Row="1" Margin="3">
<Canvas Width="800" Height="60">
<TextBlock FontSize="36"
Canvas.Top="5" Canvas.Left="4"
Foreground="Black">Shadow</TextBlock>
<TextBlock FontSize="36"
Canvas.Top="3" Canvas.Left="2"
Foreground="Gray">Shadow</TextBlock>
</Canvas>
</Button>
<Button Grid.Column="1" Grid.Row="0" Margin="3">
<Canvas Width="800" Height="60">
<TextBlock FontSize="36"
Canvas.Top="3" Canvas.Left="0"
Foreground="Gray">Engrave</TextBlock>
<TextBlock FontSize="36"
Canvas.Top="5" Canvas.Left="2"
Foreground="White">Engrave</TextBlock>
<TextBlock FontSize="36"
Canvas.Top="4" Canvas.Left="1"
Foreground="Black">Engrave</TextBlock>
</Canvas>
</Button>
<Button Grid.Column="1" Grid.Row="1" Margin="3">
<Canvas Width="800" Height="60">
<TextBlock FontSize="36"
Canvas.Top="5" Canvas.Left="3"
Foreground="Gray">Emboss</TextBlock>
<TextBlock FontSize="36"
Canvas.Top="2" Canvas.Left="2"
Foreground="White">Emboss</TextBlock>
<TextBlock FontSize="36"
Canvas.Top="4" Canvas.Left="4"
Foreground="Black">Emboss</TextBlock>
</Canvas>
</Button>
</Grid>
</UserControl>

Sunday, February 1, 2009

My Five Minutes of Fame

Well, I've had my five minutes of fame. I submitted my Silverlight Tic Tac Toe project to the silverlight.net site. They posted it to their site on Tuesday.

Since then, the statistics on my blog have went crazy. I was seeing a net traffic load of about 15 hits per day (Yes, I know that is a pathetically low number, but since I've only been blogging for a few months, I thought that was a good start). But, since Tuesday I've averaged 150 hits per day.

The one thing that had disappointed me was the lack of comments from my visitors. Well, with over 800 hits on my Tic Tac Toe post, I only got two comments. Sigh. I guess I was just expecting too much.

The one thing the stats told me before I posted my Silverlight Tic Tac Toe game, was what people were interested enough in to seek me out. I learned that Counts in a substring, shuffling and Latin squares are by far the most popular things I'd blogged about. Now all my stats point to Silverlight.net.

Who knows what tomorrow may bring. I may finish that old magazine game, Switcheroo (The endgame AI is giving me fits!) or I may post some more "Old style" coding articles. What would you rather see more of?

*** And maybe a blatant call for comments will work :-) ***