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
$ inxi | |
CPU~Quad core AMD Athlon X4 750K (-MCP-) speed/max~1400/3400 MHz Kernel~4.4.0-24-generic x86_64 Up~9:05 Mem~2784.2/7927.0MB HDD~3000.6GB(19.5% used) Procs~215 Client~Shell inxi~2.2.35 | |
$ python test.py | |
Average: | |
For loop: 0.000379131793976 | |
Operator: 0.000367625951767 | |
Lambda 1: 0.000438968896866 | |
Lambda 2: 0.000436615228653 | |
Numpy array 1: 5.86407184601e-05 | |
Numpy array 2: 5.91254234314e-06 |
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 telebot | |
bot = telebot.TeleBot("TOKEN") # This token is not valid, you should obtain your token from @BotFather bot (https://core.telegram.org/bots#botfather) | |
@bot.message_handler(commands=['start', 'help']) | |
def send_welcome(message): | |
bot.reply_to(message, "Howdy, how are you doing?") | |
@bot.message_handler(func=lambda message: True) | |
def echo_all(message): |
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 | |
# -*- coding:utf8 -*- | |
from os import path | |
import lxml.html | |
import requests | |
output = "razumovskaja_8_klass" | |
url = "https://megaresheba.ru/publ/reshebnik/russkomu_jazyku/razumovskaja_8_klass/35-1-0-1217/{task}" | |
userAgent_header = {'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:40.0) Gecko/20100101 Firefox/40.1'} |
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://projecteuler.net/problem=4 | |
A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 × 99. | |
Find the largest palindrome made from the product of two 3-digit numbers. | |
''' | |
from time import time | |
n = 0 | |
start = time() | |
DELAY = 1000 | |
for a in range(9, 0, -1): |
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
Failed to load resource: net::ERR_FILE_NOT_FOUND | |
popup.html:1 Error in response to cookies.getAll: InvalidCharacterError: Failed to execute 'btoa' on 'Window': The string to be encoded contains characters outside of the Latin1 range. | |
at Object.a [as callback] (chrome-extension://njabckikapfpffapmjgojcnbfjonfjfg/scripts/popup.js:4:30972) | |
at Object.callback (chrome-extension://njabckikapfpffapmjgojcnbfjonfjfg/scripts/popup.js:4:32382) |
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://oauth.vk.com/authorize?client_id=6263031&display=page&redirect_uri=https://oauth.vk.com/blank.html&scope=photos,messages,offline,docs&response_type=token | |
vkToken = токен вконтакте | |
userId = айди пользователя вк # ID бота | |
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
monitor() { | |
heading_template='\[$(date +%T)\] ' | |
heading_length=11 # "[HH:MM:SS] "=11 | |
#$(echo -n '{CMD}' | cut -c -$(( $COLUMNS - {heading_length} )) ) | |
heading_template+="\$( echo -n '$@' | cut -c -\$(( \$COLUMNS - $heading_length )) )" | |
heading=$(eval echo -n $heading_template) | |
output=$(eval $@ 2>&1) | |
while true; do |
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 | |
import matplotlib.pyplot as plt | |
from matplotlib.widgets import Slider | |
import matplotlib.lines as mlines | |
fig, ax = plt.subplots() | |
plt.subplots_adjust(bottom=0.60) | |
plt.grid(True) | |
MIN = -10 |
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
from sys import argv | |
from hashlib import md5 | |
import time | |
import shutil | |
import os | |
import sqlite3 | |
import progressbar # https://pypi.org/project/progressbar2/3.18.1/ | |
def download(fromDir, toDir, copyId): |
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
/** | |
* Collision box object. | |
* @param {number} x X position. | |
* @param {number} y Y Position. | |
* @param {number} w Width. | |
* @param {number} h Height. | |
*/ | |
function CollisionBox(x, y, w, h) { | |
this.x = x; | |
this.y = y; |
OlderNewer