Skip to content

Instantly share code, notes, and snippets.

View miss-invincible's full-sized avatar
🤗
less is more

shivangi miss-invincible

🤗
less is more
View GitHub Profile
@miss-invincible
miss-invincible / golang_articles.md
Last active April 20, 2020 09:33
Good golang articles
@miss-invincible
miss-invincible / reflect_kind_type.go
Created January 14, 2020 07:02
Difference between reflect.kind and reflect.TypeOf
package main
import (
"fmt"
"reflect"
)
func main() {
type shivangi int32
var a shivangi = 3
@miss-invincible
miss-invincible / explore_rate_limiter.go
Created August 1, 2019 09:27
This is a simple test to explore the functionality of go rate limiter. Here, I am trying to test it's behaviour in parallel and synchronous calling.
package main
import (
"sync"
"fmt"
"time"
"https://github.com/uber-go/ratelimit"
)
var prev time.Time
for running mapper reducer using python streaming
hadoop jar /usr/local/hadoop-streaming-2.7.2.jar -input input -output output3 -mapper mapper.py -reducer reducer.py
copy file form one user to another:
sudo cp /home/USER1/FNAME /home/USER2/FNAME
/usr/local/hadoop-2.8.0/bin/hadoop jar ~/Downloads/
hadoop-streaming-2.8.0.jar -mapper mapper.py -reducer reducer.py -file mapper_kmeans.py -file reducer_kmeans.py -input input/cluster.txt -output output_l
import os
directory = os.path.dirname("/Users/user-name/your-directory/")
# directory = (os.getcwd());
# print directory
for filename in os.listdir(directory):
if filename.endswith(".txt"):
print(os.path.join(directory, filename))
continue
else:
Open a command prompt.
Go to the directory where you have your .java files
Create a directory "build"
Run java compilation from the command line
javac -d ./build *.java
#if there are multiple files to be jarred or
javac -d ./build file_name.java
1) install python3 (numpy has one dependency which needs python3.4 so it is better to install python3)
2) install pip python3:
sudo apt install python3-pip
3) install sklearn:
pip3 install -U scikit-learn
4) test on python if it is successfully installed:
python3
from sklearn.cluster import KMeans
if everything is imported successfully then its cool, else it will ask to install python numpy
5) install python numpy
@miss-invincible
miss-invincible / log.md
Created April 25, 2017 12:04
log the commits

to see the log of git commits :
git log branchname

to change a commit messsage:(not tested this)
git commit --amend

@miss-invincible
miss-invincible / file_revert.md
Created April 23, 2017 17:59
revert changes of a single file in git

if you wish to revert the changes of a single file use this command (when you file name does not match with any of the branch names):
git checkout filename

if your file name is similar to any of your branch names the use this command:
git checkout -- filename