Skip to content

Instantly share code, notes, and snippets.

@mdtareque
mdtareque / notes.md
Last active April 5, 2019 04:14
grease monkey - getting started
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.InputStreamReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Vector;
@mdtareque
mdtareque / Sync gh-pages + master branches
Created January 13, 2017 04:15 — forked from mandiwise/Sync gh-pages + master branches
Keep gh-pages up to date with a master branch
// Reference: http://lea.verou.me/2011/10/easily-keep-gh-pages-in-sync-with-master/
$ git add .
$ git status // to see what changes are going to be commited
$ git commit -m 'Some descriptive commit message'
$ git push origin master
$ git checkout gh-pages // go to the gh-pages branch
$ git rebase master // bring gh-pages up to date with master
$ git push origin gh-pages // commit the changes
https://docs.oracle.com/javase/7/docs/api/java/lang/Thread.State.html
block daigram
http://www.w3resource.com/java-tutorial/java-threadclass-methods-and-threadstates.php
examples
http://beginnersbook.com/2013/03/multithreading-in-java/
Deadlock
// Bismillah-ir-rahman-ir-rahim
#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <climits>
#define de(x) cerr << #x << "=" << x << endl
Get details of web server running at a website without access to it's commandline.
Two solutions
1. telnet
2. curl
1. press enter twice after HEAD command
mtk07:21 PM ~/ > telnet web.iiit.ac.in 80
Trying 10.4.21.70...
Connected to web.iiit.ac.in.
@mdtareque
mdtareque / output
Created October 6, 2016 05:12
Check if a number is power of n or not
Is power of 4 : True
Is power of 4 : False
Is power of 5 : True
# Google Apac Test 2017, Round B, Problem A: Sherlock and Parentheses
for t in xrange(1, input() + 1):
l, r = map(int, raw_input().strip().split())
mn = min(l,r)
print "Case #" + str(t) + ": " + str((mn*(mn+1))>>1)
mtk03:33 PM cpp/ > time g++ -DCODING -std=c++11 -Wall -g template.cpp
real 0m6.993s
user 0m6.428s
sys 0m0.424s
import nltk
nltk.help.upenn_tagset()