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
#!/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; |
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
#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
(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
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
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
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
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
Subject: Top Level Object should not have a container | |
Data::Walk Version 2.01 assigns `container` and `type` for top-level objects | |
in an inconsistent way. On one hand, A scalar at top level gets the | |
arrayref of `@args` as `container`, and `ARRAY` as `type`. Whereas | |
a hashref, or arrayref, at top-level gets *ITSELF* as the `container`, | |
and its own ref type (`ARRAY|HASH`) as `type`. The latter behaviour | |
is not consistent because it implies that the item is contained in | |
itself. | |
NewerOlder