This file contains hidden or 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
class Program | |
{ | |
public static void Main() | |
{ | |
var ctor = typeof (R).GetConstructor(new Type[] {typeof (string)}); | |
var result = (R)ctor.Invoke(new object[]{"a"}); | |
result.Test(); | |
} |
This file contains hidden or 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
[Serializable] | |
public struct ArrayValue<T> : IEnumerable<T> | |
{ | |
private List<T> _under; | |
public ArrayValue(IEnumerable<T> under) | |
{ | |
_under = new List<T>(under); | |
} |
This file contains hidden or 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
open System.IO | |
open System.Net | |
open System.Text | |
async { | |
let file = File.OpenRead("Program.fs") | |
let! stuff = file.AsyncRead(250) | |
printfn "%A" (Encoding.Default.GetString(stuff)) |
This file contains hidden or 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.IO; | |
using System.Net; | |
using System.Security.AccessControl; | |
using System.Text; | |
namespace SimpleExample | |
{ | |
class Program | |
{ |
This file contains hidden or 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
#r "WindowsBase.dll" | |
#r "PresentationCore.dll" | |
#r "System.Xaml.dll" | |
(* | |
Script to copy all photos from flash card to | |
some folder in form of /Year/Month/Day of the DateTaken | |
DateTaken is retrieved from EXIF infroamtion. | |
To make this script work, you have ensure that all | |
applicable WIC codecs are installed. For example |
This file contains hidden or 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
-- Stupid solution to remove duples from sql table... | |
DECLARE @temp TABLE | |
( | |
[Col1] [uniqueidentifier] NOT NULL, | |
[Col2] [uniqueidentifier] NOT NULL | |
) | |
INSERT INTO @temp | |
SELECT DISTINCT [Col1] ,[Col2] |
This file contains hidden or 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
private readonly IList<ProductImageAssignee> _images = new List<ProductImageAssignee>(); | |
public virtual IEnumerable<ProductImageAssignee> Images { get { return _images; } } |
This file contains hidden or 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
type Order = { | |
Number : string | |
Date : DateTime | |
Items : { | |
ProductSKU : string | |
Quantity : int | |
} list | |
} |
This file contains hidden or 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
// Code | |
exception MyError of string | |
// and generate stuff | |
[Serializable, CompilationMapping(SourceConstructFlags.Exception)] | |
public class MyError : Exception, IStructuralEquatable | |
{ | |
internal string Data0@; |
This file contains hidden or 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
let versions = new Table(db, "__MoveVersions") | |
(** first version **) | |
versions.Columns.Add(new Column(versions, "Sequence", DataType.NVarChar(450))) | |
versions.Columns.Add(new Column(versions, "Version", DataType.NVarChar(450))) | |
versions.Columns.Add(new Column(versions, "PreviousVersion", DataType.NVarChar(450))) | |
versions.Columns.Add(new Column(versions, "LastUpdated", DataType.DateTime)) | |
(** or second version **) |