This file contains hidden or 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
<html> | |
<head> | |
<title>Fire</title> | |
<meta charset="utf-8" /> | |
<style type="text/css"> | |
* { | |
margin: 0px; | |
padding: 0px; | |
} |
This file contains hidden or 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 scrapy | |
from scrapy.crawler import CrawlerProcess | |
class Accum: | |
buffer = [] | |
class CotacaoSpider(scrapy.Spider): | |
name = 'cotacao' | |
logger = None | |
start_urls = ['https://economia.uol.com.br/cotacoes/'] |
This file contains hidden or 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
package main | |
import ( | |
"fmt" | |
_ "github.com/lib/pq" | |
"github.com/gohouse/gorose" | |
"gobot.io/x/gobot" | |
"gobot.io/x/gobot/platforms/mqtt" | |
"encoding/json" | |
) |
This file contains hidden or 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
[{ | |
"id": "open", | |
"similar_words": ["abrir", "abra", "abre"] | |
}, { | |
"id": "door", | |
"similar_words": ["porta", "portao"] | |
}, { | |
"id": "temperature", | |
"similar_words": ["temperatura", "temp"] | |
}] |
This file contains hidden or 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 time | |
import struct | |
server_addr = ('', 9092) | |
server = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) | |
server.bind(server_addr) | |
while True: | |
data, address = server.recvfrom(640) |
This file contains hidden or 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 time | |
from multiprocessing import Process | |
class ThreadManager(object): | |
_pool = [] | |
@staticmethod | |
def register(service): | |
ThreadManager._pool.append(service) |
This file contains hidden or 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 json, time | |
import mysql.connector as mysql | |
class Database: | |
def __init__(self, user=None, password=None, host=None, port=3306, schema=None, debug=False): | |
self.user = user | |
self.password = password | |
self.host = host | |
self.port = port | |
self.schema = schema |
This file contains hidden or 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 math import log | |
import numpy as np | |
from colour import Color | |
class Variance: | |
filters = [] | |
def convert(self, a_color): | |
m = 255. | |
a_color[0] = ((a_color[0]/m) * 100) / 100 |
This file contains hidden or 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
<?php | |
abstract class Normalizer implements Iterator, ArrayAccess, Countable | |
{ | |
protected $data; | |
protected $cursor = 0; | |
public function setData(array $data) | |
{ | |
$this->data = $data; | |
} |
This file contains hidden or 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 detection import Detector | |
import cv2 | |
import numpy as np | |
import imutils | |
import time | |
img = cv2.imread("sample1.jpg") | |
img = imutils.resize(img, width=640) | |
buf = img.copy() |
NewerOlder