Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Make Cirru great again!

Jon jiyinyiyong

💭
Make Cirru great again!
View GitHub Profile
View chart.js
myChart.showLoading();
$.get(ROOT_PATH + '/data/asset/geo/HK.json', function (geoJson) {
myChart.hideLoading();
echarts.registerMap('HK', geoJson);
myChart.setOption(option = {
title: {
@jiyinyiyong
jiyinyiyong / deque.nim
Last active Oct 14, 2020
Compare deque add(at tail) and delete(at head) performance with seq and linkedlist
View deque.nim
import nimprof
import times
import lists
import deques
let n = 40000
proc loopDeque(): void =
var data: Deque[int]
@jiyinyiyong
jiyinyiyong / output.text
Created Oct 12, 2020
Time consumption of calcit-runner running a tiny script
View output.text
=>> cat tests/snapshots/add.cirru
{} (:package |app)
:configs $ {} (:init-fn |app.main/main!) (:reload-fn |app.main/reload!)
:files $ {}
|app.main $ {}
:ns $ quote
ns app.main $ :require
:defs $ {}
|main! $ quote
@jiyinyiyong
jiyinyiyong / mini_list.nim
Created Oct 10, 2020
Simpler list to try...
View mini_list.nim
type
MiniList*[T] = ref object
value*: T
next*: MiniList[T]
proc initMiniList*[T](xs: varargs[T]): MiniList[T] =
if xs.len == 0:
return nil
@jiyinyiyong
jiyinyiyong / calcit.core.cirru
Created Sep 22, 2020
Drafted core abstractions in calcit-runner
View calcit.core.cirru
defn reduce-to-false (test prev xs)
if (empty? xs) true
if (test prev (first xs))
reduce-exit test (first xs) (rest xs)
, false
defn reduce-find (test xs)
if (empty? xs) nil
if (test (first xs)) (first xs)
View cond-impl.clj
(defmacro cond2
[& clauses]
(when clauses
(list 'if (first clauses)
(if (next clauses)
(second clauses)
(throw (IllegalArgumentException.
"cond requires an even number of forms")))
(cons 'user/cond2 (next (next clauses))))))
@jiyinyiyong
jiyinyiyong / names.md
Last active Sep 24, 2020
Possible names of new projects
View names.md
  • cassia 肉桂
  • kalmia 山月桂
  • minla 火尾希鹛
@jiyinyiyong
jiyinyiyong / old-sharings.md
Created Apr 19, 2020
Links to my old sharings
View old-sharings.md
@jiyinyiyong
jiyinyiyong / 九章.cirru
Last active Dec 22, 2019
基于九章算术语言习惯的伪代码
View 九章.cirru
今有 三十三
今有 二十
今有 $
答曰 |丙为
术曰 问相加几何 ( )
$
You can’t perform that action at this time.