This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace MixinDemo | |
{ | |
public interface ILogger | |
{ | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (EomAppCommon.Settings.DebugEomDatabase) | |
{ | |
var form = new System.Windows.Forms.Form(); | |
var grid = new System.Windows.Forms.DataGridView { | |
AutoGenerateColumns = true, | |
Dock = System.Windows.Forms.DockStyle.Fill, | |
DataSource = | |
(from c in new [] { | |
Tuple.Create("DADatabaseR1ConnectionString", this.DADatabaseR1ConnectionString), | |
Tuple.Create("StatsYear", this.StatsYear.ToString()), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void Main() | |
{ | |
//Store the root node in Container | |
//While (there are nodes in Container) | |
// N = Get the "next" node from Container | |
// Store all the children of N in Container | |
// Do some work on N | |
var paths = new List<int[]>(); | |
int N = 10; | |
var stack = new Stack(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void Main() | |
{ | |
var N = 5; | |
Node.Graph.Add(new Node()); | |
bool canExpand = true; | |
while (canExpand) | |
{ | |
Func<int, IEnumerable<Move>> addNodes = steps => from c in Node.Graph |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace CodeGenExperiement | |
{ | |
using System; | |
#line 1 "c:\users\music\documents\visual studio 2010\Projects\CodeGenExperiement\CodeGenExperiement\PreTextTemplate1.tt" | |
[System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "10.0.0.0")] | |
public partial class PreTextTemplate1 : PreTextTemplate1Base | |
{ | |
public virtual string TransformText() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class ReflectionExtensions | |
{ | |
public static Type UnderlyingType(this MemberInfo member) | |
{ | |
Type type; | |
switch (member.MemberType) | |
{ | |
case MemberTypes.Field: | |
type = ((FieldInfo)member).FieldType; | |
break; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class ObjectSetExtensions | |
{ | |
public static int IdByName<T>(this ObjectSet<T> set, string name) where T : class | |
{ | |
int id = set.ToList() | |
.Where(c => c.MemberValue<string>("name") == name) | |
.Select(c => c.MemberValue<int>("id")) | |
.FirstOrDefault(); | |
if (id != default(int)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Data.Entity; | |
namespace EFCodeFirst | |
{ | |
public class Thing | |
{ | |
public int Id { get; set; } | |
public string Name { get; set; } | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$d = "C:\db\backup" | |
$today = get-date -uformat "%Y_%m_%d" | |
$log = "C:\db\backup\" + "Purge_" + $today + ".log" | |
$a = Get-ChildItem $d -recurse | |
foreach($x in $a) | |
{ | |
$y = ((Get-Date) - $x.CreationTime).Days | |
if ($y -gt 3 -and $x.PsISContainer -ne $True) | |
{ | |
$deleted = "Deleting - " + $x.fullname + " - Last Write Time - " + $x.LastWriteTime |