Skip to content

Instantly share code, notes, and snippets.

@pstoll
pstoll / CMakeLists.txt
Last active November 17, 2023 23:42
Some prime number research, providing the ability to select precision and see the tradeoffs on speed. Do everything to make the computation fast. Yes, I feel dirty about the sighandler stuff.
cmake_minimum_required(VERSION 3.5)
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
find_package(primesieve "7.0" REQUIRED )
#if (${CMAKE_SYSTEM_NAME} MATCHES "Emscripten")
# set(CMAKE_C_COMPILER "emcc")
# set(CMAKE_CXX_COMPILER "emcc")
#endif ()
@pstoll
pstoll / CMakeLists.txt
Created February 3, 2019 17:49
hex sum 1.0.4 source setup.
cmake_minimum_required(VERSION 3.5)
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
find_package(primesieve "7.0" REQUIRED )
#if (${CMAKE_SYSTEM_NAME} MATCHES "Emscripten")
# set(CMAKE_C_COMPILER "emcc")
# set(CMAKE_CXX_COMPILER "emcc")
#endif ()
@pstoll
pstoll / gs-tiller-group-cat-report-macros.js
Last active May 1, 2022 20:03
GoogleSheet Group Category Reports Macros
/** @OnlyCurrentDoc */
/** If you use Tiller & Category Rollup reports, this macro will create the groups to hide/collapse each level of report
* code from https://stackoverflow.com/questions/67784454/group-and-collapse-rows-in-google-apps-script
* relevant docs:
* https://community.tillerhq.com/t/docs-category-rollup-report/121
* https://spreadsheet.dev/reading-from-writing-to-range-in-google-sheets-using-apps-script
*
*/
@pstoll
pstoll / tour-golang.go
Created November 18, 2012 19:18
Go sqrt example
// http://tour.golang.org/#45
// by Perry Stoll
package main
import (
"fmt"
"math"
)
$ python ./test-seqs.py
timing 5 iterations with 1000 items:
first 5 ids: ['5aalphabetR84', '2aalphabet3aY', 'BmalphabetACg', 'JMalphabetunQ', 'Gqalphabet7le']
func dedup_orig: 0.00107002258301
func dedup_a1: 0.000247001647949
func dedup_a2: 0.000427961349487
timing 5 iterations with 10000 items:
first 5 ids: ['UPalphabetGuF', 'gqalphabet1rI', 'DGalphabetxbx', 'cHalphabetOYB', 'JYalphabetzW2']
func dedup_orig: 0.0133740901947
func dedup_a1: 0.00292015075684
#include <assert.h>
#include <inttypes.h>
#include <iostream>
#include <iterator>
#include <vector>
#include <chrono>
# /usr/bin/env python
# Author: Perry A. Stoll <perry at pstoll dot com>
# Date: June 2017
# Copyright Perry Stoll
#
# Generate the first N fibonnaci numbers.
#
# Note this is quite different from generating the Nth fibonnaci
# numbers in terms of storage and laying out the computation
$ openssl s_client -showcerts -connect verizon.com:443
CONNECTED(00000003)
depth=1 /C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert SHA2 High Assurance Server CA
verify error:num=20:unable to get local issuer certificate
verify return:0
---
Certificate chain
0 s:/C=US/ST=California/L=Santa Monica/O=EdgeCast Networks, Inc./CN=*.can.transactcdn.com
i:/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert SHA2 High Assurance Server CA
-----BEGIN CERTIFICATE-----
{
"battery": {
"temp_stats": {
"max": 29.469999313354492,
"90th": 28.979999542236328,
"10th": 26.260000228881836,
"50th": 27.1299991607666,
"min": 25.84000015258789
},
"cells": {
--- src/http/ngx_http_variables.c.orig 2010-01-11 03:21:46.000000000 -0800
+++ src/http/ngx_http_variables.c 2010-02-18 10:01:32.000000000 -0800
@@ -93,6 +93,9 @@
static ngx_int_t ngx_http_variable_pid(ngx_http_request_t *r,
ngx_http_variable_value_t *v, uintptr_t data);
+static ngx_int_t ngx_http_variable_start_time(ngx_http_request_t *r,
+ ngx_http_variable_value_t *v, uintptr_t data);
+
/*