Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@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/Pluto.jl@0.19.36/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/Pluto.jl@0.19.36/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/Pluto.jl@0.19.36/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 January 20, 2024 21:48
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 January 20, 2024 21:03
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
@Nexarian
Nexarian / ubuntu-2204-laptop-setup.sh
Last active January 20, 2024 21:03
Ubuntu 22.04 setup
#!/usr/bin/env bash
set -e
cd ~
sudo -v
sudo apt-get -y install nvidia-prime vim git mesa-utils net-tools \
gnupg2 software-properties-common apt-transport-https gpg wget \
@Nexarian
Nexarian / xrdp-intel-setup.sh
Last active January 20, 2024 21:03
Setup for Intel acceleration and XRDP
#!/usr/bin/env bash
set -e
sudo -v
sudo apt-get update
sudo apt-get dist-upgrade -y
sudo apt-get autoremove -y