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/python3 | |
import requests | |
from bs4 import BeautifulSoup | |
def clean(url): | |
r = requests.get(url) | |
html = r.text | |
soup = BeautifulSoup(html, "lxml") | |
for script in soup(["script", "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
// -*- qml -*- | |
import QtQuick 2.0 | |
import Sailfish.Silica 1.0 | |
import Sailfish.Media 1.0 | |
import com.jolla.mediaplayer 1.0 | |
import org.nemomobile.thumbnailer 1.0 | |
import org.nemomobile.dbus 2.0 | |
import "scripts/AlbumArtFinder.js" as AlbumArtFinder | |
import "cover" |
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 | |
from datetime import datetime | |
import statsmodels.api as sm | |
import statsmodels.tsa.stattools as st | |
import pandas as pd | |
import json | |
import pytz | |
import matplotlib.pyplot as plt | |
import numpy as np | |
import math |
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
/* | |
IoT Manager mqtt device client https://play.google.com/store/apps/details?id=ru.esp8266.iotmanager | |
Based on Basic MQTT example with Authentication | |
PubSubClient library v 1.91.1 https://github.com/Imroy/pubsubclient | |
- connects to an MQTT server, providing userdescr and password | |
- publishes config to the topic "/IoTmanager/config/deviceID/" | |
- subscribes to the topic "/IoTmanager/hello" ("hello" messages from mobile device) | |
Tested with Arduino IDE 1.6.6 + ESP8266 Community Edition v 2.0.0-stable and PubSubClient library v 1.91.1 https://github.com/Imroy/pubsubclient | |
ESP8266 Community Edition v 2.0.0-stable have some HTTPS issues. Push notification temporary disabled. |
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
// Устанавливаем библиотеку: https://github.com/amperka/dht | |
// подключаем библиотеку | |
#include <dht.h> | |
// создаём объект-сенсор | |
DHT sensor = DHT(); | |
void setup() | |
{ | |
Serial.begin(9600); |
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 | |
import requests | |
import shutil | |
fn = "http://www.japanese-cinema-db.jp/Details?id=" | |
def saveFile(path): | |
r = requests.get(fn + str(path), stream=True) | |
if r.status_code == 200: | |
with open(str(path) + ".htm", 'wb') as f: |
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 | |
import requests | |
import shutil | |
fn = "https://bkrs.info/changes.php?total=100&start=%d&view=words_edited" | |
def saveFile(path): | |
r = requests.get(fn % str(path), stream=True) | |
if r.status_code == 200: | |
with open(str(path) + ".htm", 'wb') as f: |
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 TABLE `Collection` ( | |
`Id` int(11) NOT NULL, | |
`Name` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL | |
) ENGINE=InnoDB DEFAULT CHARSET=latin1; | |
CREATE TABLE `Item` ( | |
`Id` int(11) NOT NULL, | |
`CollectionId` int(11) NOT NULL, | |
`Value` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL | |
) ENGINE=InnoDB DEFAULT CHARSET=latin1; |
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 numpy as np | |
# @title | |
dict_file = 'words.txt' | |
users_file = 'users.txt' | |
users = [u for l in open(users_file).readlines()] | |
words = [u for l in open(words_file).readlines()] | |
def count_words_general(users, words): |
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
Usage: align dictfile.txt source translate | |
Russian tokenization has not been implemented yet, using generic scripts... | |
Read total: 4860962 | |
Reading X stop list... done. | |
Reading seed translation lexicon... done. | |
Number of entries: 29638 | |
Loading axis...done. | |
Number of sentences: 31 | |
Loading axis...done. | |
Number of sentences: 25 |
OlderNewer