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 <vector> | |
using namespace std; | |
const char EMPTY_SPACE = '_'; | |
const char PLAYER1_PIECE = 'X'; | |
const char PLAYER2_PIECE = 'O'; | |
const unsigned int NCOLUMNS = 7; | |
const unsigned int NROWS = 6; |
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 <map> | |
#include <set> | |
#include <iostream> | |
#include <string> // Don't know if neccessary... | |
#include <stdexcept> // Provides the RuntimeError class | |
using namespace std; | |
class Graph { | |
typedef string NodeName; |
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
private boolean compareInts(int one, int two) | |
{ | |
boolean areEqual = false; | |
if(one == two) | |
{ | |
areEqual = true; | |
} | |
return areEqual; | |
} |
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
def is_even(num): | |
"Returns true iff num is even." | |
i = 0 | |
while i < num: | |
i += 2 | |
return i == num | |
def get_even_numbers(a, b): |
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 secure redirect I found in the snippets library did not satisfy me. | |
# Here is my version which satisfied my needs more. The next argument/ | |
# referrer will only be used if your application knows how to route it. | |
# This won't work very well if you have multiple applications. | |
# Licensed under the Unlicense, go nuts. | |
## Create the base form ## | |
from flask import request, url_for, render_template | |
from flaskext.wtf import Form, HiddenField | |
from werkzeug.exceptions import NotFound, HTTPException |
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 urlparse | |
def add_get_params(url, params): | |
"Add the given parameters to a URL's query." | |
components = urlparse.urlsplit(url) | |
# Form a list containing each of the get parameters including the new ones. | |
new_query = components.query.split("&") + \ | |
[str(k) + "=" + str(v) for k, v in params.items()] |
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
Twix | |
Fido | |
John | |
Smith | |
47 |
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
237.87 | |
9.52 |
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
int a = 5; | |
int b = 10; | |
cout << "a: " << a << " b: " << b << endl; | |
a = b; | |
b = a; | |
cout << "a: " << a << " b: " << b << endl; |
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> | |
using namespace std; | |
int main() { | |
double radius; | |
string bulk; | |
cin >> radius; | |
cin >> bulk; |
OlderNewer