<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom"><title type="text">Blog posts by Mats Decker</title><link href="http://world.optimizely.com" /><updated>2010-02-24T15:04:00.0000000Z</updated><id>https://world.optimizely.com/blogs/Mats-Decker/</id> <generator uri="http://world.optimizely.com" version="2.0">Optimizely World</generator> <entry><title>How to restore user when database is restored.</title><link href="http://labs.dropit.se/blogs/post.aspx?id=f5c65576-5358-430c-9bf7-428bf29bc4f9" /><id>&lt;p&gt;A thing that always annoys me, when backup-restoring a database between database servers, is the mismatch between the sql login and database login. In some way they have the same name but some id isn&#39;t equal so they don&#39;t match. Atleast in newer versions of SQL Server you could delete one and re-map it.&lt;/p&gt;
&lt;p&gt;Stumbled across this script that matches the server login and database login.&lt;/p&gt;
&lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;USE [Database]
EXEC sp_change_users_login &#39;Update_One&#39;, &#39;Username&#39;, &#39;Username&#39;

&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This only works when the usernames match.&lt;/p&gt;</id><updated>2010-02-24T15:04:00.0000000Z</updated><summary type="html">Blog post</summary></entry> <entry><title>Developer lunch: Entity Framework in .NET 4</title><link href="http://labs.dropit.se/blogs/post.aspx?id=9b79a088-9d3a-40cc-bf26-1354f8f3554c" /><id>&lt;p&gt;For &quot;my&quot; developer lunch i selected an awesome session from Microsoft PDC09, called &lt;a href=&quot;http://microsoftpdc.com/Sessions/FT10&quot; target=&quot;_blank&quot;&gt;Evolving ADO.NET Entity Framework in .NET 4 and Beyond&lt;/a&gt;, where Microsoft&#39;s Shyam Pather and Chris Anderson takes us through an hour of as many new features in the new Entity Framework as possible.&lt;/p&gt;
&lt;p&gt;Especially interesting is the ability to use POCO-classes (Plain Old CLR Objects) and the &quot;Model first&quot; concept where you remove the dependency to any base classes and begin with the logic tier. Also, with the embedding of LinqToSql into Entity Framework, the rendering of SQL-clauses and implementation of Stored Procedures in the context really takes the data access layer to a new level and remove many pitfalls seen in the past with OR mappers.&lt;/p&gt;
&lt;p&gt;Adding to this with the ability to test applications with fake repositories and such i think this is the way to build applications for quite a while.&lt;/p&gt;</id><updated>2010-02-13T14:10:00.0000000Z</updated><summary type="html">Blog post</summary></entry> <entry><title>PDC09 Session - Data Programming and Modeling for the Microsoft .NET Developer</title><link href="http://labs.dropit.se/blogs/post.aspx?id=261fd379-9c74-4dd6-8ad9-f293c3d37047" /><id>&lt;p&gt;
&lt;/p&gt;&lt;p&gt;Don Box and Chris Anderson went through Entity Framework and the new stuff that has improved the developer experience. For instance you can use Entity Framework and still use IDataReader etc getting the data so you may start migrating from SqlConnection to Entity Framework without committing entirely. They also addressed the never ending story about where the framework should be modeled (database, definitions file, C# code) and the answer is ... the way you like it :). It all depends on where the model origins, for an instance if you have an existing database it will be hard to make another model in code.&lt;/p&gt;
&lt;p&gt;They also showed the entity framewark talking with Share Point over OData(!) where they could access the data via and atom feed and manipulate that data directly in the share point server. I really have to look into odata!&lt;/p&gt;
&lt;div&gt;On another note i really have to see more about &#39;M&#39; the &quot;data language&quot;, which they only talked about peripherally.&lt;/div&gt;
</id><updated>2009-11-17T23:14:00.0000000Z</updated><summary type="html">Blog post</summary></entry> <entry><title>A very interesting first day at PDC 09 is coming to an end.</title><link href="http://labs.dropit.se/blogs/post.aspx?id=9784f739-d3b2-470f-bebb-7cca7ec01a9e" /><id>&lt;p&gt;We&#39;ve been here in Los Angeles for a couple of days doing tourist stuff but today we were back to work. And a very interesting day at that. We rather early decided to attend the Windows 7 Developer Boot Camp session to see firsthand the new and updated features of the latest version of Windows.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;After the initial speak of Mark Russinovich, going through general Windows 7 improvements, Arun Kishan and Landy Wang kickstarted the conference with Kernel and Memory changes.&lt;/p&gt;
&lt;p&gt;Since i&#39;m a C# developer focusing on web, there were a lot of stuff going over my head with some of the extremely technical stuff but still very interesting to know what goes around below when writing my very high level language code. But in short you should get Windows 7 for clients or upgrade to Windows Server 2008 R2 just for perfomance gain on the same computer :).&lt;/p&gt;
&lt;p&gt;Arun addressed redesign of access to and handling of threads and strains. He also talked about core parking, where cores not used enters sleep mode and therefore takes a lot less power to a laptop battery&#39;s relief and in a global perspective takes a lot less power from the power grid when a billion computers are not running their two billion plus cores at full effect.&lt;/p&gt;
&lt;p&gt;Landy on the other hand talked about how memory managing has changed to being more suspect about application allocation memory in an abusive way, ie when an application tries to allocate like all pages in memory the memory manager lowers the priority of the allocated memory so that smaller applications aren&#39;t effected so the only thing running slowly is the abusing program itself. By having it this way Windows 7 allocates a lot of memory to begin with but is&#39;s good memory allocation since it gives it to applications that need it. In short this means that it pays of to write good code handling memory stuff nowadays contrary to pre Windows 7 where the good applications were the ones paying for the bad applications&#39; memory handling.&lt;/p&gt;
&lt;p&gt;This is only an outtake of their whole presentations but the presentations should be online very soon and every developer should see them.&lt;/p&gt;</id><updated>2009-11-17T04:54:00.0000000Z</updated><summary type="html">Blog post</summary></entry> <entry><title>How to log log4net</title><link href="http://labs.dropit.se/blogs/post.aspx?id=76857a1c-9a27-4fff-bfda-f8710b3891f7" /><id>&lt;p&gt;I had some problems with log4net not logging my site at all. It just created empty(0kB) log files, turned out to be missing write permissions to the log files directory.&lt;/p&gt;
&lt;p&gt;But the interesting thing is how i found it by logging log4net by just adding two settings to my web.config file.&lt;/p&gt;
&lt;pre class=&quot;language-csharp&quot;&gt;&lt;code&gt;&amp;lt;appSettings&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;add key=&quot;log4net.Internal.Debug&quot; value=&quot;true&quot;/&amp;gt;
&amp;lt;/appSettings&amp;gt;

&amp;lt;system.diagnostics&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;trace autoflush=&quot;true&quot;&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;listeners&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;add
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; name=&quot;textWriterTraceListener&quot;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; type=&quot;System.Diagnostics.TextWriterTraceListener&quot;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; initializeData=&quot;C:\temp\log4net.txt&quot; /&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/listeners&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/trace&amp;gt;
&amp;lt;/system.diagnostics&amp;gt;
&lt;/code&gt;&lt;/pre&gt;</id><updated>2009-10-14T12:37:00.0000000Z</updated><summary type="html">Blog post</summary></entry></feed>