This file contains hidden or 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
""" | |
Instructions - | |
pip install httpx ipython | |
ipython -i async_vs_threads.py | |
%timeit asyncio.run(test_threads()) | |
%timeit asyncio.run(test_async()) | |
""" |
This file contains hidden or 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
Sentiments of a broken nation | |
Separated by religions and the hesitation | |
Vote banks, industries and corporations | |
Filthy pockets of the rich and famous | |
At the cost of poverty and desperation | |
Facing death and struggling daily | |
Without having a definite solution | |
Death and problems has no religion | |
Respect your neighbour from another nation | |
Fill the hearts with humanity |
This file contains hidden or 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
void main() { | |
List<int> x = createList(); | |
} | |
List<int> createList() { | |
return ["1", "2", "3", "4", "5"]; | |
} |
This file contains hidden or 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
void main() { | |
List<int> x = createList(); | |
} | |
createList() { | |
return ["1", "2", "3", "4", "5"]; | |
} |
This file contains hidden or 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
# | |
# Adapted from https://opencv-python-tutroals.readthedocs.io/en/latest/py_tutorials/py_gui/py_video_display/py_video_display.html#capture-video-from-camera | |
# | |
import numpy as np | |
import cv2 | |
caps = [cv2.VideoCapture(i) for i in range(2)] # open 2 camera feeds | |
while(True): |
This file contains hidden or 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
var start = DateTime.now() | |
var db = await appSync.getCacheDatabase(); | |
var pages = appSync.paginate( | |
..., | |
priority: CachePriority.cache, // Try cache first, then network | |
cache: db, | |
); |
This file contains hidden or 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 typing | |
from django.db import models | |
from channels.db import database_sync_to_async | |
M = typing.TypeVar("M", bound=models.Model) | |
class AsyncCrud: |
This file contains hidden or 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
# | |
# 🙏 to prior art: http://puzzlemusa.com/2018/05/14/learning-rate-finder-using-keras/ | |
# | |
# Example: | |
# finder = find_lr(model, 1e-10, 1e-2) | |
# finder.plot() | |
from bokeh.plotting import figure, show | |
from bokeh.io import output_notebook | |
from bokeh.models import HoverTool |
This file contains hidden or 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
# Generates 4 sets of images | |
# - original images | |
# - images with rotation | |
# - images with horizontal flip | |
# - images with vertical flip | |
train_gen = PersonDataGenerator( | |
train_df, | |
batch_size=32, | |
aug_list=[ | |
ImageDataGenerator(rotation_range=45), |
This file contains hidden or 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
[ +29 ms] executing: [/Users/dev/Tools/flutter/] git log -n 1 --pretty=format:%H | |
[ +48 ms] Exit code 0 from: git log -n 1 --pretty=format:%H | |
[ ] 68587a0916366e9512a78df22c44163d041dd5f3 | |
[ ] executing: [/Users/dev/Tools/flutter/] git describe --match v*.*.* --first-parent --long --tags | |
[ +12 ms] Exit code 0 from: git describe --match v*.*.* --first-parent --long --tags | |
[ ] v1.9.1+hotfix.6-0-g68587a091 | |
[ +9 ms] executing: [/Users/dev/Tools/flutter/] git rev-parse --abbrev-ref --symbolic @{u} | |
[ +14 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u} | |
[ ] origin/stable | |
[ ] executing: [/Users/dev/Tools/flutter/] git ls-remote --get-url origin |