Skip to content

Instantly share code, notes, and snippets.

@arosh
arosh / main.c
Last active Dec 8, 2020
hwpoison
View main.c
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <sys/mman.h>
const int SIZE = 4096;
int main(void) {
int *addr = malloc(sizeof(int)*SIZE);
posix_memalign(&addr, 4096, sizeof(int)*SIZE);
View main.dart
import 'dart:typed_data';
import 'package:flutter/material.dart';
import 'package:mlkit/mlkit.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
@arosh
arosh / Bayes.md
Created Oct 8, 2018
楽しいベイズモデリングの誤植?
View Bayes.md
  • p.16 $\hat{R}>1.1$ は $\hat{R}<1.1$ の間違い?
@arosh
arosh / off.html
Created Feb 27, 2018
Spring Seminar
View off.html
<form action="on.html"><button type="submit" style="padding: 0.5em 1em; font-size: 18px; background-color: #4CAF50; color: #FFF; border: none;">OFF -&gt; ON</button></form>
@arosh
arosh / nginx.conf
Last active Nov 25, 2017
Nginx WebDAV
View nginx.conf
user www-data;
worker_processes 1;
pid /run/nginx.pid;
events {
worker_connections 10240;
}
http {
sendfile on;
@arosh
arosh / README.md
Last active Jun 26, 2017
ACM-ICPC OB/OG の会 2017年度 模擬国内予選
View README.md
View simple.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View stanutil.py
def stanfit_to_dataframe(fit, pars=None):
"""
Parameters
==========
fit : pystan.StanFit4model
"""
import pandas
summary = fit.summary(pars=pars)
columns = summary['summary_colnames']
index = summary['summary_rownames']
@arosh
arosh / hello.js
Last active Mar 14, 2017
Promise sleep
View hello.js
function wait () {
return new Promise((resolve, reject) => {
setTimeout(resolve, 1000)
})
}
function foo (i) {
return new Promise((resolve, reject) => {
console.log(i)
resolve()
@arosh
arosh / queue_test.go
Created Jan 25, 2017
type assertion is too slow
View queue_test.go
package main
import (
"testing"
"errors"
)
var (
ErrQueueEmpty = errors.New("Queue is empty")
)