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
#!/usr/bin/env python3 | |
"""This script computes Cohen's Kappa Coefficient. Invoke with `python3 kappy.py data.csv`, | |
where `data.csv` is a CSV file that contains three columns and no header. The first column | |
contains identifiers that are not used for the purpose of computing the Kappa Coefficient. | |
The second column encodes the first rater's findings. The third column encodes the second rater's findings.""" | |
import csv | |
import sys |
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
-- This is 'luacontroller' code for train station signs. | |
-- | |
-- It was designed for the 'advtrains' and 'textline' mods, | |
-- but it does not have any dependencies on them. | |
-- | |
-- Usage: | |
-- | |
-- 1. Tweak the 'stops', 'destination', 'train_type', | |
-- 'at_platform_duration' and 'train_at_platform_pin' | |
-- constants to suit your needs. |
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 <iostream> | |
#include <vector> | |
class Alias | |
{ | |
private: | |
Alias(const std::vector<int>& data) : data(data) { } | |
// Delete this to make sure that we don't accidentally make a copy. | |
Alias(const Alias&) = delete; |
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
// This source file was borrowed from Kevin Frei's Source Code | |
// (https://kscdg.codeplex.com/SourceControl/latest#JIT-Benchmarks/FractalPerf.cs) | |
// Licensed under the MIT license. | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; |
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
#!/usr/bin/env bash | |
if [ $# -lt 2 ]; then | |
echo "Usage: mono-ln filename.exe script-path.sh [readlink|greadlink]" | |
fi | |
if [ $# -lt 3 ]; then | |
readlink_name="readlink" | |
else | |
readlink_name=$3 | |
fi |
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
// Compile with `dsc Struct.ds -platform wasm -Wno-build` | |
public struct Vector2 | |
{ | |
public int X; | |
public int Y; | |
public int LengthSquared() | |
{ | |
return X * X + Y * Y; |
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.Diagnostics; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace Test | |
{ | |
public class Program |
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
... | |
var doc = this.CodeBox.Document; // this.CodeBox is a RichEditBox | |
string text; | |
doc.GetText(Windows.UI.Text.TextGetOptions.None, out text); | |
text = text.Replace('\r', '\n'); // Transform this so we don't have to deal with '\r' | |
var highlighter = new XmlHighlighter(text); // Highlight code | |
int textLength = text.Length; |