Memoization using generics – Part 2
This is Part 2 of my series on Memoization. In Part 1 I described the basic principles behind memoization, and showed some examples on how to create an effective generic method to do memoization of methods with zero and one parameter. In this post I will show how to do memoization of methods with two parameters
RSSReader example code from my NNUG speech (WPF and Caliburn)
November 24 I presented Caliburn and Caliburn.Micro at the .Norwegian .Net User Group community meeting in Stavanger.
In my speech I tried to sum up some of the advantages of using a robust framwork when doing developing in Silverlight or WPF, framworks like: MVVM Light, Caliburn or Caliburn.Micro.
The source code from my speech can be found at filehub.iserialized.com. The example is a fairly simple WPF application, and the GUI it selves sucks, as my focus has been:
- Databinding
- Core Caliburn functionality
- The simplicity of using IoC in the combination WPF and Caliburn
Linq performance, Count() vs Any()
I just came across some very interesting information. Every used the following statement:
if (mysequenece.Count() > 0)
{
//Do something
}
The problem here is the Count() statement which can potentially be very inefficient, as it traverse the whole list to calculate a value. But we reallly don't need the exact count, in most cases we just need to know if there are any values, and hence, we can rather use Any() which is another extension method from Linq.
Getting started with Caliburn Part 2: Multiple Views on one ViewModel
The documentation and tutorials on Caliburn is still very limited, and is one of the biggest obstacles getting started with Caliburn right now. In this post I hope to fill some of the gaps I have seen in the lack of documentation by showing how you can easily hook up two Views to one ViewModel.
Getting started with Caliburn
The lack of documentation and examples of usage is one of the biggest obstacles getting started with Caliburn. I hope this article can help somewhat!
One of my biggest fears when starting a new project is heading in the wrong direction and not realizing that we are headed for disaster until it's too late. Due to architectural decisions, this is always a worry, but the new project is based on WPF, the risk and possibility of a failure is drastically increased. I'm afraid that my WPF projects become "Windows Formish", not taking advantage of MVP/ MVVM.
This is Part 1 of my series on Caliburn, Part 2 on multiple views on one ViewModel can be found here, and Part 3 on unit testing Caliburn can be found here.
Caliburn was designed to aid in the development of WPF and Silverlight applications, enabling easier use of among other MVP and MVVM. This article will be a walkthrough of a rather simple WPF application based on Caliburn. The example used here is a very simple application retrieving a value from a textbox, publishing it to an EventAggregator, and then let another component handle the published message. Hopefully I am able to show some of the advantages of Caliburn through this example.
Memoization using generics and lambda expressions
Memoization is a hidden treasure of programming techniques. Most developers has a good understanding of caching and use it to optimize queries, but why even do calculations on cached or live data, when you don’t need to calculate at all?
