Skip to content

Instantly share code, notes, and snippets.

@azu
azu / README.md
Last active September 22, 2024 09:48
Node.jsのTypeScriptサポートについて
@nobonobo
nobonobo / main.go
Created June 11, 2024 09:53
TinyGo + MicroBit:v2 で IMUを読む
package main
import (
"fmt"
"machine"
"time"
"tinygo.org/x/drivers/lsm303agr"
)
@terasakisatoshi
terasakisatoshi / mvc.html
Last active January 5, 2024 05:17
変分モンテカルロ法で遊ぶ
<!DOCTYPE html><html lang="en"><head><meta name="viewport" content="width=device-width"><meta charset="utf-8">
<meta name="pluto-insertion-spot-meta">
<meta name="theme-color" media="(prefers-color-scheme: light)" content="white"><meta name="theme-color" media="(prefers-color-scheme: dark)" content="#2a2928"><meta name="color-scheme" content="light dark"><link rel="icon" type="image/png" sizes="16x16" href="https://cdn.jsdelivr.net/gh/fonsp/[email protected]/frontend-dist/favicon-16x16.347d2855.png" integrity="sha384-3qsGeVLdddzV9oIkj3PhXXQX2CZCjOD/CiyrPQOX6InOWw3HAHClrsQhPfX9uRAj" crossorigin="anonymous"><link rel="icon" type="image/png" sizes="32x32" href="https://cdn.jsdelivr.net/gh/fonsp/[email protected]/frontend-dist/favicon-32x32.8789add4.png" integrity="sha384-cOe5vSoBIgKNgkUL27p9RpsGVY0uBg9PejLccDy+fR8ZD1Iv5dF1MGHjIZAIZwm6" crossorigin="anonymous"><link rel="icon" type="image/png" sizes="96x96" href="https://cdn.jsdelivr.net/gh/fonsp/[email protected]/frontend-dist/favicon-96x96.48689391.png" integrity=

Moment 2.30.0

Bugfixes

  • #6128 [feature] Graceful handling of undefined locale name
  • #5554 [bugfix] Handle invalid mutations
  • #6193 [bugfix] weekyear setter handle dow
  • #5592 [bugfix] Stricter single digit date parsing
  • #5827 [bugfix] ts: toISOString function also return null
  • #5607 [bugfix] unify duration.valueOf and asMilliseconds
@dc1394
dc1394 / newton.rs
Created December 26, 2023 12:02
Twitterの1D-Newton法の速度比較のコード(Rust版)
use std::fs::File;
use std::io::Write;
fn main() {
let mass = 1.0;
let k = 1.0;
let dt = 1e-2;
let nt = 100000000;
let mut xt = vec![0.0; nt + 1];
@dc1394
dc1394 / newton.cpp
Last active December 26, 2023 16:08
Twitterの1D-Newton法の速度比較のコード
#include <fstream> // for std::ofstream
#include <iomanip> // for std::setprecision
#include <ios> // for std::scientific
#include <utility> // for std::make_pair, std::pair
#include <vector> // for std::vector
namespace {
std::pair<double, double> Runge_Kutta_4th(double x, double v, double dt, double mass, double k);
double force(double x, double mass, double k);
}
@abikoushi
abikoushi / lpmixnorm.R
Created December 8, 2023 16:37
posterior density of the mixture normal distribution
library(ggplot2)
library(gganimate)
logsumexp=function (logx1,logx2){
logx1 + log1p(exp(logx2-logx1))
}
llmixnorm <- function(par, y){
a0 <- par[1]
b0 <- par[2]
@Nexarian
Nexarian / xrdp-setup-no-hw-accel.sh
Last active June 20, 2024 05:45
XRDP setup with only CPU encoding. No hardware acceleration
#!/usr/bin/env bash
set -e
sudo -v
sudo apt-get update
sudo apt-get dist-upgrade -y
sudo apt-get autoremove -y
@Nexarian
Nexarian / setup-freerdp.sh
Last active June 20, 2024 05:45
Install FreeRDP
#!/usr/bin/env bash
set -e
sudo -v
sudo apt install -y make git g++ nasm
git clone https://github.com/cisco/openh264.git ~/openh264
cd ~/openh264