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 / ask.php
Last active February 23, 2019 16:46
Ask PHP 7,Array
<?php
$data = [
0 => [
'nama_file' = 'wajah1.png',
'id' = 'orang1',
'bit-depth' = 8,
],
1 => [
'nama_file' = 'wajah2.png',
'id' = 'orang2',
@lol97
lol97 / grayscale.py
Created January 25, 2019 13:05
Grayscale Method
#import library
import cv2
# path gambar
path_img = "Image/baboon.png"
# load image
img_asli = cv2.imread(path_img)
cv2.imshow("asli",img_asli)
cv2.waitKey(0)
'''
code for :
simpson 1/3 for seach area from list [[x,y]]
using :
python 3.6
sufyan97
'''
'''
case for single:
list = [[3,10],[5,10],[7,9]]
'''
Stegano Code
with
library stegano
sufyan97
install stegano
pip install stegano
'''
#import lsb method
from stegano import lsb
'''
code for load and show image
with :
opencv
by aglissae
'''
# import library
import cv2
@lol97
lol97 / aturan_titik_tengah.py
Created January 2, 2019 10:59
Soal nomor 1
'''
code by : Sufyan Saori (xsufyan@gmail.com)
soal1:
hitung hasil dari luas nilai x dan y dari tabel berikut dengan xawal=0 dan xakhir=6 dan h=2
tabel_awal = [[3,10],[5,10],[7,8],[9,8],[11,8],[13,5],[15,3]]
tabel_tengah = [[4,10],[6,7],[8,8],[10,8],[12,5],[14,3]]
format list [[x1,y1],...,[xn,yn]]
'''
def hitung_luas_mode_titik_tengah(tabel_nilai,h):
@lol97
lol97 / aturan_titik_tengah2.py
Created January 2, 2019 10:02
Integral Numerik Soal 2
'''
@author : sufyan saori (xsufyan@gmail.com)
code ini untuk menyelesaikan soal yang ada pada situs : https://aimprof08.wordpress.com/2012/09/09/aturan-titik-tengah-midpoint-rule/
'''
import math
def fungsi_soal(x):
# ubah fungsi kembalian (return) sesuai dengan keinginan soal
return 2+math.cos(2*(x**0.5))
@lol97
lol97 / qr_decoder.py
Created November 24, 2018 17:23
QRCode_decode
from PIL import Image
from pyzbar.pyzbar import decode
data = decode(Image.open('hasil.png'))
print(data[0][0].decode('UTF-8'))
@lol97
lol97 / qr_generate.py
Created November 24, 2018 17:22
qrcode_generator
import pyqrcode
code = pyqrcode.create("lakad matatag2")
code.png("hasil.png",scale=6)
code.show()
@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)