I hereby claim:
- I am somada141 on github.
- I am adamoscoco (https://keybase.io/adamoscoco) on keybase.
- I have a public key ASB2iqBiHK6mS_FlhGJxkyOqwbCJnaWK3UNLnDhPimsgSAo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
... | |
class UpdatePersonName(graphene.Mutation): | |
class Input: | |
uuid = graphene.Int(required=True) | |
name = graphene.String(required=True) | |
person = graphene.Field(Person) |
This note shows how to iteratively retrieve the decoded content of the pages in a PDF file using Python and the pdfminer
Python package.
At the time of writing, the latest version of
pdfminer
was used, i.e.,20140328
. Thus, as the package seems poorly maintained and prone to API-breaking changes one may have to explicitly install this version for the following code to work.
The following generator will iterate over a PDF file under a given filename
and iteratively yield
the text content of each PDF page:
When a VM is not accessible and the original Vagrantfile has been deleted one can use the following command to remove those VMs:
vagrant global-status --prune
source: http://stackoverflow.com/questions/24440142/removing-list-of-vms-in-vagrant-cache/24446866
By piping input, e.g., cat <some_file>
, to the following command one can replace all line breaks with spaces
sed ':a;N;$!ba;s/\n/ /g'
This will read the whole input, e.g., file, in a loop and then replace the newline(s) with a space.
Explanation:
This method will work no matter which version of Ubuntu or desktop environment you are running.
lsb_release -a
Your version will be shown on the Description line.
source: https://help.ubuntu.com/community/CheckingYourUbuntuVersion
This can be done with the listdir()
and getcwd()
methods of the os
module:
os.listdir("path")
: lists all files and directories under path
which is provided as a stringos.getcwd()
: returns the full path to the current working directoryusage:
import os
os.listdir(os.getcwd())
You can install a specific version of a package with apt-get in the terminal. First, determine the available versions you can install with the following command:
apt-cache showpkg <packagename>
e.g. apt-cache showpkg subversion-tools
would give something like:
> Package: subversion-tools
The following process shows how one would build SimpleITK (from source) to link against and work with the Anaconda Python environment on Mac OSX.
The majority of this process can be applied to other non-vanilla Python interpreters such as Enthought Canopy and Enthough Python Distribution (EPD). This process has also been tried on Windows 7 with Canopy.
Here's how one would go about building SimpleITK against their Anaconda Python:
py27
but be careful to amend appropriately and activate through source activate <environment_name>
Imports:
import vtk
from vtk.util import numpy_support
import numpy
Create a vtkDICOMImageReader
object, set its directory to the one containing all DICOM files, and Update
to read in all data: