Skip to content

Instantly share code, notes, and snippets.

View HarshitRuwali's full-sized avatar
👨‍💻
Learning New Things

Harshit Ruwali HarshitRuwali

👨‍💻
Learning New Things
View GitHub Profile
@HarshitRuwali
HarshitRuwali / csv_to_img.py
Last active September 4, 2020 15:58
Extract the Images from the CSV file.
import numpy as np
import cv2
import mxnet as mx
import pandas as pd
import random
import os
curdir = os.path.abspath(os.path.dirname(__file__))
def gen_record(csvfile,channel):
@HarshitRuwali
HarshitRuwali / DockerRun.md
Last active October 3, 2020 21:34
Run the docker image interactively in shell.

Just create interactive container. No start but named for future reference.

Use your own image.

docker create -it --name new-container <image>

Now start it.

docker start new-container

Now attach bash session.

docker exec -it new-container /bin/bash

@HarshitRuwali
HarshitRuwali / booth-multiplication.cpp
Last active October 1, 2020 11:16
C++ program for booth multiplication.
#include<iostream>
using namespace std;
void add(int a[], int x[], int q);
void complement(int a[], int n) {
int i;
int x[8] = { NULL };
x[0] = 1;
@HarshitRuwali
HarshitRuwali / work.sh
Created July 31, 2020 07:20
Shell file for setting the work environment.
# Place this file in the root directory of the system
# Run `chmod +x work.sh`
# Run `./work.sh`
open -a "Mail.app"
open -a "Safari.app" https://stackoverflow.com/ https://mail.google.com/mail/u/0/#inbox https://github.com
open -a "Firefox Developer Edition.app"
# You may add your editor too. I am not adding cause I use a couple of editors (Sublime, Xcode, Android Stdio) for different work so it matters what you want that time.
@HarshitRuwali
HarshitRuwali / .zshrc
Last active October 11, 2020 14:25
zsh configuration
# for the figlet message
figlet Ruwali
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
@HarshitRuwali
HarshitRuwali / Neural-network.py
Created July 6, 2020 07:35
Neural network example
import random
import math
#
# Shorthand:
# "pd_" as a variable prefix means "partial derivative"
# "d_" as a variable prefix means "derivative"
# "_wrt_" is shorthand for "with respect to"
# "w_ho" and "w_ih" are the index of weights from hidden to output layer neurons and input to hidden layer neurons respectively
#
@HarshitRuwali
HarshitRuwali / C and C++ files
Created July 6, 2020 07:33
Running C and C++ files
gcc file.c
./a.out
g++ file.cpp
./a.out
@HarshitRuwali
HarshitRuwali / Anaconda.txt
Created June 14, 2020 13:11
Some useful terminal commands for Anaconda users.
To activate the Anaconda environment.
PATH=$PATH:$HOME/anaconda/bin
For the base:
source ~/.bash_profile
For the loacl environment we created:
conda activate <name>