An academic release of Dryad and DryadLINQ is available for download on Microsoft Research site: Dryad and DryadLINQ Academic Release.
Dryad is a distributed computing engine for clusters running Windows HPC Server 2008. DryadLINQ allows to use LINQ programming model in distributed application running on Dryad.
Wednesday, May 11, 2011
Friday, May 6, 2011
Parallel programming with .NET 4.0
Microsoft published 12 articles on parallel programming with .NET 4.0. You can download them here: Articles on Parallel Programming with the .NET Framework 4. These articles are mostly about TPL, PLINQ and thread safe data structures introduced with .NET 4.0.
Syntaxhighlighting for Blogger
Added syntax highlighting for the code snippets in my postings. Thanks to Heisencoder for his tutorial!
Friday, April 15, 2011
ReSharper's Object Initializer Quick Fix and IDisposable
This week I had to realize that not every Resharper suggestion is really useful. Some quick fixes carelessly applied can even introduce flaws into your code. The quick fix I have in mind is Resharpers suggestion to use an object initializer instead of creating an instance with subsequent assignments to its properties. Applying this quick fix to following code:
Things learned:
var person = new Person(); person.Name = "John"; person.Lastname = "Doe";would change it to:
ver person = new Person {
Name = "John", Lastname = "Doe" };
This quick fix is really handy and can imho improve the readability of the code. But it should not be applied when the type is an IDisposable! Why? An object initializer just creates a temporary instance of Person initializes the properties and then assignes this temporary variable to the variable person. Something like that:var temp = new Person(); temp.Name = "John"; temp.Lastname = "Doe"; var person = temp;The problem is that if an exception is thrown during the properties initialization you have no chance to dispose the new instance because you have no access to that temporary local variable. It's created by the compiler and is therefore not visible in you c# code. Even if you put the object initializer inside a try catch block or an using directive you will have a problem: http://ayende.com/Blog/archive/2009/01/15/avoid-object-initializers-amp-the-using-statement.aspx.
Things learned:
- Never use object initializers with types implementing IDisposable
- Resharper is a great tool but you should never apply quick fixes blindly. Think for yourself. Don't let the tools do the thinking for you ;)
Labels:
C#,
programming,
resharper,
tools
Tuesday, March 8, 2011
ReSharper: remove unused references.
Today I was cleaning up unused references in a Visual Studio solution. Thanks to ReSharper it was not as tedious as I fought at first. Another great feature provided by this tool saved me a couple of minutes (or maybe hours): http://www.jetbrains.com/resharper/features/navigation_search.html#Find_ReferencedDependent_Code.
To use it select the referenced assembly in the solution browser and choose "Find Code Dependent on Module" from the context menu. If the assembly isn't used anywhere in the current project ReSharper will show a message box saying: "Code dependent on module XXXXXXX was not found". In this case you can remove this reference safely.
To use it select the referenced assembly in the solution browser and choose "Find Code Dependent on Module" from the context menu. If the assembly isn't used anywhere in the current project ReSharper will show a message box saying: "Code dependent on module XXXXXXX was not found". In this case you can remove this reference safely.
Labels:
programming,
resharper,
tools,
visual studio
Friday, March 4, 2011
SQL or NoSQL: The Hybrid.
It seems like a coexistence of SQL and NoSQL worlds is possible now. The folks from DeNA succeeded in creating a hybrid of both approaches. The MySQL plugin HandlerSocket turns the InnoDB engine into a NoSQL database. HandlerSocket allows to benefit from mature RDBMS storage engines and the lightweight NoSQL protocol that abandons the SQL processing. The results are very promising: with 750,000 queries per second the HandlerSocket achieves a considerably better throughput than the standard MySQL (105,000 qps).
For details on this benchmark and more information about HandlerSocket see Yoshinori Matsunobu's blog: http://yoshinorimatsunobu.blogspot.com/2010/10/using-mysql-as-nosql-story-for.html.
And last but not least: HandlerSocket ist open source. You can grab the code from github: https://github.com/ahiguti/HandlerSocket-Plugin-for-MySQL.
For details on this benchmark and more information about HandlerSocket see Yoshinori Matsunobu's blog: http://yoshinorimatsunobu.blogspot.com/2010/10/using-mysql-as-nosql-story-for.html.
And last but not least: HandlerSocket ist open source. You can grab the code from github: https://github.com/ahiguti/HandlerSocket-Plugin-for-MySQL.
Tuesday, March 1, 2011
Magic GUIDs, ReSharper and more...
Here are some tricks I discovered today:
- Magic GUIDs: Creating unit tests in Visual Studio is quite easy when you are doing it 'the right way'. But sometimes when I want to write tests first and create a new project for them I mistakenly choose the class library project type instead of a unit test project. However these are two different project types so when I try to run my tests from the class library project the Visual Studio won't find them. Fortunately you can convert an existing visual studio class library project to unit tests project: http://blog.drorhelper.com/2008/12/how-to-convert-net-class-library-to-ms.html
- ReSharper: There is a great new feature in ReSharper 5.0 called value tracking.
- Another nice ReSharper feature useful when you want to restructure you code: Move code elements up and down: [Ctrl]+[Alt]+[Shift]+[Up|Down]. You can move single lines but also entire methods.
- Sourcemaking: A website with lots of stuff about design pattern, antipatterns and refactoring: http://sourcemaking.com/
Labels:
programming,
tools,
visual studio
Subscribe to:
Posts (Atom)