... Home Contact

Krzysztof Koźmic's blog

You're doing it wrong.


Show appreciation: My Amazon.com Wish List

Me@Twitter

    Currently reading

    Article Categories

    Archives

    Post Categories

    MyPersonal

    Syndication:

    March 2009 Entries

    Tags are now fixed

    Ever since I changed the skin of my blog to the current one, if you clicked any tag from the tag cloud you’d get an error 404. Few people pinged me about it during past few months, but I thought it would require some time to make it work, so I never got around to actually fixing it. Until today. As it turned out it was just a matter of copying missing control from another skin’ folder to my current one. Can it be any simpler? Anyway it works now (at least on my machine ) so enjoy. ...

    Dynamic Proxy frameworks comparison: update

    After my post comparing different dynamic proxy frameworks, many people were surprised by the poor performance of LinFu.DynamicProxy framework. In the update I noted that it was gathering the stack trace for each intercepted call, that made the framework so slow. Philip, the author of LinFu updated the framework, removing usage of StackTrace. It made a drastic change in the performance, and my previous comparison no longer correspond to current characteristics of the framework. As such I decided to re-run the test. Here are the results: All the times are roughly 10% better than...

    On self-documenting code

    Take this piece of code: public int Count(string text) { Console.WriteLine("Counting..."); // simulate some lengthy operation... Thread.Sleep(5000); return text.Length; } What’s wrong with it? It’s not very obvious what the magic number 5000 means? Does it mean 5000 years? 5000 minutes? 5000 the time it takes to run around Main Market Square in Kraków? Sure, you can hover over the invocation (if you’re in Visual Studio) and see the tooltip and see that the number denotes milliseconds,...

    Productivity tip of the week, part 3

    This time it’s not a single keyboard shortcut. There’s a little known feature of ReSharper, called To-Do Items. It’s a series of tags, you can define, and when you put them in your comments somewhere in the code, ReSharper will pick the comment up and put it, in the To-Do Explorer Window. There are 3 predefined tags: TODO, BUG, NOTE and NotImplemented which picks up the NotImplementedException occurrences in your code. Yes, this is not a code comment, but most of the time you’ll use comments only. So how is this useful and boosts productivity? As you...

    Castle Dynamic Proxy tutorial part VIII: Interface proxy without target

    This is part VIII of my ongoing tutorial on Castle Dynamic Proxy. If you are new to it, you probably want to read previous parts first: Introduction The what, why and how Selecting which methods to intercept Breaking hard dependencies InterceptorSelector, fine grained control over proxying ...

    Productivity tip of the week II

    Since my Keyboard shortcut of the week post spawned some positive reactions and requests to continue it on a regular basis... well, here we go. This week's productivity tip of the week is actually a keyboard shortcut as well, this time however it's ReSharper specific (you should do yourself a favor and get ReSharper anyway, if you don't use it). It's for Visual Studio' keymap.: ALT + SHIFT + L What it does is it highlights the location of currently active file in the Solution Explorer. It's very useful if you explore codebase, navigate between calls and want to quickly find out where...

    Comparing execution speed of .NET dynamic proxy frameworks

    A recent comment on Twitter from Tim Barcz started me thinking about alternative proxy frameworks (alternative to Castle Dynamic Proxy that is). Recently LinFu Dynamic Proxy started gaining some popularity, after it was included as one of standard bytecode providers in NHibernate. Disclaimer: To make things clear. I'm a long time user of Castle Dynamic proxy and I may be biased towards it. I also happen to know how to use it, contrary to all the other frameworks, that’s why the following test may not be realizing their full potential. If you spot...

    Keyboard shortcut of the week

    My team at work is far from agile, but I’m trying to smuggle some ideas and practices, according to the old Latin proverb “gutta cavat lapidem, non vi, sed saepe cadendo”. Recently, as a small way of continuous improvement I suggested each week we print some Visual Studio or ReSharper keyboards shortcut, that we didn’t know or use, and which can help us do some things a little bit faster. Here’s the first one: It’s pinned to a cork whiteboard in a location that everyone looks at it few times a day. Hopefully by...

    Writing Launchy plugin in C# with Launchy#

    Today I learned about Launchy# – C# binding for Launchy extensibility API, that allows developers to write Launchy plugins in managed code. I once wrote… a hack more than extensions, that enabled users to tweet from Launchy. I was reluctant to extend it further, because then I’d have to write unmanaged code, which is far from my definition of fun. However, now I’m thinking about playing a little bit with Launchy# and building a proper Twitter-Launchy pluging (Twitty?). So now I’m gathering ideas. What would you like to see in  Twitty? UPDATE It looks like the...

    WPF memory leak with VisualBrush TileMode="Tile"

    Recently at work, while working on WPF GUI for our application we noticed, that our app leaks memory. After some time (actually a lot of time, since we first though that it was video codec’s fault) we nailed it, and unfortunately, it looks like it’s a bug in the WPF itself. I attach a sample application that exposes the issue. What it does is basically… blinking a rectangle. The key thing is, how the rectangle is declared: <Rectangle Name="ResultsBorder" Height="100" Width="100" Opacity="0.0"> ...

    Castle Dynamic Proxy 2.1 RC1 has been released

    Jono just released a RC1 of next version of Castle Dynamic Proxy - 2.1. As compared to version v2.0, which was released as part of RC3 of Castle, it contains numerous bugfixes, and few new features (support for IInterceptorSelector, mixins and few others) as well as improved documentation (something that is going to improve much, by the time final 2.1 is released). This release is the first one since the split of monolithic Castle bundle into independent projects. You can get the binaries here.

    Call for CSS ninja

    As few people pointed out, my blog sometimes renders incorrectly in Firefox. The right pane, moves left, and it makes things look less than ideal. As my knowledge of CSS is very poor I call for help to you, dear reader. I will give a free license for NHibernate to the first person who helps me with this. Contact me via GTalk, email, or Contact form of this site if you want to help.

    Castle Dynamic Proxy tutorial part VII: Kinds of proxy objects

    This is part VII of my ongoing tutorial on Castle Dynamic Proxy. If you are new to it, you probably want to read previous parts first: Introduction The what, why and how Selecting which methods to intercept Breaking hard dependencies InterceptorSelector, fine grained control over proxying ...