start new:
tmux
start new with session name:
tmux new -s myname
/* this code is from http://c-faq.com/lib/calendar.br.html */ | |
#define DayOfWeek(d,m,y) (int)(DaysElapsed(d,m,y) % 7) | |
long DaysElapsed(int d,int m,int y) { | |
static int cd[]={0,31,59,90,120,151,181,212,243,273,304,334}; | |
long n=365L*(y-1); | |
if (m<3) y--; | |
return n+y/4-y/100+y/400+cd[m-1]+d; |
#!/bin/bash | |
# bash generate random alphanumeric string | |
# | |
# bash generate random 32 character alphanumeric string (upper and lowercase) and | |
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1) | |
# bash generate random 32 character alphanumeric string (lowercase only) | |
cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 32 | head -n 1 |
# ipak function: install and load multiple R packages. | |
# check to see if packages are installed. Install them if they are not, then load them into the R session. | |
ipak <- function(pkg){ | |
new.pkg <- pkg[!(pkg %in% installed.packages()[, "Package"])] | |
if (length(new.pkg)) | |
install.packages(new.pkg, dependencies = TRUE) | |
sapply(pkg, require, character.only = TRUE) | |
} |
import math._ | |
1L // Long型の 1 | |
1:Long // Long型の 1 | |
127:Byte // Byte型の 127 | |
32767:Short // Short型の 32767 | |
(1+2).toLong // Long型への変換 | |
(2+3) toLong // Long型への変換 |
# | |
# Sample nginx.conf optimized for EC2 c1.medium to xlarge instances. | |
# Also look at the haproxy.conf file for how the backend is balanced. | |
# | |
user "nginx" "nginx"; | |
worker_processes 10; | |
error_log /var/log/nginx_error.log info; |
$ npm install -g http-server
$ http-server -p 8000 -a foo.bar.com
Would serve PWD at http://foo.bar.com/
#!/bin/sh | |
# one way (older scala version will be installed) | |
# sudo apt-get install scala | |
#2nd way | |
sudo apt-get remove scala-library scala | |
wget http://www.scala-lang.org/files/archive/scala-2.11.4.deb | |
sudo dpkg -i scala-2.11.4.deb | |
sudo apt-get update |