Skip to content

Instantly share code, notes, and snippets.

View vvvu's full-sized avatar
🏉
Focusing

Vivaldi vvvu

🏉
Focusing
  • Iceland
View GitHub Profile
/*
Desc: Read data from the data stream that implements the interface io.Reader (e.g., os.Stdin)
Variables:
- r io.Reader (interface)
Functions:
- s.Split(): Split sets the split function for the Scanner. The default split function is ScanLines. The input is split into tokens by the split function.
- Alternative: ScanBytes, ScanLines, ScanRunes, ScanWords.
- s.Scan(): Scan advances the Scanner to the next token.
@vvvu
vvvu / setting_the_seed.py
Created November 18, 2021 08:15
PyTorch_Setting_The_Seed
# Function for setting the seed
def set_seed(seed):
np.random.seed(seed)
torch.manual_seed(seed)
if torch.cuda.is_available(): # GPU operation have separate seed
torch.cuda.manual_seed(seed)
torch.cuda.manual_seed_all(seed)
set_seed(42)
@vvvu
vvvu / .git-commit-template
Created December 25, 2020 07:03 — forked from zakkak/.git-commit-template
This commit message template that helps you write great commit messages and enforce it across your team.
# [<tag>] (If applied, this commit will...) <subject> (Max 72 char)
# |<---- Preferably using up to 50 chars --->|<------------------->|
# Example:
# [feat] Implement automated commit messages
# (Optional) Explain why this change is being made
# |<---- Try To Limit Each Line to a Maximum Of 72 Characters ---->|
# (Optional) Provide links or keys to any relevant tickets, articles or other resources
# Example: Github issue #23
@vvvu
vvvu / leetcode.cpp
Last active November 12, 2020 01:26
My LeetCode Template
#include <iostream>
#include <map>
#include <set>
#include <cmath>
#include <queue>
#include <cstdio>
#include <string>
#include <vector>
#include <cstring>
#include <algorithm>
@vvvu
vvvu / color_scheme.icls
Created July 25, 2020 13:49
My JetBrain ColorScheme - 07/25/2020
<scheme name="Atom One Dark" version="142" parent_scheme="Darcula">
<option name="FONT_SCALE" value="1.0" />
<metaInfo>
<property name="created">2020-07-03T00:00:04</property>
<property name="ide">CLion</property>
<property name="ideVersion">2020.1.0.0</property>
<property name="modified">2020-07-03T00:00:16</property>
<property name="originalScheme">_@user_Atom One Dark</property>
</metaInfo>
<option name="LINE_SPACING" value="1.2" />