Essay Writer For Hire Assignment Writing Service 1 Federal Muskegon Essays Online Videos Essay Paper Title Page Write My Essay For Me No Writing A Research Paper Last Minute Essay Service Unlimited Accounting Homework Help Graphs Writing Research Papers With Confidence How To Write Essay Quotes Write 4 Today Writing A Research Paper 9th Grade Lesson Plan Essay Writing Services Professional Resume Service Coursework Help Quickbooks Writing Essay 6 Assignment Writing Service 77 Writing Nursing Research Papers Cheap Essay Writing Ielts Essay 4 Writers Custom Essay Quote Write My Research Paper Juvenile Delinquency Essay Help Conclusion Essay On Service To Community Can You Write My Essay Research Paper Help Yahoo Academic Writing Materials Write My Essay Questions Essay Paper 53 Tutorial Cheap Essay Writing Quotation Research Papers For Sale In California Law Essay Writing Help Cheap Essay Writing Service 09 Assignment Writing Service 24 College Essay Ideas To Write About Buy Essay Online 401k Company Essay Writing Services Xbox 360 Essay Service X Servant Write Essay About My Life Writing An Essay Book Title Paper Writing Service 4wd Tahoe Paper Airplanes Writing A Research Paper In Mla Style Writing Essay Book Title Essay Report Help Proofreading Service 86 Do My Homework Images Coursework Help 360 Essays Online 123 Essay Writing Service Nyc Writing Assignment Lesson Plans Coursework Help Dogs Essay Writing Help In Singapore Homework Help Online Now Editing Services 32 Help With Latin Homework Write My Essay Violence Research Paper Writing Service 1st Accounting Homework Help 5 Grade Essay Writing Grade 5 Cheap Essay Writing Nj Assignment Help Desk Institute Proofreading Services Quad Corp Writing Essays Examples Accounting Homework Help 5th Grade Science Do My Geometry Homework Free Writers Help Kids Read College Essay Writing Zen Paper Writing Help 123 Proofreading Service 2 Search Guide Frontier Professional Resume Writing Services Manassas Va Buy Exam Essays Write My Paper For Me 162 Custom Research Papers Examples Essays Research Papers For Sale Yakaz Write Essay Knowledge Essay Writing Letter To A Friend Cheap Essay Writing 247 Write My Research Paper 7th Grade Format Writing A Research Paper In 2 Days Research Paper Help The Poor Academic Writing Examples _ Commentaries Essay Research Paper Help 76 Essay Mla Format Essay Writers Express Writing Essay Phrases Writing An Essay Powerpoint Research Paper Help Jet Blue Web Isapi Bins Cheap Essay Writing 2nd Grade Homework Help 6 Grade Science Academic Writing Checklist Custom Term Papers Fast Homework Help Online 5 Card Draw Writing Quality Research Paper Home Help In Essay Writing Lin Tan Custom Research Paper Writing Service Buy Essay Paper Online Paper Writer Kesey Writers Help Reading Coursework Help 999 Editing Services Vistaprint Writing Kids Books Coursework Help Zachary Homework Help Online Chat Coursework Help 2014 Academic Writing Dorothy Zemach Writers Help 80 Do My Essay 24 Extended Essay Question Help Write 8 146 In Word Form College 4 U Writing Help Thesis College Essay Writing Notes Custom Essay Writing Service Kawasaki Academic Writing Task 1 Examples Assignment Help Hope Live Custom Essay Writing Services Beaumont Tx Paper Writing How To Buy Essays Online Antonym Dictionary Proofreading Service 1 Federal Muskegon College Essay On Career Goals Assignment Writing Instructions Ielts Academic Writing Samples Band 8 Homework Help Government Research Papers For Sale 400ex Essay Help Chat Proofreading Service 3 Pricegong College Essay Help Middle School Write An Essay On 73rd Amendment Act Essay Writing Help 12 Buy Research Paper Qualitative Writing Assignment Julius Caesar Accounting Homework Help Ks3 Research Paper Help Unscramble Letters Professional Writing Services Price List Proofreading Services Leicester College Essay 250 Words Examples Custom Essay Writing Service 3gcollect Professional Resume Writing Services Calgary Accounting Homework Help Dictionary Writing Service Zone Essay Writing Service 4wd Light Paper Invitations Essay Vacation Buy Essays Online Law School Help Writing Sweet 16 Candle Speeches Custom Writing Websites Academic Writing Report Sample Assignment Writing 098 Essay Writing Xmas Letters Essay Writing Layout Cheap Essay Writing Service 7 Pricegong Professional Resume Writing Service Hawaii Help With Homework Zone Trabuco Rd Lake Forest Ca Cheap Essay Writing Lecture Academic Writing Bailey Research Papers For Sale Essays Essay Writing 911 Accounting Homework Help Calculus Writing An Essay On Global Warming Essay Writing Checklist Help Essay Against Euthanasia Homework Help 7th Graders Writing Research Papers Lester Essays Online 4x4 Games Write 95 417 In Expanded Form With Multiplication Best Essay Writing Service Best Online Homework Help 12 Weebly Essay Writing Services Scams Buy Essay Online 365 Research Papers For Sale 63129 Writing Assignment For Valentines Day Essay Writing 2009 Paper Writing Units College Essay Help Chat Room Essay Writing For Toefl Buy Essay Online Reviews Buy Legal Essay Interview Essay Paper Examples Paper Writing Service Graphics Writing An Essay For College Admission Essays Online 90 Day Loans Assignment Writing Guidelines For Business Students Writing Essays Templates Essay Service 7001 Essay Paper Css Do My Essay Xml File Buy Essay Online Pregnancy Test Buy Research Papers History Essay Service Forum Jungle Essay Papers Writing Essay 050177 Writing Essay Practice Worksheets Write Essay Lesson Plan Writing A Research Paper On Autism Write My Essay Keywords Help With Accounting Homework For Free Online Writing A Research Paper About A Person Proofreading Service Zanussi University Assignment Writing Service English Coursework Help Gcse Academic Writing Download Do My Essay 80 Words Paper 007 Vocabulary Homework Help Online Essay Writing Dvd Buy Research Papers In Finance College Essay Writing For Dummies Write My Research Paper Steps Essay Help Verb Editing Services For Graduate Students Essay Paper Abortion Essay Service Central Account Online Write My Research Paper Qualitative Custom Research Papers Thesis Cheap Essay Writing Transitions College Essay 10 Year Reunion Essay Writing Service 7 And 24 Extended Essay Writers Essay Writing Services Discount Code Online Homework Help 123 Buy Research Paper Unit Plan Write My Essay 1119 Do My Essay About My Life Homework Help Fundamental Accounting Principles Online Homework Help Forums Custom Printing Papers Guide To Assignment Writing And Referencing Essay Writing In English Homework Help Vectors Term Paper Writing 0 40 My Posse Dont Do Homework Quotes Essay Writing Outline 5 Paragraph What Is The Best Essay Writing Service Uk Writing Service Vehicles Assignment Writing 0 100 Essay Help Free Writing An Essay For A Scholarship Writing Your Resume Expository Writing Vs Research Papers What Is The Difference Accounting And Finance Homework Help Writing Essays Elementary School Write An Essay Jet Essay Help Jesus Essay Writing Program Homework Help Online Xxxv Movie Write An Essay Vato Research Paper Help Choosing A Career College Essay Writing 5 Paragraph Writers Help Pay My Bills Essay Service Xrg Writing An Essay Using Mla Format Essay Help Gumtree Academic Writing Rules Buy Research Paper Heading Online Homework Help Phone Number Writing Services Blog Research Paper Writing Service Hp Essay Writer In Philippines Writers Help 4 You Buy An Essay Outline Essay Writer For Free How To Write An Essay Very Quickly Custom Officer Exam Papers Essay Paper Zombie Targets Assignment Help Vi Write My Essay In 5 Hours Write My Paper For Me Personally College Essay Help 8787 Essay Help 74410 Write My Research Paper 2nd Grade Buy An Essay 2012 Editing Games Write My Essay For Me Youll Ride Or Die Essay Papers On Ethics Essay Writing Service 24 South Padre Island Essay Writing Service King San Antonio Buy Ephedrine Buy Free Essay Cheap Essay Writing Service Reviews Writing A Research Paper University Coursework Help 25 Homework Help Victorians Medical Research Paper Writing Service Editing Services Zune Essay Service 004 Hpc Ncsu Bookc Tox Courses Websites Toxicology Buy An Essay 911 Attack Custom Essay Writing Services For Artists Help With 5th Grade Science Homework College Essay Writing Help Write My Research Paper Summary College Essay 0n Homework Help Onlinekhabar Custom Essays Contact Number Custom Essay Writing Service Cheap 7 Per Page Writers Help Ive Fallen And I Cant Get Up Writing Servicemen In Iraq Professional Writing Services 4 Africa Service Provider Are Custom Essay Sites Reliable Custom Essay Industry Write My Essay Lead Ins

Bellatrix Provisioning Commands

April 17, 2012
Tags: ,

A quick guide to built-in Bellatrix provisioning commands

Summary

A table of Bellatrix provisioning commands as at 1.1.2

Bellatrix Provisioning

As mentioned in my previous post Bellatrix allows you to start and provision Amazon Web Services EC2 instances.In this context ‘provision’ refers to the process of installing software, creating directories, changing file permissions etc.

The built in commands are documented here in the official doco but before I found that I’d ripped the cmds.py file apart and produced the following table. It’s a little more succinct than the official version so I think it’s worth publishing here.

Version Alert

For obvious reasons this type of thing is prone to Bellatrix changing. This page is valid as of the 1.1.2 version of Bellatrix.

Provisioning Commands

Command Description
apt_get_install Return the “sudo apt-get install” command
apt_get_update Executes apt-get update.
chmod Applies the chmod command
createSoftLink Creates a new soft link
copy Copy a file using -f so it doesn’t fail if the destination exists
create_django_project Creates a Django project
createVirtualEnv Generate a new Python virtual environment using virtualenv
executeInVirtualEnv Execute a command within a virtualenv environmen
flatCommands Given a list of commands it will return a single one concatenated by ‘&&’ so they will be executed in sequence until any of them fail
install_pip Install pip using apt-get install
install_nginx Install Nginx in Ubuntu using the repo they provide as described in http://wiki.nginx.org/Install#Ubuntu_PPA
installPackageInVirtualEnv Install a Python package into a virtualenv
mkdir Created a new directory. “-p” flag is used so the command generates the same result regardless whether the directory exists or not.
pip_install Install a Python package using pip
sudo Execute a list of commands using sudo
wget Downloads a web resource using wget
1

Bellatrix + Windows Users – Two things to remember

April 17, 2012
Tags: ,

Bellatrix – Windows Idiosyncracies

Summary

Two things you might find useful if you’re starting to use Bellatrix on Windows.

What’s Bellatrix Again ?

Bellatrix allows you browse and control Amazon EC2 instances using simple commands on your local machine.

For instance :

bellatrix start ami key_name

run on your machine will launch an EC2 instance within Amazon Web Services based on the named ami (Amazon Machine Image) and allow you to contact it using the key_name you have specified.

You’ve been able to do something like this with the Python package Boto for some time but Bellatrix provides a lot of ready to use commands rather than having to write your own scripts.

Bellatrix on Windows Then ?

Location of Home

I’m a bit embarrassed to write this but in the Bellatrix doco which describes what config files you need and where to place them it refers to

<your_home>

I’m familiar with the idea of ‘Home’ on a unix box but in a Windows enviroment ? I wasn’t really sure what it meant (I’ve only been using Windows for 15 years so you can see where the confusion crept in). I managed to persuade myself it was referring to the Bellatrix directory within the Python site-packages directory !

Well here’s the news for the Windows users out there who are as ‘home-challenged’ as I am. It turns out you should putting those config files in a directory located at :

%HOMEPATH%\.bellatrix

which for me is

C:\Users\Richard Shea\.bellatrix

Yes but what about the dots ?

Which brings me onto another windows specific thing – how do you produce a directory with a dot as its first character ? I started off trying to do it via File Explorer and discovered something strange. File Explorer won’t let you specify a directory name that starts with a dot … unless you specify the directory name as having a trailing dot as well … if you do that File Explorer quietly throws away the trailing dot and you have the name you wanted in the first place ! Weird … or perhaps “only on Windows”

In closing

Anyway the good news is I’ve got it up and running and listing my instances ! Next step is to to use Bellatrix to start an EC2 instance and provision it as a Nagare environment. There’ll be a blog post about that by the time I’ve done, I’m sure !

3

Datejs – Date.isAfter – no such function ?

September 29, 2011
Tags:

date.js – missing methods

Summary

Save yourself a lot of pain and ensure you’re using the right version of  Datejs.

Datejs – It’s great !

Let me start by saying that Datejs, an open-source JavaScript Date Library, is great ! It provides a lot of much needed functionality to the area of dates in Javascript.

Weirdly missing methods

Having said that what I want to highlight is that if you use the standard download links offered by the website (as shown below) you’ll get a version of Datejs which is not the most current one.

What’s more it seems that the version you will get contains a number of defects.

I can vouch for this as I’ve spent a couple of hours today wondering why the ‘.isAfter’ and the ‘.compare’ methods didn’t seem to exist in the form they are documented ! Very frustrating !

What You Should Do

Instead of using the download link on the first page to get the date.js file go here instead : http://www.datejs.com/build/date.js. The version number is the same, “1.0 Alpha-1″, but the build date is “2008-05-13″.

At least at the time of writing – it’s the “2008-05-13″ build you want.

Credit Where Credits Due

I’m grateful to Ben McIntyre whose post on the Datejs forums alerted me to this problem, I only wish I’d seen it earlier !

0

Find (Python) File in which object is defined

September 18, 2011
Tags:

Every so often I have an object defined in some Python code and I want to work out in which file that object was defined.

Generally this can be done by a bit of grepping but if the object name in question is pretty generic this can be less than productive and it turns out there is a nice ready made way provided for us in the Python Standard Library.

So as an example currently I’m working with Pyro4 and I’m curious to know, for instance, where a particular constant, VERSION, is defined.

>>> import Pyro4
>>> print Pyro4.constants.VERSION
4.8

Well the ‘inspect’ module from the Python standard library allows you do just that, specifically the ‘getfile’ method – http://docs.python.org/library/inspect.html#inspect.getfile

>>> inspect.getfile(Pyro4.constants)
'C:\\Python27\\lib\\site-packages\\pyro4-4.8-py2.7.egg\\Pyro4\\constants.pyc'

As we can now see the VERSION object derives from the constants.pyc at the path given. In this case the definition is actually in the middle of an egg, pyro4-4.8-py2.7.egg,  which  means direct access to the underlying source code is not as straightforward as if it were implemented in plain old python scripts.

Nevertheless we can still make use of another inspect module function, the ‘getsource’ method (http://docs.python.org/library/inspect.html#inspect.getsource) to get some more information about the object we’re interested in as follows:

>>> inspect.getsource(Pyro4.constants)
'"""\nDefinitions of various hard coded constants.
Pyro - Python Remote Objects.  Copyright by Irmen de Jong.
irmen@razorvine.net - http://www.razorvine.net/projects/Pyro"""
# Pyro version\nVERSION = "4.8"
# standard object name for the Daemon object
DAEMON_NAME = "Pyro.Daemon"
# standard name for the Name server itself
NAMESERVER_NAME = "Pyro.NameServer"

… etc, etc.

0

The Python dict() constructor

March 22, 2011
Tags:

The Python dict() constructor

Summary

How to add key/value pairs to an existing dictionary using the dict() contstructor

Using dict()

I’ve fallen into the habit of building dictionaries in Python using the braces approach, that is :

d1 = {'name':'Jane', 'age':21}

I was reminded today that you can use the conventional constructor method associated with the dict type as follows :

d1 = dict(name='Jane', age=21)

This will produce the same dictionary as the previous example. Notice that name of the keyword arguments (‘name’ and ‘age’) end up being the keys of the dictionary. Notice also that because they are keyword arguments to the function dict() they are not supplied as quoted strings.

What I learnt today

I was looking at some code today and discovered there’s something else the dict() function can do which I didn’t previously know of. If you have an existing dictionary which you wish to add some key/value pairs to you can do this.

#Create d1 from above
d1 = dict(name='Jane', age=21)

#Now produce a new dictionary, d2, based
#upon d1 and with extra key/value pairs

d2=dict(d1, weight=50, shoesize=7)

print d2
{'age': 21, 'shoesize': 7, 'name': 'Jane', 'weight': 50}

Taking it further

Not surprisingly you can use the same technique to modify the existing key/value pairs in a dictionary, like this :

#Create d1 from above
d1 = dict(name='Jane', age=21)

#Now produce a new dictionary, d3, based
#upon d1 with a modified existing key/value pair

d3=dict(d1, name='John')

print d3
{'age': 21, 'name': 'John'}

0

Where is Django installed ?

March 21, 2011

Where is Django installed ?

Summary

It’s useful to know where Django is for a number of reasons – customising admin templates for instance.

Todays Learning Point

Django is generally going to be installed in the site-packages directory of the Python directory you’re using. If you’re on an unfamiliar machine however where that is may not be immediately obvious so here’s a way to be sure.

If you need to know where the Django installation is you can do that from within Python quite easily.

>>> import django
>>> print django.__path__
['/usr/lib/python2.5/site-packages/django']

Why __path__

__path__ is a special attribute of Python packages; it’s initialized to hold the name of the directory holding the package’s __init__.py. To put that in blunter terms __path__ is going to tell you where the files that make up the package are – in this case Django.

0

Django to the world

March 18, 2011

Django to the world

When your shiny new Django site is invisible to other machines …

Summary

The default setting in Django means your development server is invisible to other machines

Todays Learning Point

When a developer creates a nice new Django site and uses the django-admin.py script :

django-admin.py runserver

to start the development server. By default the development server is responding to requests made on port 8000 on IP address 127.0.0.1 (or the synonym ‘localhost’). As such you’re not going to be able to see that Django site from any other machine.

In most cases this is just what’s needed. The development server is intended for use by the developer only. However there may be circumstances where you want another developer to see your work – or as happened to me today where you are developing on a virtual machine running within your development machine.

If that’s the case there’s a way around it

Specify IP on Server Launch

You can issue a slightly different command when starting the development server

python manage.py runserver 0.0.0.0:8000

The above command will listen on port 8000 of all public IP addresses of the hosting machine and that in turn will mean other machines can access the Django site served through your development server.

0

Ace ‘Editor in the Browser’ – Documentation

March 17, 2011

Ace ‘Editor in the Browser’ – Documentation

The documentation for Ace – where is it ?

Summary

The Ace documentation isn’t that hard to find but you do need to know where to look

Ace in the hole

The Ace project provides a customizable, embeddable code editor for web applications. It’s written solely in JavaScript and is really very impressive.

You can see it in action at their demo page (which frankly is a bit bare bones) or at the Cloud9 project for which Ace is the starting point.

Documentation is where ?

You can download the Ace distribution from https://github.com/ajaxorg/ace – you need the ‘Downloads’ button at the top right.

Once you’ve done that you’ll find there’s nothing worth reading in the docs folder within the distribution.

Instead what you need to do is go visit the Ace wiki at Github. It took me a while to work this out (with the help of the Ace user group forum) so I hope it will save some others the trouble.

0

AttributeError: ‘str’ object has no attribute ‘digits’

March 14, 2011

‘str’ object has no attribute ‘digits’

On silly ways you can puzzle yourself – part 412

Summary

How to make Python report that a string object has no attribute ‘digits’

Confusing Yourself – the easy way


Today I was working on a little piece of code which I hadn’t originally written and which looked something like this :

import string
def foo(string):
  for c in string:
    if c in string.digits:
       #do something

As is well known the Python string module contains a number of useful constants one of which is string.digits

>>> import string
>>> print string.digits
0123456789

Missing ‘digits’

My problem was that every time I went to execute this code it got to the reference to string.digits and the Python intepreter would report

AttributeError: 'str' object has no attribute 'digits'

I spent a happy half hour looking backwards and forwards trying to understand why the String module might think it had no attribute ‘digits’ when everything indicated quite clearly it did until I realised what the problem was.

def foo(string):

That argument name ‘string’ had carefully chucked away my previous reference to the String module and as a string has no attribute ‘digits’ the intpreter was quite reasonably complaining !

My defense

In my defense I wouldn’t normally use variable names, like ‘string’,  that come quite that close to commonly used modules but then like I say I didn’t write the original function

… but what I should have done

But then again what I should have done a great deal sooner than I did was to add a couple of lines to the function so that it read :

import string
import pprint
def foo(string):
  for c in string:
    pprint.pprint(dir(string))
    if c in string.digits:
       #do something

which would have output something like this

['__add__',
 '__class__',
 '__contains__',
 '__delattr__',
 '__doc__',
 '__eq__',
 '__format__',
 '__ge__',
 '__getattribute__',
 '__getitem__',
 '__getnewargs__',
 '__getslice__',
 '__gt__',
 '__hash__',
 '__init__',
 '__le__',
 '__len__',
 '__lt__',
 '__mod__',
 '__mul__',
 '__ne__',
 '__new__',
 '__reduce__',
 '__reduce_ex__',
 '__repr__',
 '__rmod__',
 '__rmul__',
 '__setattr__',
 '__sizeof__',
 '__str__',
 '__subclasshook__',
 '_formatter_field_name_split',
 '_formatter_parser',
 'capitalize',
 'center',
 'count',
 'decode',
 'encode',
 'endswith',
 'expandtabs',
 'find',
 'format',
 'index',
 'isalnum',
 'isalpha',
 'isdigit',
 'islower',
 'isspace',
 'istitle',
 'isupper',
 'join',
 'ljust',
 'lower',
 'lstrip',
 'partition',
 'replace',
 'rfind',
 'rindex',
 'rjust',
 'rpartition',
 'rsplit',
 'rstrip',
 'split',
 'splitlines',
 'startswith',
 'strip',
 'swapcase',
 'title',
 'translate',
 'upper',
 'zfill']

… and made it pretty clear that things were not as I thought they were.

0

Sphinx – how to make autodoc really automatic ?

December 9, 2010

Automating sphinx.ext.autodoc

A tool to help use the ‘autodoc’ facilties of Sphinx.

Summary

Sphinx has a great extension,sphinx.ext.autodoc, which imports the modules you want to document and uses the docstrings as the basis for the documentation. A script I’ve just found makes using sphinx.ext.autodoc even easier.

generate_modules.py

Although the sphinx.ext.autodoc extension reduces the work of creating Sphinx source files a great deal I still found myself having to create a set of files which corresponded to the modules in a project. This was a bit of a bore particularly as I like to start creating documentation early in a project and so modules would come and go during development.

On a number of occasions I wished I had a script to automatically create the source files needed … well it turns out that Etienne Desautels has already done the heavy lifting and written generate_modules.py which does just what I want.

Making use of it

generate_modules.py is completely independent of Sphinx. Just download it from the above location and run it as

>python generate_modules.py --help

Usage: generate_modules.py [options] <package path> [exclude paths, ...]

Note: By default this script will not overwrite already created files.

Options:
 -h, --help            show this help message and exit
 -n HEADER, --doc-header=HEADER
                       Documentation Header (default=Project)
 -d DESTDIR, --dest-dir=DESTDIR
                       Output destination directory
 -s SUFFIX, --suffix=SUFFIX
                       module suffix (default=txt)
 -m MAXDEPTH, --maxdepth=MAXDEPTH
                       Maximum depth of submodules to show in the TOC
                       (default=4)
 -r, --dry-run         Run the script without creating the files
 -f, --force           Overwrite all the files
 -t, --no-toc          Don't create the table of content file

Most of this is pretty self-explanatory.

My index.rst looks like this :

Welcome to pySourceAid's documentation!
=======================================

Contents:
=========

.. toctree::
:maxdepth: 2

overview.rst

Modules
===============

.. toctree::
:maxdepth: 20
:numbered:
:glob:

modules/*

Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`

And that line in the index.rst

    modules/*

… means that autodoc is going to go looking for source files corresponding to each of the modules in a directory called modules. As a result when I run generate_modules.py I use a command like this

python generate_modules.py --suffix=rst --dest-dir=C:\myproject\docs\source\modules C:\myproject\src

Where the modules are living in C:\myproject\src

Environment

This blog post is based on some work done using : Python 2.6 and Sphinx 1.0.5

0