Do you know code with constructors containing each and every property? I’ve never had a name for CoP before this post. Thanks Richard! Btw.: Extension methods do the job as well without the need to know a second object ;-)
Recent content on lennybacon.com
- Generator
- Hugo -- gohugo.io
- Public lists
-
HWC DUS
Conference: dotnet Cologne 2009
On the 15th of Mai the Cologne/Bonn .NET Community invited to the Microsoft Campus in Cologne for a day full of WPF and Silverlight – the dotnet Cologne 2009. My submission to the Call for Papers was the only Talk NOT talking about User Interfaces… but was accepted – Thanks, to Roland, Albert and Stefan! I was happy that my presentation was not held in room 404 ;-) Hoper to see you on one (or all) of the next events:
WPF Fast Start – Coole Daten-Visualization in 15 min.
Wie man Benutzeroberflächen für Desktops und das Web mit der Windows Presentation Foundation (WPF) erstellt, das können Sie jetzt im MSDN-Portal für Softwarehersteller (ISVs) lernen – in einer Viertelstunde. Möglich macht’s WPF Fast Start, eine WPF-Komponente, die Sie in eine Ihrer Anwendungen implementieren und testen können. Einfach herunterladen und nach dem beigefügten Tutorial vorgehen. http://www.microsoft.com/germany/msdn/my/softwarehersteller/WPF_FastStart.mspx
MCPD’ed as Enterprise Application Developer 3.5
Today I got confirmed I passed :-)
Visual Studio Team please add comment CSS selection
Until then this Visual Studio macro helps to comment and uncomment in CSS files. Imports System Imports EnvDTE Imports EnvDTE80 Imports EnvDTE90 Imports System.Diagnostics Public Module StyleSheets Public Sub CommentCss() Dim ts As TextSelection = DTE.ActiveDocument.Selection Dim text As String = ts.Text.Trim(" ") Dim fileName = DTE.ActiveDocument.FullName If Not fileName.EndsWith(".css") Then DTE.ExecuteCommand("Edit.CommentSelection") Return End If If String.IsNullOrEmpty(text) Then Return End If ts.Text = "/*" + text + "*/" End Sub Public Sub UncommentCss() Dim ts As TextSelection = DTE.
Let’s Kill Internet Explorer 6
I just stumbled over Richards initiative on killing IE6… I extended the message to display and added it to my blog and our companies web site: Here is the mark up: <!--[if lte IE 6]> <div style="background-color: #f9f4ad; border: solid 1px #e0d200; padding: 8px; margin-top: 10px; text-align: center;"> <p>You are using an <strong>old and unsupported version of Internet Explorer.</strong></p> <p>In order to get the most out of the web, you should get a <a href="http://www.
IX powered ASP.NET Seminar vom 23.-27. März in Essen
Die IX veranstaltet zusammen mit IT-Visions (Dr. Holger Schwichtenberg) ein .NET Seminar, das wahlweise in verschiedenen, zum Teil aufeinander aufbauenden Blöcken gebucht werden kann. Dabei werden die Grundkonzepte von .Net, die Sprachsyntax von C#, die Handhabung der Entwicklungsumgebung Visual Studio, die wichtigsten Funktionen der .Net-Klassenbibliothek geschult. Neben allgemeinen .Net-Seminaren gibt es spezielle Kurse zu Desktop-Anwendungen mit Windows Forms und WPF sowie Web-Anwendungen mit ASP.NET und AJAX. Anmeldung per Mail an mich oder die IX-Konferenzseite…
Sorting generic Dictionaries
A colleague (Daniel Wessels) just asked me how I would sort a generic Dictionary because it has no build in Sort method. A solution that uses functionality that is built in would be to (ab)use a generic list: var dictionary = new Dictionary<string, int>() { {"George",42}, {"Mike",28}, {"Pete", 56}, {"Sam", 33}, }; var list = dictionary.ToList(); list.Sort((a, b) => a.Value.CompareTo(b.Value)); foreach (var keyValuePair in list) { Console.WriteLine( string.Concat( keyValuePair.Key, " ", keyValuePair.
MCPD ASP.NET 3.5
I just received the confirmation to the exam i did a few weeks ago:
Changing background color of a textbox from a CustomValidator’s client side script
I’m currently at a customer in Hannover and was asked how to change the background color of a textbox from the client side validation method called by a CustomValidator control. Here is a sample how to access the pages validation properties including the one from the custom validator: function validateRequired(sender, args) { if (args.Value == null) return; if (args.Value.length > 0) return; args.IsValid = false; var txt = $get(sender.controltovalidate); if (txt) { txt.
Nic is telligent now…
My good friend Nicolas Goetz has just started to work as International Account Manager (DE, AT … up to Asia) for famous and well known telligent. The guys around Rob Howard are the creators of “Community Server” (the stuff that runs e.g. www.asp.net and loads of other community sites). Nice move, Nic. Wish you all the best.
This URLs TAG
Get yours at http://tag.microsoft.com/
Snow, snow, snow
The best time to produce loads of code is when It’s cold outside …
ReadAssembylName a handy tool to get fully qualified assembly names
I’m currently working on a project together with Jürgen Bayer (autor of the C# 2008 Codebook and the Visual C# 2008 Kompendium) that makes use of a lot of dependency injection. The configuration files are blown with fully qualified assembly names but how do you get them? Working for instance with custom providers for ASP.NET membership, ASP.NET profile or ASP.NET roles gets you in the same circumstances. In the past I fired up Red Gate’s Reflector and loaded the needed assembly to copy the name.
SOA, WCF and Distributed Systems talk in Frankfurt
Kostja invited Michael and me to speak at the next event of the .net user group in Frankfurt (Germany). We’ll show some real project implementations and tell stories from the technology and architecture trenches. The event will be hosted at Microsoft in Bad Homburg. Further details can be found here…
netug-niederrhein.de User Group Meeting
The user group met today at netzkern, a company in Wuppertal specialized in .net development and SiteCore - thanks the venue and drinks! Thanks to Matthias for the pic! This time we had “Sliverlight 2 in the real world” as a topic presented by Florian Kruesch. He presented new visual features as well as use cases and projects he’s working on. Because he didn’t touch the non-visual stuff like Isolated Storage he invited me to show something that I’ve build with the bits:
First Day at PDC
The first day of PDC is almost gone. I met my former Boss Clemens Vasters had a nice conversation during lunch with John Lam and “a guy with a blue shirt” that I’m not allow to cite here :-). Micheal Willers, Ron Jacobs and I talked about SOA, Dublin, OSLO and the sometimes hard job trying to explain people the problems they will have in the feature (commonly known as archtecture :-P).
Freeing up Disc Space Batch
In reply to Scott Hanselmann’s post on freeing up disc space I’d like to share a batch that I’ve written some time ago to clear different temp directories for instance before I run a backup. the referenced file “cleanup.txt” just contains the text “yes” (w/o quotes) to automate the cacls command. @Echo off for /f "tokens=3 delims=\" %%i in ("%USERPROFILE%") do (set user=%%i) 2>&1 @Echo on * del /F /S /Q "C:\Users\%user%\AppData\Local\Microsoft\WebsiteCache\*.
UrlAuthorization with ASP.NET Routing
What is life without security. In the last posts I told you how to do URLRewriting with the ASP.NET 3.5 RoutingEngine and how to pass query strings to the destination Web Form. In this post I’ll add some authorization code to let ASP.NET Authentication mechanisms play well. The first step is to figure out which authentication mechanism has taken place in the local configuration file. For the case of forms based authentication it would be nice to redirect to the configured login Web Form, for all other authentication mechanisms we can only throw a security exception and set a HTTP status code.
ASP.NET Routing for URLRewriting with QueryStrings
In the last post I showed how to use the ASP.NET 3.5 Routing Engine for URL rewriting purposes. I want to go further in this post by adding the ability to add variables into a route path and forward and append query string variables to the destination Web Form request. A route can contain one or more variables expressed by its {name}. RouteTable.Routes.Add( new Route( "articles/{id}", new devcoach.Web.RoutingPageHandler())); Inside of the RoutingHandler we can iterate through the variables by accessing them by the RouteData property on the parameter passing the RequestContext:
ASP.NET Routing for URLRewiting
With ASP.NET MVC comes a component that is called the routing engine. In ASP.NET MVC it is responsible to assign a controller to an incoming request: From an conceptional view the routing engine consists of two parts: a) The RouteTable which stores the information which routes are defined b) The UrlRoutingModule which finds matches to routes on incoming requests. But the routing engine is not limited to MVC in its use.
The only feature in word 2007 that is not easily accessible..
A note to myself :-)
Do not trust user input - live.com
I was searching for a colleague’s blog in a “legacy search engine” ;-)… and found a page in Kay Giza’s blog which linked “Niel Gräf” to somewhere. It wasn’t his blog, It was a linked “Live Search”: http://search.live.com/results.aspx?mkt=de-de&FORM=TOOLBR&q=“Nils+Gräf”&FORM=TOOLBR Kay please don’t take it personal… What we see is a foreign page calling into Live without encoding the URL properly. That is what every non technical publisher will do - because they do not know better!
Database-Normalization And Scalability
In his last post Jeff Atwood summarized really really nice the discussions I have (and had over the last year) while helping customers on large scaling web sites, service-oriented back-ends or just the plain old data access topic. Thanks Jeff! All others: Go read!
Thoughts on JBOWS and the victom of "yet another tool"
I really enjoyed reading Nicks post here. If you take a group of well-meaning and intelligent engineers, and you give them a process that looks like a normal software development process, and you train them on it, and they believe that this process works… and you add SOA… you get JaBOWS (Just a Bunch of Web Services). Many companies out there trying to get on the SOA road fail by believing a tool can lead the way.
Simplify LINQ code?
A few days ago a developer at a customer asked me how he could simplify the following code as he identified a pattern: X tries and the error handling. public PlanungsGruppenLesenA PlanungsGruppenLesen( PlanungsGruppenLesenF param) { PlanungsGruppenLesenA ret = new PlanungsGruppenLesenA(); if (ret.PlanungsGruppen == null) { throw new ArgumentNullException("param.PlanungsGruppen"); } int nRetry = 0; while (nRetry < DBWerkzeug.MaxWiederholungen) { try { using (XXX_POC.POC db = new XXX_POC.POC( DBWerkzeug.GetConnectionString())) { var q = from p in db.
JSON support for IE
Pretty helpful while working on WCF services with JSON serialization and AJAX: REGEDIT4 [HKEY_CURRENT_USER\Software\Classes\Mime\Database\Content Type\application/json] "CLSID"="{25336920-03F9-11cf-8FD0-00AA00686F13}" "Extension"=".json"
NRW07 - succeeded!
Last friday we (Stephan Oetzel and me - JustCommunity e.V.) held the NRW07 (Germany’s biggest software developer and IT professional community conference) in my hometown Wuppertal at die Börse. The organization of the event and founding the company devcoach were the reason why it was pretty quite around my blog the last months - so sorry for that. Photo by Thomas Freudenberg The event was a huge success. we had around 130 people (including speakers) - a great audience from all over the country.
Running ReSharper 3.0 with VS 2008 (Beta 2)
This morning I downloaded Visual Studio 2008 Beta 2.0 and installed it over the day. As always when a new version is out I’m looking forward to use the new features, but… As always I start missing the Add-Ins I usually use in the old version of the IDE - especially this is the case with ReSharper. So I tried out a few things and finally got it to run.
My shopping list for today :-)
1 x Intel Core 2 Duo E6850 (4096Kb/2x3Ghz) 64bit (Conroe) 1 x Arctic Freezer 7 Pro 4 x 2048MB DDR2 1 x Chieftec “Bravo-Series” Tower (400W) Black 3 x HITACHI DeskStar 250GB (SATA II) 1 x ABIT IN9 32X-MAX WiFi “Beast” 1 x DVD-RW SATA 1 x NVIDIA Geforce Club3D 8600GT (512MB)