Skip to content

Instantly share code, notes, and snippets.

@casparkleijne
casparkleijne / iris.csv
Created December 28, 2018 21:56 — forked from netj/iris.csv
sepal.length sepal.width petal.length petal.width variety
5.1 3.5 1.4 .2 Setosa
4.9 3 1.4 .2 Setosa
4.7 3.2 1.3 .2 Setosa
4.6 3.1 1.5 .2 Setosa
5 3.6 1.4 .2 Setosa
5.4 3.9 1.7 .4 Setosa
4.6 3.4 1.4 .3 Setosa
5 3.4 1.5 .2 Setosa
4.4 2.9 1.4 .2 Setosa
static readonly Random rand = new Random(DateTime.Now.Millisecond);
Stack<TimeSpan> times = new Stack<TimeSpan>(
Enumerable
.Range(0, 30) // <-- intervals
.Select(i => new TimeSpan(0, 0, rand.Next(5))) //<-- frequencies
static byte[] BitReverseTable =
{
0x00, 0x80, 0x40, 0xc0, 0x20, 0xa0, 0x60, 0xe0,
0x10, 0x90, 0x50, 0xd0, 0x30, 0xb0, 0x70, 0xf0,
0x08, 0x88, 0x48, 0xc8, 0x28, 0xa8, 0x68, 0xe8,
0x18, 0x98, 0x58, 0xd8, 0x38, 0xb8, 0x78, 0xf8,
0x04, 0x84, 0x44, 0xc4, 0x24, 0xa4, 0x64, 0xe4,
0x14, 0x94, 0x54, 0xd4, 0x34, 0xb4, 0x74, 0xf4,
0x0c, 0x8c, 0x4c, 0xcc, 0x2c, 0xac, 0x6c, 0xec,
0x1c, 0x9c, 0x5c, 0xdc, 0x3c, 0xbc, 0x7c, 0xfc,
static byte[] NibbleReverseTable =
{
0x00,0x10,0x20,0x30,0x40,0x50,0x60,0x70,0x80,0x90,0xA0,0xB0,0xC0,0xD0,0xE0,0xF0,
0x01,0x11,0x21,0x31,0x41,0x51,0x61,0x71,0x81,0x91,0xA1,0xB1,0xC1,0xD1,0xE1,0xF1,
0x02,0x12,0x22,0x32,0x42,0x52,0x62,0x72,0x82,0x92,0xA2,0xB2,0xC2,0xD2,0xE2,0xF2,
0x03,0x13,0x23,0x33,0x43,0x53,0x63,0x73,0x83,0x93,0xA3,0xB3,0xC3,0xD3,0xE3,0xF3,
0x04,0x14,0x24,0x34,0x44,0x54,0x64,0x74,0x84,0x94,0xA4,0xB4,0xC4,0xD4,0xE4,0xF4,
0x05,0x15,0x25,0x35,0x45,0x55,0x65,0x75,0x85,0x95,0xA5,0xB5,0xC5,0xD5,0xE5,0xF5,
0x06,0x16,0x26,0x36,0x46,0x56,0x66,0x76,0x86,0x96,0xA6,0xB6,0xC6,0xD6,0xE6,0xF6,
0x07,0x17,0x27,0x37,0x47,0x57,0x67,0x77,0x87,0x97,0xA7,0xB7,0xC7,0xD7,0xE7,0xF7,
static string[] HexTable =
{
"00","01","02","03","04","05","06","07","08","09","0A","0B","0C","0D","0E","0F",
"10","11","12","13","14","15","16","17","18","19","1A","1B","1C","1D","1E","1F",
"20","21","22","23","24","25","26","27","28","29","2A","2B","2C","2D","2E","2F",
"30","31","32","33","34","35","36","37","38","39","3A","3B","3C","3D","3E","3F",
"40","41","42","43","44","45","46","47","48","49","4A","4B","4C","4D","4E","4F",
"50","51","52","53","54","55","56","57","58","59","5A","5B","5C","5D","5E","5F",
"60","61","62","63","64","65","66","67","68","69","6A","6B","6C","6D","6E","6F",
"70","71","72","73","74","75","76","77","78","79","7A","7B","7C","7D","7E","7F",
@casparkleijne
casparkleijne / yoda.cs
Created August 9, 2011 21:15
Add Some Yoda to your linq
using System;
using System.Collections.Generic;
using System.Linq;
namespace Dagobah.System
{
public static class Yoda
{
public static bool IHave<T>(this IEnumerable<T> source, T value)
{
@casparkleijne
casparkleijne / feach.js
Created January 19, 2011 08:56
fast each.
Array.prototype.each = function (f) {
var j = this.length,
k = j % 8;
for(j; j > k; 0){
f(this[--j],j);
f(this[--j],j);
f(this[--j],j);
f(this[--j],j);
f(this[--j],j);
f(this[--j],j);
(function ($) {
$.fn.toolTip = function (type) {
var $t, init, show, hide;
init = function () {
/** HERE I WANT TO KNOW THE ORIGINAL SELECTOR (.wizard .info) **/
$t = $('<div class="toolTip"><div></div></div>')
$("body").append($t);
};
"use strict";
var CasparKleijne = {};
CasparKleijne.Core = {};
CasparKleijne.Canvas = {};
CasparKleijne.Canvas.GFX = {};
(CasparKleijne.Core.TimeLineManager = function (s) {
var a,
"use strict";
var csprkdemo = {};
csprkdemo.ui = {};
(csprkdemo.ui.main = function () {
var config, init, events;
config = {
params: {}
};
init = function (params) {