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
import java.util.ArrayList; | |
import java.util.List; | |
import java.util.Scanner; | |
public class Test { | |
private static Scanner sc = new Scanner(System.in); | |
private static List<MiniMax> lijsten = new ArrayList<MiniMax>(); | |
public static void main(String[] args) { | |
int aantalLijsten = sc.nextInt(); |
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() | |
{ | |
Capture(); | |
} | |
private readonly byte[] _data = new byte[4096]; | |
private Socket _mainSocket; | |
public void Capture() |
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() | |
{ | |
for(int i = 0; i < 5; i++){ | |
var list = GetList(); | |
DisplayList(list); | |
GetHotStreaks(list); | |
} | |
} | |
private static Random rand = new Random(); |
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
private void AddEqualsMethod(ref CodeTypeDeclaration type, TinyType tinyType) | |
{ | |
// Create method | |
var method = new CodeMemberMethod() | |
{ | |
Name = "Equals", | |
Attributes = MemberAttributes.Public | MemberAttributes.Override, | |
ReturnType = new CodeTypeReference(typeof (bool)), | |
}; | |
method.Parameters.Add(new CodeParameterDeclarationExpression(typeof (object), "o")); |
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
foreach (var argument in genericTypeParameters.Arguments) | |
{ | |
var typeInfo = semanticModel.GetTypeInfo(argument); | |
var dir = @"C:\Users\Jeroen\Documents\Visual Studio 2013\Projects\RoslynTester"; | |
var solution = MSBuildWorkspace.Create().OpenSolutionAsync(dir).Result; | |
var syntaxRoots = | |
from project in solution.Projects | |
from document in project.Documents |
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
"features": [ | |
{ | |
"name":"kiosk_mode" | |
}, | |
{ | |
"name":"create_contacts" | |
}, | |
{ | |
"name":"create_quotes", | |
"dependencies": [ |
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 void Unit_CanParse_Organisation() | |
{ | |
var data = GetResponse("organisation"); | |
var obj = JsonConvert.DeserializeObject<Organisation>(data); | |
Assert.IsNotNull(obj); | |
Assert.AreEqual(165, obj.Id); | |
Assert.AreEqual("qa", obj.Alias); | |
Assert.AreEqual("Some name", obj.Name); |
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
try | |
{ | |
var irrelevant = myApi.GetUserInfoAsync().AsTask().Result; | |
} | |
catch (AggregateException ae) | |
{ | |
if (ae.InnerException.GetType() == typeof(InvalidOperationException)) | |
{ | |
Assert.IsTrue(true); | |
} |
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 sealed class TestClass | |
{ | |
public event TypedEventHandler<TestClass, LogoutEventArgs> Logout; | |
public void DoSomething() | |
{ | |
if (Logout != null) | |
{ | |
Logout(this, new LogoutEventArgs()); | |
} |
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 invocations = new int[]{0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; | |
var random = new Random(); | |
var iterations = 100000000; | |
var data = new object[] { 5, 5L, (sbyte) 5, (short) 5, (byte) 5, (ushort) 5, (uint) 5, 5ul, "lala", SomeEnum.SomeValue }; | |
var times = new long[] { 0L, 0L }; | |
var sw = new Stopwatch(); | |
sw.Start(); | |
OlderNewer