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 | |
n_steps = 50 | |
c, d= np.array([3,3]),np.array([1,2]) | |
a = c-d | |
b = (np.linalg.norm(c)**2-np.linalg.norm(d)**2)/2 | |
x = np.linspace(0, 4, n_steps) | |
y = np.linspace(0, 4, n_steps) | |
X, Y = np.meshgrid(x, y) |
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
ffmpeg -i input.mp4 -vcodec libx264 -acodec mp2 -pix_fmt yuv420p output.mp4 |
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
package main | |
import "fmt" | |
type person struct { | |
name string | |
age int | |
} | |
func (p person) print() { |
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 sympy import * | |
from sympy.abc import k | |
B=Matrix([[1, .5], [.5, 1]]) | |
print(B.eigenvals()) | |
A=Matrix([[1+k, .5], [.5, 1+k]]) | |
print(A.eigenvals()) | |
A=Matrix([[1+k, .5, 1], [.5, 1+k, 1],[.5, 1, 1+k]]) | |
print(A.eigenvals()) |
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 | |
n_dimensions = 2 | |
A = np.random.rand(n_dimensions) # source | |
B = np.random.rand(n_dimensions) # target | |
# linear function | |
n_steps = 50 | |
delta = (A-B)/n_steps |
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
""" Worker will wail to another to finish a task in order to do some procedure | |
""" | |
import threading | |
import logging | |
import time | |
logging.basicConfig(level=logging.DEBUG, | |
format='(%(threadName)-10s) %(message)s',) | |
def worker(lock, seconds=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
wb=openpyxl.load_workbook("doc.xlsx") | |
sheet, inrange=list(wb.defined_names["MYDEFINEDNAME"].destinations)[0] | |
[xy.value for xy in x] for x in wb[sheet][inrange]] |
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
# newest version for Mozilla Firefox 81.0.2 | |
javascript:/*PDF - toggle filter invert*/(function(){var L='style_PDFI',S='#viewerContainer>#viewer.pdfViewer>.page{filter: invert(100%)}',SS,E=document.querySelector('style[id="'+L+'"]');if(E){SS=E.disabled;E.disabled=(SS==true)?false:true}else{SS=document.createElement('style');SS.setAttribute('type','text/css');SS.id=L;SS.innerHTML=S;document.querySelector('head').appendChild(SS); document.querySelectorAll("#viewerContainer>#viewer.pdfViewer>.page").forEach(e=>e.style.border="10px solid rgba(0, 0, 0, 0)"); document.querySelector("#viewerContainer>#viewer.pdfViewer").style.background="#666"; document.querySelector("#toolbarViewer").style.background="#999"; document.querySelector("#toolbarViewer").style.borderBottom="#999 solid 1px"; document.querySelector("#toolbarSidebar").style.background="#999";document.querySelector("#outlineView").style.background="#bbb"}})() | |
# my bookmarklet | |
javascript:/*PDF - toggle filter invert*/(function(){var L='style_PDFI',S='#viewerC |
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
#extracted from: https://www.scrapehero.com/how-to-rotate-proxies-and-ip-addresses-using-python-3/ | |
import requests | |
from lxml.html import fromstring | |
def get_proxies(): | |
url = 'https://free-proxy-list.net/' | |
response = requests.get(url) | |
parser = fromstring(response.text) | |
proxies = set() | |
for i in parser.xpath('//tbody/tr'): | |
if i.xpath('.//td[7][contains(text(),"yes")]'): |