Skip to content

Instantly share code, notes, and snippets.

@kotaroito
kotaroito / gist:4651754
Last active May 6, 2019 15:48
perl eval.
#!/usr/env/perl
use strict;
use warnings;
use utf8;
sub eval_func {
# coding: utf-8
# In[1]:
import os
import tensorflow as tf
import glob
import random
from numpy.random import randint
# coding: utf-8
import os
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <pthread.h>
int x = 0;
int n = 100;
pthread_t tid[100];
pthread_mutex_t mut = PTHREAD_MUTEX_INITIALIZER;
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <pthread.h>
int x = 0;
int n = 100;
pthread_t tid[100];
@kotaroito
kotaroito / .my.cnf
Created January 6, 2014 08:40
.my.cnf - minimum
[mysql]
prompt='\\u@\\h[\\d]:\\c> '
<html lang="ja">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body>
<div id="item-1" class="item" style="height: 100px; border-style: dotted">
テストだよ。
</div>
<div id="item-2" class="item" style="height: 100px; border-style: dotted">
テストだよ。
@kotaroito
kotaroito / gist:6510661
Created September 10, 2013 14:57
LOCK_EX | LOCK_NB
use Fcntl qw(:flock LOCK_NB);
use Parallel::ForkManager;
my $pm = new Parallel::ForkManager(2);
for (1..2) {
my $pid = $pm->start and next;
write_file();
$pm->finish;
}
use Fcntl qw(:flock LOCK_NB);
use Parallel::ForkManager;
my $pm = new Parallel::ForkManager(2);
for (1..2) {
my $pid = $pm->start and next;
write_file();
$pm->finish;
}
@kotaroito
kotaroito / gist:6257228
Last active December 21, 2015 05:28
vagrant
# download box
$ cd ~/Downloads;
$ curl -L http://developer.nrel.gov/downloads/vagrant-boxes/CentOS-6.4-x86_64-v20130427.box -o CentOS-6.4-x86_64-v20130427.box
# add box
$ vagrant box add centos6.4-x86_64 ./CentOS-6.4-x86_64-v20130427.box
# initialize
$ mkdir ~/vagrant; cd ~/vagrant
$ vagrant init centos6.4-x86_64