Skip to content

Instantly share code, notes, and snippets.

Avatar

Rich Lander richlander

View GitHub Profile
@richlander
richlander / RyuJIT-Install-Instuctions.md
Created Aug 18, 2014
Instructions to Install and Use RyuJIT
View RyuJIT-Install-Instuctions.md

Try RyuJIT -- Your code runs faster on X64 Windows

How to enable RyuJIT

Download and install RyuJIT now.

RyuJIT only works on 64-bit editions of Windows Vista and Windows Server 2008 and later.

After installation, there are two ways to turn on RyuJIT. If you just want to enable RyuJIT for one application, set an environment variable:

@richlander
richlander / list.cs
Last active Aug 29, 2015
Code sample with documented output
View list.cs
using System;
using System.Collections.Generic;
public class Program
{
public static void Main()
{
// Demonstrates common uses of List<T>.
// Doc: https://msdn.microsoft.com/library/6sh2ey19.aspx
@richlander
richlander / ComputeSumsWithSIMD.cs
Created Jul 20, 2015
Compute the sums of the values in two arrays of integers, with Vector<T>
View ComputeSumsWithSIMD.cs
// Task: Compute the sums of the values in two arrays of integers, A and B.
// Traditional approach:
for (int i = 0; i < size; i++)
{
C[i] = A[i] + B[i];
}
// With Vector<int> you can instead do this:
View csharp-null-conditional-operator.cs
int length = customers?.Length ?? 0; // 0 if customers is null
View vb-read-only-auto-properties.vb
Public Class Customer
Public ReadOnly Property First As String = "Jane"
Public ReadOnly Property Last As String = "Doe"
End Class
@richlander
richlander / vb-null-conditional-operator.vb
Created Jul 20, 2015
Null-Conditional operator (?.)
View vb-null-conditional-operator.vb
Dim length As Integer = If(customers?.Length, 0) ' 0 if customers is null
View csharp-static-imports.cs
using static System.Console;
using static System.Math;
using static System.DayOfWeek;
class Program
{
static void Main()
{
WriteLine(Sqrt(3 * 3 + 4 * 4));
WriteLine(Friday - Monday);
View vb-static-imports.vb
Imports System.Console
Imports System.Math
Imports System.DateOfWeek
Module Program
Sub Main()
WriteLine(Sqrt(3 * 3 + 4 * 4))
WriteLine(Friday - Monday)
End Sub
End Module
View csharp-nameof-operator.cs
if (x == null) throw new ArgumentNullException(nameof(x));
View csharp-string-interpolation.cs
var s = $"{p.Name} is {p.Age} year{{s}} old";