cross-posted from Wainwright Lab blog, archiving in the notebook here. This early tutorial includes some background on XML parsing from R using XPath. See the later rfishbase tutorial for more functionality.
In lab known for its quality data collection, high-speed video style, writing the weekly blog post can be a bit of a challenge for the local code monkey. That’s right, no videos today. But lucky for me, even this group can still make good use of publicly available data. Like the other day, when one of our newer graduate students wanted to do a certain degree of data-mining from information available from FishBASE. Now I’m sure there are plenty of reasons to grumble about it, but there’s quite an impressive bit of information available on FishBASE, most of it decently referenced if by no means comprehensive. And getting that kind of information quickly and easily is rapidly becoming a skill every researcher needs. So here’s a quick tutorial of the tools to do this.
Okay, so what are we talking about? Let’s start with an example fishbase page on Nile tilapia:
Okay, so there’s a bunch of information we could start copying down, then go onto the next fish. Sounds pretty tedious for 30,000 species… Now we can get an html copy of this page, but that’s got all this messy formatting we’ll have to dispense with. Luckily, we scroll down a little farther and we see the magic words:
Download XML
The summary page takes us to just what we were looking for:
To the human eye this might not look very useful, but to a computer, it’s just what we wanted. ((Well, not acutally. A RESTful interface to this data would be better, where we could query by the different categories, finding all fish of a certain family or diet, but we’ll manage just fine from here, just might be a bit slower)) It’s XML - eXtensible Mark-up Language: meaning it’s all the stuff on the previous page, marked up with all these helpful tags so that a computer can make sense of the document. ((Actually, not everything on the html page. Between the broken links, there’s tons of information like the life history tool, diet data references, etc that somehow haven’t made it into the XML summary sheet.))
To process this, we’ll fire up our favorite language and start scripting. To access the internet from R we’ll use a the command-line url browser, curl, available in the RCurl package. We’ll process XML with the XML package, so let’s load that too. Install these from CRAN if you don’t have them:
require(XML)
require(RCurl)
Click on that XML link to the summary page, and note how the url is assembled: https://fishbase.sinica.edu.tw/maintenance/FB/showXML.php?identifier=FB-2&ProviderDbase;=03
The thing to note here is what followers the php?. There’s something called an identifier, which is set equal to the value FB-2. 2 is the id number of Nile tilapia. Change that to 3 (leave the rest the same) and you get African perch.
We can grab the content of this page in R and parse the XML using these two packages:
fish.id <- 2
url <- paste("https://fishbase.sinica.edu.tw/",
"maintenance/FB/showXML.php?identifier=FB-",
fish.id, "&ProviderDbase=03", sep="")
tt <- getURLContent(url, followlocation=TRUE)
doc <- xmlParse(tt)
We create the url with a given fish id. Then the getURLContent line is the equivalent of pointing your browser to that url. Because the page is XML, we then read or parse the page with xmlParse, creating an R object representation of all that XML. We are ready to rock and roll.
If you look closely at the XML, you’ll see all these placed around the information we want, like the scientific names, identifying what they are. For instance, we see the lines that look like this:
<dwc:Family>Cichlidae</dwc:Family>
<dwc:Genus>Oreochromis</dwc:Genus>
Clearly these are telling us the family and the Genus for this creature. The computer just has to look for the tag (this whole entry is called a node) and that’s the family. The dwc stands for Darwin Core, which is a big language or ontology created explicitly for taxonomic applications. It tells the computer that “Family” in Darwin-Core speak, is precisely the taxonomic meaning of the word. The computer can go and look up the dwc “namespace” given at the beginning of this document to learn exactly what that word means.
To grab this text using R, we simply ask for the value of the node named dwc:Family:
Family <- xmlValue(getNodeSet(doc, "//dwc:Family")[[1]])
Family
There’s two commands combined in that line. getNodeSet() is the first, getting any nodes that have the name dwc:Family anywhere (the // means anywhere) in the document. The [[1]] indicates that we want the first node it finds (since there’s only one of these in the entire document). Specifying which node we want makes use of thexpath syntax, a powerful way of navigating XML which we’ll use more later.
The xmlValue command just extracts the contents of that node, now that we’ve found it. If we ask R for the value it got for Family, it says Cichlidae, just as expected.
That was easy. We can do the same for Genus, Scientific Name, etc. As we go down the XML document, we see some of the information we want isn’t given a uniquely labeled node.
For instance, the information for size, habitat, and distribution are all under nodes called . Closer look shows these nodes are under “parent” nodes, all called . If we look at the other “child” nodes of these nodes, we see they also have a node called , like this:
<dataObject>
<dc:identifier>FB-Size-2</dc:identifier>
... other stuff ....
<dc:description> Text We need </dc:description>
... other stuff ....
</dataObject>
That identifier node tells us that this dataObject has size information. We can grab the content of that dc:description by first finding the identifier that says FB-Size-2, going up to it’s parent dataObject, and asking that dataObject for it’s child node called description. Like this:
size_node <- getNodeSet(doc, paste("//dc:identifier[string(.) =
FB-Size-", fish.id, "']/..", sep=""))
size <- xmlValue( size_node[[1]][["description"]] )
Okay, so that looks crazy complicated – guess we got in a bit deep. See that link to xpath above? That’s a wee tutorial that will explain most of what’s going on here. It’s pretty simple if you take it slow. Using these kind of tricks, we can extract just the information we need from the XML.
Meanwhile, if you want the fast-track option, I’ve put this together in a little R package called rfishbase. The package has a function called fishbase() which extracts various bits of information using these calls. Once you get the hang of it you can modify it pretty easily. I do a little extra processing to get numbers from text using Regular Expressions, a sorta desperate but powerful option when everything isn’t nicely labeled XML.
Using this function we query a fish id number and get back the data in a nice R list, which we can happily manipulate. Here’s a quick demo:
require(rfishbase)
## a general function to loop over all fish ids to get data
getData <- function(fish.ids){
suppressWarnings(
lapply(fish.ids, function(i) try(fishbase(i)))
)
}
# A function to extract the ages, handling missing values
get.ages <- function(fish.data){
sapply(fish.data, function(out){
if(!(is(out,"try-error")))
x <- out$size_values[["age"]]
else
x <- NA
x
})
}
# Process all the XML first, then extract the ages
fish.data <- getData(2:500)
yr <- get.ages(fish.data)
# Plot data
hist(yr, breaks=40, main="Age Distribution", xlab="age (years)");
Note we take a bit of care to avoid the missing values using try() function. Here’s the results:
Kinda cool, isn’t it?


This is an example of using Kendo UI Grid with Web API 2. This particular example shows how to setup the CRUD operations on the client and it is important to note that the default Web API 2 controller methods do not work with the CRUD config in this file. To see an example of how they need to be setup, have a look at the code on my GitHub.
By: Jeffrey Scranton


A collection of functions commonly used in the work of the biostatisticians. The goal of gtsummary is to make reporting of tabular analytic results simple, beautiful, and reproducible.
You can install the production version of gtsummary with:
and the development version with:
The vignettes/tutorials for the primary gtsummary functions have detailed examples and can be found at danieldsjoberg.com/clintable. Each vignette is an Rmarkdown file (*.Rmd) and a copy of the files can be found here: https://github.com/ddsjoberg/clintable/tree/master/vignettes.
| Variable | Drug | Placebo | p-value |
|---|---|---|---|
| N = 107 | N = 93 | ||
| Age, yrs | 47 (39, 58) | 46 (36, 54) | 0.3 |
| Unknown | 3 | 5 | |
| Marker Level, ng/mL | 0.61 (0.22, 1.20) | 0.72 (0.22, 1.63) | 0.4 |
| Unknown | 4 | 4 | |
| T Stage | 0.13 | ||
| T1 | 25 (23%) | 26 (28%) | |
| T2 | 26 (24%) | 23 (25%) | |
| T3 | 29 (27%) | 13 (14%) | |
| T4 | 27 (25%) | 31 (33%) | |
| Grade | 0.3 | ||
| I | 38 (36%) | 29 (31%) | |
| II | 34 (32%) | 24 (26%) | |
| III | 35 (33%) | 40 (43%) | |
| Tumor Response | 52 (51%) | 30 (33%) | 0.017 |
| Unknown | 6 | 3 |
mod1 = glm(am ~ mpg + factor(cyl), mtcars, family = binomial(link = "logit"))
fmt_regression(
mod1, exponentiate = TRUE,
label = list(`factor(cyl)` = "No. of Cylinders", mpg = "Miles per Gallon")
)
| N = 32 | OR | 95% CI | p-value |
|---|---|---|---|
| Miles per Gallon | 1.45 | 1.03, 2.40 | 0.080 |
| No. of Cylinders | |||
| 4 | Ref. | ||
| 6 | 2.08 | 0.13, 39.0 | 0.6 |
| 8 | 2.02 | 0.04, 119 | 0.7 |


Rushmore (1998)
The Royal Tenenbaums (2001)
The life aquatic with Steve zissou (2004)
The Darjeeling limited (2007)
Hotel chavelier (2007)
Fantastic Mr.Fox (2009)
Moonrise kingdom (2012)
Cousin Ben Troop Screening with Jason Schwartzman (2012)
Castello calvancanti (2013)
The grand budapest hotel (2014)
Isle of dogs (2018)
The french dispatch (2020)


Enter weight first then it's profit in first input and capacity in second input!
Run
Result
Profit
Weight
P/W
X
Result


Hability to use autocmd and enable indexing only for desired filetypes
-
obxhdx
Hi, I'm a Linux user and whenever I open Vim from my home dir I get it stuck indexing all my music folders and stuff like that.
I've found a plugin called gitgnore.vim that automatically sets the wildgnore variable for all .gitgnore file entries. The problem is that it reads a ".gitgnore" from the current dir, so I'd have to put .gitignore files everywhere.
What I think that would be much better is to have a flag to disable Command-T indexing, so I could use autocmd on my .vimrc and enable it only for the filetypes I want.
Reply
This topic is now closed.


--- creation_epoch:<PHONE_NUMBER> lastmod_epoch:<PHONE_NUMBER> categories: ['Tech Tricks'] title: Removing the Windows 10 Lock Screen Graphic --- I got tired of having to swipe up the lock screen to get to my login prompt so I found this handy site for disabling it.
How to Enable or Disable the Lock Screen in Windows 10, tenforums.com


SpaceX's Mk1 Rocket Blows Its Top During Cryogenic Pressure Test
SpaceX will move on to the Mk2 rather than fix the damaged rocket.
by Donna FuscaldoSpaceX's Starship Mk1 rocket ship blew its top during a cryogenic pressure test Wednesday (20 November) one day after Mk1's testing began.
SpaceX founder and Chief Executive Elon Musk said on Twitter the company will now focus on creating prototypes that are more advanced then try to fix the Mk1. The comments were in reply to a Twitter user who said the accident with the Mk1 is a good time to move on to more advanced versions.
RELATED: ELON MUSK: SPACEX CAN LAUNCH ROCKETS INTO ORBIT AT A FRACTION OF NASA'S COSTS
The anomaly occurred at SpaceX's South Texas facilities. Officials at SpaceX told Space.com the results were not unexpected given the purpose of the test was to "pressurize systems to the max."
SpaceX said there were no injuries and it doesn't view it as a setback. "As Elon tweeted, Mk1 served as a valuable manufacturing pathfinder but flight design is quite different. The decision had already been made to not fly this test article and the team is focused on the Mk3 builds, which are designed for orbit," SpaceX told Space.com.
Mk1 was supposed to engage in uncrewed tests
Musk had previously said the Mk1 would undergo uncrewed test flights hitting altitudes of 12 miles. He targeted the end of 2019 for those tests but with this week's failure its back to the drawing board.
The Starship Mk2 is already being constructed at SpaceX's Florida facilities and is equipped with the company's Raptor engines. Ultimately the rocket will be equipped with five Raptor engines as it makes its journey from Earth. It also just recently begun construction on SpaceX's third rocket.


Risk: Europe
Combat Resolver
Attacker
Defender
Siege Weapons:
Archers:
Cavalry:
Footmen:
Predict
Resolve
Clear
Reset


Docker
3. September 2014
What is docker?
With docker you can:
- · build
- · ship
- · run
distributed applications
Main conceptual difference: docker aims to model processes!
What is a linux container?
Think VM...
© https://www.docker.com/whatisdocker/
What is a linux container?
...on a diet
© https://www.docker.com/whatisdocker/
Differences - the good parts
- · Containers run in the same operating system as the host (sharing resources)
- ⇒ But you can restrict resource usage.
- · Docker uses AuFS as file system layer. This divides the filesystem in a read and write layer.
- ⇒ All running containers from the same image share the same readonly filesystem!
- · Intermediary build images are cached
- · Superfast startup (1-5 seconds)
- · rapidly growing ecosystem with lots of convenience tools
Differences - the bad parts
- · VMs are a bit harder to break out from
- · Docker is linux only (though it works inside a VM)
Building blocks: Images
-
Image
A read only layer (just like a DVD image)
-
Parent image
Each image may depend on another layer beneath it
-
Base image
An image without a parent
Building blocks: Images
© http://docs.docker.com/terms/image/
Building blocks: Containers
-
When you run an image, docker adds a read-write layer on top of it.
-
This writable layer is the container
-
You can promote a container to an image via docker commit
-
Containers can be restarted
Building blocks: Containers
© http://docs.docker.com/terms/container/
Bored already?
© http://www.cutestpaw.com/
What can I do?
How does it work?
The Dockerfile
FROM litaio/ruby
RUN apt-get update -qq && apt-get install -y ca-certificates
RUN gem install bundler
ADD . /root/app
WORKDIR /root/app
ENV HOME /root
RUN bundle install
EXPOSE 3000
ENTRYPOINT bundle exec unicorn -c config/unicorn.rb
The Docker Registry
→ this way ←Demo
docker run base ping google.com
docker ps -a
docker images
docker run -p 7474:7474 --name 'neo4j' -d tpires/neo4j
Container links
(consumer) → (redis)
docker run --link neo4j:neo
--name="app" -d "the_app"
tcp_address = ENV['NEO_PORT_7474_TCP_ADDR']
port = ENV['NEO_PORT_7474_TCP_PORT']
Data volume container
(neo4j) → (neo4j-data-volume)
Dockerfile
VOLUME /data
Starting the container
docker run --name neo4j
--volumes-from neo4j-data-volume
-d neo4j:2.1.2
Multi-server: meet the ambassador pattern
(consumer) → (redis)
(consumer) → (redis-ambassador) → (redis)
(consumer) → (redis-ambassador) → ☁ → (redis-ambassador) → (redis)
Ambassador example
docker run -d --name redis_ambassador
--expose 6379 -e REDIS_PORT_6379_TCP=tcp://<IP_ADDRESS>:6379
svendowideit/ambassador
Security
LXC uses
-
Linux capabilities support:
· list, enable and disable capabilities like
CHOWN, KILL, NET_BIND_SERVICE, SYS_CHROOT, ...
-
Control groups:
· Resource quotas, Access restrictions, ...
-
User namespace
· LXC is no longer running as root
But the docker daemon is!
-
Apparmor, SELinux, other kernel hardening solutions
Tools
The ecosystem is growing rapidly.
Here are some interesting projects.
Tools
Fig
Define and start your depent containers all in one.
web:
build: .
command: bundle exec unicorn -c config/unicorn.rb
links:
- memcached
environment:
- NEO_USER=neoadmin
memcached:
image: borja/docker-memcached
Tools
Decentralized cluster management, failure handling and high availability.
Tools
CoreOS
- A minimal linux system (Linux kernel + systemd)
- + Built for running docker containers
- + Service discovery
-
Fleet (from CoreOS)
- Systemd at the cluster level
Tools
Kubernetes
"Kubernetes is a system for managing containerized applications across multiple hosts, providing basic mechanisms for deployment, maintenance, and scaling of applications."
Tools
Self-hosted Heroku
Build your own infrastructure with a nice UI
Who's using it already?
Google, amazon, IBM, Microsoft, ebay, yandex, newrelic, mailgun, spotify, yelp, ...
You can run it with Red hat, ubuntu, OpenStack, VMWare, azure, EC2, google compute, ...
Questions?
Appendix
Building blocks: Images
Since Docker uses a Union File System, the processes think the whole file system is mounted read-write. But all the changes go to the top-most writeable layer, and underneath, the original file in the read-only image is unchanged. Since images don't change, images do not have state.


Describes the common server setups used for a web application and the potential issues.

There are three components in typical application to be deployed:
This setup can be achieved by installing a LAMP stack (Linux, Apache, MySQL, and PHP).
This setup could potentially reduce performance and may create difficulty in identifying the cause.
It is important to keep the database separate in a server inside a private network other than that running the aplication that ensures elevated security. It also ensures that resources aren't shared and hence an better performance compared to that of "All in One" setup. Although the setup is more complex, it leverages additional resources to increase capacity, thereby improving performance.
Please refer to https://en.wikipedia.org/wiki/Private_network
for more information on Private Network
Because the servers are isolated, this setup can create connectivity issues.
Load balancing is a core networking solution that distributes incoming requests among multiple servers hosting the same application.
Including in a load balancer to the server architecture can improve performance. The load balancer can quickly switch to the failover to serve the request when the primary server fails until the primary server can come back up online to serve requests again. It also enables the use of same domain and port to serve requests from multiple applications.
This setup offers complete control on the requests and could possibly protect against denial of service.
This setup could have a negative affect performance if it isn't configured efficiently.
Web Accelerator is a proxy server that reduces the access time by caching the response.
Also known as as "caching HTTP," reverse proxy is used to reduce the time to serve a request, as it caches the responses in memory. This ensures responses can be reused for repeated requests of same type. This can protect against Denial of Service attacks and can be used as reverse proxy load balancer.
This setup might not improve the performance signficantly, if the cached responses are never requested.
This setup needs one master and several subordinate nodes to be distribute the request across available nodes. This improves the read performance of a database system.
It offers complete control on the requests to could possibly protect against denial of service
The subordinates become inaccessible if the master fails.


The best way to learn is with examples, and ProtParCon is no exception. For this reason, the following sections describe some pre-made examples of how to use ProtParCon to manipulate molecular sequence data and identify molecular convergences.
Since ProtParCon is written in pure Python, you can use ProtParCon in any Python script or interactive Python session. Meanwhile, ProtParCon also ships a command-line toolset to you, you are able to use the command-line tools in a terminal. We will show you examples of using ProtParCon in Python and terminal separately.
Use ProtParCon in Python¶
Import ProtParCon¶
You can import ProtParCon as a module or directly import general use functions inside the module, thus the following two ways of importing are acceptable:
>>> import ProtParCon
>>> from ProtParCon import msa, aut, mlt, asr, imc
Align multiple sequences¶
Multiple sequence alignment (MSA) can be easily done in ProtParCon by using
function msa()
, and this function has a common interface for all
supported MSA programs.
At this stage, MSA via MUSCLE, MAFFT, and Clustal (Omega) are supported.
You are only required to pass the path to the executable of any supported
MSA program and the path to a sequence file in FASTA format to function
msa()
, ProtParCon will then take care of everything related to sequence
alignment for you.
The following examples assume that you have the needed MSA program installed in your system and the path to its executable is the same as used here. Otherwise, you need to replace the path to the executable of a MSA program with its actual path. In our case, the executable of MUSCLE is named muscle and it is already in the system path, so we are able to directly use muscle as the path to the MUSCLE executable. All the examples also assume that the sequence file used is in the current work directory and it is named seq.fa. If this is not the case for you, you need to use either a relative or absolute path of the files accordingly to make ProtParCon works as expected.
This Python session will automatically align sequences using MUSCLE and save the alignment output to a file named seq.muscle.fasta in the same directory of the sequence file:
>>> from ProtParCon import msa
>>> msa('muscle', 'seq.fa')
The default naming rule for alignment output will be in the format of [basename].[aligner].fasta, where basename is the filename of the sequence file without known FASTA format file’s extension, aligner is the name of the MSA program (figured by ProtParCon according to the MSA’s executable) in lower case, and fasta is the file extension for FASTA file. Thus, the following session will align sequence using MAFFT and save the alignment output to a FASTA format file named ‘seq.mafft.fasta’:
>>> from ProtParCon import msa
>>> msa('mafft', 'seq.fa')
And this will align the same sequence with Clustal (Omega) and save the alignment to a FASTA file named ‘seq.clustal.fasta’:
>>> from ProtParCon import msa
>>> msa('clustal', 'seq.fa')
Note
The above example assumes that you have system wide Clustal Omega installed and the string clustal point to the executable of Clustal Omega. If your Clustal Omega is not system widely installed, or the path to its executable is not clustal, change it accordingly.
If you want to save the alignment output to a file using a customized name,
you can pass a filename to argument outfile
. This session will align
sequence using MUSCLE and save the alignment output into a file named
alignment.fasta in the same directory of the sequence file (if you want
to save the alignment to a different directory, pass a relative or absolute
path accordingly):
>>> from ProtParCon import msa
>>> msa('muscle', 'seq.fa', outfile='alignment.fasta')
Infer Maximum-Likelihood tree¶
Infer Maximum-Likelihood (ML) tree can be easily done in ProtParCon by using
function mlt()
. Since this function provides a common interface for
all supported ML programs, you can use this function to infer ML tree
using all supported ML programs in the same manner.
At this stage, ML tree inference via IQ-TREE, FastTree, RAxML, and PhyML
are supported in ProtParCon. You are only required to pass the path to the
executable of any supported MSA program and the path to an alignment file
in FASTA format to function msa()
, ProtParCon will then take care of
everything about ML tree inference for you.
The following examples assume you have the needed ML program installed on your system and the path to its executable is the same as used here. Otherwise, you need to replace the path to the executable of a MSA program with its actual path. In our case, the executable of IQ-TREE is named iqtree and it is already in the system path, so we are able to directly use iqtree as the path to the executable of IQ-TREE software. All the examples also assume that the alignment file used is in the current work directory and it is named msa.fa. If this is not the case for you, you need to use either a relative or absolute path of the files accordingly to make ProtParCon works as expected.
This Python session will automatically infer ML tree using IQ-TREE and save the best ML tree to a file named msa.IQ-TREE.ML.newick in the same directory of the multiple sequence alignment file:
>>> from ProtParCon import mlt
>>> mlt('iqtree', 'msa.fa')
The default naming rule for ML tree output will be in the format of [basename].[mlter].ML.newick, where basename is the filename of the alignment file without known FASTA format file’s extension, mlter is the name of the ML program (figured by ProtParCon according to the ML program’s executable), ML denotes that the file contains a Maximum-Likelihood tree, and newick is the file extension for NEWICK file. Thus, the following session will infer ML tree using RAxML and save the ML tree to a file named ‘msa.RAxML.ML.newick’:
>>> from ProtParCon import mlt
>>> mlt('raxml', 'msa.fa')
Since mlt()
provides a common interface for inferring ML tree, the
other two supported ML programs can also be used in the same way. This
example will infer ML tree using PjyML and save the ML tree to a file named
‘msa.PhyML.ML.newick’:
>>> from ProtParCon import mlt
>>> mlt('phyml', 'msa.fa')
And, of course, this example will infer ML tree using FastTree and save the ML tree to a file named ‘msa.FastTree.ML.newick’:
>>> from ProtParCon import mlt
>>> mlt('fasttree', 'msa.fa')
If you want to save the resulted ML tree to a file using a customized
name, you can pass a filename to argument outfile
. This session will
infer ML tree using RAxML and save the tree to a file named tree.newick
in the same directory of the alignment file (if you want to save the
ancestral states output to a different directory, pass a relative or absolute
path accordingly):
>>> from ProtParCon import mlt
>>> mlt('raxml', 'msa.fa', outfile='tree.newick')
Function mlt() also allows you to specify a substitution model for inferring a ML tree. The model can be a name of empirical substitution name (e.g. JTT, WAG, LG, …) or a name combined with a other options (e.g. JTT+G8, LG+G8+I, WAG+G4+I+F). For example, the following example will infer ML tree using LG model with 8 Gamma categories account for among-site rate variation and estimated ML base frequencies of 20 amino acids via PhyML:
>>> from ProtParCon import mlt
>>> mlt('raxml', 'msa.fa', outfile='tree.newick', model='LG+G8+F')
If you do not want to specify the modeling process via argument model, there are four other arguments: gamma, alpha, freq, and invp, that you can use to specify additional modeling information, such as number of discrete Gamma categories, shape of discrete Gamma distribution, base frequencies of 20 amino acids, and proportion of invariable site. The value specified by these arguments have high priority than the ones coming with model argument. Therefore, the following example will do the exactly same things as the above example:
>>> from ProtParCon import mlt
>>> mlt('raxml', 'msa.fa', outfile='tree.newick', model='LG',
gamma=9, freq='estimate')
You also have the option to provide a start tree and/or constraint tree to control the way in which ML tree has been inferred via arguments start_tree and constraint_tree:
>>> from ProtParCon import mlt
>>> mlt('raxml', 'msa.fa', outfile='tree.newick', model='LG+G8+I',
start_tree='/path/to/the/start/tree/file',
constraint_tree='/path/to/the/constraint/tree/file')
Reconstruct ancestral states¶
Ancestral states reconstruction (ASR) can be easily done in ProtParCon by using
function asr()
, and this function has a common interface for all supported
ASR programs.
At this stage, ASR via CODEML (inside PAML package), and RAxML are supported.
You are only required to pass the path to the executable of any supported ASR
program, the path to an alignment file in FASTA format, and a guide tree file
in NEWICK format to function asr()
, ProtParCon will then take care of everything
about ancestral states reconstruction and results parsing for you.
The following examples asuume you have the needed ASR program installed on your system and the path to its executable is the same as used here. Otherwise, you need to replace the path to the executable of a ASR program with its actual path. In our case, the executable of CODEML is named codeml and it is already in the system path, so we are able to directly use codeml as the path to the CODEML executable. All the examples also assume that the alignment file and the tree file used here are in the current work directory and they are named msa.fa and tree.newick. If this is not the case for you, you need to use either a relative or absolute paths of these files accordingly to make ProtParCon works as expected.
This Python session will automatically reconstruct ancestral states using CODEML and save the ancestral states output to a file named msa.codeml.tsv in the same directory of the sequence file:
>>> from ProtParCon import ars
>>> asr('codeml', 'msa.fa', 'tree.nwick')
The resulted ancestral states file seq.codeml.tsv is TAB separated file, and the first line of the file will start with ‘#TREE’ and followed by a TAB (t) and then a NEWICK formatted tree string, the internal nodes are labeled. The second line of the tsv file is intentionally left as a blank line and the rest lines of the file are tab separated sequence IDs and amino acid sequences.
The default naming rule for ancestral states output will be in the format of [basename].[asrer].tsv, where basename is the filename of the alignment file without known FASTA format file’s extension, asrer is the name of the ASR program (figured by ProtParCon according to the MSA’s executable) in lower case, and fasta is the file extension for FASTA file. Thus, the following session will reconstruct ancestral states using RAxML and save the ancestral states output to a file named ‘msa.raxml.tsv’:
>>> from ProtParCon import asr
>>> asr('raxml', 'msa.fa')
If you want to save the ancestral states output to a file using a customized
name, you can pass the filename to argument outfile
. This session will
reconstruct ancestral states using RAxML and save the ancestral states output
to a file named ancestors.tsv in the same directory of the alignment file
(if you want to save the ancestral states output to a different directory,
pass a relative or absolute path accordingly):
>>> from ProtParCon import asr
>>> asr('raxml', 'msa.fa', outfile='ancestors.tsv')
The default reconstruction will use JTT model as substitution model, of course
you can use any supported substitution models by passing the name of the model
to argument model
. This session will reconstruct ancestral states via
CODEML using WAG model:
>>> from ProtParCon import ars
>>> asr('codeml', 'msa.fa', 'tree.nwick', model='WAG')
Since asr()
function provides a common inteface for ancestral states
reconstruction, the same rule also applies to other support ASR programs,
like RAxML. Thus, this session will reconstruct ancestral states via RAxML
using ‘WAG’ model:
>>> from ProtParCon import ars
>>> asr('codeml', 'msa.fa', 'tree.nwick', model='WAG')
The argument model can also pass other information for guiding state reconstruction rather than just the name of a empirical substitution model. If the model argument combined name and Gamma category numbers, i.e. JTT+G4, WAG+G8, etc., a discrete Gamma model would be used to account for among-site rate variation. If the model argument combined name and frequencies, i.e. LG+G8+F, WAG+F, etc., a ML estimate of base freqeuencies of 20 amino acids would be used instead of empirical values associated with the specified substitution model. Thus, this session will reconstruct ancestral states using LG model with 8 Gamma categories and a ML estimate of base frequencies of 20 amino acids via RAxML:
>>> from ProtParCon import ars
>>> asr('raxml', 'msa.fa', 'tree.nwick', model='LG+G8+F')
Another way for you to providing complicted modeling information is to use these four arguments: gamma, alpha, freq, and invp, along with argument model. Argument gamma will accept a integer of number of Gamma category, alpha will let you specify the shape parameter of the discrete Gamma distribution, and freq will accept either empirical or estimate to specify how the base frequencies of 20 amino acids will be handled. Thus, the following example will do the exactly same thing as the above example:
>>> from ProtParCon import ars
>>> asr('raxml', 'msa.fa', 'tree.nwick', model='LG',
gamma=8, freq='estimate')
Moreover, ProtParCon also allows you to use a customized substitution model (or matrix) instead of the built-in empirical models in ASR programs. You can pass the model (or matrix) file to argument model. In this case, if you still want to provide modeling information, such as Gamma categories and shape, base frequencies of amino acid, you are required to pass all these information through gamma, alpha, and freq. This example shows you how you can use a specified model (or matrix) file along with complicated modeling information for ancestral states reconstruction:
>>> from ProtParCon import ars
>>> asr('codeml', 'msa.fa', 'tree.nwick', model='/path/to/my/own/model',
gamma=8, freq='estimate')
Note
The model (or matrix) file needs to be in the right format required by ASR programs, before use the model file, check the manual for your ASR program to make sure you model file is in the right format.
Simulate protein sequences¶
ProtParCon supports simulate proteins sequences via EVOLVER (inside PAML package)
and Seg-Gen in Python script or interactive session using a common interface.
You are only required to provide an executable of any supported simulation
program and a phylogenetic tree (with branch lengths) to the general use
function sim()
, ProtParCon will then take care everything about simulation for
you. The simplest example will look like this:
>>> from ProtParCon import sim
>>> sim('evolver', 'tree.nwick')
The above code will use EVOLVER to simulate proteins sequences along the phylogenetic tree specified in tree file tree.newick. ProtParCon will automatically extract the number of leaf nodes that need to be simulated from the tree file. The default simulation procedure will set the substitution model to JTT model, the length of protein sequence to 100 amino acid sites, and the number of datasets (or duplicates) to 100. Thus, after run the above code, ProtParCon will simulate protein datasets and save simulated sequences to a tab separated file. The default naming rule for simulation output will be in the format of [simulator].simulations.tsv, where simulator is the name of the simulation program you used (this will be figured by ProtParCon automatically).
The resulted simulation file is a TAB separated text file, and the first line of the file will start with ‘#TREE’ and followed by a TAB (t) and then a NEWICK formatted tree string, the internal nodes are labeled. The second line of the tsv file is intentionally left as a blank line and the rest lines of the file are blank line separated sequence blocks, in each sequence block, each sequence takes a whole line and the sequence IDs and amino acid sequences are separated by a TAB (‘t’).
The function sim() also allows you to simulate sequences under various scenarios. For example, the following example will use Seq-Gen to simulate 200 protein datasets with the length set to 500 amino acids and substitution model set to LG with 8 Gamma categories to account for among sites rate variation:
>>> from ProtParCon import sim
>>> sim('seqgen', 'tree.newick', length=500, n=200,
model='LG', gamma=8)
The following example will use Seq-Gen to simulate 200 protein datasets with the length and base frequencies of 20 amino acids extracted from a multiple protein sequence alignment file:
>>> from ProtParCon import sim
>>> sim('seqgen', 'tree.newick', n=200, model='LG', gamma=8,
msa='path/to/the/multiple/sequence/alignment/file',
freq='estimate',
outfile='path/to/the/simulation/output/file')
Since you also passed a filename to argument outfile, in the above example, simulated sequences and the labeled tree will be saved to the file you specified.
Topology test¶
For our own purpose, the only topology test supported in ProtParCon at this stage is AU test and the test need to use IQ-TREE. The test can be easily done via function aut inside ProtParCon. For example, assume we have multiple sequence alignment file and a hypothesis phylogenetic relationship specified in a NEWICK tree file, we want to know how big the differences are between the phylogenetic relationship specified by the tree file and the relationship specified by the best ML tree given the MSA file, thus we can do the following:
>>> from ProtParCon import aut
>>> aut('iqtree', 'msa.fa', 'tree.newick', model='WAG')
Running the above code will conduct AU test implemented in IQ-TREE program without knowing how to use IQ-TREE.
Identify molecular convergence in proteins¶
The function imc()
inside ProtParCon package provides a common and easy way to
identify parallel and convergent amino acid replacements in orthologous
proteins separately. It is able to take the following kinds of
sequence data and identify parallel and convergent amino acid replacements
for all comparable branch pairs within the phylogenetic tree:
- sequences: raw protein sequence file, need to be in FASTA format (a NEWICK format tree, a multiple sequence alignment program, an ancestral states reconstruction program are also required.
- msa: multiple sequence alignment file, need to be in FASTA format (a NEWICK format tree and an ancestral states reconstruction program are also required).
- ancestors: reconstructed ancestral states file, need to be in tsv (tab separated) file, the first line needs to start with #TREE, second line need to be a blank line, and the rest lines in the file need to be tab separated sequence name (or ID) and amino acid sequences.
- simulations: simulated sequences, need to be in tsv file, the first line needs to start with #TREE, second line need to be a blank line, each dataset need to be separated by a blank line and inside each dataset block, each line should consist of tab separated sequence name (or ID) and amino acid sequences.
In the simplest way, if you pass a result file generated during ancestral states reconstruction to imc(), parallel and convergent amino acid replacements will be identified without requiring any other information:
>>> from ProtParCon import imc
>>> imc('path/to/the/ancestral/states/file')
After running the above code, there are two TAB separated files saved to the current work directory: ‘imc.counts.tsv’ and ‘imc.details.tsv’. The former file contains information about the number of parallel and convergent amino acid replacements among branch pairs, while the later file contains details of each identified parallel or convergent amino acid replacement.
If you are interested in identifying parallel and convergent amino acid replacements in a protein orthologous group and you also want to identify the corresponding number of parallel changes in simulated datasets based on the protein orthologous group, you can manually do sequence alignment, ancestral states reconstruction, sequence simulation, and identify parallel and convergent changes step by step, or you can just let imc() do all the work for you:
>>> from ProtParCon import imc
>>> imc('path/to/the/orthologous/file', tree='path/to/the/tree/file',
aligner='path/to/the/executable/of/a/MSA/program',
ancestor='path/to/the/executable/of/a/ASR/program',
anc_model='LG+G8+F',
simulator='path/to/the/executable/of/a/simulation/program',
sim_model='LG+G8+F',
wd='path/to/the/work/directory')


Try out our Premium Member services: Virtual Legal Assistant, Query Alert Service and an ad-free experience. Free for one month and pay only if you like it.
IN THE HIGH COURT OF JHARKHAND AT RANCHI W.P.(C) No. 1729 of 2013 Jay Durga Minerals ....Petitioner Versus The State of Jharkhand & others ... Respondents -------- Coram: THE HON'BLE MR JUSTICE P.P. BHATT -------- For the Petitioner : Mr. Ayush Aditya, Advocate For the Respondents: J.C. to A.G. & Mr. Prabhash Kumar, Advocate /20.3.2013: Petitioner, by way of filing the present writ petition under Article 226 of the Constitution of India, has prayed for issuance of an appropriate writ/ order/ direction upon the respondent-Deputy Commissioner, West Singhbhum to decide T.A. Misc. Case No. 55/2012-13 on the basis of recommendations made by the Circle Officer and Sub-Divisional Officer without further delay as the said application was filed way back on 23.5.2012 and which is pending since then. Learned counsel for the petitioner, at the outset, clarified that at present he confined his prayer with regard to application made by him for renewal of lease. Learned counsel for the petitioner submitted that so far other prayers are concerned, at this juncture, he does not want to press. Heard the learned counsel for the petitioner as well as respondents and perused the materials placed on record. It appears that the present petitioner was granted permission under Section 49 of the CNT Act in the year 2007 in T.A. Misc. Case No. 71/2006-07
vide its permission dated 16.8.2007 for a period of 5 years, which was operational till 15.8.2012. Subsequently, petitioner applied for renewal of the same on 23.5.2012. Thereafter, DCLR (Legal) issued public notice vide Annexure-2 dated 4.12.2012 inviting objection, if any, on or before 28.12.2012. Petitioner has also annexed the report of the Circle Officer, Noamundi as well as Sub-Divisional Officer, Jagannathpur vide Annexure- 3 & 4 of this writ petition, wherein both the officers have recommended for renewal of the lease. It also transpires that in the meantime, Jharkhand State Pollution Control Board vide its show-cause notice dated 9.2.2013, issued under Section 21 of the Air & Water (Prevention & Control of Pollution) Act, 1981 & 1974 informed the petitioner that as to why his consent application dated 10.5.2012 should not be rejected as lease under CNT Act has already expired on 15.8.2012 and the petitioner has not submitted the renewal paper of lease. Thereafter, in response to show-cause notice dated 9.2.2013, petitioner vide his letter dated 2.3.2013 requested the Member Secretary, JSPC Board, Ranchi to grant one month's time in anticipation of renewal. Copy of show-cause notice as well as reply to the said notice are annexed to this writ petition vide Annexure- 5 &6.
In the light of the above background of the matter and more particularly the petitioner's application for renewal dated 23.5.2012 to the authorities concerned, decision is required to be taken in accordance with law without further delay. Therefore, respondent No.2 i.e. Deputy Commissioner, West Singhbhum is directed to deal with and decide T.A. Misc. Case No. 55/2012-13 in accordance with law, preferably within a period of four weeks from the date of receipt/production of a copy of this order.
With the aforesaid observation and direction, this writ petition stands disposed of.
.
(P.P. Bhatt, J.) S.B.


{% extends "base.html" %} {% load i18n %} {% block title %}{% trans "Payment" context "Payment form page title" %} — {{ block.super }}{% endblock %} {% block breadcrumb %} {% with order=payment.order %} {% if order.user == user %}
{% endif %} {% endwith %} {% endblock breadcrumb %} {% block content %}Please provide your name exactly as provided on your card.
Credit card number (Primary account number/PAN) should be 14-digit number in front. Depending on card issuer (Visa/mastercard) CVV2 code might be placed above card number or in the back (see image below for reference).
Please make a transfer to provided bank account and add your purchase information to payment details:
JSC "Company"
IBAN: xxxxxxxxxxxxxxxxx
Bank: BANK AB
Company code:<PHONE_NUMBER>
You can send your payment confirmation to<EMAIL_ADDRESS>for faster shipment.
{% endif %}


Title
Image
Notification Text
Notification using a directive
Notification using a function
Key
Value
{{key}}
{{value}}
Get permission


{% extends "global/Base.html" %} {% load staticfiles otree_tags %} {% block title %} Solution to Understanding Question {{ num_q }} of {{ total_q }} {% endblock %} {% block content %} {% if player.training_answer_x == Constants.training_answer_x_correct %}
Your answer {{player.training_answer_x}} for participant A was correct.
{% else %}Your answer {{player.training_answer_x}} for participant A was incorrect.
{% endif %} {% if player.training_answer_y == Constants.training_answer_y_correct %}Your answer {{player.training_answer_y}} for participant B was correct.
{% else %}Your answer {{player.training_answer_y}} for participant B was incorrect.
{% endif %}Suppose that participant A sent 20 points to participant B. Having received the tripled amount, participant B sent 50 points to participant A. In the end, how many points would participant A and B have?
Solution: Participant A would have 130 points and B 10 points.
Explanation: Participant A first sent 20 points to B. It was tripled thus B received 20*3=60 points. Then participant B sent 50 points to A. Participant A received exactly 50 points. Hence at last A would have 100-20+50=130 points and B would have 60-50=10 points.
{% next_button %}
{% include instructions %} {% endblock %}


Eagles Fans Chant “You Can Shove Tom Brady Up Your A–” Ahead of Sunday’s Matchup (VIDEO)
by Darrelle LincolnEagles fans certainly know how to make anything into a fight song.
Just ahead of Sunday’s matchup against the New England Patriots — a couple members of the fan base seem to be out and about near some casinos and chanting a peculiar new fight song that involved the Patriots legendary QB.

The Patriots will take on the Eagles at Lincoln Financial Field at 3:25 EST.


Please note that each children's event will typically last for around 45 minutes.
In conjunction with Herts at War we are thrilled to be able to provide an immersive history experience for our younger attendees with our interactive pop-up museum. Speak to experts, handle artefacts and gain an insight into what it was like to be a soldier in The Great War.
Children will be invited to attend and not only find out all about the life of a pilot in the Great War, but to see if they have what it takes to join their ranks in this workshop based on genuine recruitment for the RFC in The Great War.
Based on his hugely successful book Forgotten Voices of the Somme, Joshua Levine will be holding an interactive workshop for our younger attendees using testimonies of the battle recorded by those who took part. Children will be able to hear about the Somme from the mouths of those who took part in one of the most famous British battles in history and discuss their thoughts with their host.
Who doesn’t want to be a Secret Agent? We are thrilled to invite our younger attendees to join Dr. Vivien Newman and learn tricks of the trade as they find out all about the lives of the Great War’s spies. We could tell you more, but it’s top secret, and no grown ups allowed!
This year Peter Doyle has published a children’s book: Percy: A Story of 1918, about the life of Percy Edwards, a young Welshman who was conscripted into the army. We are delighted to offer children the opportunity to sit down with the author and learn all about one teenager compelled to pick up a rifle for the last year of the war.


--- layout: post title: build-failed-could-not-find-type-system-globalization-sortversion date: '2014-05-05T19:04:00.001+01:00' author: John Smith tags: modified_time: '2014-05-05T19:04:22.535+01:00' blogger_id: tag:blogger.com,1999:blog-31446756.post-3551952495367922287 blogger_orig_url: http://www.solrevdev.com/2014/05/build-failed-could-not-find-type-system.html ---
In the middle of quite a few bug fixes and some heavy refactoring of some early code and this is where I have ended up. Time for some food and a break I think!
Build failed. Could not find type ‘System.Globalization.SortVersion’
There seems to be a post on stackoverflow about the issue so I’ll take a look next up.


sphinx-build¶
Synopsis¶
sphinx-build [options] <sourcedir> <outputdir> [filenames …]
Description¶
sphinx-build generates documentation from the files in
<sourcedir>
and places it in the <outputdir>
.
sphinx-build looks for <sourcedir>/conf.py
for the configuration
settings. sphinx-quickstart(1) may be used to generate template
files, including conf.py
.
sphinx-build can create documentation in different formats. A format is selected by specifying the builder name on the command line; it defaults to HTML. Builders can also perform other tasks related to documentation processing.
By default, everything that is outdated is built. Output only for selected files can be built by specifying individual filenames.
For a list of available options, refer to sphinx-build -b
.
Options¶
-
-b
buildername
¶ The most important option: it selects a builder. The most common builders are:
- html
Build HTML pages. This is the default builder.
- dirhtml
Build HTML pages, but with a single directory per document. Makes for prettier URLs (no
.html
) if served from a webserver.- singlehtml
Build a single HTML with the whole content.
- htmlhelp, qthelp, devhelp, epub
Build HTML files with additional information for building a documentation collection in one of these formats.
- applehelp
Build an Apple Help Book. Requires hiutil and codesign, which are not Open Source and presently only available on Mac OS X 10.6 and higher.
- latex
Build LaTeX sources that can be compiled to a PDF document using pdflatex.
- man
Build manual pages in groff format for UNIX systems.
- texinfo
Build Texinfo files that can be processed into Info files using makeinfo.
- text
Build plain text files.
- gettext
Build gettext-style message catalogs (
.pot
files).- doctest
Run all doctests in the documentation, if the
doctest
extension is enabled.- linkcheck
Check the integrity of all external links.
- xml
Build Docutils-native XML files.
- pseudoxml
Build compact pretty-printed “pseudo-XML” files displaying the internal structure of the intermediate document trees.
See /usage/builders/index for a list of all builders shipped with Sphinx. Extensions can add their own builders.
-
-M
buildername
¶ Alternative to
-b
. Uses the Sphinx make_mode module, which provides the same build functionality as a default Makefile or Make.bat. In addition to all Sphinx /usage/builders/index, the following build pipelines are available:- latexpdf
Build LaTeX files and run them through pdflatex, or as per :confval:`latex_engine` setting. If :confval:`language` is set to
'ja'
, will use automatically the platex/dvipdfmx latex to PDF pipeline.- info
Build Texinfo files and run them through makeinfo.
Important
Sphinx only recognizes the
-M
option if it is placed first.New in version 1.2.1.
-
-a
¶
If given, always write all output files. The default is to only write output files for new and changed source files. (This may not apply to all builders.)
-
-E
¶
Don’t use a saved environment (the structure caching all cross-references), but rebuild it completely. The default is to only read and parse source files that are new or have changed since the last run.
-
-t
tag
¶ Define the tag tag. This is relevant for
only
directives that only include their content if this tag is set.New in version 0.6.
-
-d
path
¶ Since Sphinx has to read and parse all source files before it can write an output file, the parsed source files are cached as “doctree pickles”. Normally, these files are put in a directory called
.doctrees
under the build directory; with this option you can select a different cache directory (the doctrees can be shared between all builders).
-
-j
N
¶ Distribute the build over N processes in parallel, to make building on multiprocessor machines more effective. Note that not all parts and not all builders of Sphinx can be parallelized. If
auto
argument is given, Sphinx uses the number of CPUs as N.New in version 1.2: This option should be considered experimental.
Changed in version 1.7: Support
auto
argument.
-
-c
path
¶ Don’t look for the
conf.py
in the source directory, but use the given configuration directory instead. Note that various other files and paths given by configuration values are expected to be relative to the configuration directory, so they will have to be present at this location too.New in version 0.3.
-
-C
¶
Don’t look for a configuration file; only take options via the
-D
option.New in version 0.5.
-
-D
setting=value
¶ Override a configuration value set in the
conf.py
file. The value must be a number, string, list or dictionary value.For lists, you can separate elements with a comma like this:
-D html_theme_path=path1,path2
.For dictionary values, supply the setting name and key like this:
-D latex_elements.docclass=scrartcl
.For boolean values, use
0
or1
as the value.Changed in version 0.6: The value can now be a dictionary value.
Changed in version 1.3: The value can now also be a list value.
-
-A
name=value
¶ Make the name assigned to value in the HTML templates.
New in version 0.5.
-
-n
¶
Run in nit-picky mode. Currently, this generates warnings for all missing references. See the config value :confval:`nitpick_ignore` for a way to exclude some references as “known missing”.
-
-N
¶
Do not emit colored output.
-
-v
¶
Increase verbosity (loglevel). This option can be given up to three times to get more debug logging output. It implies
-T
.New in version 1.2.
-
-q
¶
Do not output anything on standard output, only write warnings and errors to standard error.
-
-Q
¶
Do not output anything on standard output, also suppress warnings. Only errors are written to standard error.
-
-w
file
¶ Write warnings (and errors) to the given file, in addition to standard error.
-
-W
¶
Turn warnings into errors. This means that the build stops at the first warning and
sphinx-build
exits with exit status 1.
-
--keep-going
¶
With -W option, keep going processing when getting warnings to the end of build, and
sphinx-build
exits with exit status 1.New in version 1.8.
-
-T
¶
Display the full traceback when an unhandled exception occurs. Otherwise, only a summary is displayed and the traceback information is saved to a file for further analysis.
New in version 1.2.
-
-P
¶
(Useful for debugging only.) Run the Python debugger,
pdb
, if an unhandled exception occurs while building.
-
-h
,
--help
,
--version
¶
Display usage summary or Sphinx version.
New in version 1.2.
You can also give one or more filenames on the command line after the source and build directories. Sphinx will then try to build only these output files (and their dependencies).
Environment Variables¶
The sphinx-build refers following environment variables:
-
MAKE
A path to make command. A command name is also allowed. sphinx-build uses it to invoke sub-build process on make-mode.
Makefile Options
The Makefile
and make.bat
files created by
sphinx-quickstart usually run sphinx-build only with the
-b
and -d
options. However, they support the following
variables to customize behavior:
-
PAPER
This sets the
'papersize'
key of :confval:`latex_elements`: i.e.PAPER=a4
sets it to'a4paper'
andPAPER=letter
to'letterpaper'
.Note
Usage of this environment variable got broken at Sphinx 1.5 as
a4
orletter
ended up as option to LaTeX document in place of the neededa4paper
, resp.letterpaper
. Fixed at 1.7.7.
-
SPHINXBUILD
The command to use instead of
sphinx-build
.
-
BUILDDIR
The build directory to use instead of the one chosen in sphinx-quickstart.
-
SPHINXOPTS
Additional options for sphinx-build. These options can also be set via the shortcut variable O (capital ‘o’).
Deprecation Warnings¶
If any deprecation warning like RemovedInSphinxXXXWarning
are displayed
when building a user’s document, some Sphinx extension is using deprecated
features. In that case, please report it to author of the extension.
To disable the deprecation warnings, please set PYTHONWARNINGS=
environment
variable to your environment. For example:
PYTHONWARNINGS= make html
(Linux/Mac)export PYTHONWARNINGS=
and domake html
(Linux/Mac)set PYTHONWARNINGS=
and domake html
(Windows)modify your Makefile/make.bat and set the environment variable
See also¶
sphinx-quickstart(1)


Convert the angle COMMON_DEGREES° into radians. (answer in terms of pi)
SOLUTION
To convert from degrees to radians, you multiply by \pi
and then divide by 180^{\circ}
.
COMMON_DEGREES^{\circ} \times \dfrac{\pi}{(180^{\circ})}
COMMON_RADIANS\pi
Convert the angle NUM_DEGREES° into radians. (Round to the nearest hundredth of a radian.)
NUM_RADIANS radians
To convert from degrees to radians, you multiply by \pi
and then divide by 180^{\circ}
.
NUM_DEGREES^{\circ} \times \dfrac{\pi}{180^{\circ}}
NUM_RADIANS


View Source
Interface ITypeSelector
Namespace:Faker.Selectors
Assembly:Faker.dll
Syntax
public interface ITypeSelector
Properties
View Source
Priority
Settable priority which indicates the priority of this TypeSelector relative to the
other selectors for this type. A fake can execute multiple strategies for selecting a value of a
given type
Declaration
int Priority { get; set; }
Property Value
| Type |
Description |
| System.Int32 |
|
View Source
TargetType
The underlying Type used for this mapping
Declaration
Property Value
| Type |
Description |
| System.Type |
|
Methods
View Source
BeNull(Boolean)
Determines if we can allow nulls for a given type
Declaration
void BeNull(bool canBeNull = false)
Parameters
| Type |
Name |
Description |
| System.Boolean |
canBeNull |
If true, we can set nulls - false by default
|
View Source
CanBind(PropertyInfo)
Determines if this strategy can be successfully executed for this field.
Declaration
bool CanBind(PropertyInfo field)
Parameters
| Type |
Name |
Description |
| System.Reflection.PropertyInfo |
field |
This method determines whether or not we will attempt to execute this strategy for a given type.
|
Returns
| Type |
Description |
| System.Boolean |
true if we can go forward with this strategy, false otherwise.
|
View Source
CanBind(Type)
Determines if this strategy can be successfully executed for this type.
Declaration
Parameters
| Type |
Name |
Description |
| System.Type |
type |
The type of object to which we are attemping to bind.
|
Returns
| Type |
Description |
| System.Boolean |
true if this selector can bind to the provided type. False other
|
View Source
Generate(Object, PropertyInfo)
Injects the generator function into the property
Declaration
void Generate(object targetObject, PropertyInfo property)
Parameters
| Type |
Name |
Description |
| System.Object |
targetObject |
The target object designed for property injection
|
| System.Reflection.PropertyInfo |
property |
The meta-data for the current property we're testing
|
View Source
Generate(ref Object)
Directly assigns a generated value to the object itself, in the case of custom selectors
Declaration
object Generate(ref object targetObject)
Parameters
| Type |
Name |
Description |
| System.Object |
targetObject |
The object to be replaced with a generated value
|
Returns
| Type |
Description |
| System.Object |
|
View Source
GenerateInstance()
Generate an instance of the underlying selector.
Declaration
object GenerateInstance()
Returns
| Type |
Description |
| System.Object |
An object instance.
|


Contact Us
We’re here to keep you on two wheels. Give us a call with any questions, comments or feedback regarding any of our products. We’re available 9am-6pm on weekdays, 9-am-5pm at weekends.
%%include('../partials/copyright.html')
%%include('../partials/head.html', { "pageType": "contact" }) %%include('../partials/header.html') %%include('../partials/menu.html')We’re here to keep you on two wheels. Give us a call with any questions, comments or feedback regarding any of our products. We’re available 9am-6pm on weekdays, 9-am-5pm at weekends.


Software and Tools
This page is a collection of different tools that I use to make a PS Admin’s job easier. Some of these are freeware or open source while others are worth paying for.
Security
- Password Safe - Free Password Safe offers excellent security for all the passwords you manage. You could memorize your passwords (ugly), keep them on a spreadsheet (bad), or use Password Safe to keep all your passwords safely encrypted. The only password you need to remember is the safe’s master password. Once you open the safe, just double-click on the password you want to use and paste password. You don’t even need to know the underlying passwords! Password Safe also has a good password generator feature. You can set up the password rules and let it generate them for you.
- Keystore Explorer - Free Keystore Explorer is a great tool for working with java keystore files, like
pskey
. Thepskeymanager
wrapper only offers a subset of functions for the Javakeytool
program. Keystore Explorer offers the same features askeytool
but has a nice GUI to work with.
Server Administration
-
RDC Manager - Free If you are in a Windows-heavy environment, this tools is a great way to manage all of your servers and remote connections. RDC Manager easily organizes all of your servers into groups, lets you connect to multiple RDC sessions, and saves your login credentials.
-
mRemoteNG - Free remote desktop tool that supports both RDP and PuTTy SSH connections.
-
Beyond Compare = $30 or $50 for Pro Beyond Compare is the best file and directory compare utility. It is incredibly fast for comparing two folder together, changing what differences you see, easily compares complex files and can synchronize folders. Beyond Compare is also scriptable, so you can take advantage of it’s features on the command line.
Development
-
SublimeText - Free to Try, $70 SublimeText is my favorite text editor. There are many editors to choose from, and I’ve tried lots, but I keep coming back to SublimeText. SublimeText has lots of plug-ins for editing and syntax highlighting, and is very responsive with large files. Package Control is a plug-in manager for SublimeText that makes it easy to install new plug-ins. Install Package Control when you open Sublime Text for the first time.
-
Visual Studio Code - Free, Visual Studio Code is a streamlined code editor with support for development operations like debugging, task running and version control. It aims to provide just the tools a developer needs for a quick code-build-debug cycle and leaves more complex workflows to fuller featured IDEs.
-
Programmer’s File Editor - Free PFE has almost no modern features, but it does one thing well: it opens very large text files without any issues. Do you have 1GB trace file that needs to be searched? Use PFE.
-
SQR Express - $149 SQR Express is a great editor for SQR programs. The ability to run the program within the editor is wonderful and it has useful tools for writing SQR programs.
-
TraceMagic - Free TraceMagic simplifies much of the information in
.tracesql
files. TraceMagic will group SQL statements, show you all the tables in the FROM clause, tables that are being Updated or Inserted. It is much easier to find the errors using TraceMagic. You will need an Oracle Support account to download; search for Doc ID1470578.1
. -
SQL Developer - Free SQL Developer has really improved in the latest versions and I enjoy using it more than Toad. It’s a great SQL tool when working on Oracle databases. Not much else to say, it’s a solid tool.
-
PSChrome Extension - Free For Chrome only, but this extension has features to make working in PeopleSoft easier. I really like the Auto-Refresh on the Process Scheduler page and the Field Information mode. The Auto-Refresh will select the Refresh button on the Process Scheduler page at an interval you want. It’s a simple way to watch what is happening on the scheduler. The Field Information mode will let you click on any text box, button, or label on a page and it gives you the record and field name. That saves a trip to App Designer.
-
DataDumper Application Class - Free The DataDumper application class let’s you dump the structure and content of a PeopleCode object to file. You can even email the output so you don’t have find it on the server. Import the
CHG_DataDumper
class and away you go. There is even a great overview video on how to use the application class.
Documentation
-
Instiki - Free I have found that wiki is the best way to keep documentation as a PS Admin. Instiki is a very simple wiki that makes it easy to create pages, link topics, and reduces the amount of work to keep documentation up-to-date. It is a light-weight wiki based on Ruby on Rails which makes it easy to run on any server.
-
Confluence - A cheap and powerful tool for team documentation.
-
Trello - Trello is a Kanban board that is great for managing lists.
-
Slack - Free for small teams
Slack is essentially IRC, but web-based and app-based with better features. I love using it with remote teams because it replaces the hallway discussions and creates better communication within teams.


Groovy’s groovy-sql
module provides a higher-level abstraction over Java’s JDBC technology. JDBC itself provides
a lower-level but fairly comprehensive API which provides uniform access to a whole variety of supported relational database systems.
We’ll use HSQLDB in our examples here but you can alternatively use Oracle, SQL Server, MySQL and a host of others.
The most frequently used class within the groovy-sql
module is the groovy.sql.Sql
class which raises the JDBC
abstractions up one level. We’ll cover that first.
1. Connecting to the database
Connecting to a database with Groovy’s Sql
class requires four pieces of information:
-
The database uniform resource locator (URL)
-
Username
-
Password
-
The driver class name (which can be derived automatically in some situations)
For our HSQLDB database, the values will be something like that shown in the following table:
| Property | Value |
|---|---|
url |
|
user |
sa (or your username) |
password |
yourPassword |
driver |
|
Consult the documentation for the JDBC driver that you plan to use to determine the correct values for your situation.
The Sql
class has a newInstance
factory method which takes these parameters. You would typically use it as follows:
import groovy.sql.Sql
def url = 'jdbc:hsqldb:mem:yourDB'
def user = 'sa'
def password = ''
def driver = 'org.hsqldb.jdbcDriver'
def sql = Sql.newInstance(url, user, password, driver)
// use 'sql' instance ...
sql.close()
If you don’t want to have to handle resource handling yourself (i.e. call close()
manually) then you can use the withInstance
variation as shown here:
withInstance
variation)Sql.withInstance(url, user, password, driver) { sql ->
// use 'sql' instance ...
}
1.1. Connecting with a DataSource
It is often preferred to use a DataSource. You may have one available to you from a connection pool. Here we’ll use the one provided as part of the HSQLDB driver jar as shown here:
import groovy.sql.Sql
import org.hsqldb.jdbc.JDBCDataSource
def dataSource = new JDBCDataSource(
database: 'jdbc:hsqldb:mem:yourDB', user: 'sa', password: '')
def sql = new Sql(dataSource)
// use then close 'sql' instance ...
If you have your own connection pooling, the details will be different, e.g. for Apache Commons DBCP:
@Grab('commons-dbcp:commons-dbcp:1.4')
import groovy.sql.Sql
import org.apache.commons.dbcp.BasicDataSource
def ds = new BasicDataSource(driverClassName: "org.hsqldb.jdbcDriver",
url: 'jdbc:hsqldb:mem:yourDB', username: 'sa', password: '')
def sql = new Sql(ds)
// use then close 'sql' instance ...
1.2. Connecting using @Grab
The previous examples assume that the necessary database driver jar is already on your classpath.
For a self-contained script you can add @Grab
statements to the top of the script to automatically download the necessary jar as shown here:
@Grab('org.hsqldb:hsqldb:2.3.2')
@GrabConfig(systemClassLoader=true)
// create, use, and then close sql instance ...
The @GrabConfig
statement is necessary to make sure the system classloader is used. This ensures that the driver classes and
system classes like java.sql.DriverManager
are in the same classloader.
2. Executing SQL
You can execute arbitrary SQL commands using the execute()
method. Let’s have a look at using it to create a table.
2.1. Creating tables
The simplest way to execute SQL is to call the execute()
method passing the SQL you wish to execute as a String as shown here:
// ... create 'sql' instance
sql.execute '''
CREATE TABLE Author (
id INTEGER GENERATED BY DEFAULT AS IDENTITY,
firstname VARCHAR(64),
lastname VARCHAR(64)
);
'''
// close 'sql' instance ...
There is a variant of this method which takes a GString and another with a list of parameters. There are also other variants with similar names: executeInsert
and executeUpdate
.
We’ll see examples of these variants in other examples in this section.
3. Basic CRUD operations
The basic operations on a database are Create, Read, Update and Delete (the so-called CRUD operations). We’ll examine each of these in turn.
3.1. Creating/Inserting data
You can use the same execute()
statement we saw earlier but to insert a row by using a SQL insert statement as follows:
sql.execute "INSERT INTO Author (firstname, lastname) VALUES ('Dierk', 'Koenig')"
You can use a special executeInsert
method instead of execute
. This will return a list of all keys generated.
Both the execute
and executeInsert
methods allow you to place '?' placeholders into your SQL string and supply a list of parameters.
In this case a PreparedStatement is used which avoids any risk of SQL injection. The following example illustrates executeInsert
using placeholders and parameters:
def insertSql = 'INSERT INTO Author (firstname, lastname) VALUES (?,?)'
def params = ['Jon', 'Skeet']
def keys = sql.executeInsert insertSql, params
assert keys[0] == [1]
In addition, both the execute
and executeInsert
methods allow you to use GStrings. Any '$' placeholders within the SQL are assumed
to be placeholders. An escaping mechanism exists if you want to supply part of the GString with a variable in a
position which isn’t where normal placeholders go within SQL. See the GroovyDoc for more details.
Also, executeInsert
allows you to supply a list of key column names, when multiple keys are returned and you are only interested in some of them.
Here is a fragment illustrating key name specification and GStrings:
def first = 'Guillaume'
def last = 'Laforge'
def myKeyNames = ['ID']
def myKeys = sql.executeInsert """
INSERT INTO Author (firstname, lastname)
VALUES (${first}, ${last})
""", myKeyNames
assert myKeys[0] == [ID: 2]
3.2. Reading rows
Reading rows of data from the database is accomplished using one of several available methods: query
, eachRow
, firstRow
and rows
.
Use the query
method if you want to iterate through the ResultSet
returned by the underlying JDBC API as shown here:
query
def expected = ['Dierk Koenig', 'Jon Skeet', 'Guillaume Laforge']
def rowNum = 0
sql.query('SELECT firstname, lastname FROM Author') { resultSet ->
while (resultSet.next()) {
def first = resultSet.getString(1)
def last = resultSet.getString('lastname')
assert expected[rowNum++] == "$first $last"
}
}
Use the eachRow
method if you want if you want a slightly higher-level abstraction which provides a Groovy friendly map-like abstraction for the ResultSet
as shown here:
eachRow
rowNum = 0
sql.eachRow('SELECT firstname, lastname FROM Author') { row ->
def first = row[0]
def last = row.lastname
assert expected[rowNum++] == "$first $last"
}
Note that you can use Groovy list-style and map-style notations when accessing the row of data.
Use the firstRow
method if you for similar functionality as eachRow
but returning only one row of data as shown here:
firstRow
def first = sql.firstRow('SELECT lastname, firstname FROM Author')
assert first.values().sort().join(',') == 'Dierk,Koenig'
Use the rows
method if you want to process a list of map-like data structures as shown here:
rows
List authors = sql.rows('SELECT firstname, lastname FROM Author')
assert authors.size() == 3
assert authors.collect { "$it.FIRSTNAME ${it[-1]}" } == expected
Note that the map-like abstraction has case-insensitive keys (hence we can use 'FIRSTNAME' or 'firstname' as the key) and also that -ve indices (a standard Groovy feature) works when using an index value (to count column numbers from the right).
You can also use any of the above methods to return scalar values, though typically firstRow
is all that is required in such cases. An example returning the count of rows is shown here:
assert sql.firstRow('SELECT COUNT(*) AS num FROM Author').num == 3
3.3. Updating rows
Updating rows can again be done using the execute()
method. Just use a SQL update statement as the argument to the method.
You can insert an author with just a lastname and then update the row to also have a firstname as follows:
sql.execute "INSERT INTO Author (lastname) VALUES ('Thorvaldsson')"
sql.execute "UPDATE Author SET firstname='Erik' where lastname='Thorvaldsson'"
There is also a special executeUpdate
variant which returns the number of rows updated as a result of executing the SQL.
For example, you can change the lastname of an author as follows:
def updateSql = "UPDATE Author SET lastname='Pragt' where lastname='Thorvaldsson'"
def updateCount = sql.executeUpdate updateSql
assert updateCount == 1
def row = sql.firstRow "SELECT * FROM Author where firstname = 'Erik'"
assert "${row.firstname} ${row.lastname}" == 'Erik Pragt'
4. Advanced SQL operations
4.1. Working with transactions
The easiest way to perform database operations within a transaction is to include the database operation within a withTransaction
closure as shown in the following example:
assert sql.firstRow('SELECT COUNT(*) as num FROM Author').num == 0
sql.withTransaction {
sql.execute "INSERT INTO Author (firstname, lastname) VALUES ('Dierk', 'Koenig')"
sql.execute "INSERT INTO Author (firstname, lastname) VALUES ('Jon', 'Skeet')"
}
assert sql.firstRow('SELECT COUNT(*) as num FROM Author').num == 2
Here the database starts empty and has two rows after successful completion of the operation. Outside the scope of the transaction, the database is never seen as having just one row.
If something goes wrong, any earlier operations within the withTransaction
block are rolled back.
We can see that in operation in the following example where we use database metadata (more details coming up shortly) to find the
maximum allowable size of the firstname
column and then attempt to enter a firstname one larger than that maximum value as shown here:
def maxFirstnameLength
def metaClosure = { meta -> maxFirstnameLength = meta.getPrecision(1) }
def rowClosure = {}
def rowCountBefore = sql.firstRow('SELECT COUNT(*) as num FROM Author').num
try {
sql.withTransaction {
sql.execute "INSERT INTO Author (firstname) VALUES ('Dierk')"
sql.eachRow "SELECT firstname FROM Author WHERE firstname = 'Dierk'", metaClosure, rowClosure
sql.execute "INSERT INTO Author (firstname) VALUES (?)", 'X' * (maxFirstnameLength + 1)
}
} catch(ignore) { println ignore.message }
def rowCountAfter = sql.firstRow('SELECT COUNT(*) as num FROM Author').num
assert rowCountBefore == rowCountAfter
Even though the first sql execute succeeds initially, it will be rolled back and the number of rows will remain the same.
4.2. Using batches
When dealing with large volumes of data, particularly when inserting such data, it can be more efficient to chunk the data into batches. This is done
using the withBatch
statement as shown in the following example:
sql.withBatch(3) { stmt ->
stmt.addBatch "INSERT INTO Author (firstname, lastname) VALUES ('Dierk', 'Koenig')"
stmt.addBatch "INSERT INTO Author (firstname, lastname) VALUES ('Paul', 'King')"
stmt.addBatch "INSERT INTO Author (firstname, lastname) VALUES ('Guillaume', 'Laforge')"
stmt.addBatch "INSERT INTO Author (firstname, lastname) VALUES ('Hamlet', 'D''Arcy')"
stmt.addBatch "INSERT INTO Author (firstname, lastname) VALUES ('Cedric', 'Champeau')"
stmt.addBatch "INSERT INTO Author (firstname, lastname) VALUES ('Erik', 'Pragt')"
stmt.addBatch "INSERT INTO Author (firstname, lastname) VALUES ('Jon', 'Skeet')"
}
After executing these statements, there will be 7 new rows in the database. In fact, they will have been added in batches
even though you can’t easily tell that after that fact. If you want to confirm what is going on under the covers, you can
add a little bit of extra logging into your program. Add the following lines before the withBatch
statement:
import java.util.logging.*
// next line will add fine logging
Logger.getLogger('groovy.sql').level = Level.FINE
// also adjust logging.properties file in JRE_HOME/lib to have:
// java.util.logging.ConsoleHandler.level = FINE
With this extra logging turned on, and the changes made as per the above comment for the logging.properties file, you should see output such as:
FINE: Successfully executed batch with 3 command(s)
Apr 19, 2015 8:38:42 PM groovy.sql.BatchingStatementWrapper processResult
FINE: Successfully executed batch with 3 command(s)
Apr 19, 2015 8:38:42 PM groovy.sql.BatchingStatementWrapper processResult
FINE: Successfully executed batch with 1 command(s)
Apr 19, 2015 8:38:42 PM groovy.sql.Sql getStatement
We should also note, that any combination of SQL statements can be added to the batch. They don’t all have to be inserting a new row to the same table.
We noted earlier that to avoid SQL injection, we encourage you to use prepared statements, this is achieved using the variants of methods which take GStrings or a list of extra parameters. Prepared statements can be used in combination with batches as shown in the following example:
def qry = 'INSERT INTO Author (firstname, lastname) VALUES (?,?)'
sql.withBatch(3, qry) { ps ->
ps.addBatch('Dierk', 'Koenig')
ps.addBatch('Paul', 'King')
ps.addBatch('Guillaume', 'Laforge')
ps.addBatch('Hamlet', "D'Arcy")
ps.addBatch('Cedric', 'Champeau')
ps.addBatch('Erik', 'Pragt')
ps.addBatch('Jon', 'Skeet')
}
This provides a much safer option if the data could come from a user such as via a script or a web form. Of course, given that a prepared statement is being used, you are limited to a batch of the same SQL operation (insert in our example) to the one table.
4.3. Performing pagination
When presenting large tables of data to a user, it is often convenient to present information a page at
a time. Many of Groovy’s SQL retrieval methods have extra parameters which can be used to select a particular
page of interest. The starting position and page size are specified as integers as shown in the following example
using rows
:
def qry = 'SELECT * FROM Author'
assert sql.rows(qry, 1, 3)*.firstname == ['Dierk', 'Paul', 'Guillaume']
assert sql.rows(qry, 4, 3)*.firstname == ['Hamlet', 'Cedric', 'Erik']
assert sql.rows(qry, 7, 3)*.firstname == ['Jon']
4.4. Fetching metadata
JDBC metadata can be retrieved in numerous ways. Perhaps the most basic approach is to extract the metadata from any row as shown in the following example which examines the tablename, column names and column type names:
sql.eachRow("SELECT * FROM Author WHERE firstname = 'Dierk'") { row ->
def md = row.getMetaData()
assert md.getTableName(1) == 'AUTHOR'
assert (1..md.columnCount).collect{ md.getColumnName(it) } == ['ID', 'FIRSTNAME', 'LASTNAME']
assert (1..md.columnCount).collect{ md.getColumnTypeName(it) } == ['INTEGER', 'VARCHAR', 'VARCHAR']
}
And another slight variant to the previous example, this time also looking at the column label:
sql.eachRow("SELECT firstname AS first FROM Author WHERE firstname = 'Dierk'") { row ->
def md = row.getMetaData()
assert md.getColumnName(1) == 'FIRSTNAME'
assert md.getColumnLabel(1) == 'FIRST'
}
Accessing metadata is quite common, so Groovy also provides variants to many of its methods that let you
supply a closure that will be called once with the row metadata in addition to the normal row closure
which is called for each row. The following example illustrates the two closure variant for eachRow
:
def metaClosure = { meta -> assert meta.getColumnName(1) == 'FIRSTNAME' }
def rowClosure = { row -> assert row.FIRSTNAME == 'Dierk' }
sql.eachRow("SELECT firstname FROM Author WHERE firstname = 'Dierk'", metaClosure, rowClosure)
Note that our SQL query will only return one row, so we could have equally used firstRow
for the previous example.
Finally, JDBC also provides metadata per connection (not just for rows). You can also access such metadata from Groovy as shown in this example:
def md = sql.connection.metaData
assert md.driverName == 'HSQL Database Engine Driver'
assert md.databaseProductVersion == '2.3.2'
assert ['JDBCMajorVersion', 'JDBCMinorVersion'].collect{ md[it] } == [4, 0]
assert md.stringFunctions.tokenize(',').contains('CONCAT')
def rs = md.getTables(null, null, 'AUTH%', null)
assert rs.next()
assert rs.getString('TABLE_NAME') == 'AUTHOR'
Consult the JavaDoc for your driver to find out what metadata information is available for you to access.
4.5. Named and named-ordinal parameters
Groovy supports some additional alternative placeholder syntax variants. The GString variants
are typically preferred over these alternatives but the alternatives are useful for Java integration
purposes and sometimes in templating scenarios where GStrings might already be in heavy use as part
of a template. The named parameter variants are much like the String plus list of parameter variants but
instead of having a list of ?
placeholders followed by a list of parameters, you have one or more
placeholders having the form :propName
or ?.propName
and a single map, named arguments or a
domain object as the parameter. The map or domain object should have a property named propName
corresponding to each supplied placeholder.
Here is an example using the colon form:
sql.execute "INSERT INTO Author (firstname, lastname) VALUES (:first, :last)", first: 'Dierk', last: 'Koenig'
And another example using the question mark form:
sql.execute "INSERT INTO Author (firstname, lastname) VALUES (?.first, ?.last)", first: 'Jon', last: 'Skeet'
If the information you need to supply is spread across multiple maps or domain objects you can use the question mark form with an additional ordinal index as shown here:
class Rockstar { String first, last }
def pogo = new Rockstar(first: 'Paul', last: 'McCartney')
def map = [lion: 'King']
sql.execute "INSERT INTO Author (firstname, lastname) VALUES (?1.first, ?2.lion)", pogo, map
4.6. Stored procedures
The exact syntax for creating a stored procedure or function varies slightly between different databases. For the HSQLDB database we are using, we can create a stored function which returns the initials of all authors in a table as follows:
sql.execute """
CREATE FUNCTION SELECT_AUTHOR_INITIALS()
RETURNS TABLE (firstInitial VARCHAR(1), lastInitial VARCHAR(1))
READS SQL DATA
RETURN TABLE (
SELECT LEFT(Author.firstname, 1) as firstInitial, LEFT(Author.lastname, 1) as lastInitial
FROM Author
)
"""
We can use a SQL CALL
statement to invoke the function using Groovy’s normal SQL retrieval methods.
Here is an example using eachRow
.
def result = []
sql.eachRow('CALL SELECT_AUTHOR_INITIALS()') {
result << "$it.firstInitial$it.lastInitial"
}
assert result == ['DK', 'JS', 'GL']
Here is the code for creating another stored function, this one taking the lastname as a parameter:
sql.execute """
CREATE FUNCTION FULL_NAME (p_lastname VARCHAR(64))
RETURNS VARCHAR(100)
READS SQL DATA
BEGIN ATOMIC
DECLARE ans VARCHAR(100);
SELECT CONCAT(firstname, ' ', lastname) INTO ans
FROM Author WHERE lastname = p_lastname;
RETURN ans;
END
"""
We can use the placeholder syntax to specify where the parameter belongs and note the special placeholder position to indicate the result:
def result = sql.firstRow("{? = call FULL_NAME(?)}", ['Koenig'])
assert result[0] == 'Dierk Koenig'
Finally, here is a stored procedure with input and output parameters:
sql.execute """
CREATE PROCEDURE CONCAT_NAME (OUT fullname VARCHAR(100),
IN first VARCHAR(50), IN last VARCHAR(50))
BEGIN ATOMIC
SET fullname = CONCAT(first, ' ', last);
END
"""
To use the CONCAT_NAME
stored procedure parameter, we make use of a special call
method. Any input parameters are simply provided
as parameters to the method call. For output parameters, the resulting type must be specified as shown here:
sql.call("{call CONCAT_NAME(?, ?, ?)}", [Sql.VARCHAR, 'Dierk', 'Koenig']) {
fullname -> assert fullname == 'Dierk Koenig'
}


To provide a high dimensional grouped variable selection approach for detection of whole-genome SNP effects and SNP-SNP interactions, as described in Fang et al. (2017, under review).
| Version: | 0.1 |
| Depends: | R (≥ 3.2.3), glmnet, MASS, stats |
| Published: | 2017-04-18 |
| Author: | Yao-Hwei Fang, Jie-Huei Wang, and Chao A. Hsiung |
| Maintainer: | Yao-Hwei Fang <yhfang at nhri.org.tw> |
| License: | GPL-2 | GPL-3 [expanded from: GPL (≥ 2)] |
| NeedsCompilation: | no |
| CRAN checks: | TSGSIS results |
| Reference manual: | TSGSIS.pdf |
| Package source: | TSGSIS_0.1.tar.gz |
| Windows binaries: | r-devel: TSGSIS_0.1.zip, r-release: TSGSIS_0.1.zip, r-oldrel: TSGSIS_0.1.zip |
| OS X binaries: | r-release: TSGSIS_0.1.tgz, r-oldrel: TSGSIS_0.1.tgz |
Please use the canonical form https://CRAN.R-project.org/package=TSGSIS to link to this page.


My name is Yue Tang. Authentic Chinese currently living in Seattle. I am a positive and life-lasting learner. I am interested in all kinds of knowledge and passionate in Coding, Writing, Reading, Communicating, Listening and Sporting. Happy to meet you here!
This is a simple project to show my personal admiration and express my gratitude to one of the greatest man in whole history, Mr. Longping Yuan, who use hybird rice to solve hunger problems of billions of people.
This survey aims at collecting the students' opinion and suggestion on school events. It is a simple but very clear survey webpage design.
© 2019 Yue "Vanessa" Tang


Also called: potential failure modes and effects analysis; failure modes, effects and criticality analysis (FMECA).
Failure modes and effects analysis (FMEA) is a step-by-step approach for identifying all possible failures in a design, a manufacturing or assembly process, or a product or service.
“Failure modes” means the ways, or modes, in which something might fail. Failures are any errors or defects, especially ones that affect the customer, and can be potential or actual.
“Effects analysis” refers to studying the consequences of those failures.
Failures are prioritized according to how serious their consequences are, how frequently they occur and how easily they can be detected. The purpose of the FMEA is to take actions to eliminate or reduce failures, starting with the highest-priority ones.
Failure modes and effects analysis also documents current knowledge and actions about the risks of failures, for use in continuous improvement. FMEA is used during design to prevent failures. Later it’s used for control, before and during ongoing operation of the process. Ideally, FMEA begins during the earliest conceptual stages of design and continues throughout the life of the product or service.
Begun in the 1940s by the U.S. military, FMEA was further developed by the aerospace and automotive industries. Several industries maintain formal FMEA standards.
What follows is an overview and reference. Before undertaking an FMEA process, learn more about standards and specific methods in your organization and industry through other references and training.
When to Use FMEA
- When a process, product or service is being designed or redesigned, after quality function deployment.
- When an existing process, product or service is being applied in a new way.
- Before developing control plans for a new or modified process.
- When improvement goals are planned for an existing process, product or service.
- When analyzing failures of an existing process, product or service.
- Periodically throughout the life of the process, product or service
FMEA Procedure
(Again, this is a general procedure. Specific details may vary with standards of your organization or industry.)
- Assemble a cross-functional team of people with diverse knowledge about the process, product or service and customer needs. Functions often included are: design, manufacturing, quality, testing, reliability, maintenance, purchasing (and suppliers), sales, marketing (and customers) and customer service.
- Identify the scope of the FMEA. Is it for concept, system, design, process or service? What are the boundaries? How detailed should we be? Use flowcharts to identify the scope and to make sure every team member understands it in detail. (From here on, we’ll use the word “scope” to mean the system, design, process or service that is the subject of your FMEA.)
- Fill in the identifying information at the top of your FMEA form. Figure 1 shows a typical format. The remaining steps ask for information that will go into the columns of the form.
Figure 1 FMEA Example (click image to enlarge)
- Identify the functions of your scope. Ask, “What is the purpose of this system, design, process or service? What do our customers expect it to do?” Name it with a verb followed by a noun. Usually you will break the scope into separate subsystems, items, parts, assemblies or process steps and identify the function of each.
- For each function, identify all the ways failure could happen. These are potential failure modes. If necessary, go back and rewrite the function with more detail to be sure the failure modes show a loss of that function.
- For each failure mode, identify all the consequences on the system, related systems, process, related processes, product, service, customer or regulations. These are potential effects of failure. Ask, “What does the customer experience because of this failure? What happens when this failure occurs?”
- Determine how serious each effect is. This is the severity rating, or S. Severity is usually rated on a scale from 1 to 10, where 1 is insignificant and 10 is catastrophic. If a failure mode has more than one effect, write on the FMEA table only the highest severity rating for that failure mode.
- For each failure mode, determine all the potential root causes. Use tools classified as cause analysis tool, as well as the best knowledge and experience of the team. List all possible causes for each failure mode on the FMEA form.
- For each cause, determine the occurrence rating, or O. This rating estimates the probability of failure occurring for that reason during the lifetime of your scope. Occurrence is usually rated on a scale from 1 to 10, where 1 is extremely unlikely and 10 is inevitable. On the FMEA table, list the occurrence rating for each cause.
- For each cause, identify current process controls. These are tests, procedures or mechanisms that you now have in place to keep failures from reaching the customer. These controls might prevent the cause from happening, reduce the likelihood that it will happen or detect failure after the cause has already happened but before the customer is affected.
- For each control, determine the detection rating, or D. This rating estimates how well the controls can detect either the cause or its failure mode after they have happened but before the customer is affected. Detection is usually rated on a scale from 1 to 10, where 1 means the control is absolutely certain to detect the problem and 10 means the control is certain not to detect the problem (or no control exists). On the FMEA table, list the detection rating for each cause.
- (Optional for most industries) Is this failure mode associated with a critical characteristic? (Critical characteristics are measurements or indicators that reflect safety or compliance with government regulations and need special controls.) If so, a column labeled “Classification” receives a Y or N to show whether special controls are needed. Usually, critical characteristics have a severity of 9 or 10 and occurrence and detection ratings above 3.
- Calculate the risk priority number, or RPN, which equals S × O × D. Also calculate Criticality by multiplying severity by occurrence, S × O. These numbers provide guidance for ranking potential failures in the order they should be addressed.
- Identify recommended actions. These actions may be design or process changes to lower severity or occurrence. They may be additional controls to improve detection. Also note who is responsible for the actions and target completion dates.
- As actions are completed, note results and the date on the FMEA form. Also, note new S, O or D ratings and new RPNs.
FMEA Example
A bank performed a process FMEA on their ATM system. Figure 1 shows part of it—the function “dispense cash” and a few of the failure modes for that function. The optional “Classification” column was not used. Only the headings are shown for the rightmost (action) columns.
Notice that RPN and criticality prioritize causes differently. According to the RPN, “machine jams” and “heavy computer network traffic” are the first and second highest risks.
One high value for severity or occurrence times a detection rating of 10 generates a high RPN. Criticality does not include the detection rating, so it rates highest the only cause with medium to high values for both severity and occurrence: “out of cash.” The team should use their experience and judgment to determine appropriate priorities for action.
Excerpted from Nancy R. Tague’s The Quality Toolbox, Second Edition, ASQ Quality Press, 2004, pages 236–240.


There are 4 main alternatives when it comes to running custom JS:
pager.childManager
if you want to be notified whenever a navigation has happened.
It is not recommended to try to stop the navigation at this point since it would involve changing the
history.
click
if you want to be notified when a navigation is about to happen and
you want a chance to stop it. Just do not return true;
in order to stop the navigation.
click
if you want to control a certain navigation. This is probably what you
want to do if you want to inject validation.
afterShow
, since they put the processing of their bindings on the event queue (possible
out of performance reasons).
If you want your code to execute after their bindings are processed you either have to be able
to jack into their bindings version of afterShow
(if they got one)
or put your code on the event queue too.

 Fry Hide Fry

afterFryIsDisplayed:function () { $('body').css("background-color", "#FF9999"); } beforeFryIsHidden:function () { $('body').stop().css("background-color", "#FFFFFF"); }


EBD - Easton Bible DIctionary
Basilisk
BASILISK
"BASILISK "(in R.V.,
Isaiah 11:8
;
14:29
;
59:5
;
Jeremiah 8:17
), the “king serpent,” as the name imports; a fabulous serpent said to be three spans long, with a spot on its head like a crown. Probably the yellow snake is intended. (See COCKATRICE.)
"BASILISK "(in R.V., Isaiah 11:8; 14:29; 59:5; Jeremiah 8:17), the “king serpent,” as the name imports; a fabulous serpent said to be three spans long, with a spot on its head like a crown. Probably the yellow snake is intended. (See COCKATRICE.)