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
# -*- coding: utf-8 -*- | |
# foo()'s a_value is unmodified. | |
def foo(): | |
a_value = "Hello" | |
def bar(): | |
a_value = "Goodbye" | |
bar() |
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
# -*- coding: utf-8 -*- | |
import threading | |
from sqlalchemy import create_engine | |
from sqlalchemy.orm import sessionmaker, scoped_session | |
engine = create_engine("mysql://testing:[email protected]/testing", | |
pool_size=20, strategy="threadlocal") | |
Session = scoped_session(sessionmaker(bind=engine)) |
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
# -*- coding: utf-8 -*- | |
import threading | |
from sqlalchemy import create_engine | |
from sqlalchemy.orm import sessionmaker, scoped_session | |
def query(): | |
engine = create_engine("mysql://testing:[email protected]/testing", | |
pool_size=20, strategy="threadlocal") | |
Session = scoped_session(sessionmaker(bind=engine)) |
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 contextlib import contextmanager | |
@contextmanager | |
def save(obj, attrs=None): | |
"""Save attributes of an object, then restore them. | |
Example: | |
import breakfast | |
with save(breakfast, ('eggs', 'bacon')): | |
breakfast.Eggs = lambda: "Eggs" |
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
<?php | |
error_reporting(E_ALL | E_STRICT); | |
class Foo | |
{ | |
public static function test() | |
{ | |
echo "Hi!\n"; | |
} |
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
;;; python-pep8.el --- minor mode for running `pep8' | |
;; Copyright (c) 2009, 2010 Ian Eure <[email protected]> | |
;; Author: Ian Eure <[email protected]> | |
;; Keywords: languages python | |
;; Last edit: 2010-02-12 | |
;; Version: 1.01 |
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
;;; python-pylint.el --- minor mode for running `pylint' | |
;; Copyright (c) 2009, 2010 Ian Eure <[email protected]> | |
;; Author: Ian Eure <[email protected]> | |
;; Keywords: languages python | |
;; Last edit: 2010-02-12 | |
;; Version: 1.01 |
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
log4j:WARN No appenders could be found for logger (org.apache.cassandra.config.DatabaseDescriptor). | |
log4j:WARN Please initialize the log4j system properly. | |
Exception in thread "main" java.lang.NullPointerException | |
at java.util.Arrays$ArrayList.<init>(Arrays.java:3357) | |
at java.util.Arrays.asList(Arrays.java:3343) | |
at org.apache.cassandra.tools.SSTableExport.export(SSTableExport.java:255) | |
at org.apache.cassandra.tools.SSTableExport.export(SSTableExport.java:299) | |
at org.apache.cassandra.tools.SSTableExport.export(SSTableExport.java:323) | |
at org.apache.cassandra.tools.SSTableExport.main(SSTableExport.java:367) |
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 __future__ import with_statement | |
import itertools | |
import functools | |
import sys | |
def download_files(keylist): | |
return [key.get_contents_to_filename('%s/%s' % (TEMP_DIR, key.name)) | |
for key in keylist] |
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
(add-hook 'before-save-hook | |
'(lambda () | |
(or (file-exists-p (file-name-directory buffer-file-name)) | |
(make-directory (file-name-directory buffer-file-name) t)))) |