Skip to content

Instantly share code, notes, and snippets.

View lol97's full-sized avatar
🎯
Focusing

Warteg Dust lol97

🎯
Focusing
  • DKI Jakarta, Indonesia
View GitHub Profile
@lol97
lol97 / NLTKTKINTER.py
Created June 27, 2018 07:18
punya syafiqur rahman
from tkinter import *
from tkinter import messagebox,filedialog
from nltk.tokenize import word_tokenize, sent_tokenize
def prosesPilihanNew():
messagebox.showinfo("Informasi", "Cuma coba-coba")
def prosesPilihanOpen():
nama = filedialog.askopenfile()
messagebox.showinfo
dataRead = str(nama.read())
@lol97
lol97 / trapezioda.py
Created June 27, 2018 12:45
Integrasi Numerik menggunakan metode Trapezioda
'''
integral trapezioda
Warteg Dust
xsufyan@gmail.com
'''
x = [0, 0.2, 0.4, 0.6, 0.8, 1.0]
y = [2, 3, 6, 5, 4, 1]
def trapezioda(x, y):
def cekSelisih(x):
@lol97
lol97 / serial.ino
Created August 4, 2018 16:14
Simple Serial Println Arduino
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
Serial.println("Hello");
delay(100);
}
@lol97
lol97 / readSerial.py
Created August 4, 2018 16:16
Simple read serial from (Arduino) at COM4 with baudrate 9600
import serial
arduino = serial.Serial('com4',9600) #contohnya ada di COM4 dan baudrate 9600
def doSomething():
data = int(arduino.readline())
print(data)
try:
while (True):
@lol97
lol97 / ledSerial.ino
Created August 4, 2018 16:20
Simple ON-OFF LED BUILT IN Arduino from serial monitor
#define LED 13
void setup() {
// put your setup code here, to run once:
pinMode(LED,OUTPUT);
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
@lol97
lol97 / ledCommand.py
Created August 4, 2018 16:21
Send Data to Arduino at serial Communication
import serial
arduino = serial.Serial('com4',9600)
def ledController():
cmd = input('type on/off/dc : ')
cmd = str.lower(cmd)
if(cmd == "on"):
arduino.write('H'.encode())
print("Lampu Nyala")
def string_splosion(data):
for x in range(len(data)):
print(data[:x+1],end="")
string_splosion("lele")
@lol97
lol97 / checkJavaScript.html
Last active August 20, 2018 08:27
Check Javascript
<!DOCTYPE html>
<html>
<head>
<title>Check Javascript</title>
</head>
<script src="https://code.jquery.com/jquery-3.3.1.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
<body>
<input type="number" name="caps_id" id="caps_id" min="1">
</body>
<script type="text/javascript">
@lol97
lol97 / Blink.ino
Created September 8, 2018 07:43
Blink pin 13 (LED) at Arduino
@lol97
lol97 / dump.py
Created September 8, 2018 09:31
BUAT IJUL :*
from sklearn.svm import SVC
from sklearn.cluster import KMeans
import random
import numpy as np
def createFeature(banyak_data):
feature = []
for x in range(banyak_data):
feature.append([random.randrange(50,98)])
feature = np.array(feature)