Here is a useful StackOverflow article on Rx
http://stackoverflow.com/questions/1596158/good-introduction-to-the-net-reactive-framework
Random outpourings of a software developer
Here is a useful StackOverflow article on Rx
http://stackoverflow.com/questions/1596158/good-introduction-to-the-net-reactive-framework
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 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.
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.
using System;
using System.Security.Cryptography;
using System.IO;
namespace FileHashSample
{
public class FileHash
{
public FileHash()
{
return;
}
public string ComputeHash(string filePath)
{
string filePathNormalized = System.IO.Path.GetFullPath(filePath);
SHA1 sha = new SHA1Managed();
FileStream fs = new FileStream(filePathNormalized, FileMode.Open, FileAccess.Read);
byte[] byteHash = sha.ComputeHash(fs);
fs.Close();
return Convert.ToBase64String(byteHash, 0, byteHash.Length);
}
public static void Main(string[] args)
{
if (args.Length == 0)
{
Console.WriteLine(“Please Enter a File Path”);
return;
}
string filePath = System.IO.Path.GetFullPath(args[0]);
FileHash objFileHash = new FileHash();
Console.WriteLine(“File Path is {0}”, filePath);
Console.WriteLine(“File Hash is {0}”, objFileHash.ComputeHash(filePath));
return;
}
}
}
Get-WmiObject -Query “SELECT SystemName, Name, InstalledDisplayDrivers, DriverVersion FROM Win32_VideoController”
This can save a lot of time debugging wpf problems that are due to flakey graphics drivers.
Powershell behaves differently between XP and Win 7.
XP uses the current working directory. Win 7 does not.
This will bite you when passing scripts around.
msbuild Whatever.sln /p:configuration=Release /p:OutDir=c:builds
This is useful when you have a web site project in visual studio 2010 (say a silverlight web project) that you would like to deploy but don’t have enough space on the build server to install the right tools.
This is quite powerful but would be useful if the documentation for this was more obvious.
This is a free Python Tutorial