Skip to content

Instantly share code, notes, and snippets.

View TheSithPadawan's full-sized avatar

Esther (EST) TheSithPadawan

  • Canada
View GitHub Profile
'''
$ python app.py
put this in your browser: http:127.0.0.1:5000 to view the json
'''
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask import render_template
import json
app = Flask(__name__)
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js"></script>
</head>
<body>
<div ng-app="app" ng-controller="MainCtrl" class="list-group">
<div class="list-group-item" ng-repeat="item in messages">
import java.util.*;
class Pair {
int x;
int y;
public Pair(int x, int y){
this.x = x;
this.y = y;
}
}
def train(lam, num_features, rate = 0.1):
iter = 0
P = defaultdict(np.array)
Q = defaultdict(np.array)
# initialize P and Q
for k, v in user_item_rating_train.items():
P[k[0]] = np.random.uniform(size = num_features)
Q[k[1]] = np.random.uniform(size = num_features)
initial_mse = validate(user_item_rating_train, P, Q)
print ("initial mse", initial_mse)
@TheSithPadawan
TheSithPadawan / GsonTest.java
Created November 29, 2018 18:49 — forked from julianbonilla/GsonTest.java
Read json from file into Gson
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import com.google.gson.Gson;
public class GsonTest {
public static void main(String[] args) throws FileNotFoundException {
@TheSithPadawan
TheSithPadawan / Literature Resources
Last active December 2, 2018 20:27
CSE 258 Literature
Translating Videos to Natural Languange using deep recurrent neural network
https://arxiv.org/pdf/1412.4729.pdf
Text Classification task using character-level covNet vs. deep learning methods (LSTM)
http://papers.nips.cc/paper/5782-character-level-convolutional-networks-for-text-classification.pdf
@TheSithPadawan
TheSithPadawan / hosting-on-github.md
Created July 28, 2020 05:28 — forked from TylerFisher/hosting-on-github.md
Basic steps for hosting on Github

Hey there, apparently people are still using this Gist from 2013! It's out of date! Consult the Github docs.

Steps for Hosting a Website on GitHub

  1. Create a GitHub account on github.com.
  2. Download either [GitHub for Mac][1] or [GitHub for Windows][2], depending on your operating system. Open the app and log in using the account you just created.
  3. (On Mac): After you login, click advanced and make sure that your name and email are correct. Then, click "Install Command Line Tools", just in case you want to start using the command line later in life.
  4. Create a new repository in your GitHub application. Name it your-username.github.io. The name is very important. Note the folder that GitHub is saving the repository to. Make sure the "Push to GitHub?" box is checked.
  5. Move your website's files into the folder that GitHub just created when you made the repository. IMPORTANT: Your homepage HTML file must be called "index.html", and it must exist in the top-level
// long and long int are identical
// int is optional
// long is a signed type size of long in c++: at least 32 bits
long x;
long int x;
// long long is a signed type of at least 64 bits
long long int x;
long long;
/*
This file contains the core code for dynamic programming
related to string
*/
/* LC 10. Regular expression matching
dp (i,j): can first i char of s match first j char of p
case 1. p[j-1] != '*' and p[j-1] != '.' ==> function: dp[i-1][j-1] && s[i-1] == p[j-1]
case 2. p[j-1] == '.' ==> dp[i-1][j-1]
case 3. p[j-1] == '*'
/*
This file organizes questions related to buying and selling
stocks
*/
/*
188. buy / sell stocks with transaction limit
buy (i,j): max profit on the ith day possible buy, total transaction limit
is j.
sell (i, j): max profit on the ith day possible sell, total transaction limit is j