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
Start server: cd my-app; ng serve | |
Start New component: | |
ng generate component <name> |
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 multiprocessing import Pool | |
import threading | |
import timeit | |
def func(x): return x**1000 | |
#multiprocessing | |
start = timeit.timeit() | |
p = Pool(4) | |
print(p.map(func,[2,4,6,8])) |
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 celery import Celery, shared_task | |
import time | |
#Redis Result backend config: | |
app = Celery('tasks', broker='amqp://localhost//', backend='redis://localhost:6379/0') | |
#Mysql Result backend config: | |
# app = Celery('tasks', broker='amqp://localhost//', backend='db+mysql://root:python098@localhost/test') | |
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
Starting nginx | |
docker run -d -p 80:80 --name webserver nginx | |
docker images | |
docker ps -a | |
remove images: | |
--------------- | |
docker rmi <> |
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
States | 2003 | 2004 | 2005 | 2006 | 2007 | 2008 | 2009 | 2010 | 2011 | 2012 | 2013 | 2014 | 2015 | 2016 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Andhra Pradesh | 9800 | 10981 | 10026 | 10953 | 9979 | 10634 | 9887 | 10681 | 11211 | 8353 | 9621 | 9267 | 9134 | 9729 | |
Arunachal Pradesh | 144 | 84 | 111 | 82 | 88 | 115 | 114 | 128 | 0 | 0 | 0 | 0 | 0 | 75 | |
Assam | 784 | 746 | 947 | 946 | 1010 | 849 | 1034 | 1345 | 1552 | 1553 | 1817 | 1777 | 1898 | 1999 | |
Bihar | 1493 | 1195 | 1076 | 1702 | 1971 | 1499 | 2719 | 2837 | 3177 | 2833 | 2837 | 2535 | 3255 | 2434 | |
Chhattisgarh | 2593 | 2837 | 3543 | 3356 | 3265 | 3814 | 3564 | 3363 | 3156 | 3654 | 3804 | 3758 | 3898 | 3164 | |
Goa | 356 | 323 | 400 | 421 | 536 | 610 | 787 | 925 | 675 | 654 | 422 | 434 | 451 | 356 | |
Gujarat | 10242 | 10229 | 10133 | 9071 | 9630 | 10167 | 9210 | 9177 | 9252 | 8188 | 7731 | 7437 | 6739 | 6309 | |
Haryana | 2529 | 2931 | 2917 | 3202 | 3752 | 3611 | 3693 | 3436 | 3425 | 3108 | 3253 | 3247 | 3389 | 2887 | |
Himachal Pradesh | 699 | 816 | 787 | 792 | 845 | 597 | 806 | 703 | 742 | 533 | 643 | 698 | 634 | 820 |
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
Index.html | |
---------- | |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Vue Animations</title> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"> | |
<link rel="stylesheet" | |
href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.5.2/animate.min.css"> |
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
to install: | |
Frozen-Flask | |
to run: | |
python <pyfilename> build | |
import sys | |
from flask import Flask | |
from flask import render_template | |
import pandas as pd |
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
Sigmoid function: | |
sigmoid(x) = 1/(1+e^-x) | |
A sigmoid function is a mathematical function having a characteristic "S"-shaped curve or sigmoid curve. | |
Softmax: | |
The softmax function is often used in the final layer of a neural network-based classifier. Such networks are commonly trained | |
under a log loss (or cross-entropy) regime, giving a non-linear variant of multinomial logistic regression. | |
W -> Vector representing weight (that represented on the line btw input(x) and first activation layer(z)) | |
b -> bias (each activation layer(z) has a bias term) |
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
#If this is set to True, the axes which are reduced are left in the result as dimensions with size one | |
<np array>.sum(axis=1, keepdims=True) | |
np.vstack - stack array row-wise | |
#Convert to NP Array: | |
df = pd.read_csv(csvfile) | |
nparr = np.array(df) | |
#finding max of a dataframe |
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
var h = 500; | |
var w = 800; | |
var svg = d3.select("body").append("svg") | |
.attr("id","chart") | |
.attr("width",w) | |
.attr("height",h); | |
var num = 51; | |
var types = 4; |
NewerOlder