Skip to content

Instantly share code, notes, and snippets.

View qnbhd's full-sized avatar
:octocat:

Konstantin T qnbhd

:octocat:
View GitHub Profile

Keybase proof

I hereby claim:

  • I am qnbhd on github.
  • I am qnbhd (https://keybase.io/qnbhd) on keybase.
  • I have a public key ASA43BDNrbD0QphwAcxyP40LkZkyc6jNgY73sOFTpjmxmwo

To claim this, I am signing this object:

@qnbhd
qnbhd / ex.go
Created September 13, 2020 19:06
declare pow(a, n) {
var result := 1
for it in [0; n) {
result = result * a
}
return result
}
var u := pow(10, 5)
@qnbhd
qnbhd / ann.go
Created September 14, 2020 20:53
var x := 6
var y := 6.89
// if-else and logical expressions
if (x > 3) && (y > 6) {
println("true")
} else {
println("false")
}
@qnbhd
qnbhd / ex.go
Created September 21, 2020 14:00
require @builtins.math
declare sin2x(x float) -> float {
return sin(2*x)
}
println(sin2x(0.5))
// math package
declare sin(x float) -> float {
return __builtin__sin(x)
}
declare cos(x float) -> float {
return __builtin__cos(x)
}
func __InBoxMathFunc(w Executor, curNode Node, argCount, line int, functor func(x float64) float64) {
opNode, _ := w.Stack.Pop()
var target float64
switch op := opNode.(type) {
case *IntNumber:
target = float64(op.Value)
case *FloatNumber:
target = op.Value
# author: qnbhd
def strlen(__s):
from unittest.mock import patch
import optparse
from io import StringIO
import sys
import os
import contextlib
import abc
import math
import random
from abc import ABCMeta
from typing import Type
import pandas
def int_float_mapping(n: int, x_min: float, x_max: float, max_value: int) -> float:
return x_min + n * (x_max - x_min) / max_value