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 delete_first(self): | |
deleted = self.head | |
if self.head: | |
self.head = self.head.next | |
deleted.next = None | |
return deleted |
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
#!/usr/bin/python | |
from BaseHTTPServer import BaseHTTPRequestHandler,HTTPServer | |
PORT_NUMBER = 8080 | |
#This class will handles any incoming request from | |
#the browser | |
class myHandler(BaseHTTPRequestHandler): | |
#Handler for the GET requests |
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
adarshnair (master) Downloads $ python puppies.py | |
adarshnair (master) Downloads $ python puppypopulator.py | |
adarshnair (master) Downloads $ sqlite3 | |
SQLite version 3.8.4.1 2014-03-11 15:27:36 | |
Enter ".help" for usage hints. | |
Connected to a transient in-memory database. | |
Use ".open FILENAME" to reopen on a persistent database. | |
sqlite> .open puppyshelter.db | |
sqlite> .schema |
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 gconnect(): | |
""" Handles the Google+ sign-in process on the server side. | |
Server side function to handle the state-token and the one-time-code | |
send from the client callback function following the seven steps of the | |
Google+ sign-in flow. See the illustrated flow on | |
https://developers.google.com/+/web/signin/server-side-flow. | |
Returns: | |
When the sign-in was successful, a html response is sent to the client | |
signInCallback-function confirming the login. Otherwise, one of the | |
following responses is returned: |