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
use v5.10; | |
use warnings; | |
use Data::Dumper; | |
my %h; | |
sub wrap { | |
my ($str, $re,$replace) = @_; | |
unless (%h) { | |
END {say Dumper %h} |
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
vectTake : (n : Fin (m)) -> Vect m a -> LTE (cast n) m -> Vect (cast n) a | |
vectTake FZ (y :: xs) LTEZero = [] | |
vectTake (FS y) (z :: xs) (LTESucc x) = z :: vectTake y xs 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
private class Wrap<T> | |
{ | |
public readonly Func<Wrap<T>, T> It; | |
public Wrap(Func<Wrap<T>, T> it) | |
{ | |
It = it; | |
} | |
} |
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
package main | |
import ( | |
"encoding/json" | |
"github.com/gorilla/mux" | |
"log" | |
"net/http" | |
) | |
type Repository struct { |
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 Main where | |
import Prelude | |
import Control.Comonad | |
import Control.Lazy | |
import Data.Array ((:)) | |
import Data.Distributive | |
import Data.Lens.Grate | |
import Data.Lens |
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
rand('state', 0); | |
rand(); | |
rand(); | |
// Output: | |
// 0.84442 | |
// 0.75795 |
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 <chrono> | |
#include <random> | |
#include <iomanip> | |
int main () | |
{ | |
std::mt19937 generator (0); | |
std::cout << generator() << std::endl; |
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
my $last_cmd = ''; | |
my $up_cnt; | |
sub up { | |
if ($last_cmd ne 'up') { | |
$up_cnt = 0; | |
} | |
`sleep 0.2s;xte 'key Up'`; | |
$last_cmd = 'up'; | |
$up_cnt++; |
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
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> | |
<xsl:output method="text"/> | |
<xsl:template name="sort"> | |
<xsl:param name="w"/> | |
<!-- position in word --> | |
<xsl:param name="i" select="1"/> | |
<!-- position in output --> | |
<xsl:param name="j" select="1"/> | |
<xsl:param name="out"/> | |
<xsl:variable name="alpha" select="'01a02b03c04d05e06f07g08h09i10j11k12l13m14n15o16p17q18r19s20t21u22v23w24x25y26z'"/> |
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
grammar GoParser; | |
sourceFile | |
: packageClause eos (importDecl eos)* ((functionDecl | methodDecl | declaration) eos)* | |
; | |
packageClause | |
: 'package' IDENTIFIER | |
; |
OlderNewer