Skip to content

Instantly share code, notes, and snippets.

Ashwin Nanjappa ashwin

Block or report user

Report or block ashwin

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
ashwin / roundHalfToEven.cpp
Created Aug 17, 2018
Round half to even implementation for float
View roundHalfToEven.cpp
#include <array>
#include <cmath>
#include <iostream>
float roundHalfToEven(float f)
const float r = round(f); // Result is round-half-away-from-zero
const float d = r - f; // Difference
// Result is not half, RHAFZ result same as RHTE
ashwin /
Created Dec 11, 2017
Print type hierarchy tree
#!/usr/bin/env python3
"""Print hierarchy of types present in Python."""
import argparse
import sys
def is_builtin(t):
"""Check if type is builtin."""
builtin_s = "__builtin__" if sys.version_info.major <= 2 else "builtins"
ashwin / gpu_topologies.txt
Created Nov 13, 2017
GPU topology examples
View gpu_topologies.txt
$ nvidia-smi topo -m
GPU0 CPU Affinity
GPU0 X 0-7
X = Self
SOC = Connection traversing PCIe as well as the SMP link between CPU sockets(e.g. QPI)
PHB = Connection traversing PCIe as well as a PCIe Host Bridge (typically the CPU)
PXB = Connection traversing multiple PCIe switches (without traversing the PCIe Host Bridge)
ashwin / weekly_view.jira
Created Oct 26, 2017
Weekly view of issues in JIRA
View weekly_view.jira
# Last week
assignee = currentUser() AND duedate < startOfWeek() AND duedate >= startofWeek("-1w")
# This week
assignee = currentUser() AND duedate < endOfWeek() AND duedate >= startOfWeek()
# Next week
assignee = currentUser() AND duedate >= endOfWeek() AND duedate <= startofWeek("+1w")
ashwin /
Created Oct 21, 2017
Perl script to convert DOT file to ASCII graph
#!/usr/bin/perl -w
use Graph::Easy::Parser::Graphviz;
my $parser = Graph::Easy::Parser::Graphviz->new();
print $parser->from_file($ARGV[0])->as_ascii();
ashwin / git-rename-remote-branch
Created Oct 12, 2017
Git script to rename remote branch
View git-rename-remote-branch
# From:
if [ $# -ne 3 ]; then
echo "Rationale : Rename a branch on the server without checking it out."
echo "Usage : $(basename $0) <remote> <old name> <new name>"
echo "Example : $(basename $0) origin master release"
exit 1
ashwin / pocket_bookmarklet.js
Created Sep 17, 2017
Pocket bookmarklet code
View pocket_bookmarklet.js
View Dockerfile.tensorrt_server_googlenet
FROM nvidia/cuda:8.0-cudnn6-devel-ubuntu16.04
ENV CUDA_ARCH "30 35 52 60"
MAINTAINER Felix Abecassis ""
# Install dependencies.
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
cmake \
git \
View Dockerfile.caffe_server_googlenet
FROM nvidia/cuda:8.0-cudnn6-devel-ubuntu16.04
MAINTAINER Felix Abecassis ""
ENV CUDA_ARCH_BIN "30 35 50 52 60"
# Install dependencies.
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
ashwin / .Xresources
Created Jul 27, 2017
My ~/.Xresources config for xterm
View .Xresources
! =============================================================================
! XTerm settings
! =============================================================================
! Use white-on-black colors
XTerm.vt100.reverseVideo: true
UXTerm.vt100.reverseVideo: true
! XTerm already has 256 colors support
! We ask it to set the correct $TERM
You can’t perform that action at this time.