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
mth_random :: Integer -> Integer | |
mth_random x = ((69069 * x) + 1) `mod` 4294967296 | |
mth_iterator :: Integer -> [Integer] | |
mth_iterator x = iterate mth_random x | |
problem_output :: [Integer] -> [Integer] | |
problem_output values = map (`mod` 36) values | |
problem_filter :: [Integer] -> [Integer] |
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
import Data.List | |
type Grid = [[Int]] | |
gridSystem :: Grid | |
gridSystem = [[500, 8, 1, 7, 8, 8, 5, 2, 9, 5, 9, 5], | |
[8, 5, 1, 1, 5, 6, 9, 4, 4, 5, 2, 1], | |
[7, 2, 3, 5, 2, 9, 2, 6, 9, 3, 9, 4 ], | |
[9, 2, 5, 9, 8, 9, 5, 7, 7, 5, 9, 6 ], | |
[2, 4, 6, 7, 1, 4, 2, 6, 6, 2, 5, 8 ], |
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 registration.signals import user_activated | |
def create_user_profile(sender, user, request, **kwargs): | |
UserProfile.objects.get_or_create(user=user) | |
user_activated.connect(create_user_profile) |
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
[2013-04-22T02:07:42+00:00] WARN: Missing gem 'right_aws' | |
[2013-04-22T02:07:43+00:00] ERROR: Running exception handlers | |
[2013-04-22T02:07:44+00:00] FATAL: Saving node information to /var/chef/cache/failed-run-data.json | |
[2013-04-22T02:07:44+00:00] ERROR: Exception handlers complete | |
[2013-04-22T02:07:45+00:00] ERROR: NoMethodError: Undefined method or attribute `ipaddress' on `node' | |
[2013-04-22T02:07:45+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out | |
[2013-04-22T02:07:45+00:00] ERROR: Sleeping for 60 seconds before trying again | |
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
authorization_header = request.META['HTTP_AUTHORIZATION'] | |
app_id_header = request.META['HTTP_X_ZIPMARK_APPLICATION_IDENTIFIER'] | |
date_header = request.META['HTTP_DATE'] | |
callback_path = reverse('zipmark_callback') | |
body_md5_hex = md5.new(request.raw_post_data).hexdigest() | |
string_to_sign = "POST\n%s\napplication/json\n%s\n%s\n%s" % (body_md5_hex, date_header, callback_path, app_id_header) | |
hmac_digest = hmac.new(settings.ZIPMARK_APPLICATION_SECRET, string_to_sign).digest() | |
sha_digest = sha.new(hmac_digest).digest() | |
signed_string = "ZM %s:%s" % (base64.b64encode(vendor_identifier), base64.b64encode(sha_digest)) |
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
[2013-04-24T14:30:13+00:00] INFO: *** Chef 11.4.0 *** | |
[2013-04-24T14:30:14+00:00] WARN: unable to detect ipaddress | |
[2013-04-24T14:30:14+00:00] WARN: unable to detect macaddress | |
[2013-04-24T14:30:14+00:00] WARN: unable to detect ip6address | |
[2013-04-24T14:30:15+00:00] INFO: Run List is [role[babl_application_server]] | |
[2013-04-24T14:30:15+00:00] INFO: Run List expands to [users::sysadmins, sudo, apt, build-essential, chef-client, database::postgresql, postgresql::server, postgresql::client, openssl, application, git, python, runit, gunicorn, tmux, vim, zsh, nginx, postgresql, postgresql::ruby, babl::babl] | |
[2013-04-24T14:30:15+00:00] INFO: HTTP Request Returned 404 Not Found: No routes match the request: /reports/nodes/babl-www/runs | |
[2013-04-24T14:30:15+00:00] INFO: Starting Chef Run for babl-www | |
[2013-04-24T14:30:15+00:00] INFO: Running start handlers | |
[2013-04-24T14:30:15+00:00] INFO: Start handlers complete. |
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
(env)vagrant@precise64:/vagrant$ python manage.py collectstatic -c | |
You have requested to collect static files at the destination | |
location as specified in your settings. | |
This will DELETE EXISTING FILES! | |
Are you sure you want to do this? | |
Type 'yes' to continue, or 'no' to cancel: yes |
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
MEDIA_ROOT = os.path.join(CURRENT_DIR, 'media_root') | |
MEDIA_URL = '/media/' | |
STATIC_ROOT = os.path.join(CURRENT_DIR, 'static_root') | |
STATIC_URL = '/static/' | |
STATICFILES_DIRS = ( | |
os.path.join(CURRENT_DIR, 'static'), | |
) | |
STATICFILES_FINDERS = ( | |
'django.contrib.staticfiles.finders.FileSystemFinder', |
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
INSTALLED_APPS = ( | |
'django.contrib.auth', | |
'django.contrib.admin', | |
'django.contrib.sites', | |
'django.contrib.comments', | |
'django.contrib.sessions', | |
'django.contrib.messages', | |
'django.contrib.contenttypes', | |
'django.contrib.staticfiles', | |
'south', |
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
(env)vagrant@precise64:/vagrant$ python manage.py shell | |
Python 2.7.3 (default, Aug 1 2012, 05:14:39) | |
[GCC 4.6.3] on linux2 | |
Type "help", "copyright", "credits" or "license" for more information. | |
(InteractiveConsole) | |
>>> from django.conf import settings | |
>>> settings.CURRENT_DIR | |
'/vagrant/mensch' | |
>>> |
OlderNewer