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
package Grid; | |
/** | |
* An imagereader that doesn't look at all like the professors + an edge detector. >.> | |
* (in my defense, it's mostly reading the API). | |
* I will use the Sobel's Operator, because I think it's the prettiest and I'm an annoying, pretentious, artist. | |
* Sobel's operator works by using a 3x3 matrix kinda operation to find the abruptness of change in rgb values. | |
* Therefore, my strategy will be to use a for loop to iterate through all the pixels and use this operator on all of them. | |
* Hopefully it works out. | |
*/ |
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
public class MainWindow { | |
public static void main(String[] args) { | |
// Write code that creates a window with a button | |
} | |
} |
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
import sys | |
from collections import deque | |
queue=deque([]) | |
k=int(sys.argv[1]) | |
for line in sys.stdin: | |
queue.append(line) | |
#behold my python black magic | |
for x in reversed(queue): | |
if x==k: print queue[x] |
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 flask import request | |
from flask import json | |
from flask import Flask | |
from flask import render_template | |
import csv | |
import collections | |
import json | |
app = Flask(__name__, static_folder='assets', | |
static_url_path='/assets') |
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
//this will not work: | |
thingsToLoad: [{ | |
id: 'thing1', | |
controller: my_project_controller1 | |
}, { | |
id: 'thing2', | |
controller: my_project_controller2 | |
}], | |
init: function() { |
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
$.getJSON('/get_some_json', function(json_data) { | |
$('#my_rendering_div') { | |
// render my content | |
} | |
}); |
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
{% extends "index.html" %} | |
{% block charts %} | |
{% for c in charts %} | |
<div id="{{ c['id']}}"></div> | |
{% endfor %} | |
<script type="text/javascript"> | |
var charts = {{ charts }} | |
</script> | |
<script src="{{ url_for('static', filename='render_charts.js') }}"></script> | |
{% endblock %} |
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
# imports are here | |
app = Flask(__name__) | |
app.secret_key = os.urandom(24) | |
@app.route('/') | |
def redirect_current_date(): | |
redirect(url_for('charts', date=datetime.now().strftime('%Y%m'))) | |
@app.route('/chart_group1') |
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 app.extensions import db | |
class Article(db.Model): | |
""" database representation of an article """ | |
id = db.Column(db.Integer, primary_key=True) | |
title = db.Column(db.String(128)) | |
subtitle = db.Column(db.String(512)) | |
body = db.Column(db.Text()) | |
votes = db.Column(db.Integer, default=1) | |
views = db.Column(db.Integer, default=1) |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |