This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Pic Downloader | |
import urlparse, requests, shutil, os | |
def pic_downloader(gdrive_link, output): | |
parsed = urlparse.urlparse(gdrive_link) | |
id = urlparse.parse_qs(parsed.query)["id"][0] | |
new_gdrive_link = "https://docs.google.com/uc?export=download&id=" + str(id) | |
path = "img/" + output | |
if not os.path.isfile(path): | |
print "Downloading for " + output | |
response = requests.get(new_gdrive_link, stream=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import base64 | |
def ambil_c1(id_kelurahan, id_tps): | |
r = requests.get('http://scanc1.kpu.go.id/viewp.php?f=' + str(id_kelurahan).zfill(7) + str(id_tps).zfill(3) + '04.jpg') | |
content_type = r.headers['content-type'] | |
if(content_type == "text/html"): | |
return None | |
else: | |
id_to_print = str(id_kelurahan).zfill(7) + str(id_tps).zfill(3) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# rtbth patch for Kernel >= 3.13 | |
Putu Wiramaswara Widya <putu@wirama.web.id> | |
## Howto | |
Use this thing with http://ppa.launchpad.net/barracuda72/ralink/ubuntu/pool/main/r/rtbth-dkms/rtbth-dkms_3.9.3-0ubuntu1~ppa3.tar.gz. Patch with this command line : | |
$ patch < rtbth_core_bluez.c.patch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
if len(sys.argv) < 2: | |
exit(1) | |
file = sys.argv[1] | |
cells = [] | |
new_cell = {} | |
f = open(file) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Penugasan Proyek SimplePOS2013 Ke-2 | |
Mulai: 19 Desember 2013 16:53 UTC+7 | |
Selesai: 20 Desember 2013 23:45 UTC+7 | |
Silahkan implementasikan layanan/service dari laman wiki https://github.com/initrunlevel0/SimplePOS2013_Gudang/wiki/Implementasi-layanan-backoffice pada paket id.ac.its.SimplePOS2013.Gudang.ServiceBO. | |
Setiap service dibuat dalam dua bentuk: Interface dan Implementasinya (lihat kelas Barang sebagai contoh dasar). | |
Pembagian Tugasnya silahkan dideklarasikan sendiri melalui komentar Issue: https://github.com/initrunlevel0/SimplePOS2013_Gudang/issues/3. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
char incomingByte = NULL; | |
void setup() { | |
Serial.begin(9600); | |
pinMode(13, OUTPUT); // Gunakan pin 19 sebagai digital output ke lampu | |
} | |
void loop() { | |
if (Serial.available() > 0) { | |
// Baca perintah byte untuk On/Off |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pygraph.classes.digraph import digraph | |
dgr = digraph() # Graph | |
flow = {} | |
# Semacam DFS | |
def find_path(source, sink, path): | |
global flow | |
if(source == sink): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import socket | |
import sys | |
import os | |
from math import floor | |
from datetime import datetime | |
if(len(sys.argv) < 4): | |
print "python.py ./klien-getfile.py <address> <port> (get/ls) <path>" | |
else: | |
HOST = sys.argv[1] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Viewpoint Datalabs International, Inc. Copyright 1996 | |
mtllib ./vp.mtl | |
g | |
v 0.000000 8.407028 0.000000 | |
v 0.000000 8.380042 -0.204985 | |
v 0.053054 8.380042 -0.198000 | |
v 0.102492 8.380042 -0.177522 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <GL/glut.h> | |
#include <math.h> | |
#include <stdio.h> | |
#define PI 3.14 | |
const float DEG2RAD = 3.14159/180; | |
double rotate_x=0, rotate_y=0; | |
void display() { | |
glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); | |
//glClearColor(1.0, 0.9, 0.0, 1.0); |
NewerOlder