Skip to content

Instantly share code, notes, and snippets.

Avatar

Илья Дубков dubkov

View GitHub Profile
View nti
https://archive.ics.uci.edu/ml/datasets/Census+Income
https://archive.ics.uci.edu/ml/machine-learning-databases/adult/adult.names
https://archive.ics.uci.edu/ml/machine-learning-databases/adult/
View pyser.py
import serial
from time import sleep
ser = serial.Serial('/dev/ttyUSB0')
ser.baudrate = 115200
while (1):
line = ser.readline()
line = line.decode("utf-8")
first_param, second_param = line.split(",")
print(int(first_param), int(second_param))
@dubkov
dubkov / debounce.c
Created Oct 23, 2018
RIOT DEBOUNCE
View debounce.c
#include <stdio.h>
#include "xtimer.h"
#include "timex.h"
#include "periph/gpio.h"
#define MY_LED_1 GPIO_PIN(PORT_C,8)
/* set interval to 1 second */
#define INTERVAL (1U * US_PER_SEC)
@dubkov
dubkov / Makefile
Last active Oct 23, 2018
RIOT-THREADS
View Makefile
APPLICATION = threads
RIOTBASE ?= $(CURDIR)/../../RIOT
BOARD ?= stm32f0discovery
USEMODULE += xtimer
CFLAGS += -DDEVELHELP
QUIET ?= 1
FEATURES_REQUIRED += periph_timer
FEATURES_REQUIRED += periph_gpio
@dubkov
dubkov / lab2importtexts.py
Created Oct 13, 2018
lab2 nbc import texts
View lab2importtexts.py
import os
import numpy as np
imported_data = []
dir_paths = ['./data/movie_review/neg/', './data/movie_review/pos/']
for dir_path in dir_paths:
for filename in os.listdir(dir_path):
with open(dir_path + "/" + filename, 'r') as content_file:
View lab1.py
import numpy as np
from sklearn import model_selection as ms
from sklearn import tree
imported_data = []
for line in open("transfusion.data","r"):
line = line.split(",")
line = map(int,line)
imported_data.append(line)
@dubkov
dubkov / lab1.py
Created Sep 29, 2018
isitmaglab1
View lab1.py
import numpy as np
from sklearn import model_selection
from sklearn import tree
imported_data = []
for line in open('transfusion.data','r'):
line = line.split(",")
line = map(int,line)
View isitlab1.py
import numpy as np
from sklearn.tree import DecisionTreeClassifier
from sklearn.model_selection import train_test_split
imported_data = []
for line in open('transfusion.data', 'r'):
line = line.split(",")
line = map(int,line)
imported_data.append(line)
all_data = np.array(imported_data)
X = all_data[:,:4]
View riot-debounce.c
// BUTTON WITHOUT THREAD
#include <stdio.h>
#include "periph/gpio.h"
#include "xtimer.h"
#include "timex.h"
#include <string.h>
View masterprog-phrases.txt
НОТЫ
0001 C1
0002 D1
0003 E1
0004 F1
0005 G1
0006 A1
0007 B1
0008 C2
0009 гамма