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 | |
from flask import Flask, request, redirect, url_for | |
from werkzeug.utils import secure_filename | |
from flask import Flask, jsonify | |
from flask.ext.cors import cross_origin | |
app = Flask(__name__) | |
@app.route('/order', methods=['GET']) |
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 denominations | |
denoms = [1, 5, 10, 25] | |
def make_change(change, denoms): | |
return _make_change(change, sorted(denoms, reverse=True)) | |
def _make_change(cents, denoms): | |
ways = [] | |
for denom in denoms: | |
if cents == denom: |
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 random | |
# A bag of random elements to pick from. | |
# Usage: when you want to guarantee that a random | |
# event will occur, but want a random ordering. | |
class RandomBag: | |
# Build a bag. Fill it with counts using tuples | |
# [('attack', 3), ('flee', 1), ...] | |
def __init__(self, element_count_tuples=[]): |
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
from nltk.util import ngrams | |
from nltk.model import NgramModel | |
from nltk.probability import LidstoneProbDist | |
# Source: should be formatted on multiple lines for each sentence. | |
SOURCE_TEXT = 'Mystery.txt' | |
LINE_START = "<line>" | |
LINE_END = "</line>" |
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
using UnityEngine; | |
using System.Collections; | |
using System.Text; | |
public class RenderTextureInNewTabExample : MonoBehaviour | |
{ | |
public Texture2D texture; | |
void Start () | |
{ |
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
Shader "Expiremental/CircleCutout" | |
{ | |
Properties | |
{ | |
[PerRendererData] x1 ("1.x", Float) = 0 | |
[PerRendererData] y1 ("1.y", Float) = 0 | |
[PerRendererData] x2 ("2.x", Float) = 0 | |
[PerRendererData] y2 ("2.y", Float) = 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
using System; | |
using System.Collections.Generic; | |
/** | |
* A space-saving data structure to store words and their counts. | |
* Words that share prefixes will have common paths along a branch of the tree. | |
*/ | |
public class Trie | |
{ | |
private TrieNode head; |
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
// | |
// Trie.cpp | |
// CPPTest | |
// | |
// Created by Eric Fruchter on 12/26/15. | |
// Copyright © 2015 Eric Fruchter. All rights reserved. | |
// | |
#include "Trie.hpp" |
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
#include <iostream> | |
#include <functional> | |
#include <iterator> | |
#include <vector> | |
struct Node { | |
Node* next = nullptr; | |
int data; | |
}; |
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
// Snake.cpp : Defines the entry point for the console application. | |
// | |
#include "stdafx.h" | |
#include <iostream> | |
#include <conio.h> | |
#include <Windows.h> | |
using namespace std; |