Skip to content

Instantly share code, notes, and snippets.

View anantkm's full-sized avatar
🎯
Focusing

Anant K. Mahale anantkm

🎯
Focusing
View GitHub Profile
@anantkm
anantkm / vision_transformer_tutorial.ipynb
Created August 11, 2021 01:38
Vision_Transformer_Tutorial.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import cv2
# initalize the cam
cap = cv2.VideoCapture(0)
# initialize the cv2 QRCode detector
detector = cv2.QRCodeDetector()
while True:
_, img = cap.read()
# detect and decode
data, bbox, _ = detector.detectAndDecode(img)
# check if there is a QRCode in the image
# please install qrcode library before running this program.
#pip install qrcode
import qrcode
# provide the link to your website.
input_data = "https://github.com/anantkm" #replace this link with desired link.
#Creating an instance of qrcode
qr = qrcode.QRCode(
version=1,
box_size=10,
@anantkm
anantkm / testcases.py
Last active July 16, 2020 05:16
These are the test cases for the project COMP9313. Instructions are in the comment section. These test cases are from different classmates. Just consolidated them and shared them here.
#All the test cases are taken from the Piazza. This file is just consolidation of all the testcases many authors.
#reference: https://piazza.com/class/kamb1tqxe9h6np?cid=149 , | Authors: Rittisak Kwanda, Anonymous Gear @149_f6
#Thanks to Raghavendran for coming up with this idea.
#instructions to use this file.
# You will need to import this file into main program (or .ipynb program given by the professor).
#replace the 'alpha_m, beta_n, data, query' with below statement.
# alpha_m, beta_n, data, query = testCase.test_case_'replaceTeseCaseNoHere'()
## Standard disclaimer : This code is provided as a sample and is in no way warranted for production use.
function global:get-StorageBlobGBSize
{
param (
[Microsoft.WindowsAzure.Commands.Common.Storage.ResourceModel.AzureStorageBlob] $blob
)
$blobGBSize = [math]::Truncate(($blob.Length / 1GB))
@anantkm
anantkm / AzureRedisTimeouttest.md
Last active January 2, 2019 01:22
Investigating and Troubleshooting StackExchange.Redis for Azure Redis Cache

Understanding and Troubleshooting StackExchange Timeout Exception.

Occasionally you encounter below timeout exception, and only thought you get is "all these days it was working fine why all of a sudden this error"?

Exception: Timeout performing GET {key}, inst: 1, mgr: Inactive, err: never, queue: 37, qu: 0, qs: 37, qc: 0, wr: 0, wq: 0, in: 65536, ar: 0, clientName: anantkm_pc, serverEndpoint: Unspecified/anantkm.redis.cache.windows.net:6380, keyHashSlot: 407, IOCP: (Busy=2,Free=998,Min=50,Max=1000), WORKER: (Busy=190,Free=8001,Min=50,Max=8191) Local-CPU: 95.8% (Please take a look at this article for some common client-side issues that can cause timeouts: http://stackexchange.github.io/StackExchange.Redis/Timeouts)

We need to understand StackExchange.Redis uses a configuration setting "synctimeout" for synchronous operations, for some reason if the intended operation is not able to complete within 1000 ms (a default value), it will throw above exception. Let's try to und

@anantkm
anantkm / XLog2CSV.ps1
Created December 12, 2018 17:26 — forked from ajith-k/XLog2CSV.ps1
Convert multiple storage analytical logs into a single csv file for easy analysis
# NOTE : This sample source code is provided "AS IS", with no warranties of any sort.
# Save as XLog2CSV.ps1 and execute as follows
# XLog2CSV.ps1 -inputFolder <input_folder_path> -outputFile <full_path_and_filename_of_csv>
# Eg:-
# XLog2CSV.ps1 -inputFolder c:\cases\Logs\2015\08\*.log -outputFile c:\cases\Logs\all_logs.csv
#
# 2015-08-21 : ajithkr : authored
#
[CmdletBinding()]