Skip to content

Instantly share code, notes, and snippets.

# coding: utf-8
from collections import Counter
import numpy as np
import matplotlib.pyplot as plt
from sklearn.metrics import accuracy_score
class KNearestNeightbors(object):
def __init__(self, k = 1):
self._train_data = None
self._target_data = None
#encoding:utf-8
import numpy as np
import matplotlib.pyplot as plt
from collections import Counter
from sklearn import datasets
from sklearn.metrics import accuracy_score
from sklearn.model_selection import train_test_split
class OlsModel(object):
def __init__(self):
#include <sys/types.h>
#include <unistd.h>
#include <stdio.h>
#include <string.h>
int main(){
pid_t pid;
char buf[256];
int pp[2];
#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
int main(){
int sock0;
/*通信についての方法や種類を記述するアドレス構造体を宣言*/
struct sockaddr_in addr;
#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
int main() {
struct sockaddr_in server;
int sock;
char buf[32];
int n;
#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <string.h>
#include <fcntl.h>
#include <unistd.h>
int main(int argc, char *argv[]) {
#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <string.h>
#include <fcntl.h>
#include <unistd.h>
int main(){
int sock0;
@habakan
habakan / visualize_density.ipynb
Created January 2, 2018 08:50
Visualize_density
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@habakan
habakan / mining_setup.sh
Last active January 22, 2018 07:41
bitzeny_mining
apt-get install build-essential libcurl4-openssl-dev
git clone https://github.com/bitzeny/cpuminer.git
cd cpuminer
./autogen.sh
./configure CFLAGS="-O3 -march=native -funroll-loops -fomit-frame-pointer"
make
@habakan
habakan / mnist_tensorflow.py
Created February 14, 2018 07:31
mnist_tensorflow
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets("MNIAT_data/", one_hot=True)
import tensorflow as tf
x = tf.placeholder(tf.float32, [None, 784])
W = tf.Variable(tf.zeros([784, 10]))
b = tf.Variable(tf.zeros([10]))
y = tf.nn.softmax(tf.matmul(x, W) + b)
y_ = tf.placeholder(tf.float32, [None, 10])