# Thursday, October 11, 2007

RONUA

Exciting! I've been invited by iSDC to do a presentation for RONUA, the ROmanian .NET User Association.

So I'll be in Romania in November. Land of Dracula?!?! 

 

#    Comments [2] |
# Wednesday, October 10, 2007

Maine Developer Network on Facebook.

Maine Developer Network on Facebook. In following of the Chris and Bob roadshow we've created an online group on Facebook for our group. Go to http://www.facebook.com/group.php?gid=6451457651 to join.

#    Comments [0] |
# Wednesday, October 03, 2007

Windows Vista gadget settings are a bad place for passwords

I did some more research on the settings part of Windows Vista gadgets and storing username/passwords in plain text in your settings is not a smart thing to do.

You can use the JavaScript code below to do basic encryption and decryption.

        function encrypt( plainString )
	{
            if ( plainString == "" ) return "";

            var xor_key = 2;
            var result = "";
            for( i = 0; i < plainString.length; ++i)
            {
		result += String.fromCharCode( xor_key ^ plainString.charCodeAt(i) );
            }
            return result;
	}

	function decrypt( encryptedString ) 
	{
            if ( encryptedString == "" ) return "";
            var xor_key = 2;
            var result;

            for( i = 0; i <  encryptedString.length; i++)
            {
		result += String.fromCharCode( xor_key ^ encryptedString.charCodeAt(i));
            }
	    return result;
	}

Read more background info here.

#    Comments [0] |
# Thursday, September 27, 2007

Windows Vista gadget deployment

A Windows Vista gadget is just a zipfile with at a specified location the 'gadget.xml' file.

A mistake I've been making repeatedly is that I right click the folder with my sources and choose 'Send to|Compressed Folder'. Doing this adds the selected folder to the zip. I rename the zip to have the '.gadget' extension and then install the gadget.

Result: nothing happens. :-(

At the 'root' of the zip is a folder with the name of the folder I selected, my sources are one level too deep for Vista to find?!

There is however zero feedback from Vista. Very frustrating. A message saying something like 'Invalid gadget: gadget.xml not found.' would be a big help.

#    Comments [1] |

XDrive Windows Vista gadget

I just finished working on my first Windows Vista gadget.

It's a small gadget which sits in the sidebar and shows the amount of free space on you AOL XDrive (5GB of free online space).

Download the gadget here.

Read more about the making of... on my AOL blog.

#    Comments [0] |
# Friday, September 21, 2007

SDC 2007

This week we, the SDN, organized the SDC 2007 (Software Developer Conference 2007). It's the 16th time we organized this two day conference and this year, like the years before, was a great success!!! We had 450 people at the conference with 30 internationally acclaimed speakers and great sponsors like Microsoft and Ordina.

Below a couple of pictures to give an impression of the event.


Full rooms, people watching, listening, learning, absorbing, captured by the speaker.


Speakers in the speakerroom getting ready for their next
session (Kevin McNeish, Stephen Forte, Chad Hower, e.a.).


Carl Franklin missed 2 flights and couldn't make it to the conferece, so no .NET Rocks show,
but the crew of the Internet show Mondays was on site to provide entertainment on the
Monday night of the conference (Richard Campbell, Mark Miller, Karen Greenwald).

#    Comments [0] |
# Thursday, September 20, 2007

TRUVEO - Complete ASP.NET sample

I've completed a comprehensive sample application integrating Windows Communication Foundation, ASP.NET and TRUVEO search into a custom search engine. Check it out here.

#    Comments [0] |
# Tuesday, September 18, 2007

TFS - Pending changes

Sometimes, like before starting a build, you want to see how many files are checked out, which pending changes there are and who still has pending work. VSTS does not offer a standard report for this, but you can use the tf.exe command line tool to query for this information:

tf status "$/ProjectName"  /server:ServerName /recursive /user:*

#    Comments [0] |
# Tuesday, September 11, 2007

SQL Server 2005 - Export Role

I needed to export all rights granted to a specific role from a SQL Server 2005 database in order to check these roles into our TFS server.

/*
	Script	:	ExportRole.sql
	Version	:	1.0
	Date	:	11-09-2007
	Author	:	Mark Blomsma, Develop-One (www.develop-one.com)
	Desc.	:	Export all rights for a role from a SQL Server 2005 database.
			Including Service Broker messages, contracts and services.
*/

-- Role is the parameter for this procedure
DECLARE @Role VARCHAR(40)
SET @Role = 'Rolename goes here'

-- Retrieve the roleid for the role which we need to export
DECLARE @RoleId int
SELECT 
	@RoleId = dp.principal_id
FROM
	 sys.database_principals dp
WHERE
	dp.name = @Role

-- Declare a temp table for collecting results.
-- Each grant statement will be a line in the results table.
DECLARE @Result 
TABLE
	(
		Line VARCHAR(256)
	)

-- Use the current database
INSERT INTO
	@Result (Line)
VALUES
	('USE [' + DB_NAME() + ']')

-- Declare variable for retrieving data from cursor
DECLARE 
	@permission_type	char(4),
	@permission_name	sysname,
	@object_name		sysname,
	@object_type		char(2),
	@type_desc			nvarchar(60)

-- Declare object cursor for retrieving rights on database objects.
DECLARE objectCursor CURSOR LOCAL FORWARD_ONLY READ_ONLY FOR
SELECT     
	p.type AS permission_type, 
	p.permission_name, 
	o.name, 
	o.type AS object_type, 
	o.type_desc
FROM
	sys.database_permissions AS p 
INNER JOIN
	sys.objects AS o ON p.major_id = o.object_id
WHERE
	(p.grantee_principal_id = @RoleId)
AND (
		p.state = 'G'
		OR
		p.state = 'W'
	)
ORDER BY
	o.type, o.name

OPEN 
	objectCursor;

-- Fetch first row with object permissions
FETCH NEXT FROM 
	objectCursor
INTO
	@permission_type,
	@permission_name,
	@object_name,
	@object_type,
	@type_desc	

-- Loop through object permissions
WHILE @@FETCH_STATUS = 0
BEGIN
	-- Insert permission into results
	INSERT INTO 
		@Result (Line)
	VALUES
		('GRANT ' + @permission_name + ' ON [' + @object_name + '] TO [' + @Role + '];')

	-- Fetch next row
	FETCH NEXT FROM 
		objectCursor
	INTO
		@permission_type,
		@permission_name,
		@object_name,
		@object_type,
		@type_desc	
END

-- Cleanup cursor
CLOSE 
	objectCursor
DEALLOCATE
	objectCursor

-- Declare object cursor for retrieving rights on message types.
DECLARE messagetypeCursor CURSOR LOCAL FORWARD_ONLY READ_ONLY FOR
SELECT DISTINCT    
	p.type AS permission_type, 
	p.permission_name, 
	mt.name
FROM
	sys.database_permissions AS p 
INNER JOIN
	sys.service_message_types AS mt ON p.major_id = mt.message_type_id
WHERE
	(p.grantee_principal_id = @RoleId)
AND (
		p.state = 'G'
		OR
		p.state = 'W'
	)
ORDER BY
	mt.name

OPEN 
	messagetypeCursor;

-- Fetch first row with message type permissions
FETCH NEXT FROM 
	messagetypeCursor
INTO
	@permission_type,
	@permission_name,
	@object_name	

-- Loop through message type permissions
WHILE @@FETCH_STATUS = 0
BEGIN
	-- Insert permission into results
	INSERT INTO 
		@Result (Line)
	VALUES
		('GRANT ' + @permission_name + ' ON MESSAGE TYPE :: [' + @object_name + '] TO [' + @Role + '];')

	-- Fetch next row
	FETCH NEXT FROM 
		messagetypeCursor
	INTO
		@permission_type,
		@permission_name,
		@object_name
END

-- Cleanup cursor
CLOSE 
	messagetypeCursor
DEALLOCATE
	messagetypeCursor


-- Declare object cursor for retrieving rights on contracts.
DECLARE contractCursor CURSOR LOCAL FORWARD_ONLY READ_ONLY FOR
SELECT DISTINCT    
	p.type AS permission_type, 
	p.permission_name, 
	c.name
FROM
	sys.database_permissions AS p 
INNER JOIN
	sys.service_contracts AS c ON p.major_id = c.service_contract_id
WHERE
	(p.grantee_principal_id = @RoleId)
AND (
		p.state = 'G'
		OR
		p.state = 'W'
	)
ORDER BY
	c.name

OPEN 
	contractCursor;

-- Fetch first row with message type permissions
FETCH NEXT FROM 
	contractCursor
INTO
	@permission_type,
	@permission_name,
	@object_name	

-- Loop through message type permissions
WHILE @@FETCH_STATUS = 0
BEGIN
	-- Insert permission into results
	INSERT INTO 
		@Result (Line)
	VALUES
		('GRANT ' + @permission_name + ' ON CONTRACT :: [' + @object_name + '] TO [' + @Role + '];')

	-- Fetch next row
	FETCH NEXT FROM 
		contractCursor
	INTO
		@permission_type,
		@permission_name,
		@object_name
END

-- Cleanup cursor
CLOSE 
	contractCursor
DEALLOCATE
	contractCursor



-- Declare object cursor for retrieving rights on services.
DECLARE serviceCursor CURSOR LOCAL FORWARD_ONLY READ_ONLY FOR
SELECT DISTINCT    
	p.type AS permission_type, 
	p.permission_name, 
	s.name
FROM
	sys.database_permissions AS p 
INNER JOIN
	sys.services AS s ON p.major_id = s.service_id
WHERE
	(p.grantee_principal_id = @RoleId)
AND (
		p.state = 'G'
		OR
		p.state = 'W'
	)
ORDER BY
	s.name

OPEN 
	serviceCursor;

-- Fetch first row with message type permissions
FETCH NEXT FROM 
	serviceCursor
INTO
	@permission_type,
	@permission_name,
	@object_name	

-- Loop through message type permissions
WHILE @@FETCH_STATUS = 0
BEGIN
	-- Insert permission into results
	INSERT INTO 
		@Result (Line)
	VALUES
		('GRANT ' + @permission_name + ' ON SERVICE :: [' + @object_name + '] TO [' + @Role + '];')

	-- Fetch next row
	FETCH NEXT FROM 
		serviceCursor
	INTO
		@permission_type,
		@permission_name,
		@object_name
END

-- Cleanup cursor
CLOSE 
	serviceCursor
DEALLOCATE
	serviceCursor



SELECT
	*
FROM
	@Result

#    Comments [0] |

SQL Server 2005 - TRUNCATE TABLE

Useful change to know about.

In SQL Server 2000 you needed quite some permissions (SS2000: TRUNCATE TABLE permissions default to the table owner, members of the sysadmin fixed server role, and the db_owner and db_ddladmin fixed database roles, and are not transferable.)

In SQL Server 2005 you're allowed to perform a truncate table as soon as you have 'ALTER' permissions on that table.

#    Comments [0] |
# Wednesday, September 05, 2007

Silverlight 1.0 available

Somasegar blogs:

I am very pleased to say that we have delivered on that promise and today we announced the release of Silverlight 1.0 as well as Expression Encoder 1.0.  Both are available on the web today! 

#    Comments [0] |
# Thursday, August 23, 2007

Silverlight and Live Search - Tafiti

Microsoft has created a very cool experimental interface for searching the web, implementing a Silverlight based userinterface on top of Live Search.

Testdrive it at: http://www.tafiti.com

#    Comments [1] |
# Wednesday, August 22, 2007

AOL Video - C#, REST and WCF 3.5

I've just posted a new blog entry on my AOL blog. I think it turned out really cool!

I use Windows Communication Foundation 3.5 (beta 2) to create a service contract, data contract and client channel and then connect to a non WCF, REST based service.

More on: http://dev.aol.com/node/595.

#    Comments [0] |

Vista Gadgets

I just installed two new Vista sidebar gadgets:

Visual Studio 2008 Global Launch Wave - this gadget counts down to the launch of VS2008.

SDC 2007 - this gadget counts down to the start of the annual software conference organized by the SDN.

#    Comments [0] |
# Sunday, August 19, 2007

Code Camp 8

Chris Bowen blogs about the registration of Code Camp 8 being open! A great event for the New England and Maine developers!

Code Camp 8: Rise of the Silverlight Surfer will be held at the Microsoft offices in Waltham, MA on the weekend of September 29th and 30th.  Registration at 8:30 AM, sessions start at 9:00.  As always, it's a completely free event (and you'll probably walk away with some swag as well.)

#    Comments [0] |
# Thursday, August 16, 2007

Gartner ITxpo 2007 in Cannes

More excellent news: Omnext will be present as a sponsor at the Gartner ITxpo 2007 in Cannes.
This ITxpo 2007 is designed to help IT and business executives exploit technology to better their business.

Read more: http://www.omnext.net/bedrijf/news/content/gartner_symposium_itxpo_c/index.xml

#    Comments [0] |

Gartner Financial Services Technology Summit 2007

Excellent news: Omnext will be present as a sponsor on the 24th and 25th of September at the Gartner Financial Services Technology Summit 2007. Read more: http://www.omnext.net/bedrijf/news/content/gartner_financial_service/index.xml

#    Comments [0] |
# Wednesday, August 15, 2007

AOL Video Search - C# Sample

Read my AOL post on using XmlDocument to invoke the REST based AOL Video Search here.

#    Comments [0] |

AOL

My publishing agent, StudioB, has landed me a great job as part the AOL blogging team and the AOL editiorial board. AOL has a number of cool service based API's, like AOL Video Search, AIM, OpenAuth and manu more. I'll be writing articles and blog posts about using these API's in C# and .NET.

I've been given my own blog space on http://dev.aol.com, check it out at: http://dev.aol.com/blog/22109.

#    Comments [0] |