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.Collections.Generic; | |
using System.Linq; | |
class Test | |
{ | |
static void Main() | |
{ | |
var voterA = new List<int> { 1, 2, 3, 4, 7 }; | |
var voterB = new List<int> { 5, 2, 0, 1 }; |
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; | |
public class Base | |
{ | |
public void Foo() | |
{ | |
Console.WriteLine("Foo"); | |
} | |
} |
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
// This is a .NET 3.5 console app, compiled with the C# 6 compiler from CTP6 | |
using System; | |
namespace System.Runtime.CompilerServices | |
{ | |
public class FormattableStringFactory | |
{ | |
public static FormattableString Create(string messageFormat, params object[] args) | |
{ | |
return new FormattableString(messageFormat, args); |
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.Linq; | |
using System.Windows.Forms; | |
class Test | |
{ | |
public static void Main() | |
{ | |
var combo = new ComboBox | |
{ |
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.Diagnostics; | |
using System.Windows.Forms; | |
namespace ConsoleExRun | |
{ | |
class Program | |
{ | |
[STAThread] | |
static void Main(string[] args) |
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
/* Stop Twenty Fourteen from being so narrow */ | |
content .entry-header, .site-content .entry-content, .site-content .entry-summary, .site-content .entry-meta, .page-content, .comments-area { | |
max-width: 800px; | |
} |
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.Collections.Generic; | |
using System.Linq; | |
class Entry {} | |
class WordEntry : Entry {} | |
class CharacterEntry : Entry {} | |
class Program | |
{ |
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.Text; | |
class Test | |
{ | |
// Notes: | |
// The target of the builder.Length assignment is evaluated before | |
// any of the assignments actually happen - in particular, before the | |
// builder assignment from the first element of the tuple. | |
// |
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 string FizzBuzz(int n) | |
{ | |
var fizz = Test(3, "fizz"); | |
var buzz = Test(5, "buzz"); | |
return fizz(buzz(x => x))(n.ToString()); | |
Func<Func<string, string>, Func<string, string>> Test(int d, string s) => | |
x => n % d == 0 ? _ => s + x("") : x; | |
} |
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.Drawing; | |
using System.Windows.Forms; | |
public class Test | |
{ | |
static void Main() | |
{ | |
Button button = new Button | |
{ |
OlderNewer