How to implement a custom search for Hugo usig Gruntjs and Lunrjs.
Install the following tools:
| 'use strict' | |
| var co = require('co') | |
| var fs = require('fs') | |
| var cofs = require('co-fs') | |
| var r1 = exports.r1 = function(fileName){ | |
| fs.readFile(fileName, (err,data)=>{ | |
| fs.readFile(data.toString().trim(), (err,data)=>{ | |
| fs.readFile(data.toString().trim(),(err,data)=>{ |
| public class Parser { | |
| public static void main(String[] args) throws IOException, ResourceException, ScriptException { | |
| GroovyScriptEngine gse = new GroovyScriptEngine(new String[]{"E:/works/dsl/src"}); | |
| Binding b = new Binding(); | |
| Script script = gse.createScript("main.groovy",b); | |
| script.evaluate("print 123"); | |
| script.run(); | |
| // gse.run("main.groovy",) |
| repos: | |
| - original: https://golang.org/x/arch | |
| repo: https://github.com/golang/arch | |
| vcs: git | |
| - original: https://golang.org/x/benchmarks | |
| repo: https://github.com/golang/benchmarks | |
| vcs: git | |
| - original: https://golang.org/x/blog | |
| repo: https://github.com/golang/blog | |
| vcs: git |
| # 生成 dhparam.pem 文件, 在命令行执行任一方法: | |
| # 方法1: 很慢 | |
| openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 | |
| # 方法2: 较快 | |
| # 与方法1无明显区别. 2048位也足够用, 4096更强 | |
| openssl dhparam -dsaparam -out /etc/nginx/ssl/dhparam.pem 4096 |
| -Xmx8G | |
| -Xms8G | |
| -Xmn2G | |
| -Xss256k | |
| -XX:MaxMetaspaceSize=256M | |
| -XX:+HeapDumpOnOutOfMemoryError | |
| -XX:+AlwaysPreTouch | |
| -XX:+UseTLAB | |
| -XX:+ResizeTLAB | |
| -XX:+UseNUMA |
Many people have asked me about using the G1 garbage collector with Cassandra. Since most of my customers are running 2.0 in production the test is with 2.0 for now. Once I script it up I'll re-run the numbers with 2.1.
I also need to re-test with Java 7 and the Oracle JDKs.
| FROM alpine:3.12 | |
| WORKDIR /app/src | |
| RUN echo "https://mirrors.tuna.tsinghua.edu.cn/alpine/v3.12/main" > /etc/apk/repositories \ | |
| && echo "https://mirrors.tuna.tsinghua.edu.cn/alpine/v3.12/community" >> /etc/apk/repositories \ | |
| && apk update && apk add git \ | |
| && apk add build-base automake autoconf libxml2 fuse-dev curl-dev \ | |
| && git clone https://github.com/s3fs-fuse/s3fs-fuse.git . \ | |
| && ./autogen.sh && ./configure && make && make install |
| import numpy as np | |
| import math | |
| def generate_circle_points(diameter, num_points,z): | |
| angles = np.linspace(0, 2 * np.pi, num_points, endpoint=False) | |
| x_coords = diameter / 2 * np.cos(angles) | |
| y_coords = diameter / 2 * np.sin(angles) | |
| z_coords = np.full(num_points, z) | |
| return x_coords, y_coords, z_coords |