Skip to content

Instantly share code, notes, and snippets.

View irdanish11's full-sized avatar
🎯
Focusing

Irfan Danish irdanish11

🎯
Focusing
View GitHub Profile
@irdanish11
irdanish11 / Oh my ZSH Autocomplete and Suggestions.md
Last active October 31, 2022 07:07
Oh my ZSH Autocomplete and Suggestions

1. Oh my zsh.

1.1. Install ZSH.

sudo apt install zsh-autosuggestions zsh-syntax-highlighting zsh

1.2. Install Oh my ZSH.

@irdanish11
irdanish11 / stream_buffer.py
Last active January 10, 2021 21:22
To prevent lagging & stream interruption(breaking) when streaming video from an IP camera, using a buffer with threading can reduce the lagging issue.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Jan 9 13:16:08 2021
@author: danish
"""
# OpenCV Python script to buffer the video stream
@irdanish11
irdanish11 / Installing miniconda on raspberry pi4-b.md
Last active April 18, 2024 16:02
Installing miniconda on raspberry pi4-b
a = tf.Variable(0)
@tf.function
def g(x):
x.assign_add(1)
return x
print(g(a))
print(g(a))
print(g(a))
@tf.function
def f(b):
a = tf.constant([[10,10],[11.,1.]])
x = tf.constant([[1.,0.],[0.,1.]])
y = tf.matmul(a, x) + b
print("PRINT: ", y)
tf.print("TF-PRINT: ", y)
return y
b = tf.Variable(12.)
class F():
def __init__(self):
self._b = None
@tf.function
def __call__(self):
a = tf.constant([[10, 10], [11., 1.]])
x = tf.constant([[1., 0.], [0., 1.]])
if self._b is None:
self._b = tf.Variable(12.)
b = None
@tf.function
def f():
a = tf.constant([[10, 10], [11., 1.]])
x = tf.constant([[1., 0.], [0., 1.]])
global b
if b is None:
b = tf.Variable(12.)
y = tf.matmul(a, x) + b
@tf.function
def f():
a = tf.constant([[10,10],[11.,1.]])
x = tf.constant([[1.,0.],[0.,1.]])
b = tf.Variable(12.)
y = tf.matmul(a, x) + b
print("PRINT: ", y)
tf.print("TF-PRINT: ", y)
return y
def f():
a = tf.constant([[10,10],[11.,1.]])
x = tf.constant([[1.,0.],[0.,1.]])
b = tf.Variable(12.)
y = tf.matmul(a, x) + b
return y
a = tf.constant([[10,10],[11.,1.]])
x = tf.constant([[1.,0.],[0.,1.]])
b = tf.Variable(12.)
y = tf.matmul(a, x) + b
print(y.numpy())