Skip to content

Instantly share code, notes, and snippets.

View Uberi's full-sized avatar

Anthony Zhang Uberi

View GitHub Profile
@Uberi
Uberi / cuda_11.8_installation_on_Ubuntu_22.04
Last active June 21, 2023 20:21 — forked from MihailCosmin/cuda_11.8_installation_on_Ubuntu_22.04
Instructions for CUDA v11.8 and cuDNN 8.7 installation on Ubuntu 22.04 for PyTorch 2.0.0
#!/bin/bash
### steps ####
# verify the system has a cuda-capable gpu
# download and install the nvidia cuda toolkit and cudnn
# setup environmental variables
# verify the installation
###
### to verify your gpu is cuda enable check
import shutil, subprocess, tempfile, os
import openpyxl
def load_workbook_xls(filename, **kwargs):
"""Same as openpyxl.load_workbook, but supports XLS files instead of XLSX files."""
soffice_path = shutil.which("soffice")
if soffice_path is None:
raise EnvironmentError("Can't find `soffice` executable - ensure Libreoffice Calc is installed correctly")
with tempfile.TemporaryDirectory() as temp_xlsx_directory:
import bisect
CHECKBOX_ENTRIES = [
(0, 0, 'One'),
(4, 0, 'Two'),
(8, 0, 'Three'),
(0, 10, 'Red'),
(4, 10, 'Green'),
(8, 10, 'Blue'),
(0, 20, 'A'),
POINTS_PER_CHARACTER = 72.23 / 13
def row_col_offset_to_xy_points(row, col, offset_x, offset_y, col_widths, row_heights):
pos_x = sum(col_widths[i] for i in range(col)) * POINTS_PER_CHARACTER + offset_x
pos_y = sum(row_heights[j] for j in range(row)) + offset_y
return (pos_x, pos_y)
@Uberi
Uberi / index.html
Last active September 15, 2018 06:16
Introduction to Web3 talk - sample dApp for setting/getting the value of a variable. https://hypotenuse.ca/intro-to-web3/
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<script type="text/javascript" src="https://cdn.jsdelivr.net/gh/ethereum/web3.js/dist/web3.min.js"></script>
<script type="text/javascript" src="index.js"></script>
<title>Storage Smart Contract</title>
</head>
<body>
@Uberi
Uberi / storage.sol
Created September 14, 2018 02:31
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.25+commit.59dbf8f1.js&optimize=true&gist=
pragma solidity ^0.4.0;
contract Storage {
uint value;
function set(uint newValue) public {
value = newValue;
}
function get() public view returns (uint) {

Keybase proof

I hereby claim:

  • I am uberi on github.
  • I am uberi (https://keybase.io/uberi) on keybase.
  • I have a public key whose fingerprint is C927 DE93 02A1 1966 1F00 8726 84D3 1436 5F56 B350

To claim this, I am signing this object:

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Uberi
Uberi / crash-rate-aggregates-watchdog.ipynb
Created April 14, 2016 16:55
crash-rate-aggregates-watchdog
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.