View namedvectors.py
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 NamedVector(object): | |
def __init__(self, array, names): | |
for i in xrange(len(names)): | |
self.__dict__[names[i]] = array[i] if i < len(array) else None | |
f = NamedVector([1, 4], ("hi", "ho", "ee")) | |
print f.hi, f.ho, f.ee | |
f = NamedVector([1, 4, 99], ("hi", "ho", "ee")) |
View gist:e8464240f1b3ab228568
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
<html dir="ltr" class="content-ltr ui-ltr"><head> | |
<base href="https://wikipedia.org"> <!-- Force links to resolve with https as protocol, rather than file:// --> | |
<script src="file:///android_asset/bundle.js"></script> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes, minimum-scale=0.25, maximum-scale=1.6"> | |
<link rel="stylesheet" type="text/css" href="file:///android_asset/styles.css"></head> | |
<body> | |
<div id="content" class="content"><h1 id="heading_0" class="section_heading" data-id="0"><i>Derfflinger</i>-class battlecruiser<a data-id="0" data-action="edit_section" class="edit_section_button"></a></h1><div id="#content_block_0"> | |
<p>The <b><i>Derfflinger</i> class</b> was a <a href="/wiki/Ship_class" title="Ship class">class</a> of three <a href="/wiki/Battlecruiser" title="Battlecruiser">battlecruisers</a> (German: <span lang="de" xml:lang="de"><i>Schlachtkreuzer</i></span>) of the <a href="/wiki/Imperial_German_Navy" title="Imperial German Navy">Imperial Ger |
View gist:bbe2a1317d15dc1d1094
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
<html dir="ltr" class="content-ltr ui-ltr"> | |
<head> | |
<base href="https://wikipedia.org"> | |
<!-- Force links to resolve with https as protocol, rather than file:// --> | |
<script src="file:///android_asset/bundle.js"></script> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes, minimum-scale=0.25, maximum-scale=1.6"> | |
<link rel="stylesheet" type="text/css" href="file:///android_asset/styles.css"> | |
</head> | |
<body> | |
<div id="content" class="content"> |
View query.py
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
from sqlalchemy import Column, Integer, ForeignKey, String, DateTime, desc | |
from sqlalchemy.orm import relationship, joinedload | |
from base import Base | |
from user import User # noqa | |
class Query(Base): | |
__tablename__ = 'query' | |
id = Column(Integer, primary_key=True) |
View gist:08e06376ddb98f21a8c4
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
# Configuration file for jupyterhub. | |
c = get_config() | |
#------------------------------------------------------------------------------ | |
# JupyterHub configuration | |
#------------------------------------------------------------------------------ | |
# An Application for starting a Multi-User Jupyter Notebook server. |
View data.bash
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
# No caching at all | |
~/c/ores-stress $ python3.4 /tmp/test.py 'data/tools-static.wmflabs.org/lolrrit-wm/1/*.out' | |
inflights | |
mean 1.756802902571764 | |
median 1 | |
pstdev 2.4299546779621792 | |
latency | |
mean 1724.702838648917 | |
median 838.930203 | |
pstdev 2159.033094872801 |
View wordcount.py
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
text = raw_input("Enter a text ") | |
textsplit = text.split() | |
count = len(textsplit) | |
print "The word count is = " + str(count) |
View projecteuler_prob_3.py
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
a=600851475143 | |
i=2 | |
while i<a : | |
if a%i==0: | |
a1=a/i | |
else : | |
i+=1 | |
continue | |
n=2 |
View gist:249008
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
dsfsdf |
View gist:249207
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
past = 0 | |
cur = 1 | |
next = 1 | |
sum = 0 | |
while next < 4000000: | |
next = cur + past | |
past = cur | |
cur = next |
OlderNewer