DirectorySoftwareBlog Details for ".Net Blog - devtalk.dk"

.Net Blog - devtalk.dk

.Net Blog - devtalk.dk
A blog about .Net, software development and architecture, MicroISVs, lifehacks and tools.
Articles: 1, 2

Articles

Odense .Net User Group is Born
2008-05-30 10:37:00
Yesterday there was a developer community night in Odense arranged by Microsoft Denmark and Developer Evangelist Daniel Mellgaard Frost. Thumbs up for the arrangement - I didn't know many of the people, but during the night everybody got talking, and I think these kinds of events really does a lot for the community feeling! Apart from networking with other developers and strengthening the community, we had a second agenda: The formation of the new Odense .Net User Group It was a great success, and the interest was huge, and while debating possible subjects for talks on the forthcoming user group events, everybody was keen on hearing about almost anything with relation to software development and .Net - so I think we have a good thing going. We have in hurry set up a blog and a feed so that you can easily follow the group and the events in the future - so visit us at http://onug.dk and please tell everybody you know in the area about u...
Devtalk on DasBlog now supports OpenID
2008-05-28 12:46:00
Recently Scott Hanselman added support for OpenID to http://www.hanselman.com/blog/ and I have been wanting this for some time. Today I finally got around to getting the source to Dasblog (revision 823) available at Codeplex or SourceForge.net Currently its the same revision, but DasBlog will move permanently to Codeplex, so go for the Codeplex checkins in the future. I tried to build, but got a few errors, but figured out that there was an issue with renaming Utils to SiteUtilities, so i commented out the second definition of the "Utils" class in SiteUtilities.cs, and it compiled. I merged the new version with my existing Dasblog, but running it gave me the following error: Could not load type 'newtelligence.DasBlog.Web.Services.OpenI dHandler' from assembly 'newtelligence.DasBlog.Web.Services'." on this line: Line 159: <add verb="*" path="authenti...
ASP.NET MVC Preview 3 Released
2008-05-27 23:23:00
The MVC Team has today released the latest preview of the MVC Framework. Last we got the Interim Release, which was a source refresh and not an official preview. The previews are probably more stable in feature set, and are relatively well-tested, whereas the interim release feels more like a focus-group test with the developer community, of new ideas to the feature set that are not decided or sufficiently tested yet. This is a great Idea - it opens for dialog, and makes me feel that we can actually still make a difference to the final product. This Preview 3 release should probably be considered as the result of this, and I am very excited to see, what changes we are going to see. So far i have noticed the following: In the Interim release it was required that you return an ActionResult from an ActionMethod, this is no longer the case - you can choose either way, void or ActionResult. ...
More About: Microsoft , Web Development , Released
Source Analysis for C# released
2008-05-27 10:01:00
If you are the nitpicking kind  of developer, which I think I must confess that I am, you might be interested in the newly released tool Microsoft Source Analysis for C#  The tool also know as Stylecop analyzes your code with regard to best practices and some style and consistency rules. It differs from FxCop as it analyzes the source code directly instead of the binaries. I just had to try it out immediately so I installed it, and it integrates nicely with Visual Studio, and you find it in the Tools menu. I am currently working on a artificial neural network library, so I decided to give it a whirl with the analysis tool. Its a fairly small project. I had 309 errors mainly consisting of lacking headers, using statements not in namespace declaration, single line comments with three slashes and calling members w...
More About: Released
Off topic: Fun
2008-05-24 21:16:00
I just love xkcd - its my favourite comic at the moment, and I keep spamming everybody with my latest favourite. The strips are often diffult to decipher for any one other than computer scientists, and they are very geeky and just simply fun. I came across a youtube video today of a talk that the author Randall Monroe gave at Google december 2007, and I wanted to share that with you. The father of algorithm analysis Donald'Beware of bugs in the above code; I have only proved it correct, not tried it'  Knuth has appeared in xkcd a few times:     So Google invited him to ask Randall Monroe a question, and he askes him what his n log(log n) algorithm is for searching :) Furthermore the author of the Python programming language Guido van Rossum now works at Google, so in reference to this cartoon he a single question:   ...
More About: Topic , Irrelevant
Vista SP1, XP SP3 and the Console Session
2008-05-17 22:06:00
When remotely administrating Windows 2003 servers with Remote Desktop, you probably have encountered the problem, that the Terminal server has exceeded the maximum number of allowed connections. To overcome this issue, you might have used the /console switch to Mstsc.exe to reach the physical console session, also known as session 0, and then throw of any hanging connections. A neat little trick, also described in a previous post. But today it suddenly didn't work anymore, and I was kind of puzzled. It would seem that Vista SP1 and XP SP3 has introduced RDC version 6.1, with some changes. The /console switch is now deprecated, and when calling it from the command prompt it is simply silently ignored - well, how helpful, a little warning message might have been nice. Instead you use the /admin switch instead like so: mstsc /v:<server> /admin By using this switch against a...
More About: Console
A few changes to the blog
2008-05-15 16:38:00
I have done a few changes to the blog today to improve usability - I thought it was getting a little cluttered: Upgraded to newest version of dasBlog Removed adsense ads Cleaned and re-arranged the sidebar Improved styling of comments Added spam protection with Akismet Removed large Digg button Swithed to Feedburner (dasblog does a 301 redirect from the old feed) Added flares Fixed a few issues with the adminsection (bad upgrade i suppose?) Added dates to posts (about time) I hope this is an improvement, and if you have any issues you are most welcome to write me, and I will make sure to fix it.
Extension Methods - Part 3 - Best practices
2008-04-25 13:38:00
Part one - The basics Part two - Behind the scenes Part three - Best practices In the previous posts we had a look at what extension methods are, and how they work, and now we will consider how and when to use them. Having bought a new hammer, everything seems to look like nails, but are there any concerns that you should have when using extension methods, and what would be best practice for use? It is tempting to take all your utility and helper wrappers and convert them to extension methods, as it increases discoverability of the method to the developer, and makes the syntax more consistent than calling a static method on a wrapper. Compare these two: IntUtility.IsEven(even); e...
More About: Extension , Part , Methods , Part 3
Extension Methods - Part 3 - Best practices
2008-04-25 13:38:00
  Part one - The basics Part two - Behind the scenes Part three - Best practices   In the previous posts we had a look at what extension methods are, and how they work, and now we will consider how and when to use them. Having bought a new hammer, everything seems to look like nails, but are there any concerns that you should have when using extension methods, and what would be best practice for use? It is tempting to take all your utility and helper wrappers and convert them to extension methods, as it increases discoverability of the method to the developer, and makes the syntax more consistent than calling a static method on a wrapper. Compare these two: IntUtility.IsEven(even); even.IsEven(); But I would be worried about type pollution if extensions to the for instance the string method is a free for all, in that you might end up with an extension method hell, from all the various methods your developers have glued onto the type. The following...
More About: Extension , Methods , Part 3
Extension Methods - Part 2 - Behind the scenes
2008-04-25 13:37:00
Part one - The basics Part two - Behind the scenes Part three - Best practices In Part one we looked at how extension methods are implemented, and what they do. It is indeed very clever, but how does it work? Lets fire up Ildasm and a have a look at what is really going on behind the scenes. Looking at the IL for the example in part one we notice that the method call to the extension method is actually just translated to a static call to the method we implemented in the Extension s class. And we see that the Extension method has bee...
More About: Behind The Scenes , Part , Methods , Scenes
Extension Methods - Part 2 - Behind the scenes
2008-04-25 13:37:00
  Part one - The basics Part two - Behind the scenes Part three - Best practices   In Part one we looked at how extension methods are implemented, and what they do. It is indeed very clever, but how does it work? Lets fire up Ildasm and a have a look at what is really going on behind the scenes. Looking at the IL for the example in part one we notice that the method call to the extension method is actually just translated to a static call to the method we implemented in the Extension s class. And we see that the Extension method has been translated to a static method with the attribute "ExtensionAttribute" indicating that its an extension method. So actually there is nothing new in the IL to make this happen - the CLR is the same, its simply compiler magic where the ExtensionAttribute (set via the this shortcut in the method signature) ensures that a call to an extension method resolves to a another static method in the IL. This mea...
More About: Behind The Scenes , Methods , Scenes
Extension Methods - Part 1 - The basics
2008-04-25 13:34:00
Part one - The basics Part two - Behind the scenes Part three - Best practices Extension methods are a powerful way of gluing your own custom functionality onto types you don't own, and make them accessible like static instance methods to the type, instead of creating a wrapper around the type. The basics As a very simple example, we might want to have a method on the the simple int type, that evaluates whether the value is an even number. So we simply create a static method in a static class, and use the C# extension method shortcut this in the method signature, indicating that the compiler needs to perform a little magic for us with the int type, and implement the IsEven check. ...
More About: Part , Methods , Basics , The Basics
Extension Methods - Part 1 - The basics
2008-04-25 13:34:00
  Part one - The basics Part two - Behind the scenes Part three - Best practices   Extension methods are a powerful way of gluing your own custom functionality onto types you don't own, and make them accessible like static instance methods to the type, instead of creating a wrapper around the type. The basics As a very simple example, we might want to have a method on the the simple int type, that evaluates whether the value is an even number. So we simply create a static method in a static class, and use the C# extension method shortcut this in the method signature, indicating that the compiler needs to perform a little magic for us with the int type, and implement the IsEven check. namespace Extensions { public static class Extensions { public static bool IsEven(this int number) { return number % 2 == 0; } } } Now we can check whether the int is even or uneven with our extension method, here in a test method: [TestMethod] public void IsEven...
More About: Methods , Basics , The Basics
ADO.NET Entity Framework Designer will support real updates from database k
2008-04-01 23:30:00
In the ADO.Net Entity Framework Tools CTP2 which is the currently available version, you will most likely run into unexpected behavior when attempting to update your model from database. If you have created an entity model from your database model, and you decide to add tables and properties to existing tables, then you would expect that an update would add these tables and properties to your entity model existing mapped entities. However this is not currently the case. The designer will simply add new entities for all tables that doesn't correspond with you entity model. This makes iterative modeling of entities and database model impossible and is not acceptable for a real life situation. So i am glad that the ADO.NET team today announced that the next version will fix this issue and add a number of other productivity enhancing improvements to the designer. Now when can we have it?
More About: Updates , Support , Database , Designer , Real
ADO.NET Entity Framework Designer will support real updates from database k
2008-04-01 23:30:00
In the ADO.Net Entity Framework Tools CTP2 which is the currently available version, you will most likely run into unexpected behavior when attempting to update your model from database. If you have created an entity model from your database model, and you decide to add tables and properties to existing tables, then you would expect that an update would add these tables and properties to your entity model existing mapped entities. However this is not currently the case. The designer will simply add new entities for all tables that doesn't correspond with you entity model. This makes iterative modeling of entities and database model impossible and is not acceptable for a real life situation. So i am glad that the ADO.NET team today announced that the next version will fix this issue and add a number of other productivity enhancing improvements to the designer. Now when can we have it?
More About: Updates , Support , Database , Designer , Real
Linq to SQL is for prototyping, RAD and simple static solutions
2008-04-01 21:25:00
When one of our primary solutions were first developed, when I was still a freelancer at the company, I decided to go completely RAD and the solution was build completely with Subsonic. Subsonic is awesome, and I enjoyed it greatly - the RAD effect is amazing, and you really move. The created architecture although build to RAD extremes, has grown out of our hands, and is to say the least, not at all maintainable. For a complicated solution, the "on the spot" generated data access without well defined tiers just doesn't cut it. Its fun building with it, but the solution is a nightmare to maintain - pure software development romanticism. Its important to have fun while developing software, but it simply isn't fun having to do massive changes in a project that has virtually no division of responsibilities. So our hope was to create a nice scalable architecture with Linq to SQL, and so I have been doing one proof of concept...
More About: Simple , Solutions , Static
Linq to SQL is for prototyping, RAD and simple static solutions
2008-04-01 21:25:00
When one of our primary solutions were first developed, when I was still a freelancer at the company, I decided to go completely RAD and the solution was build completely with Subsonic. Subsonic is awesome, and I enjoyed it greatly - the RAD effect is amazing, and you really move. The created architecture although build to RAD extremes, has grown out of our hands, and is to say the least, not at all maintainable. For a complicated solution, the "on the spot" generated data access without well defined tiers just doesn't cut it. Its fun building with it, but the solution is a nightmare to maintain - pure software development romanticism. Its important to have fun while developing software, but it simply isn't fun having to do massive changes in a project that has virtually no division of responsibilities. So our hope was to create a nice scalable architecture with Linq to SQL, and so I have been doing one proof of concept after the other combined with the MVC framework. I w...
More About: Simple , Solutions , Static
Practice LINQ with LINQPad
2008-03-14 11:13:00
I came across this little nifty application called LINQPad by Joseph Albahari. Its free and just a plain executable with no installation needed. Like with Management Studio you can query your SQL Database but instead with LINQ.  It even gives you a Lambda expression for you query, so that you can tune your queries. I normally do a lot of queries to various databases every day with SQL from Management Studio, but to practice my LINQ skills I'm currently doing these with LINQPad instead. It supports LINQ to SQL, LINQ to Objects, LINQ to XML and contains 200 examples from the book C# 3.0 in a Nutshell. Actually you can execute any C# 3 og VB9 snippet, so its great for experimenting. LINQPad Download: http://www.linqpad.net/
More About: Practice
Practice LINQ with LINQPad
2008-03-14 11:13:00
I came across this little nifty application called LINQPad by Joseph Albahari. Its free and just a plain executable with no installation needed. Like with Management Studio you can query your SQL Database but instead with LINQ.  It even gives you a Lambda expression for you query, so that you can tune your queries. I normally do a lot of queries to various databases every day with SQL from Management Studio, but to practice my LINQ skills I'm currently doing these with LINQPad instead. It supports LINQ to SQL, LINQ to Objects, LINQ to XML and contains 200 examples from the book C# 3.0 in a Nutshell. Actually you can execute any C# 3 og VB9 snippet, so its great for experimenting. LINQPad Download: http://www.linqpad.net/
More About: Practice
Preface: Creating a website for production with ASP.NET 3.5, Visual Studio
2008-03-05 21:32:00
For almost a year, I have been the tech lead at the danish entrepreneur site Amino. Besides being the probably foremost forum for entrepreneurs in Denmark, we have launched a number of services catering for all business owners - the flagship and breadwinner being a site, where you can sell, buy or merge companies online: http://www.amino.dk/virksomhedsbors/ (Beware, its in danish) We are very agile, and we move extremely fast on changes - this obviously has some cost, and we now have several sites, that are rather similar - or at the least - have a lot of similar features and/or look and feel. But they are growing apart, and we need a more uniform platform to build our future sites on. Therefore we have chosen to rebuild the platform, with all the experience we have gained through the last year, and embracing our agility and love for new technology, we have decided to move to ASP.NET 3.5, Visual Studio 2008 - and we will be using LINQ to SQL and the MVC framework. From one p...
More About: Website , Creating , Production
Preface: Creating a website for production with ASP.NET 3.5, Visual Studio
2008-03-05 21:32:00
For almost a year, I have been the tech lead at the danish entrepreneur site Amino. Besides being the probably foremost forum for entrepreneurs in Denmark, we have launched a number of services catering for all business owners - the flagship and breadwinner being a site, where you can sell, buy or merge companies online: http://www.amino.dk/virksomhedsbors/ (Beware, its in danish) We are very agile, and we move extremely fast on changes - this obviously has some cost, and we now have several sites, that are rather similar - or at the least - have a lot of similar features and/or look and feel. But they are growing apart, and we need a more uniform platform to build our future sites on. Therefore we have chosen to rebuild the platform, with all the experience we have gained through the last year, and embracing our agility and love for new technology, we have decided to move to ASP.NET 3.5, Visual Studio 2008 - and we will be using LINQ ...
More About: Website , Creating , Production
Row_Number with constant in ORDER BY
2008-02-25 03:02:00
Row number is a nifty analytic function of MSSQL 2005, that allows you to assign a number to each row to which it is applied. This is very useful when paging a result set, where you can nest a select, and return only rows within a specified range - something like so: SELECT   RowNum,   Column From   (Select       ROW_NUMBER() OVER (ORDER BY Column) AS RowNum,       Column   FROM     Table) AS   Result WHERE   RowNum BETWEEN @Startrow AND (@Startrow + @Maxrows) This is nice, but what if you want to keep an existing sort - and not sort it again when assigning row numbers, or if you don't need it to be sorted, and want a more effective execution plan? The row number function wants the sort expression, so what to do? You could sort by a constant, but the problem is that SQL Server doesn?t allow a constant in the row_number function?s order by clause. ...
More About: Order
Row_Number with constant in ORDER BY
2008-02-25 03:02:00
Row number is a nifty analytic function of MSSQL 2005, that allows you to assign a number to each row to which it is applied. This is very useful when paging a result set, where you can nest a select, and return only rows within a specified range - something like so: SELECT   RowNum,   Column From   (Select       ROW_NUMBER() OVER (ORDER BY Column) AS RowNum,       Column   FROM     Table) AS   Result WHERE   RowNum BETWEEN @Startrow AND (@Startrow + @Maxrows) This is nice, but what if you want to keep an existing sort - and not sort it again when assigning row numbers, or if you don't need it to be sorted, and want a more effective execution plan? The row number function wants the sort expression, so what to do? You could sort by a constant, but the problem is that SQL Server doesn?t allow a constant in the row_number function?s order by clause. By chance I realized that...
More About: Order
Become a More Efficient Developer
2007-11-02 13:52:00
I have found that there are certain times where i hit a sort of coding frenzy, where I seem to be more efficient and more inventive. These are the times, where I get the most demanding tasks done, and often faster than I had expected. So naturally I have explored a little how to get into that frenzy - because if you can somehow invoke it on yourself, you might create some hours of coding frenzy every day, where you can get a heap of work done. Everybody is different, so what I have found to be true about myself, may not apply to you at all. Getting to that zone of coding frenzy is a lot like falling asleep: You are easily distracted until you get there, and even the smallest distractions may get you off the path completely. But when you get there, you are less likely to be distracted. 1. Plan the frenzy ahead, and organize your situation so that you are most likely to be left alone in that period. Let people now that you don't want to be disturbed. If need...
More About: Developer , Efficient
Become a More Efficient Developer
2007-11-02 13:52:00
I have found that there are certain times where i hit a sort of coding frenzy, where I seem to be more efficient and more inventive. These are the times, where I get the most demanding tasks done, and often faster than I had expected. So naturally I have explored a little how to get into that frenzy - because if you can somehow invoke it on yourself, you might create some hours of coding frenzy every day, where you can get a heap of work done. Everybody is different, so what I have found to be true about myself, may not apply to you at all. Getting to that zone of coding frenzy is a lot like falling asleep: You are easily distracted until you get there, and even the smallest distractions may get you off the path completely. But when you get there, you are less likely to be distracted. 1. Plan the frenzy ahead, and organize your situation so that you are most likely to be left alone in that period. L...
More About: Developer , Efficient
Expand and Debug a Custom BuildProvider
2007-10-27 21:06:00
Yesterday I described how to create a Custom BuildProvider, that automatically creates a string class with static string members from an xml file, containing localized text for a webpage. I wanted to generalize the class, so that i could use it for different purposes, for instance an "Urls" class to contain all site urls defined also in an xml file. I decided to define what to generate in the builder.stringsbuildprovider file, that also triggers the codegeneration like so: <? xml version="1.0" encoding="utf-8" ?> <!-- Builds static key/value "strings" classes from the defined values filename: which XML file contains the data classname: define the name of the class you want namespace: in which namespace should the class be created nodename: what is the single node name that define...
More About: Debug
Expand and Debug a Custom BuildProvider
2007-10-27 21:06:00
Yesterday I described how to create a Custom BuildProvider, that automatically creates a string class with static string members from an xml file, containing localized text for a webpage. I wanted to generalize the class, so that i could use it for different purposes, for instance an "Urls" class to contain all site urls defined also in an xml file. I decided to define what to generate in the builder.stringsbuildprovider file, that also triggers the codegeneration like so: <?xml version="1.0" encoding="utf-8" ?> <!-- Builds static key/value "strings" classes from the defined values filename: which XML file contains the data classname: define the name of the class you want namespace: in which namespace should the class be created nodename: what is the single node name that defines the data attributename: which name from xml attribute do you want as the lookupvalue valuename: which attribute from xml contains the value --> <classes&g...
More About: Debug , Ovid
Generate code with the BuildProvider
2007-10-26 00:31:00
Now and then you find yourself between a rock and a hard place in the attempt to make your code easy to understand, and easily maintainable at the same time. I am currently working on a fairly comprehensive refactoring of a site, or more accurately, a series of similar sites. Amongst other things I have implemented the possibility of localizing these sites. The localized text is placed in Resource.xml files, that are handled by a custom ResourceManager, and looks like this: <?xml version="1.0" encoding="utf-8" ?> <Resource> <!-- General terms --> <item name="Wanted">Købes< /item> <item name="For_Sale">Sælges& lt;/item> <item name="Merge">Fusion</item > </Resource> On the basepage i have a GetString method that uses the ResourceManager to get the localized text. I works nicely. No locked files, no sattelite assemblies and very transparent. But one thing...
More About: Code , Ovid
Generate code with the BuildProvider
2007-10-26 00:31:00
Now and then you find yourself between a rock and a hard place in the attempt to make your code easy to understand, and easily maintainable at the same time. I am currently working on a fairly comprehensive refactoring of a site, or more accurately, a series of similar sites. Amongst other things I have implemented the possibility of localizing these sites. The localized text is placed in Resource.xml files, that are handled by a custom ResourceManager, and looks like this: <? xml version="1.0" encoding="utf-8" ?> < Resource > <!-- General terms --> < item name ="Wante...
More About: Code
Outlook 2007 indexing bug
2007-08-16 21:19:00
Im really not much of a fan of Outlook 2007: Its slow and buggy. It keeps loosing my search folders, that i use for handling of categorized emails - and I have given op the use of flags, as they keep disappearing. Its horrendously slow - and it often freezes while attempting to open the most interesting of my mails. I have learned to live with this in anticipation of a service pack, that will adresse these problems, as I fell in love with the search. But now for weeks I haven't been able to find mails, that I know I have in my folders with search phrases that should return these mails. When searching I get the message "Search results may be incomplete because items are stil being indexed. Click here for more details". When clicking I am told that Outlook is currently indexing my mails, and some number of remaining items across all open mailboxes. This number has now been the same for weeks. No indexing is happening. It seems Outlook gets stuck indexing. So to resolve th...
More About: Outlook 2007 , Indexing
More articles from this author:
1, 2
81253 blogs in the directory.
Statistics resets every week.


Contact | About
© Blog Toplist 2009 - Supported by Web Catalog - SEO by FeWorks
eXTReMe Tracker