Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)
That's it!
Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)
That's it!
// Check Iranian National Code Validity - Clojure, C#, F#, Ruby, JavaScript, Dart, Python, Scala, Java 8, PHP, C, Go, Swift, Kotlin, Groovy, Rust, Haskell, Erlang, Elixir, Power Query M Language, VBA, R, Lua, Fortran, Pascal/Delphi, Excel, Stored Procedure / MySQL | |
// بررسی صحت کد ملی ایران - کلوژر، سیشارپ، افشارپ، روبی، جاوااسکریپت، دارت، پایتون، اسکالا، جاوا ۸، پیاچپی، سی، گو، سوئیفت، کاتلین، گرووی، راست، هسکل، ارلنگ، الکسیر، پاورکوئری ام، ویبی ای، آر، لوآ، فرترن، پاسکال/دلفی، اکسل، مایاسکیوال | |
// در نسخههای قبل یکسان بودن اعداد نا معتبر تشخیص داده میشد ولی | |
// اعداد یکسان نامعتبر نیست https://web.archive.org/web/20170706081048/http://www.fardanews.com/fa/news/127747/رندترین-شماره-ملی-بلای-جان-صاحبش-شد | |
// بعضی از پیادهسازیها سریع نیستند، میتوانید نسخهٔ خود را بر پایهٔ | |
// نسخهٔ سی یا گو ایجاد کنید که بهترین سرعت را داشته باشد | |
/** |
#/etc/init.d/vboxdrv setup Not Found - VirtualBox Fix!
When setting up Virtual Box I was faced with the immortal error telling me to run sudo /etc/init.d/vboxdrv setup
. Simple enough, until you're told it doesn't exist.
Thus began my fight to get it working. The fix is here in the hope that it helps someone else.
To follow this guide you need to have a basic understanding of shell commands. If you don't, then just be careful.
First off I like aptitute so let's install it.
import sys | |
import subprocess | |
import re | |
def convert_to(folder, source, timeout=None): | |
args = [libreoffice_exec(), '--headless', '--convert-to', 'pdf', '--outdir', folder, source] | |
process = subprocess.run(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE, timeout=timeout) | |
filename = re.search('-> (.*?) using filter', process.stdout.decode()) |
sudo certbot certonly --standalone -d registry.example.com |
See how a minor change to your commit message style can make a difference.
Tip
Take a look at git-conventional-commits , a CLI util to ensure these conventions, determine version and generate changelogs
""" | |
hypercorn main:multi_port -k uvloop -b 127.0.0.1:8000 -b 127.0.0.1:8001 | |
""" | |
from fastapi import FastAPI | |
from starlette_exporter import PrometheusMiddleware, handle_metrics | |
app = FastAPI() | |
app.add_middleware(PrometheusMiddleware) |