This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import subprocess | |
import sys | |
pattern = sys.argv[1] | |
print(pattern) | |
out = subprocess.run(["ps", "aux"], stdout=subprocess.PIPE, text=True).stdout | |
out = str(out).split("\n") | |
out = list(filter(lambda x: pattern in x, out)) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import tensorflow as tf | |
# Newton's optimization method for multivariate function in tensorflow | |
def cons(x): | |
return tf.constant(x, dtype=tf.float32) | |
def compute_hessian(fn, vars): | |
mat = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# MLP using theano | |
import numpy as np | |
import theano | |
import theano.tensor as T | |
from sklearn.datasets import load_iris | |
iris = load_iris() | |
train_x = iris.data | |
train_y = iris.target | |
nn_input_dim = train_x.shape[1] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import print_function | |
import sys | |
import io | |
import pip | |
import httplib2 | |
import os | |
from mimetypes import MimeTypes | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# PROBLEM LINK : https://www.hackerrank.com/challenges/temperature-predictions | |
import numpy as np | |
from sklearn import ensemble | |
def isfloat(value): | |
try: | |
float(value) | |
return True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Problem link : https://www.hackerrank.com/challenges/time-series-prediction | |
from sklearn import linear_model as lm | |
import sys | |
import pandas as pd | |
import numpy as np | |
import statsmodels.api as sm | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1648 | 5136 | 918 | 2824 | 3867 | 860 | 3712 | 2968 | 3525 | 4323 | 3617 | 4360 | 2756 | 89 | 442 | 3556 | 5261 | 2492 | 5062 | 2486 | 4942 | 2267 | 4809 | 3853 | 2288 | ||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
11: Star Wars: Episode IV - A New Hope (1977) | 4.5 | 5 | 4.5 | 4 | 4 | 5 | 4 | 5 | 4 | 4 | 3 | 4 | 4.5 | 4 | 3.5 | |||||||||||
12: Finding Nemo (2003) | 5 | 5 | 4 | 4 | 4.5 | 4.5 | 4 | 5 | 4 | 5 | 4.5 | 4 | 3.5 | 4 | 2 | 3.5 | 3.5 | |||||||||
13: Forrest Gump (1994) | 5 | 4.5 | 5 | 4.5 | 4.5 | 5 | 4.5 | 5 | 5 | 4.5 | 4.5 | 5 | 3 | 4 | 5 | 3.5 | 4.5 | 4.5 | 4 | 3.5 | 4.5 | 3.5 | 3.5 | |||
14: American Beauty (1999) | 4 | 4.5 | 2 | 3.5 | 5 | 3.5 | 5 | 3.5 | 4 | 4 | 3.5 | 4.5 | 3.5 | 4 | 3.5 | |||||||||||
22: Pirates of the Caribbean: The Curse of the Black Pearl (2003) | 4 | 5 | 3 | 4.5 | 4 | 2.5 | 5 | 3 | 4 | 4 | 4.5 | 4 | 1 | 3 | 1.5 | 4 | 4 | 2.5 | 3.5 | 5 | 3.5 | |||||
24: Kill Bill: Vol. 1 (2003) | 3 | 5 | 4 | 3 | 3 | 0.5 | 3.5 | 5 | 4 | 4 | 4 | 5 | 5 | 5 | 0.5 | 4 | 4 | 4.5 | 4 | 5 | 5 | 3 | ||||
38: Eternal Sunshine of the Spotless Mind (2004) | 5 | 5 | 0.5 | 4 | 5 | 3 | 5 | 3 | 4 | 3 | 5 | 1.5 | 5 | 5 | ||||||||||||
63: Twelve Monkeys (a.k.a. 12 Monkeys) (1995) | 3 | 4 | 2.5 | 3.5 | 2 | 2 | 4 | 4 | 3.5 | 4 | 5 | |||||||||||||||
77: Memento (2000) | 5 | 5 | 4.5 | 3 | 4.5 | 3.5 | 3.5 | 4 | 4 | 4 | 5 | 4 | 4 | 4.5 | 5 | 4 | 4.5 | 5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os, filecmp | |
codes = {200:'success',404:'file not found',400:'error',408:'timeout'} | |
def compile(file,lang): | |
if lang == 'java': | |
class_file = file[:-4]+"class" | |
elif lang == 'c': | |
class_file = file[:-2] | |
elif lang=='cpp': |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
baseball | economics | politics | Europe | Asia | soccer | war | security | shopping | family | num-attr | User 1 | User 2 | ||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
doc1 | 1 | 0 | 1 | 0 | 1 | 1 | 0 | 0 | 0 | 1 | 5 | 1 | -1 | |
doc2 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 4 | -1 | 1 | |
doc3 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 3 | |||
doc4 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 1 | 0 | 0 | 4 | 1 | ||
doc5 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 3 | |||
doc6 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 1 | ||
doc7 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 2 | |||
doc8 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 0 | 1 | 4 | |||
doc9 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 2 |