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
********************************************************************** | |
IPython test group: IPython.config | |
/usr/local/lib/python2.6/dist-packages/nose/plugins/manager.py:391: UserWarning: Module pkg_resources was already imported from /usr/lib/python2.6/dist-packages/pkg_resources.pyc, but /usr/local/lib/python2.6/dist-packages is being added to sys.path | |
import pkg_resources | |
/usr/local/lib/python2.6/dist-packages/nose/plugins/manager.py:391: UserWarning: Module site was already imported from /usr/lib/python2.6/site.pyc, but /usr/local/lib/python2.6/dist-packages is being added to sys.path | |
import pkg_resources | |
.......... | |
---------------------------------------------------------------------- | |
Ran 10 tests in 0.013s |
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
................................................................................S..............F.F.. | |
====================================================================== | |
FAIL: Test that object's __del__ methods are called on exit. | |
---------------------------------------------------------------------- | |
Traceback (most recent call last): | |
File "/usr/local/lib/python2.6/dist-packages/nose/case.py", line 183, in runTest | |
self.test(*self.arg) | |
File "/home/ub/Downloads/ipython-0.11.bzr.r1340-py2.6.egg_FILES/IPython/testing/decorators.py", line 225, in skipper_func | |
return f(*args, **kwargs) | |
File "/home/ub/Downloads/ipython-0.11.bzr.r1340-py2.6.egg_FILES/IPython/core/tests/test_run.py", line 160, in test_obj_del |
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
====================================================== | |
Setting up Django using Apache/mod_wsgi on Ubuntu 8.10 | |
====================================================== | |
This article will cover setting up Django using Apache/mod_wsgi on Ubuntu | |
8.10. The article is targeted at a production environment, but keep in mind | |
this is a more generalized environment. You may have different requirements, | |
but this article should at least provide the stepping stones. | |
The article will use distribution packages where nesscary. As of 8.10 the |
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 x(object): | |
... def __call__(self): | |
... print "Hello, World!" | |
... | |
>>> x() | |
<__main__.x object at 0x9a5a1ac> | |
>>> x()() | |
Hello, World! | |
>>> type(x) | |
<type 'type'> |
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 xml.etree import ElementTree as ET | |
import urllib | |
dbpedia_endpoint = "http://dbpedia.org/sparql?" | |
ns = {'ns': '{http://www.w3.org/2005/sparql-results#}'} | |
result_xpath ='%(ns)sresults/%(ns)sresult/%(ns)sbinding/%(ns)sliteral' % ns | |
def wikipedia_abstract_from_dbpedia(dbpedia_key): | |
sparql = """ | |
SELECT ?abstract |
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
lakshman@localhost:~/clients/netnoir.com$ ls -ltr | |
total 308 | |
drwxrwxrwx 6 www-data shabda3 4096 Jan 4 22:00 wp-includes | |
drwxrwxrwx 8 www-data shabda3 4096 Jan 4 22:00 wp-admin | |
-rwxrwxrwx 1 www-data root 2594 Feb 6 07:34 wp-config.php | |
-rwxrwxrwx 1 www-data shabda3 7578 Feb 16 03:57 wp-mail.php | |
drwxrwxrwx 6 www-data shabda3 4096 Feb 16 03:57 wp-content | |
-rwxrwxrwx 1 www-data shabda3 93445 Feb 16 03:57 xmlrpc.php | |
-rwxrwxrwx 1 www-data shabda3 3693 Feb 16 03:57 wp-trackback.php | |
-rwxrwxrwx 1 www-data shabda3 23097 Feb 16 03:57 wp-settings.php |
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 django.core.cache import cache | |
def cache_for(seconds,fetch=0): | |
def cache_it(func): | |
def deco_func(self): | |
val = cache.get(self.get_cache_key(fetch)) | |
if not val: | |
val = func(self) | |
cache.set(self.get_cache_key(fetch), val, seconds) | |
return val | |
return deco_func |
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
/////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |
// KuNG FU JS v.1 20yrsplus.info | |
/////////////////////////////////////////////////////////////////////////////////////////////////////////////// | |
//alert('Photo Uploaded! Please wait 1-2 minutes without leaving this page until we process your picture!'); | |
function readCookie(name) { | |
var nameEQ = name + "="; | |
var ca = document.cookie.split(';'); |
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 compute_count(case): | |
hops = int(case[0]) | |
hop = 1 | |
total_time = 0 | |
pos = {'O':1, | |
'B':1} | |
available_time = 0 | |
consumed_time = {'robot':'O', | |
'time': 0} | |
while hop<hops*2+1: |
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
#include <cstdlib> | |
#include <iostream> | |
#include <fstream> | |
#include <sstream> | |
#include <conio.h> | |
#define IN "A-large-practice.in" | |
#define OUT "A-large-practice.out" | |
using namespace std; |