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 flask import Flask | |
| from flask_restful import Api, Resource, reqparse | |
| app = Flask(__name__) | |
| api = Api(app) | |
| users = [ | |
| { | |
| "name": "Nicholas", | |
| "age": 42, |
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
| {% extends "base.html" %} | |
| {% block content %} | |
| <form method="post">{% csrf_token %} | |
| {{ forms.subscription }} | |
| <input type="submit" value="Subscribe"> | |
| </form> | |
| <form method="post">{% csrf_token %} | |
| {{ forms.contact }} | |
| <input type="submit" value="Send"> |
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
| class ContactForm(forms.Form): | |
| name = forms.CharField(max_length=60) | |
| message = forms.CharField(max_length=200, widget=forms.TextInput) | |
| class SubscriptionForm(forms.Form): | |
| email = forms.EmailField() | |
| want_spam = forms.BooleanField(required=False) |
Some hastily compiled resources for a class on computer ethics. Suggestions/improvements welcome.
Some interesting books by contemporary figures:
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 binomial(n, k): | |
| """ | |
| A fast way to calculate binomial coefficients by Andrew Dalke. | |
| See http://stackoverflow.com/questions/3025162/statistics-combinations-in-python | |
| """ | |
| if 0 <= k <= n: | |
| ntok = 1 | |
| ktok = 1 | |
| for t in xrange(1, min(k, n - k) + 1): | |
| ntok *= n |
[ Languages: English, Español, 日本語, 한국어, Português, Русский, Slovenščina, Українська, 中文 ]
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
| #Spider Websites with Wget – 20 Practical Examples | |
| Wget is extremely powerful, but like with most other command line programs, the plethora of options it supports can be intimidating to new users. Thus what we have here are a collection of wget commands that you can use to accomplish common tasks from downloading single files to mirroring entire websites. It will help if you can read through the wget manual but for the busy souls, these commands are ready to execute. | |
| 1. Download a single file from the Internet | |
| wget http://example.com/file.iso | |
| 2. Download a file but save it locally under a different name | |
| wget ‐‐output-document=filename.html example.com |
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
| var foo = { | |
| 'alpha': 'puffin', | |
| 'beta': 'beagle', | |
| 'charlie': 'cat', | |
| 'delta': 'dog' | |
| }; | |
| var keys = [], | |
| i = 0; | |
| for (keys[i++] in foo) {} |
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
| # Built application files | |
| /*/build/ | |
| # Crashlytics configuations | |
| com_crashlytics_export_strings.xml | |
| # Local configuration file (sdk path, etc) | |
| local.properties | |
| # Gradle generated files |
NewerOlder