Skip to content

Instantly share code, notes, and snippets.

View sprintr's full-sized avatar
🎯
Focusing

Amin Ullah sprintr

🎯
Focusing
View GitHub Profile

Run with the following bash command

ts-node computeJoinPoint.ts
@sprintr
sprintr / bounding-box-regression.py
Last active April 26, 2022 16:27
Bounding Box Regression
# The actual height and width of each cell
cell_height, cell_width = 256, 256
# Bounding box parameters normalized between 0 and 1
# This comes from the output of a bounding box regression model
bx, by, bh, bw = 0.6, 0.6, 0.4, 0.4
# Calculate height and width
height = cell_height * bh
width = cell_width * bw
@sprintr
sprintr / pytorch-multiclass-accuracy.py
Last active April 24, 2022 23:52
Multiclass Classifier Accuracy
test_correct = 0
train_correct = 0
output = (net(mnist_test_X) > 0.5).float()
for i, v in enumerate(output):
if v.argmax() == mnist_test_y[i].argmax():
test_correct += 1
output = (net(mnist_train_X) > 0.5).float()
for i, v in enumerate(output):
@sprintr
sprintr / Skycam.py
Created June 2, 2021 23:40
SkyCam Equations
# SkyCam Equations
# ----------------
# See https://www.scienceforums.com/topic/9394-skycam-formula-upside-down-pyramid/?tab=comments#comment-148968
import math
# Distances between adjacent towers
v = 460
w = 250
@sprintr
sprintr / pytorch-or.py
Last active April 7, 2020 00:14
PyTorch
# -*- coding: utf-8 -*-
import torch
import torch.nn as nn
import torch.optim as optim
x_train = torch.Tensor([
[0, 0],
[0, 1],
[1, 0],
@sprintr
sprintr / main.js
Last active December 3, 2018 19:35
This is a dirty implementation of a GO SMS Pro's backup reader. Thanks to Waseem Kathia.
(function () {
var fs = require("fs"),
xml = require("xml-js");
var content = fs.readFileSync("gosms_sys119.xml", "utf8");
var result = xml.xml2json(content, { compact: true, spaces: 4 });
var styleSent = "color: blue;";
var styleReceived = "color: red;";
var stylePara = "font-family: Calibri; font-size: 11pt;";
@sprintr
sprintr / php7_build_ubuntu.sh
Created April 7, 2018 05:09 — forked from root-talis/php7_build_ubuntu.sh
Compiling PHP 7 on Ubuntu 15.04 with Various Supported Modules
#! /bin/bash
# PHP 7 Initial Compile #
# Author: Maulik Mistry
# Date: Aug 04, 2017
# References:
# http://www.zimuel.it/install-php-7/
# http://www.hashbangcode.com/blog/compiling-and-installing-php7-ubuntu
#
# License: BSD License 2.0
  • id unprefixed identifier of the preference. Generally a dotted name.
  • type Data type for the preference (generally, string, boolean, number)
  • initial Default value for the preference
  • options Additional options for a preference
@sprintr
sprintr / .profile
Last active May 24, 2020 08:56
Git Bash alias' list
alias []="brackets"
alias php="winpty php"
alias php7="winpty php7"
alias serve="winpty php -S localhost:8080 -t ."
alias serve7="winpty php7 -S localhost:8080 -t ."
alias python="winpty python"
alias python3="winpty python3"
alias perl="winpty perl"
alias ruby="winpty ruby"
alias node="winpty node"
@sprintr
sprintr / main.js
Last active December 24, 2017 10:50
Brackets' CodeMirror simple-mode demo
define(function (require, exports, module) {
var CodeMirror = brackets.getModule("thirdparty/CodeMirror/lib/codemirror"),
LanguageManager = brackets.getModule("language/LanguageManager");
CodeMirror.defineSimpleMode("handlebars", {
start: [
{ regex: /\{\{!--/, push: "dash_comment", token: "comment" },
{ regex: /\{\{!/, push: "comment", token: "comment" },
{ regex: /\{\{/, push: "handlebars", token: "tag" }
],