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 python3 | |
from urllib.request import urlopen | |
def slicefile(data, start, end): | |
import itertools | |
lines = data.splitlines() | |
return itertools.islice(lines, start, end) | |
def pages(data, lines): | |
count = 0 | |
start, end = 0, lines |
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 urllib.request import urlopen | |
def slicefile(data, start, end): | |
import itertools | |
lines = data.splitlines() | |
return itertools.islice(lines, start, end) | |
def pages(data, lines): | |
count = 0 | |
start, end = 0, lines | |
import os |
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 iDict(dict): | |
def __setitem__(self, key, item): | |
self.__dict__[key] = item | |
def __getitem__(self, key): | |
return self.__dict__[key] | |
def __repr__(self): | |
return repr(self.__dict__) |
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 -*- | |
morse_alphabet = { | |
"А" : ".-", | |
"Б" : "-...", | |
"В" : ".--", | |
"Г" : "--.", | |
"Д" : "-..", | |
"Е" : ".", | |
"Ж" : "...-", |
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 javax.json.*; | |
import java.io.*; | |
import java.lang.reflect.*; | |
import java.util.*; | |
public class Bean2JSON { | |
public static void main(String[] args) throws Exception { | |
Object inst; | |
String json; | |
Class clazz = Class.forName(args[0]); | |
inst = clazz.newInstance(); |
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
A Python web framework with embedded HTTP server on port 8888. | |
You can connect Python method with server.bind(func, name), where | |
server is serverlib.WebServer object, func is function to bind ( | |
it must return str object), and name is URI for newly created page. | |
When you call run() method, the web server starts, and really binds functions | |
with URIs. |
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
Ukrainian_Time = { | |
'minute': 'хвилина', | |
'hour': 'година', | |
'second': 'секунда', | |
'minutes': 'хвилин', | |
'hours': 'годин', | |
'seconds': 'секунд', | |
} | |
Ukrainian_Time_Numbers = [ |
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
return (n<2) ? n : (fibonacci(n-1) + fibonacci(n-2)); |
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 requests | |
from bs4 import BeautifulSoup as Parser | |
FILE = open('WEATHER', 'w') # Our output file | |
headers = { | |
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:45.0) Gecko/20100101 Firefox/45.0' # Mozilla Firefox (to avoid blocking) | |
} | |
def get_data(date): |
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://kit-pro.fontawesome.com/releases/v5.9.0/css/pro.min.css |
OlderNewer