Skip to content

Instantly share code, notes, and snippets.

# SSH の設定
SSH_CONFIG="/etc/ssh/sshd_config"
SSH_CONFIG_BACKUP="/etc/ssh/sshd_config.bk"
SSH_PORT_NUMBER="22"
function change_setting () {
TARGET=$1
KEYWORD=$2
VALUE=$3
// necessary tools to use pyenv
sudo yum install gcc gcc-c++ make git openssl-devel bzip2-devel zlib-devel readline-devel sqlite-devel
// Install pyenv
sudo git clone https://github.com/yyuu/pyenv.git /usr/bin/.pyenv
cd /usr/bin/.pyenv
sudo mkdir shims
sudo mkdir versions
// Set path of pyenv
@wsuzume
wsuzume / ishitah.ipynb
Last active June 15, 2018 16:04
Solution for ishitah's problem
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
i=
_am=
stair=
_maker_=
eval(s=%q[
eval(%q[def_
stair(s)_if_AR
GV.size()==0_the
n_10.upto(50)_do_|
i|_puts(s.slice!(0,i
#coding:utf-8
import numpy as np
class WhiteningScaler:
def __init__(self, axis=0, threshold=1e-12, apply_zca=False):
# 行方向にデータが格納されている場合は axis=0
# 列方向にデータが格納されている場合は axis=1
self.axis = axis
self.threshold = threshold
@wsuzume
wsuzume / o_transform.py
Created August 12, 2017 22:20
o_transform transforms "time series signal of values" to "current values taking past values into account in each terms"
import numpy as np
def o_transform(signal):
ret = []
for n in range(1, len(signal)+1):
a = 2 / (n + 1)
d = -2 / (n * (n + 1))
s = 0
for t in range(n):
@wsuzume
wsuzume / repo.py
Last active December 17, 2016 11:30
#!/usr/bin/env python
#coding: UTF-8
import Image
import sys
def threshold(x,a):
if x > a:
return 1
else:
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include "type.h"
#include "rgsmap.h"
#include "instmake.h"
#define INST1(var) (var&0x000000ff)
#define INST2(var) (((var&0x0000ff00)>>8)|((var&0x000000ff)<<8))
@wsuzume
wsuzume / prvm02.cpp
Last active April 8, 2016 17:11
procyon virtual machine
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include "type.h"
#include "rgsmap.h"
#define OPRND1(var) ((var>>8)&0x0000000f)
#define OPRND2(var) (var&0x0000000f)
@wsuzume
wsuzume / compiler.cpp
Last active March 24, 2016 13:42
useage: ./compiler source dest
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int rmindent(char *buf)
{
int i;
for (i = 0; ; i++) {
if (buf[i] != ' ') {