var counter = 0 function nextClick(){ (...) if (...) { (...) } else if (...) { qArraycounter; counter++; } }
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 datetime import datetime | |
import sqlalchemy as sa | |
import sqlalchemy.orm as orm | |
from sqlalchemy.engine import create_engine | |
from sqlalchemy.ext.declarative import declarative_base | |
engine = create_engine('sqlite:///test.db') | |
Base = declarative_base(bind=engine) |
I've been trying to understand how morepath works with the quickstart guide in the documentation.I have a couple of questions regarding the design, and my understanding of what's happening.
So, a model is a resources, pretty much a representation of an object stored in a databse. Atleast, this is how I understand it, if this is so, why can't we have a path assigned to it, inside the classbody itself. So, right now:
# We declare the object
class User(object):
def __init__(self, username, fullname, email):
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
package too_test | |
import ( | |
"fmt" | |
"log" | |
"net" | |
"github.com/hjr265/too" | |
) |
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
# encoding=utf-8 | |
# FILE INFO ##################################################### | |
# Title : pip requirements generator | |
# By : Quazi Nafiul Islam <[email protected]> | |
# Date : 28 Apr 2014 | |
# Made to be used with pycharm Macros | |
################################################################# | |
import pip |
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
function goinit { | |
export GOROOT=/usr/local/Cellar/go/1.2.1/libexec | |
if [ $# -lt 1 ] | |
then | |
echo "No directories were created." | |
export GOPATH=$(pwd -P) | |
export PATH=$PATH:$GOPATH:$GOPATH/bin | |
else | |
echo "$1 being created" | |
mkdir $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
# encoding=utf-8 | |
__author__ = 'Quazi Nafiul Islam' | |
import sys | |
import pip | |
if __name__ == '__main__': | |
sys.stdout = open('requirements.txt', 'w') | |
pip.main(['freeze']) |
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 collections import defaultdict | |
from heapq import * | |
def prim( nodes, edges ): | |
conn = defaultdict( list ) | |
for n1,n2,c in edges: | |
conn[ n1 ].append( (c, n1, n2) ) | |
conn[ n2 ].append( (c, n2, n1) ) | |
mst = [] |
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 requests | |
def get_raw_repo_data(username): | |
""" | |
Creates a connection to api.github.com through HTTPS | |
""" | |
print('starting') | |
CONNECTION_DETAILS = { | |
"host": "https://api.github.com", | |
"path": "/users/" + username + "/repos", |
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
function getCookie(name) { | |
var cookieValue = null; | |
if (document.cookie && document.cookie != '') { | |
var cookies = document.cookie.split(';'); | |
for (var i = 0; i < cookies.length; i++) { | |
var cookie = jQuery.trim(cookies[i]); | |
// Does this cookie string begin with the name we want? | |
if (cookie.substring(0, name.length + 1) == (name + '=')) { | |
cookieValue = decodeURIComponent(cookie.substring(name.length + 1)); | |
break; |