Go to content Go to navigation Go to search

Brokenwire.NET::programming

Be prepared: get the Christmas Lights
· 15 days ago by Thijs Kroesbergen

A long, long time ago I wrote about that cool christmas lights application, written by an unknown author in ancient times.

Recently I took up the plan to re-write this application using the .NET framework (check out the new logo).

I used Scott Hanselman's "BabySmash" as an inspiration to get started, and I was able to write this in a matter of hours.

 

So as we are getting closer to the holiday season, this is the time to grab your copy of the cool new Christmas Lights for you desktop from the download page. Christmas will never be the same again once you've experienced this!

The application "works" as of right now (tray-icon, blinking lights around the borders) but there is still a lot of room for improvement.

Here is a (non complete) list of features that I wish for:

Help me extend this list (and motivate me to work on this) by leaving a comment!

In the meanwhile, have fun! Oh and btw, did I mention you can download the Christmas Lights?

(More about the experiences with ClickOnce, Framework 3.5 and WPF in upcoming blog posts. And once I've tidied the sources I'll put it them here too.)

Comment - Permalink -

Tip: Batch files with over 9 parameters
· 37 days ago by Thijs Kroesbergen

This has been around for ages, but it saved a us lot of work today (once we figured this out)..

So when you are writing a batch file (.cmd file) to automate some stuff you might run in to the issue that you can only retrieve the command line parameters up to number 9, by using the %1 to %9 variables.

Example:

@echo off
SET ONE=%1
SET TWO=%2
SET THREE=%3
SET FOUR=%4
SET FIVE=%5
SET SIX=%6
SET SEVEN=%7
SET EIGHT=%8
SET NINE=%9

So what do you do when you need number ten and up? %10 and up don't exist! Solution: You use the "shift" command!

Every time you call SHIFT the parameters will move 1 position, so if you call it ten times...

SHIFT
SHIFT
SHIFT
SHIFT
SHIFT
SHIFT
SHIFT
SHIFT
SHIFT

then you can retrieve number 10 and up..

SET TEN=%1
SET ELEVEN=%2
SET TWELVE=%3
SET THIRTEEN=%4
SET FOURTEEN=%5
SET FIFTEEN=%6
SET SIXTEEN=%7
SET SEVENTEEN=%8
SET EIGHTEEN=%9

How about that! (Be honest, did you know this?)

Comment [1] - Permalink -

SQL Server 2008 - RTM
· 106 days ago by Thijs Kroesbergen

Another cool product I’ve been looking forward to has been released into the wild today: SQL Server 2008 .
It is available from the MSDN subscriber site right now! Dig in, enjoy!

Now we can finally use C# as a scripting language for SSIS packages. Besides that there are a lot more exciting new features in SSIS .

Comment - Permalink -

SQL Server Service Broker: cleanup
· 168 days ago by Thijs Kroesbergen

Imagine that you've been playing with the SQL Server Service broker, and you've got thousands of conversations stuck in the queue. And then you discover that there is nothing like "truncate table" possible on the queue... You can cleanup each conversation in the queue with the "end conversation with cleanup" statement.

So, a bit of searching and this is the result:

WARNING: DO NOT USE THIS ON A PRODUCTION ENVIRONMENT: the messages in the queue are lost forever!

use [YOURDB] declare @handle uniqueidentifier declare conv cursor for select conversation_handle from sys.conversation_endpoints open conv fetch next from conv into @handle while @@FETCH_STATUS = 0 Begin END Conversation @handle with cleanup fetch next from conv into @handle End close conv deallocate conv

To see how many conversations there a left:

select count(*) from sys.transmission_queue

Have fun! (I know I did)
More about the Service Broker and ending conversations soon on this channel.

UPDATE:

The really really quick 'n dirty way:

ALTER DATABASE LogistiekeMeetpuntenAdministratie WITH NEW_BROKER

Comment - Permalink -

Previous