Skip to content

Instantly share code, notes, and snippets.

import math
const
params = 2'i32
print = 10000'i32
generations = 100000'i32
popsize = 100
mutate = 0.5
bound_from = 0.0
bound_to = 100.0
@GULPF
GULPF / stats.txt
Created April 28, 2018 22:05
Nim stdlib usage for top 1000 starred GitHub projects
Number of files that imports the module (~15000 files total)
1 oswalkdir
1 rstgen
1 ftpclient
1 distros
1 strmisc
2 rlocks
2 lenientops
2 unidecode
3 httpserver
anonymous
anonymous / robobrowser_save_html_to_file.py
Created November 4, 2017 02:51
python save screenshot to file, robobrowser python 3.6
import random
import webbrowser
from robobrowser import RoboBrowser
def html_fixer(html_source: str):
trans_table = {ord(c): None for c in u'\r\n\t'}
src_list = [html_source]
html_source = ' '.join(s.strip().translate(trans_table) for s in src_list)
html_source = " ".join(html_source.split())
@retsyo
retsyo / gist:54e6838d65bee85604adc3717dd4f8ce
Last active September 11, 2017 06:22
nim: could not import: cblas_sscal
I could not run compiled nim app if it uses openblas in msys2+mingw64 on win64.
I have update nim to the new `git cloned` one, openblas to the latest one too
for example, as for https://github.com/mratsim/Arraymancer
```bash
$ nim
Nim Compiler Version 0.17.1 (2017-07-17) [Windows: amd64]
Copyright (c) 2006-2017 by Andreas Rumpf
@agentzh
agentzh / dns_server.lua
Created August 18, 2016 19:33
My first hacked version of silly Lua DNS server atop NGINX (with patched ngx_stream_lua_module).
local bit = require "bit"
local byte = string.byte
local lshift = bit.lshift
local rshift = bit.rshift
local concat = table.concat
local insert = table.insert
local char = string.char
local band = bit.band
local sub = string.sub
local gsub = string.gsub
import os, osproc, parsecfg, streams, strutils, json, winlean
import wox, registry
var wp = newWox()
proc getSessions(): seq[string] =
result = @[]
let iniPath = joinPath(getConfigDir(), "winscp.ini")

打印表头

小明正在用JavaScript写一个日志分析程序。该程序会将日志转化为CSV文件,以便在Excel等应用中加载为一个表格。现在他在生成表头上遇到了困难。

他需要实现如下一个方法:

function printLine(array) {
    console.log(array.join(","));
}
@bishboria
bishboria / springer-free-maths-books.md
Last active March 24, 2025 13:36
Springer made a bunch of books available for free, these were the direct links
@ACGT
ACGT / douyu_notify.py
Last active August 31, 2016 20:40
douyu notify
# -*- coding: utf-8 -*-
import sys
import string
import threading
from time import sleep
import requests
import ctypes
import datetime
request_interval=100
@G4MR
G4MR / nim-tooltip.nim
Last active October 30, 2023 07:00
nim windows tool tip
import windows, typeinfo, os
var wc : Widechar = 32515;
var h : HINST
var nid : NOTIFYICONDATA = NOTIFYICONDATA()
var szip : array[0..63, char]
var info : array[0..255, char]
var infoTitle : array[0..63, char]
var title = "My Title"
for x in 0..title.len: