This file contains hidden or 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
| public class LongestCommonSubsequence { | |
| public static int getLongestCommonSubsequence(String a, String b) { | |
| int[][] matrix = new int[a.length() + 1][b.length() + 1]; | |
| for (int i = 0; i <= a.length(); i++) { | |
| for (int j = 0; j <= b.length(); j++) { | |
| if (i == 0 || j == 0) { | |
| matrix[i][j] = 0; |
This file contains hidden or 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
| public class EditDistance { | |
| /** | |
| * Returns the EditDistance between source and target string | |
| * @param source | |
| * @param target | |
| * @return | |
| */ | |
| public int editDistanceBetween(String source, String target) { | |
| if (source == null || target == null){ |
This file has been truncated, but you can view the full file.
This file contains hidden or 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
| The Project Gutenberg EBook of The Adventures of Sherlock Holmes | |
| by Sir Arthur Conan Doyle | |
| (#15 in our series by Sir Arthur Conan Doyle) | |
| Copyright laws are changing all over the world. Be sure to check the | |
| copyright laws for your country before downloading or redistributing | |
| this or any other Project Gutenberg eBook. | |
| This header should be the first thing seen when viewing this Project | |
| Gutenberg file. Please do not remove it. Do not change or edit the |
This file contains hidden or 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 java.util.*; | |
| import java.io.FileReader; | |
| import java.io.IOException; | |
| import java.io.BufferedReader; | |
| import java.util.regex.Matcher; | |
| import java.util.regex.Pattern; | |
| public class SpellChecker { | |
| public static final int EDIT_DISTANCE_THRESHOLD = 1; |
This file contains hidden or 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
| # WINDOWS: set OAUTHLIB_INSECURE_TRANSPORT=1 | |
| # Macos/linux: export OAUTHLIB_INSECURE_TRANSPORT=1 | |
| # https://flask-dance.readthedocs.io/en/latest/quickstarts/google.html | |
| ########################################################################### | |
| ########################################################################### | |
| # Visit the Google Developers Console at https://console.developers.google.com and | |
| # create a new project. In the “APIs & auth” section, click on “Credentials”, and | |
| # then click the “Create a new Client ID” button. Select “Web Application” for | |
| # the application type, and click the “Configure consent screen” button. Put in |
This file contains hidden or 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 | |
| os.environ['OAUTHLIB_INSECURE_TRANSPORT'] = 'true' | |
| os.environ['OATHLIB_RELAX_TOKEN_SCOPE'] = 'true' | |
| ################################################ | |
| from flask import Flask, redirect, url_for, render_template | |
| from flask_dance.contrib.google import make_google_blueprint, google | |
| app = Flask(__name__) |
This file contains hidden or 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 | |
| os.environ['OAUTHLIB_INSECURE_TRANSPORT'] = 'true' | |
| os.environ['OATHLIB_RELAX_TOKEN_SCOPE'] = 'true' | |
| ################################################ | |
| from flask import Flask, redirect, url_for, render_template | |
| from flask_dance.contrib.google import make_google_blueprint, google | |
| app = Flask(__name__) |
This file contains hidden or 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
| {% extends "base.html" %} | |
| {% block content %} | |
| <div class="jumbotron"> | |
| <div align='center'> | |
| <h1>Welcome to the page for {{ current_user.username }}</h1> | |
| <img align="center" src="{{ url_for('static', filename='profile_pics/'+current_user.profile_image) }}"> | |
| </div> | |
| </div> | |
| <div class="container"> | |
| <form method="POST"> |
This file contains hidden or 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
| let pets = [ | |
| {name: "meow", species: "cat", age: 2}, | |
| {name: "miles", species: "dog", age: 10}, | |
| {name: "gogo", species: "mouse", age: 1}, | |
| {name: "popo", species: "dog", age: 1} | |
| ] | |
| // x = pets.push({name: "Puppster", species: "dog", age: 4}) | |
| // console.log(x) |
This file contains hidden or 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
| class TestClass: | |
| @classmethod | |
| def setup_class(cls): | |
| print("Setup Testclass") | |
| @classmethod | |
| def teardown_class(cls): | |
| print("Teardown class") |