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
// Simplest C# Softmax example | |
// Based on the Python example here: https://en.wikipedia.org/wiki/Softmax_function | |
void Main() | |
{ | |
var z = new[] { 1.0, 2.0, 3.0, 4.0, 1.0, 2.0, 3.0 }; | |
var z_exp = z.Select(Math.Exp); | |
// [2.72, 7.39, 20.09, 54.6, 2.72, 7.39, 20.09] | |
var sum_z_exp = z_exp.Sum(); |
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
// Slightly modified Adalight protocol implementation that uses FastLED | |
// library (http://fastled.io) for driving WS2811/WS2812 led stripe | |
// Was tested only with Prismatik software from Lightpack project | |
#include "FastLED.h" | |
#define NUM_LEDS 114 // Max LED count | |
#define LED_PIN 6 // arduino output pin | |
#define GROUND_PIN 10 | |
#define BRIGHTNESS 255 // maximum brightness |
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
; Surround current word in BOLD e.g. this is **bold** | |
NumpadMult::Send ^{Left}**^{Right}** | |
; Surround current word in ITALIC e.g. this is *italic* | |
NumpadDiv::Send ^{Left}*^{Right}* | |
; Surround current word in CODE e.g. this is some `code` | |
NumpadSub::Send ^{Left}{SC029}^{Right}{SC029} |
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
` & h::Send {Left} | |
` & j::Send {Down} | |
` & k::Send {Up} | |
` & l::Send {Right} |
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
<Query Kind="FSharpProgram" /> | |
let dump (title : string) x = x.Dump(title) | |
let add x y = x + y | |
dump "add results" (add 6 4) | |
[1, 2, 3, 4] | |
|> dump "array contents" |
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 Newtonsoft.Json; | |
using System; | |
using System.Collections.Specialized; | |
using System.Net; | |
using System.Text; | |
//A simple C# class to post messages to a Slack channel | |
//Note: This class uses the Newtonsoft Json.NET serializer available via NuGet | |
public class SlackClient | |
{ |