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 | |
# -*- encoding: utf8 -*- | |
from html.parser import HTMLParser | |
from html import unescape | |
import pycurl | |
from io import BytesIO | |
class Citate(): | |
def __init__(self): |
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
IP=$1 | |
# проверить является ли IP - адресом/хостом с портом. [127.0.0.1]:21212 | |
ISPORT=$(expr match "$IP" '\[.*]\:[0-9]\{1,5\}') | |
if [[ ISPORT -gt 0 ]]; | |
then | |
echo "$IP не является ip-адресом. поиск и замена таких адресов пока не реализован" | |
exit 0 | |
fi | |
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
#!/bin/bash | |
echo "Авдеевка Донецкая | |
Александрия Кировоградская | |
Александровск Луганская | |
Алмазная Луганская | |
Алупка Крым | |
Алушта Крым | |
Алчевск Луганская | |
Ананьев Одесская |
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
/* | |
* Query that simulates running sp_spaceused on every applicable object in a database and gathering it all into a single result set | |
* This set-based approach is more efficient then actually doing that. | |
* The logic is derived strait from the source of sp_spaceused, so the numerical values should be a 1-to-1 match. | |
* Three changes have been made to the result set: | |
* (1) The object's schema and type are included. | |
* (2) Actual numbers are used in the result instead of strings with ' KB' appended to the end. | |
* (3) The reserved, data, index_size, and unused columns are renamed with a postfix of '_kb'. | |
* Compatibility: 2005+ | |
* Released by Greg Drake on 2013-06-03 |
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
# | |
# rison for python (parser only so far) | |
# see http://mjtemplate.org/examples/rison.html for more info | |
# | |
###################################################################### | |
# | |
# the rison parser is based on javascript openlaszlo-json: | |
# Author: Oliver Steele |
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/python | |
# -*- coding: utf-8 -*- | |
from graph import * | |
from math import sin, cos, pi | |
def ellipse( x1, y1, x2, y2, vertex_count = 36 ): | |
""" | |
Рисует эллипс, вписанный в прямоугольник x1,y1 x x2,y2 | |
""" | |
(x1, x2) = (min(x1, x2), max(x1, x2)) |
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 graph import * | |
from math import sin, cos, atan, sqrt, pi | |
def cart2pol(x, y): | |
r = sqrt(x**2 + y**2) | |
phi = atan(y, x) | |
return (r, phi) | |
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 | |
# cv = list of 2d control vertices | |
# n = number of samples (default: 100) | |
# d = curve degree (default: cubic = 3) | |
# closed = is the curve closed (periodic) or open? (default: open) | |
def bspline(cv, n=100, d=3, closed=False): | |
# Create a range of u values | |
count = len(cv) | |
knots = None | |
u = 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
import turtle | |
import math | |
from math import cos, sin, pi | |
# turtle.delay(50) | |
def cart2pol(x, y): | |
r = sqrt(x**2 + y**2) | |
phi = atan(y, x) | |
return (r, phi) |
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
urlencode() { | |
# urlencode <string> | |
old_lc_collate=$LC_COLLATE | |
LC_COLLATE=C | |
local length="${#1}" | |
for (( i = 0; i < length; i++ )); do | |
local c="${1:i:1}" | |
case $c in | |
[a-zA-Z0-9.~_-]) printf "$c" ;; |
OlderNewer