Combining OData and Powershell
It seemed so obvious that someone has already done it:
http://www.dougfinke.com/blog/index.php/2010/08/04/odata-powershell-explorer/
An open source pub sub framework
Where to find PRISM
Keeping vim in english despite regional settings
Entity Framework Code First Fluent API – Can I create a fluent rules engine.
I am currently working through a lot of training courses (due to my employer being in special administration).
I have started on the Entity Framework Code First modules.
EF Code first seems to provide a declarative way of having a set of business entities that do not know about the database be persisted and loaded.
I am not interested in the annotation api since that is tying the business entities to the database.
[Rule #1 The model should not know about the view or the database.]
However the fluent api looks very interesting in that it can be used as an ORM (albeit a very simple one).
This means that a model could have two databases that it maps to (say old system and new system, or production and archive) that have distinct schema’s.
What would be interesting would be to see if this fluent api could not also be used as a validating rules engine. A given object can have different validation rules depending upon context.
Rx Documentation
Here is a useful StackOverflow article on Rx
http://stackoverflow.com/questions/1596158/good-introduction-to-the-net-reactive-framework
Fitnesse and C#
Here are some sample fitnesse tests and fixtures.
!define COMMAND_PATTERN {%m -r fitnesse.fitServer.FitServer,dotnet2fit.dll %p}
!define TEST_RUNNER {dotnet2Runner.exe}
!path C:developfitnessedotnet2fittestfittestbinReleasefittest.dll
!|Import|
|fittest|
!|fittest.OurFirstTest|
|string1|string2|Concatenate?|
|Hello|World|HelloWorld|
!|fittest.SecondTest|
|a|b|Output?|
|One|Two|a = One;b = Two;|
!|ActionFixture|
|start|ActionFixtureTest|
|enter|firstPart|Hello|
|enter|secondPart|World|
|press|join|
|check|together|Hello, World|
namespace fittest
{
public class OurFirstTest : fit.ColumnFixture
{
public string string1;
public string string2;
public string Concatenate()
{
return string1 + string2;
}
}
public class SecondTest : fit.ColumnFixture
{
public string a;
public string b;
public string c;
public string Output()
{
StringBuilder sb = new StringBuilder();
if (a != null) sb.AppendFormat(“a = {0};”, a);
if (b != null) sb.AppendFormat(“b = {0};”, b);
if (c != null) sb.AppendFormat(“c = {0};”, c);
return sb.ToString();
}
}
public class ActionFixtureTest : fit.Fixture
{
public string FirstPart;
public string SecondPart;
public string Together;
public void Join()
{
Together = string.Format(“{0}, {1}”, FirstPart, SecondPart);
}
}
}
vim searches
vim is a very powerful editor once you can remember a few command combinations.
The basic search is invoked with / (or ? if you want to go backwards).
Of late I have been using the character find command f (especially in visual mode, vf[char] is extremely useful as would yf[char].
For the uninitiated these select until the next character (or with y copy [yank] into the default buffer).
Yesterday I found in the help files the * and # commands.
* is search forward for the word under the current cursor (# is the backwards version).
Another useful option is t which searches for a character but stops one character before. So yt) will copy upto the next closing bracket or y2t) will copy til the second following bracket!
This is also useful for extracting the contents of a parameter list:
vb%bd
Enter visual mode, back one word go to matching brace, back one word then delete (and copy into default buffer).
This is a lightweight refactoring in itself.
Updated vs vim
vs vim has had a recent update here.
This fixes a number of issues such as providing edit history on search and correctly handling multiline puts.
It still is missing ex functions plus the editing of prior search commands is not quite there yet.