Skip to content

Instantly share code, notes, and snippets.

@arosh
arosh / nginx.conf
Last active December 17, 2023 15:23
redmine on nginx + unicorn
# This is example contains the bare mininum to get nginx going with
# Unicorn or Rainbows! servers. Generally these configuration settings
# are applicable to other HTTP application servers (and not just Ruby
# ones), so if you have one working well for proxying another app
# server, feel free to continue using it.
#
# The only setting we feel strongly about is the fail_timeout=0
# directive in the "upstream" block. max_fails=0 also has the same
# effect as fail_timeout=0 for current versions of nginx and may be
# used in its place.
@arosh
arosh / hotbath.ipynb
Last active January 2, 2022 05:55
hotbath
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@arosh
arosh / MainWindow.xaml
Created July 31, 2012 02:54
System.Windows.Forms.PictureBox with WPF
<Window x:Class="Measure_and_Control.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:wf="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"
Title="初めてのアプリケーション" Height="350" Width="525">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*" />
<ColumnDefinition Width="*" />
@arosh
arosh / main.go
Created December 30, 2016 16:58
read until EOF
package main
import (
"bufio"
"fmt"
"os"
"io"
"log"
)
@arosh
arosh / gist:210bf4ed4e632a6b765d
Last active March 22, 2021 13:46
wstring and mbstring
// http://simd.jugem.jp/?eid=122
// このあたりの説明が丁寧でおすすめ(仕様に準拠しているかどうかは別として)
wstring to_wstring(const string & mbs) {
// http://linuxjm.sourceforge.jp/html/LDP_man-pages/man3/mbstowcs.3.html
size_t ws_len = mbstowcs(NULL, mbs.c_str(), 0);
wstring ws(ws_len, '\0');
mbstowcs(&ws[0], mbs.c_str(), ws.size());
return ws;
}
@arosh
arosh / main.c
Last active December 8, 2020 04:56
hwpoison
#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);
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 October 8, 2018 12:04
楽しいベイズモデリングの誤植?
  • p.16 $\hat{R}&gt;1.1$$\hat{R}&lt;1.1$ の間違い?
@arosh
arosh / off.html
Created February 27, 2018 07:04
Spring Seminar
<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>