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
>>> x = range(0, 100000000) | |
>>> import gc | |
>>> x = None | |
>>> gc.collect() | |
0 |
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
<!doctype html> | |
<html> | |
<script> | |
var response = prompt("Do you like me?"); | |
if (response === "yes") { | |
console.log("I like you too!"); | |
} | |
if (response === "no") { | |
console.log("GTFO"); | |
} |
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 get_or_create_db(self, db_name, designs=ALL_DESIGNS): | |
from couchapp import dispatch | |
couchapp_dir = os.path.join( | |
settings.PROJECT_DIR, '..', '..', 'couchdb', 'tweet_counts' | |
) | |
server = couchdbkit.Server(uri=settings.COUCHDB_SERVER_URI, | |
resource_class=couchdb.RequestsResource) | |
db = server.get_db(db_name) | |
try: | |
db.info() |
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 UserProfileForm(forms.ModelForm): | |
class Meta: | |
model = UserProfile | |
def __init__(self, *args, **kwargs): | |
super(UserProfileForm, self).__init__(*args, **kwargs) | |
self.fields['country'].queryset = Country.on_site.all() |
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
Thread model: posix | |
gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00) | |
configure:3747: $? = 0 | |
configure:3754: gcc -V >&5 | |
llvm-gcc-4.2: argument to `-V' is missing | |
configure:3758: $? = 1 | |
configure:3780: checking for C compiler default output file name | |
configure:3802: gcc -I/Users/dan/tmp/build-couchdb/build/include -I/Users/dan/tmp/build-couchdb/build/include/js -Xlinker -rpath=/Users/dan/tmp/build-couchdb/build/lib -L/Users/dan/tmp/build-couchdb/build/lib conftest.c >&5 | |
ld: unknown option: -rpath=/Users/dan/tmp/build-couchdb/build/lib | |
collect2: ld returned 1 exit status |
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 BaseEnrich(object): | |
def __init__(self): | |
self.guesser = Guesser() | |
@task(ignore_result=True, base=BaseEnrich) | |
def enrich(self, data): | |
data['guess'] = self.guesser.guess('text') | |
return data | |
@task(ignore_result=True) |
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
Hi, | |
This is an automated message. | |
I've sent several emails to recruiters at g2 over the past months | |
saying that I don't want any CVs. I'm not recruiting. | |
However, you've ignored me. Why would I use a recruitment agency | |
who ignores what I want? Hence, I'll never use you. I will also | |
strongly recommend that none of my contacts use you. |
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 tastypie.fields import NOT_PROVIDED, ToManyField | |
class OrmToManyField(ToManyField): | |
def __init__(self, to, attribute, related_name=None, default=NOT_PROVIDED, | |
null=False, blank=False, readonly=False, full=False, | |
unique=False, help_text=None, orm_attribute=None): | |
super(OrmToManyField, self).__init__( | |
to, attribute, related_name=related_name, default=default, |
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
[2012-10-22 13:46:19,817][DEBUG][action.search.type ] [Ariann] [production_tweets_for_2012_42][0], node[Nf8YZvJoRAm6s6JPWSx7Xg], [P], s[STARTED]: Failed to execute [org.elasticsearch.action.search.SearchRequest@711e0568] | |
org.elasticsearch.transport.RemoteTransportException: [Glorian][inet[/xxx.xxx.xxx.xxx:9501]][search/phase/query+fetch] | |
Caused by: java.lang.OutOfMemoryError: loading field [secondsync.geo] caused out of memory failure | |
at org.elasticsearch.index.cache.field.data.support.AbstractConcurrentMapFieldDataCache.cache(AbstractConcurrentMapFieldDataCache.java:137) | |
at org.elasticsearch.index.search.geo.GeoPolygonFilter.getDocIdSet(GeoPolygonFilter.java:60) | |
at org.elasticsearch.common.lucene.search.OrFilter.getDocIdSet(OrFilter.java:56) | |
at org.elasticsearch.common.lucene.search.AndFilter.getDocIdSet(AndFilter.java:56) | |
at org.elasticsearch.common.lucene.search.AndFilter.getDocIdSet(AndFilter.java:56) | |
at org.elasticsearch.common.lucene.search.NotDelete |
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
Non-default config: | |
cluster.name: staging-es | |
http.port: 9600 | |
transport.tcp.port: 9700 | |
index.cache.field.type: soft | |
script.native: | |
excludetags.type: com.secondsync.elasticsearch.script.ExcludeTagsScriptFactory | |
OlderNewer