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 mathjsEx() | |
{ | |
var math = mathjs() | |
math.EPSILON = 1E-15 | |
dot = function (x, y) { return math.subset(math.multiply(math.transpose(x), y), math.index(0, 0)) } | |
norm = function (x) { return math.sqrt(dot(math.conj(x), x)) } | |
diagBlock = function (A, B) | |
{ |
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
foreach($i in Get-ChildItem -Recurse) { | |
if ($i.PSIsContainer) { | |
continue | |
} | |
# You might need some more pattern | |
if ($i.FullName -like "*.cc" -or $i.FullName -like "*.h") { | |
echo $i.FullName | |
$tmp = $i.FullName + ".tmp" | |
get-content -Encoding UTF8 $i.FullName | set-content -Encoding UTF8 $tmp |
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 argparse | |
import csv | |
import os | |
import struct | |
import wave | |
parser = argparse.ArgumentParser(description="Convert csv to wav.") | |
parser.add_argument("csv", help="csv file") | |
parser.add_argument("data", type=int, help="zero-based index of data row") | |
parser.add_argument("-f", dest="freq", metavar="SAMPLING_RATE", type=int, default=44100, help="sampling rate") |
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 grammar = ` | |
Expression | |
= Scalar | |
/ GeneralVectorExpr | |
GeneralVectorExpr | |
= head: GeneralVector tail: (_ ("+" / "-") _ GeneralVector) * { | |
return head; | |
} |
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
Parameter set: Type. | |
Parameter uniqueObject: (set -> Prop) -> set. | |
Axiom UniqueObject: forall P, (exists! x, P x) -> P (uniqueObject P). | |
Parameter in_: set -> set -> Prop. | |
Axiom ZF_Ext: forall X Y, (forall z, in_ z X <-> in_ z Y) -> X = Y. | |
Axiom ZF_Pair: forall x y, exists Z, in_ x Z /\ in_ y Z. | |
Axiom ZF_Sep: forall P: set -> Prop, forall X, |
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
module Test | |
open System.IO | |
open System.Threading | |
open System.Threading.Tasks | |
let R = System.Random() | |
let _work (n : int) : int option = | |
Thread.Sleep (n * 1000) | |
if R.Next() % 3 = 0 |
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; | |
using System.Linq; | |
public class Test | |
{ | |
public static T[] ConvArray<T>(object[] array) | |
{ | |
return array.Cast<T>().ToArray(); | |
} |
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.Linq; | |
using System.Drawing; | |
using OpenCvSharp; | |
using ZXing; | |
namespace ISBNReader | |
{ | |
static 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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using LinqToTwitter; | |
using LitJson; | |
namespace TwitterConsole | |
{ | |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#define ROW_SIZE 1024 | |
char header[44] = { | |
'R', 'I', 'F', 'F', | |
0, 0, 0, 0, | |
'W', 'A', 'V', 'E', |
NewerOlder