- PHP >= 5.6.4
- OpenSSL PHP Extension
- PDO PHP Extension
- Mbstring PHP Extension
- Tokenizer PHP Extension
- XML PHP Extension
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
#!/usr/bin/env python | |
# encoding: utf-8 | |
import tweepy #https://github.com/tweepy/tweepy | |
import csv | |
#Twitter API credentials | |
consumer_key = "" | |
consumer_secret = "" | |
access_key = "" |
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 request | |
import json | |
# get top artist with last.fm api | |
# search on google last.fm api please | |
def get_artist_name(URL): | |
data = request.get(URL).text | |
data = json.loads(data) | |
top_artist = data["topartists"]["artist"][0]["name"] |
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 algoritma logistic regression pada scikit learn | |
from sklearn.linear_model import LogisticRegression | |
# membuat variable classifier dengan algoritma logistic regression | |
clf = LogisticRegression() | |
# properti yang dibutuhkan pada aplikasi ini mempunyai sebuah array dengan value sebagai berikut | |
# index 0 : Jarak rumah dalam KM | |
# index 1 : Level bau ketek (1 - 10) | |
# index 2 : Jenis kendaraan denga properti 0 = angkot, 1 = motor, 2 = mobil |
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
mysqldump -u [user] -p[user_password] [nama_database] > [nama_file].sql |
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 datetime | |
import os | |
import glob | |
now = datetime.datetime.now().strftime("%d-%m-%y") | |
date = now.split("-") | |
date_of_today = date[0] | |
db_user = "user" | |
db_user_password = "user_password" |
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
* 12 * * * cd [python script directory] && /usr/bin/python [python script directory]/backup_database.py | |
example: | |
* 12 * * * cd var/www/backup_db/ && /usr/bin/python var/www/backup_db/backup_database.py |
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
no | waktu yang di habiskan (detik) | ||
---|---|---|---|
SQL LIKE operator | Regex | ||
1 | 5.0 | 3.5 | |
2 | 4.7 | 3.5 | |
3 | 4.2 | 3.3 | |
4 | 5.0 | 3.9 | |
5 | 4.4 | 3.9 | |
6 | 4.3 | 4.2 | |
7 | 5.6 | 2.9 | |
8 | 4.2 | 3.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
select u.display_name | |
,s.amount | |
,u.location | |
from [bigquery-public-data:stackoverflow.users] u | |
join ( | |
select s.owner_user_id, | |
count(*) amount | |
from [bigquery-public-data:stackoverflow.posts_questions] s | |
group by s.owner_user_id | |
) s |
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
select tag | |
,count(*) number | |
from( | |
select SPLIT(q.tags, '|') tag | |
from [bigquery-public-data:stackoverflow.posts_questions] q | |
join [bigquery-public-data:stackoverflow.users] u | |
on q.owner_user_id = u.id | |
where REGEXP_MATCH(u.location, '(?i)indonesia') | |
) | |
group by tag |
OlderNewer