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
/************************************************************** | |
* | |
* primabot Davis Sensor Reader | |
* | |
* target prosesor: Atmega 328p | |
* | |
* Widoyo | |
* 20 Okt 2020 | |
* | |
**************************************************************/ |
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
#define library and main variable | |
import MySQLdb | |
from urllib2 import urlopen | |
import urllib2 | |
import requests | |
import time | |
import json | |
def push_notifikasi(wilayah,stasiun,tanggal,jam,ch,status,state): | |
tanggal_jam = str(tanggal) + " " + str(jam) | |
data = { |
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
$def with (ctx) | |
$ kegiatan = ctx.get('kegiatan') | |
$ pos = ctx.get('pos') | |
$ petugas = ctx.get('petugas') | |
$ tg = ctx.get('tgl') | |
$code: | |
haris = [h.title() for h in "sen_sel_rab_kam_jum_sab_min".split('_')] | |
bulan = [b.title() for b in "jan_feb_mar_apr_mei_jun_jul_ags_sep_okt_nop_des".split('_')] | |
$var extra_header: | |
<style> |
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
'Somarejan': | |
- 'mBokde Gembong': | |
- Mitro + : | |
- Tuminah | |
- Wardi | |
- Sri | |
- Wi | |
- Hadi Saimin | |
- Kenthut | |
- Yatman |
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
#Anomali Data Detection | |
import pandas as pd | |
#----------Data Preparation | |
df = pd.read_csv("E:/2.KULIAH/KP2_BBWS/DEBIT/tma_wonogiri.csv",header=None) | |
#colNaming | |
df.columns = ["DATE", "TIME", "OLD_VAL"] | |
#Combine column | |
df["DATETIME"] = df["DATE"].map(str) + " " + df["TIME"] |
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
def anomaly_detect(nama_pos, sampling_awal, sampling_akhir): | |
'''Return [('SamplingDate', 'SamplingTime', oldval, newval)]''' | |
pass | |
if __name__ == "__main__": | |
anomaly_detect('dengkeng', '2016-01-01', '2016-01-31') |
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
# -*- coding: utf-8 -*- | |
from urllib2 import urlopen | |
from HTMLParser import HTMLParser | |
products = open('produk.txt').readlines() | |
STATS_START = '<dl class=\'c-deflist\'' | |
STATS_END = '</dl>' |
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
// printFloat prints out the float 'value' rounded to 'places' places after the decimal point | |
void printFloat(float value, int places) { | |
// this is used to cast digits | |
int digit; | |
float tens = 0.1; | |
int tenscount = 0; | |
int i; | |
float tempfloat = value; | |
// make sure we round properly. this could use pow from <math.h>, but doesn't seem worth the import |
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
def create_num(num): | |
''' | |
Script Pythonfu untuk Gimp | |
''' | |
img = gimp.Image(384, 160, 1) | |
pdb.gimp_context_push() | |
text_layer = pdb.gimp_text_fontname(img, None, 60, 0, num, -1, True, 142, 0, "Ubuntu Bold Italic") | |
pdb.gimp_layer_resize_to_image(text_layer) | |
layer = pdb.gimp_image_flatten(img) | |
pdb.file_png_save_defaults(img, layer, "/tmp/%s.png" % num, "/tmp/%s.png" % num) |
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
<!doctype> | |
<html> | |
<head> | |
<!-- Include the PubNub Library --> | |
<script src="https://cdn.pubnub.com/pubnub.min.js"></script> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> | |
<!-- Instantiate PubNub --> | |
<script type="text/javascript"> |
NewerOlder