Skip to content

Instantly share code, notes, and snippets.

View not-for-me's full-sized avatar
☺️
Fun coding time!

Woojin.joe not-for-me

☺️
Fun coding time!
View GitHub Profile
test1 <- read.csv("~/Dropbox/rcv/test1/total.csv")
plot(test1$centralized,
xaxt="n",
ylim=c(0,12500),
xlab="Number of Message",
ylab="Transfer Time(sec)",
type="l",
lty=1,
lwd=2)
axis(1,at=1:length(test1$msg),labels=test1$msg)
@not-for-me
not-for-me / 1003.c
Last active August 29, 2015 14:06
Fibonacci Modified Ver
#include <stdio.h>
int main(void)
{
int t,n,i,f0[41],f1[41];
f0[0]=1;
f0[1]=0;
f1[1]=1;
f1[0]=0;
scanf("%d",&t);
@not-for-me
not-for-me / csv.r
Created October 1, 2014 08:30
CSV to Graph
pm10 <- data.frame(read.csv("~/Develop/Java/CSN-System/pm10.csv"))
id_2200501 <- sqldf("SELECT * FROM pm10 WHERE id = 2200501")
id_2030601 <- sqldf("SELECT * FROM pm10 WHERE id = 2030601")
id_2000901 <- sqldf("SELECT * FROM pm10 WHERE id = 2000901")
id_2001001 <- sqldf("SELECT * FROM pm10 WHERE id = 2001001")
plot(id_2200501$value, xaxt="n", ylim=c(0,300), xlab="Time", ylab="PM10(ug/m^3)", type="l", lty=1, lwd=2)
lines(id_2030601$value, col="firebrick", lty=1, lwd=2)
lines(id_2000901$value, col="dodgerblue4", lty=1, lwd=2)
@not-for-me
not-for-me / decToBin.c
Created October 2, 2014 16:33
Convert Decimal number to binary number
void decToBin(int x) {
if(x == 1)
cout << x;
else {
decToBin(x/2);
cout << x%2;
}
}
@not-for-me
not-for-me / factorial.scala
Created October 2, 2014 16:44
Factorials
def factorial(n: Int): Int = {
def loop(acc: Int, n: Int): Int =
if (n == 0) acc
else loop(acc*n, n-1)
loop(1, n)
}
@not-for-me
not-for-me / readXLS.py
Created October 20, 2014 07:41
Python Program for reading xls
# coding: utf-8
from xlrd import open_workbook
wb = open_workbook('simple.xls')
for sheet in wb.sheets():
print(u'Sheet:' + sheet.name)
print("Number of Sheets: " + str(wb.nsheets))
@not-for-me
not-for-me / writeXLS.py
Created October 20, 2014 07:42
Make Excel File with Python
# coding: utf-8
from xlwt import Workbook
book = Workbook()
sheet1 = book.add_sheet(u'Ex Sheet1')
sheet2 = book.add_sheet(u'Ex Sheet2')
sheet1.write(0,0, u'Name')
sheet1.write(0,1, u'Sex')
//Arduino Sample Code for SHT1x Humidity and Temperature Sensor
//www.DFRobot.com
//Version 1.0
#include <SHT1x.h>
// Specify data and clock connections and instantiate SHT1x object
#define dataPin 10
#define clockPin 11
SHT1x sht1x(dataPin, clockPin);
float tempC;
int reading;
int tempPin = 0;
void setup()
{
Serial.begin(9600);
analogReference(INTERNAL);
}
void loop()
{
@not-for-me
not-for-me / Rational.scala
Created October 5, 2015 06:33
스칼라의 클래스 선언 샘플
package nfm.ex06
/**
* Programming In Scala 2/e List 6.5 코드
* 분수 Class
* @param n 분자
* @param d 분모
*/
/* 스칼라에 있는 문법: Class에서 기본 생성자 선언 가능