Skip to content

Instantly share code, notes, and snippets.

View ksoda's full-sized avatar
👯‍♀️
I may be slow to respond.

Ken Sonoda ksoda

👯‍♀️
I may be slow to respond.
  • Tokyo
View GitHub Profile
@ksoda
ksoda / gist:7fdfa33f43148bc265779cbaa673274d
Last active June 6, 2023 15:38
メソドロジと可観測性ツール

Memo: メソドロジと可観測性ツール

詳解 システム・パフォーマンスから。よくわからない箇所を書き留めるための文書。

メソドロジと分析

仕事を省略できるので性能チューニングは仕事をする場所付近で行うと効果が高い。 チューニング2.3.4やワークロードの特性の把握2.5.10参照。

方向性を定めるため目標を定めると、行動を選択するとき役立つ。定まればあとは要因を探すだけだ。

@ksoda
ksoda / _main.md
Last active July 24, 2020 15:27
Intermezzo Alloy part 2

Alloy part 2

前回の続き。Part 3

アトムと関係

アトムとは不可分、不変、非解釈(性質が組み込まれていない)を満たす。これだけではモデル化する能力が足りない。 そこで時空間を表せる関係を導入する。これはアトムからなるタプルの集合だ。

論理系

var _require = function _require(cond) {
if (!cond) {
factor(-Infinity);
}
}
// Class attendance model.
var attendance = function(i_pl, i_stats, busy) {
var attendance = function (interest, busy) {
if (interest) {
(def alt-from-char {\U 1 \D -1})
(defn ending-valley? [step alt]
(and (= alt -1) (= step \U)))
(defn countingValleys [n s]
(:cnt
(reduce
(fn [acc step]
(let [{:keys [cnt alt]} acc]
@ksoda
ksoda / read.rs
Last active November 3, 2021 12:32
VS Code snippet
#[allow(dead_code)]
fn read<T: std::str::FromStr>() -> Option<T> {
let mut b = String::new();
std::io::stdin().read_line(&mut b).ok();
b.trim().parse().ok()
}
/// # Examples
/// ```
/// let mtx = (0..2).map(|_| read_v().unwrap()).collect();
@ksoda
ksoda / host-only-nat.csv
Last active September 16, 2019 16:18
Research Selenium Grid connection
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 9.
"No.","Time","Source","Destination","Protocol","Length","Info"
"6","17.004176504","192.168.56.102","192.168.56.1","TCP","66","49931 > 4444 [SYN] Seq=0 Win=64240 Len=0 MSS=1460 WS=256 SACK_PERM=1"
"7","17.004243596","192.168.56.1","192.168.56.102","TCP","66","4444 > 49931 [SYN, ACK] Seq=0 Ack=1 Win=64240 Len=0 MSS=1460 SACK_PERM=1 WS=128"
"8","17.004560848","192.168.56.102","192.168.56.1","TCP","54","49931 > 4444 [ACK] Seq=1 Ack=1 Win=2102272 Len=0"
"9","17.013046010","192.168.56.102","192.168.56.1","HTTP","202","GET /grid/api/hub HTTP/1.1 "
"10","17.013094764","192.168.56.1","192.168.56.102","TCP","54","4444 > 49931 [ACK] Seq=1 Ack=149 Win=64128 Len=0"
"13","17.056025","192.168.56.102","192.168.56.1","TCP","66","[TCP Retransmission] 49931 > 4444 [SYN] Seq=0 Win=64240 Len=0 MSS=1460 WS=256 SACK_PERM=1"
"14","17.056329","192.168.56.1","192.168.56.102","TCP","66","[TCP Retransmission] 4444 > 49931 [SYN, ACK] Seq=0 Ack=1 Win=64240 Len=0 MSS=1460 SACK_PERM=1 WS=128"
"15","17.056409","192.168.56.102","1
@ksoda
ksoda / LICENSE
Created September 18, 2019 12:49
LICENSE
MIT License
Copyright (c) 2019 Ken SONODA
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
let
pkgs = import <nixpkgs> {};
stdenv = pkgs.stdenv;
in with pkgs; {
myProject = stdenv.mkDerivation {
name = "myProject";
version = "1";
src = if pkgs.lib.inNixShell then null else nix;
buildInputs = with rPackages; [
@ksoda
ksoda / scroll-sync.js
Last active February 9, 2020 07:56 — forked from hogashi/scroll-sync.js
scroll original window -> new window will be scrolled synchronously
//javascript:
(() => {
const mkDebounce = fn => {
let timeoutId;
let resolves = [];
return function(...args) {
return new Promise(resolve => {
clearTimeout(timeoutId);
timeoutId = setTimeout(() => {
timeoutId = null;
@ksoda
ksoda / asdf.go
Created January 13, 2020 15:23
Install a specific version of a package
//usr/bin/env go run "$0" "$@"; exit "$?"
package main
import (
"fmt"
"os"
"github.com/codeskyblue/go-sh"
)