var path = @"C:\dev\whatever"; var dllFileName = @"something.dll"; var files = from file in new DirectoryInfo(path).GetFiles(dllFileName, SearchOption.AllDirectories) let fvi = FileVersionInfo.GetVersionInfo(file.FullName) select new { File = file.FullName, Version = fvi }; files.OrderByDescending(f => f.Version.FileMajorPart) .ThenByDescending(f => f.Version.FileMinorPart) .ThenByDescending(f => f.Version.FileBuildPart) .Dump(); |
public class Pixel | |
{ | |
private double _x; | |
private double _y; | |
public Pixel(double x, double y) | |
{ | |
_x = x; | |
_y = y; | |
} |
#requires -version 2.0 | |
[CmdletBinding()] | |
param ( | |
[parameter(Mandatory=$true)] | |
[ValidatePattern('\.rptproj$')] | |
[ValidateScript({ Test-Path -PathType Leaf -Path $_ })] | |
[string] | |
$Path, | |
[parameter( |
desc "Convert old gist tags into new format" | |
task :convert_gists, :dir do |t, args| | |
puts ">>> !! Please provide a directory, eg. rake convert_gists[source/_new_posts]" unless args.dir | |
if args.dir | |
if args.dir == "/" | |
dir = "" | |
else | |
dir = args.dir.sub(/(\/*)(.+)/, "\\2").sub(/\/$/, ''); | |
end | |
Dir.open dir do |d| |
public static T GetFarthestAncestor<T>(this T self, Func<T, T> ancestorSelector) | |
{ | |
var parent = ancestorSelector(self); | |
return parent != null | |
? GetFarthestAncestor(parent, ancestorSelector) | |
: self; | |
} |
[Serializable] | |
public abstract class ValueObject<T> : IEquatable<T> where T : class | |
{ | |
public override bool Equals(object obj) | |
{ | |
if (obj == null) | |
return false; | |
var other = obj as T; |
- Branching in svn and git are both easy, but merging is much easier in git. I have spent lots of time merging in svn.
- Being able to commit locally without being connected compliments my workflow. I can push several commits to "master" when I'm done and not one giant commit all at once.
- Lots of history in svn takes up a lot more space than git
- Rebasing and cherry-picking in git makes hot-fixes much more easy than in svn.
- Pulling/fetching source code is much quicker in git than svn.
These are just a few that come to mind that wouldn't fit in a tweet :)
dynamic config = new Configuration(); | |
// returns 5 as a string (see app.config file) | |
var retryAttempts1 = config.RetryAttempts; | |
// returns 5 if found in config, else 10 | |
var retryAttempts2 = config.RetryAttempts(10); | |
// returns 5 if it exists in config, else userInput if not null, else 10 | |
var retryAttempts3 = config.RetryAttempts(userInput, 10); |
This was a comment for this post: http://chrismissal.wordpress.com/2012/04/17/more-of-chris/
When I moved to San Francisco in 2007, I knew it wouldn’t be cheap. Ever since I’ve been conscious of phrases like “cost of living” and “quality of life,” I’ve understood that this is an expensive city. But I had been living in Los Angeles and was coming up here for research on a novel that I was writing, and I fell head over heels in love with the city. There was no going back. So I found a job, packed up, and took some crappy apartment in the Lower Haight that pushed the boundary of my nonprofit salary. The place was beyond gross. There was cat food stuck in the old, dingy carpets. Human feces often