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
@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 / 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 / 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);
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 / topicmodel.r
Last active August 29, 2015 14:03
topicmodel_with_r
# Library Load
library(tm)
# Set file Paths
otFilePath <- "~/Documents/mining/project/old"
ntFilePath <- "~/Documents/mining/project/new"
# Import txt to TextCorpus
oldTextCorpus <- Corpus(DirSource(otFilePath), readerControl = list(reader = readPlain, language = "en"))
newTextCorpus <- Corpus(DirSource(ntFilePath), readerControl = list(reader = readPlain, language = "en"))
@not-for-me
not-for-me / clustering_bible.r
Last active August 29, 2015 14:03
Clustering text(bibile) wirh R
# Library Load
library(tm)
# Set file Paths
otFilePath <- "~/Documents/mining/project/old"
ntFilePath <- "~/Documents/mining/project/new"
# Import txt to TextCorpus
oldTextCorpus <- Corpus(DirSource(otFilePath), readerControl = list(reader = readPlain, language = "en"))
newTextCorpus <- Corpus(DirSource(ntFilePath), readerControl = list(reader = readPlain, language = "en"))
@not-for-me
not-for-me / classification_with_whole_term.r
Created June 17, 2014 07:22
Document Classification with whole Term
# Load Library
library(tm)
library(party)
library(rpart)
library(nnet)
library(randomForest)
# Current R environment session Info
sessionInfo()
@not-for-me
not-for-me / classification_with_selected_term.r
Last active August 29, 2015 14:02
Document Classification with selected Term
# Library Load
library(tm)
library(party)
library(rpart)
library(nnet)
library(randomForest)
# Current R environment session Info
sessionInfo()
import org.eclipse.paho.client.mqttv3.MqttCallback;
import org.eclipse.paho.client.mqttv3.MqttClient;
import org.eclipse.paho.client.mqttv3.MqttConnectOptions;
import org.eclipse.paho.client.mqttv3.MqttDeliveryToken;
import org.eclipse.paho.client.mqttv3.MqttException;
import org.eclipse.paho.client.mqttv3.MqttMessage;
import org.eclipse.paho.client.mqttv3.MqttTopic;
public class SimpleMqttClient implements MqttCallback {
@not-for-me
not-for-me / .vimrc
Created April 15, 2014 03:04
Vim Configuration
set autoindent
set cindent
set smartindent
set nocompatible
set visualbell
set backspace=indent,eol,start
set history=50
set ruler
set showcmd
set incsearch