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
// Imports the Google Cloud client library | |
const vision = require('@google-cloud/vision'); | |
// Creates a client | |
const client = new vision.ImageAnnotatorClient(); | |
client | |
.labelDetection('https://www.googleapis.com/download/storage/v1/b/staging.serverlessid.appspot.com/o/licensePlate%2Fsample.jpg?generation=1520858044266983&alt=media') | |
.then(results => { |
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 zmq | |
import json | |
import random | |
import time | |
from uuid import uuid4 | |
from datetime import datetime | |
import argparse | |
parser = argparse.ArgumentParser() | |
parser.add_argument("--device_id", help="Device ID that must send the weather 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
import zmq | |
import time | |
from elasticsearch import Elasticsearch | |
from uuid import uuid4 | |
import json | |
import argparse | |
parser = argparse.ArgumentParser() | |
parser.add_argument("--device_id", help="Device ID that must send the weather data", | |
action="store") |
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
// Load the AWS SDK for Node.js | |
var AWS = require('aws-sdk'); | |
var dateFormat = require('dateformat'); | |
// Set the region | |
AWS.config.update({region: 'ap-northeast-1'}); | |
// Create SQS service object | |
var sqs = new AWS.SQS({apiVersion: '2012-11-05'}); | |
var queueURL = "<url>/clickstreamQueueDev"; |
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
var QUEUE_URL = '<url>/clickstreamQueueDev'; | |
var AWS = require('aws-sdk'); | |
var sqs = new AWS.SQS({region : 'ap-northeast-1'}); | |
exports.handler = function(event, context, callback) { | |
var params = { | |
MessageBody: event.body, | |
QueueUrl: QUEUE_URL | |
}; | |
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
version: '2' | |
services: | |
portainer: | |
image: portainer/portainer | |
command: -H unix:///var/run/docker.sock | |
volumes: | |
- /var/run/docker.sock:/var/run/docker.sock | |
- portainer_data:/data | |
ports: |
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
class StackArray(object): | |
""" | |
Perbandingan sintaks Python dan Java | |
- self = this | |
- def = function | |
- None = null | |
""" | |
def create_stack(self, panjang): | |
self.panjang = panjang |
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
class QueueArray(object): | |
def create_queue(self): | |
self.queue = [] | |
def destroy_queue(self): | |
self.queue = None | |
def enqueue(self, nilai): | |
if type(self.queue) != None: |
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
CREATE DATABASE kereta_api_indonesia; | |
use kereta_api_indonesia; | |
CREATE TABLE country ( | |
id_country INT PRIMARY KEY AUTO_INCREMENT, | |
name VARCHAR(50) NOT NULL | |
); | |
INSERT INTO country (name) VALUES ('Indonesia'); |
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
library(e1071) | |
library(gmodels) | |
# 1. Load dataset from CSV | |
bank_csv <- read.csv("./Downloads/bank-additional/bank-additional-full.csv", header=TRUE, sep=";") | |
bank_df <- as.data.frame(bank_csv[1:32951,]) | |
summary(bank_df) | |
# 2. Do the preprocessing |
OlderNewer