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 Node : | |
def __init__( self, data ) : | |
self.data = data | |
self.next = None | |
self.prev = None | |
class LinkedList : | |
def __init__( self ) : | |
self.head = None |
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
''' | |
Playing with MapReduce in python | |
ref. | |
http://mikecvet.wordpress.com/2010/07/02/parallel-mapreduce-in-python/ | |
''' | |
from multiprocessing import Pool | |
def generate_data(A = 90000, B = 20) : | |
return [ [ [j] for j in range(B)] for i in range(A)] |
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
# -*- encoding: utf-8 -*- | |
def latex_decode( s ) : | |
''' | |
A simple function which taks a latex escaping command | |
and returns the appropriate unicode character according | |
to this table (via wikipedia): | |
LaTeX command Sample Description | |
\`{o} ò grave accent |
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 manage.py runserver | |
Traceback (most recent call last): | |
File "manage.py", line 8, in <module> | |
execute_from_command_line(sys.argv) | |
File "//anaconda/lib/python2.7/site-packages/django/core/management/__init__.py", line 399, in execute_from_command_line | |
utility.execute() | |
File "//anaconda/lib/python2.7/site-packages/django/core/management/__init__.py", line 392, in execute | |
self.fetch_command(subcommand).run_from_argv(self.argv) | |
File "//anaconda/lib/python2.7/site-packages/django/core/management/base.py", line 242, in run_from_argv | |
self.execute(*args, **options.__dict__) |
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
==>sh medstack.sh init index run | |
*** Initializing server on www.lvh.me:8080 with medstack.settings.base | |
*** Running all tests | |
Traceback (most recent call last): | |
File "manage.py", line 9, in <module> | |
execute_from_command_line(sys.argv) | |
File "//anaconda/lib/python2.7/site-packages/django/core/management/__init__.py", line 385, in execute_from_command_line | |
utility.execute() | |
File "//anaconda/lib/python2.7/site-packages/django/core/management/__init__.py", line 354, in execute | |
django.setup() |
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
==>sh medstack.sh init index run | |
*** Initializing server on localhost:8080 with medstack.settings.base | |
*** Running all tests | |
Syncing... | |
Traceback (most recent call last): | |
File "manage.py", line 9, in <module> | |
execute_from_command_line(sys.argv) | |
File "//anaconda/lib/python2.7/site-packages/django/core/management/__init__.py", line 399, in execute_from_command_line | |
utility.execute() | |
File "//anaconda/lib/python2.7/site-packages/django/core/management/__init__.py", line 392, in execute |
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
*** Initializing server on localhost:8080 with medstack.settings.base | |
*** Running all tests | |
Syncing... | |
Traceback (most recent call last): | |
File "manage.py", line 9, in <module> | |
execute_from_command_line(sys.argv) | |
File "//anaconda/lib/python2.7/site-packages/django/core/management/__init__.py", line 399, in execute_from_command_line | |
utility.execute() | |
File "//anaconda/lib/python2.7/site-packages/django/core/management/__init__.py", line 392, in execute | |
self.fetch_command(subcommand).run_from_argv(self.argv) |
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
django.db.utils.OperationalError: could not connect to server: No such file or directory | |
Is the server running locally and accepting | |
connections on Unix domain socket "/tmp/.s.PGSQL.5432"? |
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
django.db.utils.OperationalError: could not connect to server: Connection refused | |
Is the server running on host "localhost" (127.0.0.1) and accepting | |
TCP/IP connections on port 5432? | |
could not connect to server: Connection refused | |
Is the server running on host "localhost" (::1) and accepting | |
TCP/IP connections on port 5432? |
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
django.core.exceptions.ImproperlyConfigured: Error loading psycopg2 module: dlopen(//anaconda/lib/python2.7/site-packages/psycopg2/_psycopg.so, 2): Library not loaded: /Applications/Postgres.app/Contents/Versions/9.3/lib/libssl.1.0.0.dylib | |
Referenced from: //anaconda/lib/python2.7/site-packages/psycopg2/_psycopg.so | |
Reason: image not found |