Skip to content

Instantly share code, notes, and snippets.

🐍
<-Python

Makarov Andrey Winand

🐍
<-Python
  • Russian Railways
  • Moscow, Russia
Block or report user

Report or block Winand

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Winand
Winand / mikrotik_helper
Created Aug 17, 2018
mikrotik helper functions
View mikrotik_helper
local download do={
# Download file: [$download "src_url" "dst_file"] returns boolean
do {
/tool fetch $1 dst-path=$2
while ([len [/file find name=$2]] = 0) do={delay 0.1}
return true
} on-error={
return false
}
}
@Winand
Winand / cv2.py
Created May 27, 2018
cv2 image matching test
View cv2.py
# -*- coding: utf-8 -*-
"""
Редактор Spyder
Это временный скриптовый файл.
"""
#import numpy as np
#import cv2 as cv
#filename = r"F:\Captura3.PNG"
@Winand
Winand / pooled.py
Created Feb 10, 2018
Spyder's IPython and process pools
View pooled.py
# -*- coding: utf-8 -*-
"""
Created on Sat Feb 10 16:32:44 2018
@author: МакаровАС
"""
from concurrent.futures import ThreadPoolExecutor, ProcessPoolExecutor
import time
View np_datetime_strings.c
....
/*
* Wraps `localtime` functionality for multiple platforms. This
* converts a time value to a time structure in the local timezone.
*
* Returns 0 on success, -1 on failure.
*/
static int get_localtime(NPY_TIME_T *ts, struct tm *tms) {
char *func_name = "<unknown>";
#if defined(_WIN32)
View gist:c214a6a25a9534d6b4ce36b4523da487
tribution
writing manifest file 'pandas.egg-info\SOURCES.txt'
running build_ext
skipping 'pandas\_libs\join.c' Cython extension (up-to-date)
skipping 'pandas\_libs\index.c' Cython extension (up-to-date)
building 'pandas._libs.index' extension
D:\andray\Software\Python\WinPython-32bit-3.4.4.5Qt5\python-3.4.4\Scripts\gcc.ex
e -mdll -O -Wall -Ipandas/_libs/src/klib -Ipandas/_libs/src -ID:\andray\Software
\Python\WinPython-32bit-3.4.4.5Qt5\python-3.4.4\lib\site-packages\numpy\core\inc
lude -ID:\andray\Software\Python\WinPython-32bit-3.4.4.5Qt5\python-3.4.4\include
View read_link.py
View logcat.txt
--------- beginning of main
11-21 21:31:53.497 153 153 W auditd : type=2000 audit(0.0:1): initialized
11-21 21:31:56.294 161 161 I /system/bin/tzdatacheck: tzdata file /data/misc/zoneinfo/current/tzdata does not exist. No action required.
11-21 21:31:56.409 164 164 I sysinit : Running /system/etc/init.d/00banner
--------- beginning of system
View dmesg
[ 0.126799] tegra124-pinctrl tegra124-pinctrl: Config param 0003 not supported on group kb_row4_pr4
[ 0.126830] tegra124-pinctrl tegra124-pinctrl: Config param 0003 not supported on group kb_row5_pr5
[ 0.126888] tegra124-pinctrl tegra124-pinctrl: Config param 0003 not supported on group clk3_req_pee1
[ 0.126921] tegra124-pinctrl tegra124-pinctrl: Config param 0003 not supported on group pu2
[ 0.126952] tegra124-pinctrl tegra124-pinctrl: Config param 0003 not supported on group pu3
[ 0.126984] tegra124-pinctrl tegra124-pinctrl: Config param 0003 not supported on group pu4
[ 0.127015] tegra124-pinctrl tegra124-pinctrl: Config param 0003 not supported on group pu5
[ 0.127046] tegra124-pinctrl tegra124-pinctrl: Config param 0003 not supported on group pu6
[ 0.127079] tegra124-pinctrl tegra124-pinctrl: Config param 0003 not supported on group spdif_out_pk5
[ 0.127111] tegra124-pinctrl tegra124-pinctrl: Config param 0003 not supported on group pk2
@Winand
Winand / handle_unhandled.py
Created Sep 14, 2016
print exception before you die
View handle_unhandled.py
if QtCore.QT_VERSION >= 0x50501:
def excepthook(type_, value, traceback_):
traceback.print_exception(type_, value, traceback_)
QtCore.qFatal('')
sys.excepthook = excepthook
@Winand
Winand / span.py
Last active Aug 1, 2016
find column respecting row/colspans
View span.py
# 0-based /row/ to search for /text/
def find_column(table, row, text):
trs = table.find_all('tr')
results = [[c for c in trs[i].findChildren(recursive=False)]
for i in range(0, row+1)]
for r in range(row-1, -1, -1):
i = 0
for c in results[r]:
if r+int(c.get('rowspan', 0)) > row:
results[-1].insert(i, None)
You can’t perform that action at this time.