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 base64, times, strutils, strformat | |
let STR_SIZE = 131072 | |
let TRIES = 8192 | |
let str = strutils.repeat('a', STR_SIZE) | |
var str2 = base64.encode(str) | |
stdout.write(fmt"encode {str[..3]}... to {str2[..3]}...: ") | |
var t = times.epochTime() |
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
require "json" | |
text = File.read("1.json") | |
jobj = JSON.parse(text) | |
coordinates = jobj["coordinates"].as_a | |
len = coordinates.size | |
x = y = z = 0 | |
coordinates.each do |coord| | |
x += coord["x"].as_f |
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 json | |
let jobj = parseFile("1.json") | |
let coordinates = jobj["coordinates"].elems | |
let len = float(coordinates.len) | |
var x = 0.0 | |
var y = 0.0 | |
var z = 0.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
{ | |
"coordinates": [ | |
{ | |
"x": 0.10327081810860272, | |
"y": 0.03247172212368832, | |
"z": 0.8155255437507467, | |
"name": "scojbq 5965", | |
"opts": { | |
"1": [ | |
1, |
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
require 'json' | |
x = [] | |
1000000.times do | |
h = { | |
'x' => rand, | |
'y' => rand, | |
'z' => rand, | |
'name' => ('a'..'z').to_a.shuffle[0..5].join + ' ' + rand(10000).to_s, |
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
$ crystal build --release src/sayhi_c.cr | |
$ ./sayhi_c | |
> Hi Status! |
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
require "./sayhi_c/*" | |
@[Link(ldflags: "#{__DIR__}/sayhi_c/sayhi.o")] | |
lib Say | |
fun hi(name : LibC::Char*) : Void | |
end | |
Say.hi("Status") |
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> | |
void hi(const char * name){ | |
printf("Hi %s!\n", 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
<!DOCTYPE html> | |
<html class='has-navbar-fixed-top' > | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>Title</title> | |
</head> | |
<body class='has-navbar-fixed-top' > | |
<p >Hello</p> | |
<p >World</p> |
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 html_dsl | |
html page: | |
head: | |
title("Title") | |
body: | |
p("Hello") | |
p("World") | |
dv: | |
p "Example" |