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
/// <summary> | |
/// Interface definition of Either | |
/// </summary> | |
/// <typeparam name="Tl">type of the Left value</typeparam> | |
/// <typeparam name="Tr">type of the Right value</typeparam> | |
public interface IEither<out Tl, out Tr> | |
{ | |
/// <summary> | |
/// Check the type of the value held and invoke the matching handler function | |
/// </summary> |
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 Data.List ((\\)) | |
data Cell = Middle | |
| North | |
| NorthEast | |
| East | |
| SouthEast | |
| South | |
| SouthWest | |
| West |
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
;; Fourier-Motzkin eliminator | |
(defn fme [rows] | |
(letfn [(shorten [[x & xs]] | |
(let [lambda (if (== 0.0 x) 1.0 (-> x double Math/abs))] | |
(map #(/ %1 lambda) xs))) | |
(classify-rows [rows] | |
(group-by (fn [row] (-> row first double Math/signum {-1.0 :lts, 0.0 :eqs, 1.0 :gts})) | |
rows))] | |
(-> rows | |
classify-rows |
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 System; | |
using System.Collections.Generic; | |
using System.Net.Http; | |
using System.Threading.Tasks; | |
namespace Siliconbrain.Utilities | |
{ | |
public class GoogleCloudMessagingApplicationServer : IDisposable | |
{ | |
private static readonly Uri _sendUri = new Uri("https://android.googleapis.com/gcm/send"); |
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
program kaland; | |
uses crt; | |
type szornytip=(nincssz,pupos,boszorkany,pincemester,vampir,hoher); | |
akadalytip=(fal,nyitottajto,zartajto); | |
kincstip=(nincsk,nyakek,korona,gyuru,jogar,gyemantoslada,kehely); | |
fegyvertip=(nincsf,buzogany,bard,kard,landzsa,szekerce); | |
iranytip=(elore,hatra,jobbra,balra); | |
hatizsaktip=record | |
kincsek:array[0..6] of kincstip; | |
fegyverek:array[1..6] of fegyvertip; |
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
// | |
// Usage: | |
// class Foo | |
// { | |
// int bar; | |
// | |
// public: | |
// property<int> Bar; | |
// | |
// Foo(int bar) |
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
#include <ios> | |
#include <ostream> | |
struct memory_dump_t | |
{ | |
typedef unsigned char byte; | |
byte const * const address; | |
std::size_t const length; | |
}; |
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
Function: Roll 4 d6. Select 3 highest. Sum selected dice. | |
Value | Count | Probability | |
-------|-------|--------------------- | |
3 | 1 | 0.007936507936507936 | |
4 | 1 | 0.007936507936507936 | |
5 | 2 | 0.015873015873015872 | |
6 | 4 | 0.031746031746031744 | |
7 | 5 | 0.03968253968253968 | |
8 | 7 | 0.05555555555555555 |
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
// ==UserScript== | |
// @name YouTube music policy display | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Show music policy info for music videos | |
// @author siliconbrain | |
// @match https://www.youtube.com/* | |
// @grant none | |
// ==/UserScript== |
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
<?xml version='1.0' encoding='UTF-8'?> | |
<patterndb version='4' pub_date='2017-09-21'> | |
<ruleset name='python_template_test' id='fab7ae24-5a2b-43a9-9ad6-39bc6c82a15b'> | |
<pattern>myprg</pattern> | |
<rules> | |
<rule id='ID:minimal_pattern' provider='user' class='CLS:minimal_pattern'> | |
<patterns> | |
<pattern>Some test value: @ESTRING:some_test_value:.@</pattern> | |
</patterns> | |
<tags></tags> |