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 perl | |
# perl note - if @ds = [1,2,3], shift(@ds) returns 1 and make @ds be [2,3] | |
# | |
# perl note - perl lets you treat chars and numbers the same and just mostly | |
# figures out what to do | |
use v5.38; | |
# the input | |
my $t = '8155999'; |
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 perl | |
use v5.36; | |
use Future::AsyncAwait; | |
use Future::IO; | |
use experimental qw( signatures ); | |
async sub f($v) { | |
say 'start of f' . $v; | |
say time; | |
say 'a' . $v; |
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
class lru { | |
size: number; | |
n: number; | |
key2val: Map<string, any>; | |
keys: string[]; | |
constructor(size: number) { | |
this.size = size; | |
this.n = 0; | |
this.key2val = new Map<string,any>(); |
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 | |
// run this: https://play.golang.org/p/lGEbAcNeVJr | |
import ( | |
"fmt" | |
"log" | |
) | |
const ( |
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 | |
// RUN IT! https://play.golang.org/p/hUrvvq_gBQX | |
import ( | |
"fmt" | |
) | |
func flatten(iface interface{}) []int { |
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 ( | |
"context" | |
"log" | |
"os" | |
"strconv" | |
"time" | |
pb "../counter" |
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 ( | |
"context" | |
"errors" | |
"log" | |
"net" | |
"sync" | |
pb "../counter" |
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
syntax = "proto3"; | |
package counter; | |
// Value contains a countername and its present value. | |
message Value { | |
string countername = 1; | |
int32 value = 2; | |
} |
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
{-# LANGUAGE PackageImports #-} | |
module Main where | |
import qualified Data.Char as C | |
import qualified Data.Word as W | |
-- must qualify this (requiring the ghc pragma above) to disambiguate | |
-- from the Data.UUID also in system-uuid | |
import qualified "uuid" Data.UUID as U | |
import qualified Data.UUID.V5 as U5 |
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 ( | |
"errors" | |
"log" | |
"math/rand" | |
"sync" | |
"time" | |
) |
NewerOlder