Skip to content

Instantly share code, notes, and snippets.

.PHONY: out
out : main.o
gcc -o out main.o
./out
main.o : main.c
gcc -c main.c
@takahub1
takahub1 / row_to_col
Last active January 12, 2017 19:41
test description
#!/usr/bin/env python
f = open('ati_array_.txt','w')
for line in open ('ati_array.txt','r'):
itemList = line.strip()
print itemList
f.write(itemList)
f.write(',')
f.close()
out: main.py
@ python main.py
#include <iostream>
#include <unistd.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#include <arpa/inet.h>
#include <string.h>
#include <fstream>
@takahub1
takahub1 / drawRandomImage
Created January 12, 2017 20:29
g++ main.cpp -std=c++11 -o out `pkg-config opencv --cflags --libs`
#include <opencv2/opencv.hpp>
#include <random>
using namespace std;
using namespace cv;
int rand_(int range){
std::random_device rnd; // 非決定的な乱数生成器
return rnd()%range;
}
out: main.cpp
@ g++ main.cpp
@ echo "----------program start!----------"
@ ./a.out
@ echo "-----------program end!-----------"
#include <iostream>
#include <unistd.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
int main(){
int sock0;
@takahub1
takahub1 / KinectOneStream
Created January 14, 2017 15:43
require libfreenect2 and opencv
/*
-- Georgia Tech 2016 Spring
--
-- This is a sample code to show how to use the libfreenet2 with OpenCV
--
-- The code will streams RGB, IR and Depth images from an Kinect sensor.
-- To use multiple Kinect sensor, simply initial other "listener" and "frames"
-- This code refered from sample code provided from libfreenet2: Protonect.cpp
-- https://github.com/OpenKinect/libfreenect2
@takahub1
takahub1 / server.py
Last active February 24, 2017 05:10
# -*- coding: utf-8 -*-
import socket
import subprocess #for unix command
import time #for sleep
import random #for random number
def main():
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind(("192.168.10.103", 51007)) # 指定したホスト(IP)とポートをソケットに設定
print "waiting for connection..."
#!/usr/bin/env python
from PyQt5.QtWidgets import (QApplication, QWidget,
QGridLayout, QVBoxLayout, QHBoxLayout,
QLabel, QLineEdit, QPushButton)
import socket
import datetime #for datetime
import os #for directory
import time #for sleep
import shutil #for fail copy