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
dev:~ austonbunsen$ python -mtimeit -c "lol = 'win';'i am a {0}er'.format(lol);" | |
1000000 loops, best of 3: 0.72 usec per loop | |
dev:~ austonbunsen$ python -mtimeit -c "lol = 'win'; ''.join(['i am a ', lol]);" | |
1000000 loops, best of 3: 0.58 usec per loop | |
dev:~ austonbunsen$ python -mtimeit -c "lol = 'win'; 'i am a %ser' % lol;" | |
1000000 loops, best of 3: 0.39 usec per loop | |
dev:~ austonbunsen$ python -mtimeit -c "lol = 'win'; 'i am a '+ lol +'er'" | |
1000000 loops, best of 3: 0.26 usec per loop |
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 csv | |
ifile = open('test.csv', "rb") | |
reader = csv.reader(ifile) | |
rownum = 0 | |
for row in reader: | |
print dir(row[rownum]) | |
rownum += 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
{% block top_content %} | |
<br/> | |
<div id="order_notification" class="left rg_font"> | |
<div class="title">Here is what your user ordered:</div> | |
<div class="table_headers"> | |
<div class="header quantity_col">Quantity</div> | |
<div class="header desc_col">Item Description</div> | |
<div class="header amount_col">Amount</div> |
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 "forms/form_base.html" %} | |
{% block maincontent %} | |
{% block additional-js %} | |
{{ block.super }} | |
<script type="text/javascript" src="{{ MEDIA_URL }}js/step.2.js"></script> | |
<script type="text/javascript" src="{{ MEDIA_URL }}js/bootstrap-limit.js"></script> | |
{% endblock %} |
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/env python | |
""" | |
Create a program that given a requested number gives you | |
the nearest number in a list. | |
Considerations: | |
- The list needs to only contain integers | |
This example is useful when you have only a certain number of | |
images sizes available and you have to pick one for your station |
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/env python | |
""" | |
Create a program that given a requested number gives you | |
the nearest number in a list. | |
Considerations: | |
- The list needs to only contain integers | |
This example is useful when you have only a certain number of | |
images sizes available and you have to pick one for your station |
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
""" | |
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy) | |
BSD License | |
""" | |
import numpy as np | |
# data I/O | |
data = open('input.txt', 'r').read() # should be simple plain text file | |
chars = list(set(data)) | |
data_size, vocab_size = len(data), len(chars) |
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
require "httparty" | |
require 'nokogiri' | |
homepage_url = "https://miami.craigslist.org/" | |
response1 = HTTParty.get homepage_url | |
home_page = Nokogiri::HTML(response1.body) | |
cats = [] | |
url_tag = [] | |
jobs = [] |