{{ message }}

Instantly share code, notes, and snippets.

# Mark Jonesorangutanboy

Last active Jul 15, 2018
LinqChallenge3
View Problem 1 - Longest Sequence.cs
 "1,2,1,1,0,3,1,0,0,2,4,1,0,0,0,0,2,1,0,3,1,0,0,0,6,1,3,0,0,0" .Split(',') .Select(x => x[0] == '0' ? '1' : ' ') .Aggregate("", (x, y) => x += y) .Split(' ') .Max(x => x.Length)
Last active Oct 31, 2015
Answers to Mark Heath's Lunchtime Linq Challenge 2
View BishopsMoves.linq
 var startX = 'C'; var startY = 5; var diagonals = Enumerable.Range(65, 8) .SelectMany(x => Enumerable.Range(1, 8), (x, y) => new { x = (char)x, y }) .Where(coord => ((coord.x - startX == coord.y - startY)) || (startX - coord.x == coord.y - startY) || (startX - coord.x == coord.y + startY) || (coord.x - startX == coord.y + startY))
Last active Aug 29, 2015 — forked from Kntajus/SpeechElements
View SpeechElements
 let unitsElement(x) = match x % 10 with | 0 -> [] | x -> [ string x ] let tensElement(x) = string (x / 10 * 10) let elementsFor2DigitNumber(x) = match x with
Created Oct 25, 2013
This is an implementation of a disposable HtmlHelper extension
View TableExtensions.cs.
 using System; using System.Collections.Generic; using System.IO; using System.Text; using System.Web.Mvc; namespace Demo.Helpers { public static class TableExtensions {
Last active Dec 19, 2015
Results for Mark Heath's Linq Challenge http://mark-dot-net.blogspot.co.uk/2013/06/lunchtime-linq-challenge.html
View 1.cs
 foreach (var s in Enumerable.Range(1, 11).Zip("Davis, Clyne, Fonte, Hooiveld, Shaw, Davis, Schneiderlin, Cork, Lallana, Rodriguez, Lambert".Split(new[] { ", " }, StringSplitOptions.None), (num, name) => num + ". " + name)) { Console.WriteLine(s); }
Created May 19, 2013
This is a subclass of Display_T35 that allows a LongTouch gesture
View GestureEnabledDisplay_T35
 public class GestureEnabledDisplay_T35 : Gadgeteer.Modules.GHIElectronics.Display_T35 { private long _touchdownTicks; private const long NanosecondsInMilliseconds = 10000; public delegate void LongTouchEventHandler(object sender, EventArgs args); public event LongTouchEventHandler LongTouch; /// /// The number of milliseconds a touch needs before it raises a longtouch event
Created Dec 18, 2012
View GridSolver.ts
 /// module Trainline { export var pointState = { Available: "AVAILABLE", Crossed: "CROSSED", Unavailable: "UNAVAILABLE" } export var pointSide = {
Created Nov 30, 2012
WeakReference v WeakReference<T>
View WeakRef.cs
 using System; using System.Diagnostics; using System.Xml; namespace WeakReferenceDemo { class Program { static void Main(string[] args) {
Created Nov 24, 2012
SignalR Demo
View DemoHub.cs
 using Microsoft.AspNet.SignalR.Hubs; using System.Timers; namespace SignalRDemo { public class DemoHub : Hub { private readonly DemoTimer _demoTimer; public DemoHub()
Created Oct 10, 2012
Caller information attributes demo
View callerinformation.cs
 using System; using System.IO; using System.Runtime.CompilerServices; class CallerInfoDemo { static void Main(string[] args) { LogMe(); Method1();
You can’t perform that action at this time.