rlo =. 4 : 'a; (,.b); +/@:*: (b =. ? 0 $~ # y)+ y - (a =. ? 0 $~ #@> y;x) +/ . * x'
iter =. 3 : 'y; 1 2 3 rlo 5 7 8 9'
data =: iter"0 i.50
outstr =: ": data
require 'files'
outstr fwrite 'out.txt'
(": $ outstr) fappend 'out.txt'
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
#!/bin/sh | |
{ | |
HEROKU_CLIENT_URL="https://s3.amazonaws.com/assets.heroku.com/heroku-client/heroku-client.tgz" | |
sh <<SCRIPT | |
# set appropriate HEROKU_DIR env variable | |
# default is ~/.local/heroku | |
# download and extract the client tarball |
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
type Custom = Custom String | |
type alias P = { i : Int, s: String, c: Custom } | |
p = P 4 "mo" (Custom "jo") | |
import Json.Encode as E | |
import Json.Decode as D | |
enc : P -> E.Value |
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
NUMBERS as JSON formatted strings may be very big -> | |
JSON::PP allow_bignum decode -> | |
List::Util sum0. &stats -> | |
JSON::PP allow_bignum encode -> | |
NUMBERS ENCODED AS STRINGS. WRONG CALCULATED VALUES DUE TO OVERFLOWS. | |
I can tolerate imprecise calculation of mean and variance, | |
but not entirely inaccurate result or numerical result encoded as string.:w | |
I am using a function to calculate statistics for a list of numbers. | |
These numbers may be big enough to lose precision if stored as normal perl numbers. |
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
APPEND '+' | |
ASC '@' | |
DESC '@-' | |
ASCEND '^' | |
ATTR [a-zA-Z_:][-_:.a-zA-Z0-9]* | |
ATTREND ']' | |
ATTRSTART '[' | |
CLASS [-a-zA-Z0-9]\+ | |
DESCEND '>' | |
DOLLAR '$' |
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
getExam : String -> Maybe String | |
getExam str = case Url.fromString str of | |
Nothing -> Nothing | |
Just u -> | |
Maybe.withDefault Nothing (Url.Parser.parse (Url.Parser.query (Url.Parser.Query.string "exam")) { u | path = "" }) | |
extractSearchArgument : String -> Url -> Maybe String | |
extractSearchArgument key location = | |
{ location | path = "" } | |
|> Url.Parser.parse (Url.Parser.query (Url.Parser.Query.string key)) |
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
(define (yoo n) | |
(cond | |
( (= n 0) (intxdx 0 1)) | |
( ( = n 1) (intxdx (intxdx 0 (/ 1 2)) (intxdx (/ 1 2) 1))) | |
( else | |
(let | |
((N (expt 2 n))) | |
(intxdx | |
(calcdown N (/ N 2)) | |
(calcup N (/ N 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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
char *noram="RAM denied\n"; | |
void die (char *msg) { | |
fputs (msg, stderr); | |
exit (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
function print_sequences() { | |
var i = app.project.sequences; | |
for (var x = 0; x < i.numSequences; x++) { | |
$.writeln(x + " " + i[x].name); | |
} | |
} | |
function print_activesequence_videotracks() { | |
var i = app.project.activeSequence.videoTracks; | |
for (var x = 0; x < i.numTracks; x++) { | |
$.writeln(x + " " + i[x].name); |
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 strict; | |
use warnings; | |
use autodie; | |
use feature qw(say); | |
use open ':std', ':encoding(UTF-8)'; | |
use Getopt::Long; | |
use Data::Dumper; |
NewerOlder