Skip to content

Instantly share code, notes, and snippets.

View hmishra2250's full-sized avatar
:octocat:
I may be slow to respond.

Himadri Mishra hmishra2250

:octocat:
I may be slow to respond.
View GitHub Profile
@virtualstaticvoid
virtualstaticvoid / iptables_rules.sh
Created June 14, 2011 08:58
25 Most Frequently Used Linux IPTables Rules Examples
# Modify this file accordingly for your specific requirement.
# http://www.thegeekstuff.com
# 1. Delete all existing rules
iptables -F
# 2. Set default chain policies
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT DROP
@jsm85
jsm85 / Blog.LuceneNetExample.Index.cs
Created January 18, 2013 10:18
Blog - Searching with Lucene.Net - Building the Index and defining the Index Document
public class Index
{
public static void BuildIndex()
{
var directory = FSDirectory.Open(new DirectoryInfo("C:\\temp\\test\\"));
Analyzer analyzer = new StandardAnalyzer(Version.LUCENE_30);
var indexWriter = new IndexWriter(directory, analyzer, true, IndexWriter.MaxFieldLength.UNLIMITED);
@mjhea0
mjhea0 / 1 - sql_interview_questions.md
Last active June 22, 2024 09:44
Jitbit's SQL interview questions
@schlamar
schlamar / example.py
Last active February 13, 2022 18:15
mplog: Python advanced multiprocessing logging.
import logging
import multiprocessing
import time
import mplog
FORMAT = '%(asctime)s - %(processName)s - %(levelname)s - %(message)s'
logging.basicConfig(level=logging.DEBUG, format=FORMAT)
existing_logger = logging.getLogger('x')
@mblondel
mblondel / letor_metrics.py
Last active April 24, 2024 19:43
Learning to rank metrics.
# (C) Mathieu Blondel, November 2013
# License: BSD 3 clause
import numpy as np
def ranking_precision_score(y_true, y_score, k=10):
"""Precision at rank k
Parameters
@j8
j8 / git_empty_branch
Created February 14, 2014 08:32
Create new branch with empty folder structure
You can create a new empty branch like this:
$ git checkout --orphan NEWBRANCH
--orphan creates a new branch, but it starts without any commit. After running the above command you are on a new branch "NEWBRANCH", and the first commit you create from this state will start a new history without any ancestry.
The --orphan command keeps the index and the working tree files intact in order to make it convenient for creating a new history whose trees resemble the ones from the original branch.
Since you want to create a new empty branch that has nothing to do with the original branch, you can delete all files in the new working directory:
@massenz
massenz / gtest-install.rst
Last active December 19, 2022 09:14
Describes how to install and run GTest, a Google framework to conduct unit testing in C++

Build and install Google Test

Download the latest_ (1.7.0) from Google Code (Q: where is it going to live, once GCode shuts down?)

Then follow the primer_, but more to the point, the README (YMMV) Having installed CLion and cmake, this is how I built gtest:

brew install cmake
cd gtest-1.7.0
@kwmiebach
kwmiebach / pytest.md
Last active June 4, 2024 06:29 — forked from amatellanes/pytest.sh
pytest cheat sheet

Usage

(Create a symlink pytest for py.test)

pytest [options] [file_or_dir] [file_or_dir] ...

Help:

@Smerity
Smerity / babi_rnn.py
Created August 17, 2015 11:32
Epoch tuning through early stopping for bAbi RNN in Keras
from __future__ import absolute_import
from __future__ import print_function
from functools import reduce
import re
import tarfile
import numpy as np
np.random.seed(1337) # for reproducibility
bAs such, I agree strongly with you that this won't make a good test dataset for testing various RNN architectures.from keras.callbacks import EarlyStopping
@sjqtentacles
sjqtentacles / mat2csvUsingPython.py
Created September 13, 2015 23:32
Converting .mat to .csv using python
import scipy.io
import numpy as np
data = scipy.io.loadmat("subject.mat")
for i in data:
if '__' not in i and 'readme' not in i:
np.savetxt(("filesforyou/"+i+".csv"),data[i],delimiter=',')