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
{"kind": "Listing", "data": {"modhash": "0h2ailm0sf73b753219e8695a84f661c5fb5ef47350859c969", "children": [{"kind": "t3", "data": {"domain": "carlcheo.com", "banned_by": null, "media_embed": {}, "subreddit": "programming", "selftext_html": null, "selftext": "", "likes": null, "user_reports": [], "secure_media": null, "link_flair_text": null, "id": "30sz09", "gilded": 0, "archived": false, "clicked": false, "report_reasons": null, "author": "vaguepotato", "num_comments": 127, "score": 698, "approved_by": null, "over_18": false, "hidden": false, "thumbnail": "", "subreddit_id": "t5_2fwo", "edited": false, "link_flair_css_class": null, "author_flair_css_class": null, "downs": 0, "secure_media_embed": {}, "saved": false, "stickied": false, "is_self": false, "permalink": "/r/programming/comments/30sz09/24_years_ago_linus_torvalds_said_linux_is_just_a/", "name": "t3_30sz09", "created": 1427751242.0, "url": "http://carlcheo.com/fascinating-posts-from-tech-founders-who-changed-the-world", "author_flair_text": null, " |
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
var devsite = devsite || {}; | |
devsite.devsite = devsite.devsite || {}; | |
$(document).ready(function() { | |
$("a.sign-in-link").bind("mousedown click", devsite.devsite.login); | |
$("a.sign-out-link").bind("mousedown click", devsite.devsite.logout); | |
devsite.devsite.loggedIn(function(d, b) { | |
b ? devsite.devsite.showError("Error while signing in: " + b) : $("#sign-in-io").hasClass("trig") && devsite.reloadWindow() | |
}) | |
}); | |
window.IO_2012 = 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
def deletedbandmemcache(): | |
"""Delete all entities in namespace.""" | |
from google.appengine.api import namespace_manager | |
###################################### | |
""" ####### IMPORTANT ########## """ | |
TESTSPACE = 'test' | |
namespace_manager.set_namespace(TESTSPACE) | |
""" ##### DO NOT DELETE ######## """ | |
###################################### |
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
synonyms = {'scotty': 'dog', 'puppy': 'dog', 'dog': 'dog'} | |
counts = [(2, 'dog'), (2, 'puppy'), (2, 'scotty')] | |
syn_counts = [] | |
for count in counts: | |
syn_counts.append((count[0], synonyms[count[1]])) | |
print syn_counts | |
sum_counts = {} |
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
// DOM methods & attributes for Document | |
DEFINE_ATTRIBUTE_EVENT_LISTENER(abort); | |
DEFINE_ATTRIBUTE_EVENT_LISTENER(change); | |
DEFINE_ATTRIBUTE_EVENT_LISTENER(click); | |
DEFINE_ATTRIBUTE_EVENT_LISTENER(contextmenu); | |
DEFINE_ATTRIBUTE_EVENT_LISTENER(dblclick); | |
DEFINE_ATTRIBUTE_EVENT_LISTENER(dragenter); | |
DEFINE_ATTRIBUTE_EVENT_LISTENER(dragover); | |
DEFINE_ATTRIBUTE_EVENT_LISTENER(dragleave); |
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
class BaseShardedCountModel(BaseModel): | |
# services | |
# - in-memory counts | |
# - getting counter name from entity | |
# - check for transition | |
def counter(self, name): | |
from lib.shardedcounter import Counter | |
return Counter(str(name + '_' + str(self.key().id()))) | |
def getshardedcount(self, name): |
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
# Load the system properties | |
system=[method://java.lang.System.getProperties()] | |
# Define the environment and language based on the system properties, | |
# with sensible defaults. | |
# (these likely came in as -D options on the command line) | |
lang=${system->lang|english} | |
env=${system->env|dev} | |
# Include language based properties |
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 plotly | |
from plotly.graph_objs import Scatter, Layout | |
plotly.offline.plot({ | |
"data": [ | |
Scatter(x=times, y=losses) | |
], | |
"layout": Layout( | |
title="loss over time" | |
) | |
}) |
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
[ | |
0, | |
1, | |
2, | |
3, | |
4, | |
5, | |
6, | |
10, | |
11, |
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
SIZE = 227 | |
def show_image_read_from_hdf5_file(img): | |
from skimage.viewer import ImageViewer | |
img = np.array(img, dtype='u1') | |
img = img.transpose((1, 2, 0)) | |
img = img[:, :, ::-1] | |
viewer = ImageViewer(img.reshape(SIZE, SIZE, 3)) | |
viewer.show() |
OlderNewer