What is Scholarly HTML?
Abstract
Scholarly HTML is a domain-specific data format built entirely on open standards that enables the interoperable exchange of scholarly articles in a manner that is compatible with off-the-shelf browsers. This document describes how Scholarly HTML works and how it is encoded as a document. It is, itself, written in Scholarly HTML.
Motivation
Scholarly articles are still primarily encoded as unstructured graphics formats in which most of the information initially created by research, or even just in the text, is lost. This was an acceptable, if deplorable, condition when viable alternatives did not seem possible, but document technology has today reached a level of maturity and universality that makes this situation no longer tenable. Information cannot be disseminated if it is destroyed before even having left its creator’s laptop.
According to the New York Times, adding structured information to their recipes (instead of exposing simply as plain text) improved their discoverability to the point of producing an immediate rise of 52 percent in traffic (NYT, 2014). At this point in time, cupcake recipes are reaping greater benefits from modern data format practices than the whole scientific endeavour.
This is not solely a loss for the high principles of knowledge sharing in science, it also has very immediate pragmatic consequences. Any tool, any service that tries to integrate with scholarly publishing has to spend the brunt of its complexity (or budget) extracting data the author would have willingly shared out of antiquated formats. This places stringent limits on the improvement of the scholarly toolbox, on the discoverability of scientific knowledge, and particularly on processes of meta-analysis.
To address these issues, we have followed an approach rooted in established best practices for the reuse of open, standard formats. The «HTML Vernacular» body of practice provides guidelines for the creation of domain-specific data formats that make use of HTML’s inherent extensibility (Science.AI, 2015b). Using the vernacular foundation overlaid with «schema.org» metadata we have produced a format for the interchange of scholarly articles built on open standards, ready for all to use.
Our high-level goals were:
- Uncompromisingly enabling structured metadata, accessibility, and internationalisation.
- Pragmatically working in Web browsers, even if it occasionally incurs some markup overhead.
- Powerfully customisable for inclusion in arbitrary Web sites, while remaining easy to process and interoperable.
- Entirely built on top of open, royalty-free standards.
- Long-term viability as a data format.
Additionally, in view of the specific problem we addressed, in the creation of this vernacular we have favoured the reliability of interchange over ease of authoring; but have nevertheless attempted to cater to the latter as much as possible. A decent boilerplate template file can certainly make authoring relatively simple, but not as radically simple as it can be. For such use cases, Scholarly HTML provides a great output target and overview of the data model required to support scholarly publishing at the document level.
An example of an authoring format that was designed to target Scholarly HTML as an output is the DOCX Standard Scientific Style which enables authors who are comfortable with Microsoft Word to author documents that have a direct upgrade path to semantic, standard content.
Where semantic modelling is concerned, our approach is to stick as much as possible to schema.org. Beyond the obvious advantages there are in reusing a vocabulary that is supported by all the major search engines and is actively being developed towards enabling a shared understanding of many useful concepts, it also provides a protection against «ontological drift» whereby a new vocabulary is defined by a small group with insufficient input from a broader community of practice. A language that solely a single participant understands is of limited value.
In a small, circumscribed number of cases we have had to depart from
schema.org, using the https://ns.science.ai/
(prefixed with sa:
) vocabulary instead
(Science.AI, 2015a). Our goal is
to work with schema.org in order to extend their
vocabulary, and we will align our usage with the outcome of these discussions.
Definition
A Scholarly HTML document is a valid HTML document that follows some additional rules to specialise its meaning and make it predictable to processors wishing to produce or consume scholarly articles. These rules are outlined in the following sections.
Please note that in its current state this specification is often informal in the manner in which it describes its constraints. This is to facilitate review by people unfamiliar with formal specification writing. As the format solidifies, it will be made more formal progressively (but attempt to remain readable).
File & Supporting Structure
The document must be encoded in UTF-8, and transmitted with a media type of
text/html
. It must feature a DOCTYPE
as its preamble.
The html
root element must feature a valid lang
attribute.
The head
element of the document must contain a
<meta charset="utf-8">
element (preferable as its
first child), a
<meta name="viewport" content="width=device-width">
element (and no other viewport meta
), and a title
element. All
the other content of the head
is ignored.
The body
element must have a prefix
attribute, which must
declare the following mapping:
| Prefix | URL |
|---|---|
| schema | http://schema.org/ |
| xsd | http://www.w3.org/2001/XMLSchema# |
| sa | https://ns.science.ai/ |
Having to declare prefixes is undoubtably an annoyance and it does hurt the human
authorability of the format (since hand-creating a document essentially requires a
boilerplate prefix declaration). This trade-off is made for several reasons. The most
important motivation is that having predictable prefixes means that the content can be
styled with CSS using reliable attribute selectors on the semantic information that
describes the document’s structure. The alternative would be to use URLs everywhere,
such that instead of sa:Abstract
we would have
https://ns.science.ai/Abstract
; but in practice that approach is more
painful since the content then becomes bloated with URLs that are longer than is
comfortable.
The RDFa content of the article must systematically make use of these prefixes when the
values match their URLs as prefixes. Authors may declare other prefix-URL mappings in
the prefix
attribute of the body
element (or
prefix
attributes elsewhere), including other prefixes mapping to the same
URLs if needed, but inside of the article’s content these prefixes must be used for
these URLs.
Article Structure
The article content is everything that is contained inside the first
article
element in document order that has a
typeof="schema:ScholarlyArticle"
. Everything part of the body
outside of that subtree is ignored. This enables publishers to surround the article
content with any amount of supporting markup, for instance for headers, footers,
or navigation, as well as to wrap the article inside arbitrary markup that may be
needed for stylistic reasons.
The article
element should have
a resource
attribute, usually with a value
of #
. The reason for that is to grant it a
URL that can be targeted by other properties. The
resource
attribute can take any value, but it
must then be matched by the
about
attributes of the properties targeting
it. If resource
is omitted, the only way in
which those properties can target it is by knowing the URL
from which the document was retrieved.
The first element child of the article
element must be an h1
heading that serves as the primary title for the document. It may itself contain markup.
The white-space-normalised text value of the h1
must appear as a substring
of the white-space-normalised text value of the title
element. This ensures
semantic alignment between the two, while enabling publishers to add their name to the
title
so as to identify themselves there alongside the content.
Any children of article
that are not section
elements are
ignored.
The first section
child element of the article
must be the
Authors and Affiliations section. It has no typeof
and its specific rules are outlined in its own chapter below.
The section
elements can be nested arbitrarily deep. Each
section
element must have as its first element child an hX
heading element the numeric part of which must be the number of section
ancestor elements that heading elements has up to the article
element, plus
one. If the numeric part is greater than 6, then h6
must be used but an
aria-level
attribute must be added that reflects the accurate depth.
(The aria-level
attribute can be used at lower depths but is not required
there.)
Each section
element may contain an arbitrary number of
hunk elements, followed by an arbitrary number of
section
elements being subsections. Note that
hunk elements must imperatively appear before the
subsections.
Sections are expected to be typed using the typeof
attribute. The following
typeof
values are currently understood:
sa:Funding
(which has its specific structure)sa:Abstract
sa:MaterialsAndMethods
sa:Results
sa:Conclusion
sa:Acknowledgements
sa:ReferenceList
Hopefully these types are largely self-documenting, they are described further in the Scholarly Article ontology (Science.AI, 2015a).
The section typed sa:ReferenceList
has special processing rules described
in the References section.
Hunk Elements
Hunk elements are the meaningful blocks from which sections are built. They contain text and inline elements. There are several types of hunk elements.
The most common hunk element is p
, which is used to capture paragraphs. It
requires no special processing.
The blockquote
, ul
, ol
, and dl
elements can be used as they typically would and require no special treatment.
The aside
hunk element is used to capture text boxes. If it contains an
hX
heading element, that element must be its first element child and its
numeric part must reflect its depth, making use of aria-level
according to
the same rules as apply for section
. The other children of
aside
must all be hunk elements.
The figure
element is a general container for content units that are
embedded inside the main body of the text. It can come in several flavours that are
dictated by its typeof
attribute.
If figure
has typeof="sa:Image"
then it is an image container.
It must contain an img
child element and should contain a
figcaption
labelling that image. An example of an image figure would be:
If figure
has typeof="sa:Table"
then it is a table container.
It must contain nothing other than a table
element. If a caption is
available, it should be included using the caption
child element of the
table
, and not the figcaption
child of the
figure
.
If figure
has typeof="sa:Formula"
then it is a formula
container. It must contain a math
element and optionally a
figcaption
describing the formula. The math
element must be
valid MathML 3. Additionally, given the dismal state of support for MathML in Web
browser the math
element must contain an annotation
descendant with the TeX equivalent of the formula.
If figure
has typeof="schema:SoftwareSourceCode"
then it is a code container. It must contain a pre
element
and optionally a figcaption
. The pre
element must contain as
its only child a code
element.
If you wish to specify the type of the language used in the code, the
figure
needs to have a schema:programmingLanguage
property
containing a type schema:Language
, itself with a schema:name
containing the the lowercase name of one of the languages from the
list
of programming languages. Canonically, this would look like the following source:
Inline Elements
Inline elements essentially decorate, describe, and enrich text. Inside of
hunk elements, of heading elements, and of captioning
elements (caption
and figcaption
) the following inline
elements can be used (and where applicable they can nest within one another):
a
abbr
bdi
bdo
cite
code
data
del
dfn
em
img
(for small, contextual images that should not be figures)ins
kbd
mark
math
(for inline equations that should not be figures; they must also contain a TeX annotation)meter
q
ruby
(with embeddedrb
,rt
,rtc
, andrp
)samp
span
strong
sub
sup
svg
(for small, contextual images that should not be figures)time
var
wbr
If an a
element is linking to a citation, then it must have
property="schema:citation"
; if it is linking
to a figure or another creative work, it must
have property="schema:hasPart"
or property="schema:isBasedOnUrl"
. These are
known as flavoured links, they can be used to
enhance the user experience by treating their behaviour
differently from regular links.
The References Section
The references section is a special type of section
element with
typeof="sa:ReferenceList"
.
Apart from its heading element, it must contain nothing other than an ol
or a dl
element.
If using a dl
element, its content must be exclusively a strictly
alternating sequence of dt
then dd
elements, with the latter
being the citation-bearing element. The dt
is used as a label in some
citation formats.
If using an ol
, then its content is only li
elements that are
the citation-bearing elements.
The citation-bearing element will have an id
and be
schema:Book
for books or
typeof="schema:ScholarlyArticle"
(or its subclass
schema:MedicalScholarlyArticle
, with probably more to come). Its
content follows the «flexcite» format (being defined as part of this document, see
#4). The
references section of this document is an example.
At the semantics level, a citation is a schema:ScholarlyArticle
(or subtype)
with an id
to reference it internally in the document and a
resource
that is a URL identifying it (its DOI for instance, preferable in
HTTP-retrievable form).
That schema:ScholarlyArticle
has any number of schema:author
which are schema:Person
(with the usual schema:givenName
,
schema:familyName
, etc.). A child cite
element, with
property="schema:name"
(and optionally a link child) provides the title
of the article.
The publisher is described using a nested schema:isPartOf
structure of
schema:PublicationIssue
, schema:PublicationVolume
,
and schema:Periodical
(with only those that are known being used). Both
schema:volumeNumber
and schema:issueNumber
may be used on the
volume and issue.
A time
element with property="schema:datePublished"
provides
the publication date, which is expressed in text in human-readable form and in the
datetime
attribute in standard form. A datatype
attribute
matching the date format must be provided.
Both schema:pageStart
and schema:pageEnd
may be provided.
Beyond the semantics, a more specific serialisation known a «Flexcite» is in the works and will be added here soon. Its properties are simple: when unstyled it reads linearly in a human-friendly manner (so as to be accessible), and it can be styled with CSS to be turned into arbitrary citation style preferences.
The Funding Section
The funding information attached to an article involves a list of sponsors each of which offers a list of funding sources. Again, an example probably makes the idea clearer:
The section has typeof="sa:Funding"
and an arbitrary heading title, like
other sections.
It contains a series of hunks that are
rel="schema:sponsor"
(there can also be other content, it is ignored for
our purposes). The example above uses a p
and a narrative style for its
content, but you have freedom to use other encodings.
As for contributor affiliations, source of fundings are
expressed using a subclass of schema:Role
(sa:SponsorRole
).
The usage of schema.org Role
type is needed
to describe the source of fundings specific to a scholarly
article as opposed to all the source of funding of an
organization (relevant or not to our scholarly article of
interest).
The funder will be typeof="schema:Organization"
(or a subtype thereof), as the object of a
schema:sponsor
property on the sa:SponsorRole
. It
will be identified through its URL (as in the a
above), and will typically
have schema:name
and often schema:alternateName
.
The specific source of funding is of type sa:FundingSource
, as the object of a
sa:roleOffer
property on the sa:SponsorRole
. It
should have a URL identifying it and a schema:serialNumber
that is its
labeled identity.
Data rich scholarly articles
Scholarly Articles are often part of a larger network of creative works containing dataset, code, additional figures, tables or media (audio, video). Even within a scholarly article, some creative works can be encoded in different ways (for instance, figures typically comes in different resolutions). Scholarly HTML aims to formally describe (and help archive) this larger context.
Further data about a scholarly graph can be exposed within the article in RDFa or as JSON-LD islands. When JSON-LD is used, it is recommended not to duplicate the data already serialized in RDFa. JSON-LD should be reserved to expose data not directly present in the HTML markup.
A scholarly graph provides a manifest for a scholarly
article listing all the creative works, their encodings
and the relationship between these objects (expressed
with schema:hasPart
and schema:isBasedOnUrl
).
| Creative Work | Property | Encoding |
schema:ScholarlyArticle |
schema:encoding |
sa:DocumentObject |
sa:Image |
schema:encoding |
schema:ImageObject |
sa:Audio |
schema:encoding |
schema:AudioObject |
sa:Video |
schema:encoding |
schema:VideoObject |
schema:Dataset |
schema:distribution |
schema:DataDownload |
schema:Table |
schema:encoding |
sa:TableObject |
schema:SoftwareSourceCode |
schema:encoding |
schema:MediaObject |
Semantic context of a scholarly article
Scholarly Articles (and their associated resources) are
frequently tagged to improve their discoverability. For
instance,
the National
Library of Medicine uses
the Medical
Subject Headings (MeSH) controlled vocabulary to index
journal articles in the life sciences. Scholarly HTML
leverages schema.org and the schema:about
property to efficiently expose this information to search
engines. When possible,
schema.org MedicalEntity
(and subclasses) should be used to describe biomedical
concepts.
Hypermedia controls
A Scholarly Article (or any resource part of a scholarly graph) can be made actionable with the addition of hypermedia controls provided through schema.org actions. Readers not familiar with schema.org Actions should refer to the actions overview document for a quick introduction.
Acknowledgements
Scholarly HTML would like to thank Scholarly HTML (you read that right) for blazing the trail perhaps a few years too soon. Particularly, the following people were particularly kind and helpful: Peter Sefton, Richard Smith-Unna, and Peter Murray-Rust.
PLOS has a short history of Scholarly HTML that is worth reading (and would be worth updating).
Dan Brickley was kind enough to drop by the office to chat about our usage of schema.org even though he was tired and hungry. As always, examples involving fish tanks are the most helpful. Tzviya Siegman and Dave Cramer have shared ideas that we happily stole.
Patrick Johnston's input has been crucial, notably in modelling authoring. We can only hope that getting those details exactly right have not caused him to lose too much sleep.
We also received very useful feedback and pointers from: Kjetil Kjernsmo (DAHUT!), Silvio Peroni, Justin Johansson, Alf Eaton, Raniere Silvia, and Mike Smith.
If we somehow forgot you in this list and you are too gracious to complain, we love you all the same.
Conclusion
Scholarly HTML is currently a work in progress and is open to change. If you have feedback, simply open an issue on GitHub, or make a pull request.
We believe that this vernacular establishes that it is possible to capture scholarly information accurately, while retaining a clean HTML structure that does minimum violence to the language’s spirit.
The science.ai platform currently supports (most of) Scholarly HTML, but our goal is not to make this a proprietary standard — quite the opposite. We would like the scholarly publishing as much as possible to align with common practices so that we can all focus on problems more interesting than content conversion.
References
- NYT, 2014
- The Full New York Times Innovation Report, by New York Times ; .
- Science.AI, 2015a
- The Scholarly Article ontology, by Science.AI ; .
- Science.AI, 2015b
- Vernacular — HTML Made Special, by Science.AI ; .


16 GLMM, Binary Outcome: Antibiotics for Leprosy
16.1 Packages
16.1.1 CRAN
library(tidyverse) # all things tidy
library(pander) # nice looking genderal tabulations
library(furniture) # nice table1() descriptives
library(texreg) # Convert Regression Output to LaTeX or HTML Tables
library(psych) # contains some useful functions, like headTail
library(lme4) # Linear, generalized linear, & nonlinear mixed models
library(effects) # Plotting estimated marginal means
library(optimx) # Unify and streamline optimization capabilities in R
16.1.2 GitHub
Helper extract
functions for exponentiating parameters form generalized regression models within a texreg
table of model parameters.
16.2 Data Prep
Data on Amenorrhea from Clinical Trial of Contracepting Women.
Source:
Table 1 (page 168) of Machin et al. (1988). With permission of Elsevier.
Reference:
Machin D, Farley T, Busca B, Campbell M and d’Arcangues C. (1988). Assessing changes in vaginal bleeding patterns in contracepting women. Contraception, 38, 165-179.
Description:
The data are from a longitudinal clinical trial of contracepting women. In this trial women received an injection of either 100 mg or 150 mg of depot-medroxyprogesterone acetate (DMPA) on the day of randomization and three additional injections at 90-day intervals. There was a final follow-up visit 90 days after the fourth injection, i.e., one year after the first injection. Throughout the study each woman completed a menstrual diary that recorded any vaginal bleeding pattern disturbances. The diary data were used to determine whether a women experienced amenorrhea, the absence of menstrual bleeding for a specified number of days. A total of 1151 women completed the menstrual diaries and the diary data were used to generate a binary sequence for each woman according to whether or not she had experienced amenorrhea in the four successive three month intervals.
In clinical trials of modern hormonal contraceptives, pregnancy is exceedingly rare (and would be regarded as a failure of the contraceptive method), and is not the main outcome of interest in this study. Instead, the outcome of interest is a binary response indicating whether a woman experienced amenorrhea in the four successive three month intervals. A feature of this clinical trial is that there was substantial dropout. More than one third of the women dropped out before the completion of the trial.
Variable List:
Indicators
id
participant identificationoccasion
denotes the four 90-day periods
Outcome or dependent variable
amenorrhea
Amenorrhea Status: 1=Amenorrhea, 0=No Amenorrhea
Main predictor or independent variable of interest
dose
0 = Low (100 mg), 1 = High (150 mg)
16.2.1 Import
data_raw <- read.table("https://raw.githubusercontent.com/CEHS-research/data/master/MLM/RCTcontraception.txt", header=TRUE)
str(data_raw)
'data.frame': 4604 obs. of 4 variables:
$ id : int 1 1 1 1 2 2 2 2 3 3 ...
$ dose : int 0 0 0 0 0 0 0 0 0 0 ...
$ occasion : int 1 2 3 4 1 2 3 4 1 2 ...
$ amenorrhea: Factor w/ 3 levels ".","0","1": 2 1 1 1 2 1 1 1 2 1 ...
id dose occasion amenorrhea
1 1 0 1 0
2 1 0 2 .
3 1 0 3 .
4 1 0 4 .
5 2 0 1 0
6 2 0 2 .
7 2 0 3 .
8 2 0 4 .
9 3 0 1 0
10 3 0 2 .
... ... ... ... <NA>
4601 1151 1 1 1
4602 1151 1 2 1
4603 1151 1 3 1
4604 1151 1 4 1
16.2.2 Long Format
data_long <- data_raw %>%
dplyr::mutate(id = factor(id)) %>%
dplyr::mutate(dose = factor(dose,
levels = c("0", "1"),
labels = c("Low", "High"))) %>%
dplyr::mutate(time = occasion - 1) %>%
dplyr::mutate(amenorrhea = amenorrhea %>% # outcome needs to be numeric
as.character() %>%
as.numeric()) %>%
dplyr::filter(complete.cases(amenorrhea)) %>% # dump missing occations
dplyr::arrange(id, time)
str(data_long)
'data.frame': 3616 obs. of 5 variables:
$ id : Factor w/ 1151 levels "1","2","3","4",..: 1 2 3 4 5 6 7 8 9 10 ...
$ dose : Factor w/ 2 levels "Low","High": 1 1 1 1 1 1 1 1 1 1 ...
$ occasion : int 1 1 1 1 1 1 1 1 1 1 ...
$ amenorrhea: num 0 0 0 0 0 0 0 0 0 0 ...
$ time : num 0 0 0 0 0 0 0 0 0 0 ...
id dose occasion amenorrhea time
1 1 Low 1 0 0
2 2 Low 1 0 0
3 3 Low 1 0 0
4 4 Low 1 0 0
... <NA> <NA> ... ... ...
3607 1149 High 3 1 2
3608 1149 High 4 1 3
3609 1150 High 1 1 0
3610 1150 High 2 1 1
3611 1150 High 3 1 2
3612 1150 High 4 1 3
3613 1151 High 1 1 0
3614 1151 High 2 1 1
3615 1151 High 3 1 2
3616 1151 High 4 1 3
16.2.3 Wide Format
data_wide <- data_long %>%
dplyr::select(-time) %>%
tidyr::spread(key = occasion,
value = amenorrhea,
sep = "_")
str(data_wide)
'data.frame': 1151 obs. of 6 variables:
$ id : Factor w/ 1151 levels "1","2","3","4",..: 1 2 3 4 5 6 7 8 9 10 ...
$ dose : Factor w/ 2 levels "Low","High": 1 1 1 1 1 1 1 1 1 1 ...
$ occasion_1: num 0 0 0 0 0 0 0 0 0 0 ...
$ occasion_2: num NA NA NA NA NA NA NA NA NA NA ...
$ occasion_3: num NA NA NA NA NA NA NA NA NA NA ...
$ occasion_4: num NA NA NA NA NA NA NA NA NA NA ...
id dose occasion_1 occasion_2 occasion_3 occasion_4
1 1 Low 0 <NA> <NA> <NA>
2 2 Low 0 <NA> <NA> <NA>
3 3 Low 0 <NA> <NA> <NA>
4 4 Low 0 <NA> <NA> <NA>
... <NA> <NA> ... ... ... ...
1142 1142 High 1 1 1 1
1143 1143 High 1 1 1 1
1144 1144 High 1 1 1 1
1145 1145 High 1 1 1 1
1146 1146 High 1 1 1 1
1147 1147 High 1 1 1 1
1148 1148 High 1 1 1 1
1149 1149 High 1 1 1 1
1150 1150 High 1 1 1 1
1151 1151 High 1 1 1 1
16.3 Exploratory Data Analysis
16.3.1 Summary Statistics
data_summary <- data_long %>%
dplyr::group_by(dose, occasion) %>%
dplyr::summarise(N = n(),
M = mean(amenorrhea),
SD = sd(amenorrhea),
SE = SD/sqrt(N))
data_summary
# A tibble: 8 x 6
# Groups: dose [2]
dose occasion N M SD SE
<fct> <int> <int> <dbl> <dbl> <dbl>
1 Low 1 576 0.186 0.389 0.0162
2 Low 2 477 0.262 0.440 0.0202
3 Low 3 409 0.389 0.488 0.0241
4 Low 4 361 0.501 0.501 0.0264
5 High 1 575 0.205 0.404 0.0169
6 High 2 476 0.336 0.473 0.0217
7 High 3 389 0.494 0.501 0.0254
8 High 4 353 0.535 0.499 0.0266
16.3.2 Visualize
data_summary %>%
ggplot(aes(x = occasion,
y = M,
fill = dose)) +
geom_col(position = "dodge") +
theme_bw() +
theme(legend.position = c(0, 1),
legend.justification = c(-0.1, 1.1),
legend.background = element_rect(color = "black"),
legend.key.width = unit(1.5, "cm")) +
labs(x = "90-day windows",
y = "Observed Proportion of Amenorrhea",
fill = "Dosage") +
scale_x_continuous(breaks = 1:4,
labels = c("First",
"Second",
"Third",
"Fourth"))
data_summary %>%
ggplot(aes(x = occasion,
y = M,
color = dose %>% fct_rev())) +
geom_errorbar(aes(ymin = M - SE,
ymax = M + SE),
width = .3,
position = position_dodge(width = .25)) +
geom_point(position = position_dodge(width = .25)) +
geom_line(position = position_dodge(width = .25)) +
theme_bw() +
theme(legend.position = c(0, 1),
legend.justification = c(-0.1, 1.1),
legend.background = element_rect(color = "black"),
legend.key.width = unit(1.5, "cm")) +
labs(x = "90-day windows",
y = "Observed Proportion of Amenorrhea",
color = "Dosage") +
scale_x_continuous(breaks = 1:4,
labels = c("First",
"Second",
"Third",
"Fourth"))
16.4 GLMM - Basic
16.4.1 Fit Models
fit_1 <- lme4::glmer(amenorrhea ~ time*dose + (1 | id),
data = data_long,
family = binomial(link = "logit"))
fit_2 <- lme4::glmer(amenorrhea ~ time + dose + (1 | id),
data = data_long,
family = binomial(link = "logit"))
<IP_ADDRESS> Compare via LRT
Should the interaction be included? No.
Data: data_long
Models:
fit_2: amenorrhea ~ time + dose + (1 | id)
fit_1: amenorrhea ~ time * dose + (1 | id)
Df AIC BIC logLik deviance Chisq Chi Df Pr(>Chisq)
fit_2 4 3931 3956 -1961 3923
fit_1 5 3932 3963 -1961 3922 0.69 1 0.41
16.4.2 Model Parameter Tables
<IP_ADDRESS> Logit Scale
# Knit to Website: texreg::htmlreg()
# Knit to PDF: texreg::texreg()
# View on Screen: texreg::screenreg()
texreg::htmlreg(list(fit_1, fit_2),
custom.model.names = c("with", "without"),
single.row = TRUE,
caption = "MLM Parameter Estimates: Inclusion of Interaction (SE and p-values)")
| with | without | ||
|---|---|---|---|
| (Intercept) | -2.55 (0.17)*** | -2.61 (0.16)*** | |
| time | 0.87 (0.07)*** | 0.91 (0.05)*** | |
| doseHigh | 0.39 (0.21) | 0.50 (0.16)** | |
| time:doseHigh | 0.08 (0.09) | ||
| AIC | 3932.14 | 3930.83 | |
| BIC | 3963.11 | 3955.61 | |
| Log Likelihood | -1961.07 | -1961.42 | |
| Num. obs. | 3616 | 3616 | |
| Num. groups: id | 1151 | 1151 | |
| Var: id (Intercept) | 4.26 | 4.24 | |
| p < 0.001, p < 0.01, p < 0.05 |
# Knit to Website: texreg::htmlreg()
# Knit to PDF: texreg::texreg()
# View on Screen: texreg::screenreg()
texreg::htmlreg(list(fit_1, fit_2),
custom.model.names = c("with", "without"),
ci.force = TRUE,
single.row = TRUE,
caption = "MLM Parameter Estimates: Inclusion of Interaction (95% CI's)")
| with | without | ||
|---|---|---|---|
| (Intercept) | -2.55 [-2.89; -2.22]* | -2.61 [-2.92; -2.30]* | |
| time | 0.87 [0.74; 1.01]* | 0.91 [0.81; 1.02]* | |
| doseHigh | 0.39 [-0.01; 0.79] | 0.50 [0.17; 0.82]* | |
| time:doseHigh | 0.08 [-0.10; 0.26] | ||
| AIC | 3932.14 | 3930.83 | |
| BIC | 3963.11 | 3955.61 | |
| Log Likelihood | -1961.07 | -1961.42 | |
| Num. obs. | 3616 | 3616 | |
| Num. groups: id | 1151 | 1151 | |
| Var: id (Intercept) | 4.26 | 4.24 | |
| * 0 outside the confidence interval |
<IP_ADDRESS> Odds ratio scale
# Knit to Website: texreg::htmlreg()
# Knit to PDF: texreg::texreg()
# View on Screen: texreg::screenreg()
texreg::htmlreg(list(extract_glmer_exp(fit_1),
extract_glmer_exp(fit_2)),
custom.model.names = c("with", "without"),
ci.test = 1,
ci.force = TRUE,
single.row = TRUE,
caption = "MLM Parameter Estimates: Inclusion of Interaction (95% CI's)")
| with | without | ||
|---|---|---|---|
| (Intercept) | 0.08 [0.06; 0.11]* | 0.07 [0.05; 0.10]* | |
| time | 2.40 [2.08; 2.75]* | 2.49 [2.24; 2.77]* | |
| doseHigh | 1.48 [0.98; 2.22] | 1.64 [1.19; 2.27]* | |
| time:doseHigh | 1.08 [0.90; 1.30] | ||
| AIC | 3932.14 | 3930.83 | |
| BIC | 3963.11 | 3955.61 | |
| Log Likelihood | -1961.07 | -1961.42 | |
| Num. obs. | 3616 | 3616 | |
| Num. groups: id | 1151 | 1151 | |
| Var: id (Intercept) | 4.26 | 4.24 | |
| * 1 outside the confidence interval |
16.4.3 Visualize the Model
<IP_ADDRESS> Scale = Logit
effects::Effect(focal.predictors = c("dose", "time"),
xlevels = list(time = seq(from = 0, to = 3, by = .1)),
mod = fit_2,
transform = NULL) %>%
data.frame %>%
ggplot(aes(x = time,
y = fit)) +
geom_hline(yintercept = 0, # reference line
color = "gray",
size = 1.5) +
geom_ribbon(aes(ymin = fit - se, # Mean +/- 1 SEM
ymax = fit + se,
fill = dose),
alpha = .2) +
geom_line(aes(color = dose),
size = 1.5) +
theme_bw() +
labs(y = "Logit Scale")
<IP_ADDRESS> Scale = Probability
effects::Effect(focal.predictors = c("dose", "time"),
xlevels = list(time = seq(from = 0, to = 3, by = .1)),
mod = fit_2) %>%
data.frame %>%
ggplot(aes(x = time,
y = fit)) +
geom_hline(yintercept = c(0, 0.5, 1), # reference lines
color = "gray",
size = 1.5) +
geom_ribbon(aes(ymin = fit - se,
ymax = fit + se,
fill = dose),
alpha = .2) +
geom_line(aes(color = dose),
size = 1.5) +
theme_bw() +
labs(y = "Predicted Probability")
Remove the error bands:
effects::Effect(focal.predictors = c("dose", "time"),
xlevels = list(time = seq(from = 0, to = 3, by = .1)),
mod = fit_2) %>%
data.frame %>%
ggplot(aes(x = time,
y = fit)) +
geom_hline(yintercept = c(0, 0.5),
color = "gray",
size = 1.5) +
geom_line(aes(linetype = dose),
size = 1) +
theme_bw() +
theme(legend.position = c(0, 1),
legend.justification = c(-0.1, 1.1),
legend.background = element_rect(color = "black"),
legend.key.width = unit(1.5, "cm")) +
labs(x = "90-day Window",
y = "Predicted Probability of Amenorrhea",
linetype = "Dosage:") +
scale_x_continuous(breaks = 0:3,
labels = c("First",
"Second",
"Third",
"Fourth"))
16.5 GLMM - Optimizers
From the documentation:
The lme4::glmer()
function fits a generalized linear mixed model, which incorporates both fixed-effects parameters and random effects in a linear predictor, via maximum likelihood. The linear predictor is related to the conditional mean of the response through the inverse link function defined in the GLM family.
The expression for the likelihood of a mixed-effects model is an integral over the random effects space. For a linear mixed-effects model (LMM), as fit by lmer, this integral can be evaluated exactly. For a GLMM the integral must be approximated. The most reliable approximation for GLMMs is adaptive Gauss-Hermite quadrature, at present implemented only for models with a single scalar random effect. The nAGQ
argument controls the number of nodes in the quadrature formula. A model with a single, scalar random-effects term could reasonably use up to 25 quadrature points per scalar integral.
The lme4::lmerControl()
function includes an argument for the optimizer
, which is the name of a optimizing function(s). IT is a character vector or list of functions: length 1 for lmer or glmer, possibly length 2 for glmer). The built-in optimizers are Nelder_Mead and bobyqa (from the minqa package). Other minimizing functions are allows (constraints do apply).
Special provisions are made for bobyqa, Nelder_Mead, and optimizers wrapped in the optimx
package; to use the optimx optimizers (including L-BFGS-B from base optim
and nlminb
), pass the method argument to optim
in the optCtrl
argument (you may also need to load the optimx
package manually using library(optimx)
.
16.5.1 Adaptive Gauss-Hermite Quadrature: Increase the number of quadrature points
nAGQ
(integer scalar) the number of points per axis for evaluating the adaptive Gauss-Hermite approximation to the log-likelihood. Defaults to 1, corresponding to the Laplace approximation. Values greater than 1 produce greater accuracy in the evaluation of the log-likelihood at the expense of speed. A value of zero uses a faster but less exact form of parameter estimation for GLMMs by optimizing the random effects and the fixed-effects coefficients in the penalized iteratively reweighted least squares step. (See Details.)
16.5.2 Laplace Approximation: switch to the Nelder_Mead optimizer
16.5.3 Laplace Approximation: Switch to the L-BFGS-B
method
16.5.4 Laplace Approximation: Switch to the nlminb
method
16.6 Quadratic Time?
Assess need for quadratic time with the LRT
Data: data_long
Models:
fit_2: amenorrhea ~ time + dose + (1 | id)
fit_3d: amenorrhea ~ time + I(time^2) + time:dose + I(time^2):dose +
fit_3d: (1 | id)
Df AIC BIC logLik deviance Chisq Chi Df Pr(>Chisq)
fit_2 4 3931 3956 -1961 3923
fit_3d 6 3925 3962 -1957 3913 9.72 2 0.0078 **
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
texreg::htmlreg(list(fit_3a, fit_3b, fit_3c, fit_3d),
custom.model.names = c("nAGQ", "Nelder_Mead",
"L BFGS B", "nlminb"),
caption = "GLMM: Various methods of ML approximation",
digits = 4)
| nAGQ | Nelder_Mead | L BFGS B | nlminb | ||
|---|---|---|---|---|---|
| (Intercept) | -2.4829*** | -2.4604*** | -2.4601*** | -2.4604*** | |
| (0.1416) | (0.1397) | (0.1397) | (0.1397) | ||
| time | 0.7714*** | 0.7561*** | 0.7558*** | 0.7561*** | |
| (0.2026) | (0.1985) | (0.1985) | (0.1985) | ||
| I(time^2) | 0.0346 | 0.0340 | 0.0341 | 0.0340 | |
| (0.0667) | (0.0655) | (0.0655) | (0.0655) | ||
| time:doseHigh | 0.8920*** | 0.8861*** | 0.8860*** | 0.8861*** | |
| (0.2574) | (0.2513) | (0.2513) | (0.2513) | ||
| I(time^2):doseHigh | -0.2599** | -0.2579** | -0.2579** | -0.2579** | |
| (0.0895) | (0.0879) | (0.0879) | (0.0879) | ||
| AIC | 3879.4906 | 3925.1127 | 3925.1128 | 3925.1127 | |
| BIC | 3916.6493 | 3962.2715 | 3962.2715 | 3962.2715 | |
| Log Likelihood | -1933.7453 | -1956.5564 | -1956.5564 | -1956.5564 | |
| Num. obs. | 3616 | 3616 | 3616 | 3616 | |
| Num. groups: id | 1151 | 1151 | 1151 | 1151 | |
| Var: id (Intercept) | 5.0794 | 4.3478 | 4.3494 | 4.3479 | |
| p < 0.001, p < 0.01, p < 0.05 |
effects::Effect(focal.predictors = c("dose", "time"),
xlevels = list(time = seq(from = 0, to = 3, by = .1)),
mod = fit_3d) %>%
data.frame %>%
ggplot(aes(x = time,
y = fit)) +
geom_hline(yintercept = c(0, 0.5),
color = "gray",
size = 1.5) +
geom_line(aes(linetype = dose),
size = 1) +
theme_bw() +
theme(legend.position = c(0, 1),
legend.justification = c(-0.1, 1.1),
legend.background = element_rect(color = "black"),
legend.key.width = unit(1.5, "cm")) +
labs(x = "90-day Window",
y = "Predicted Probability of Amenorrhea",
linetype = "Dosage:") +
scale_x_continuous(breaks = 0:3,
labels = c("First",
"Second",
"Third",
"Fourth"))


The loss factors are given for mass flow rates from port_a to port_b as:
A_a < A_b (Idelchik 1994, diagram 4-1, p. 208): zeta = dp/(rho_a*v_a^2/2) = (1 - A_a/A_b)^2 for Re_a ≥ 3.3e3 (turbulent flow) zeta = 30/Re for Re_a < 10 (laminar flow) A_a > A_b (Idelchik 1994, diagram 4-9, p. 216 and diagram 4-10, p. 217) zeta = dp/(rho_b*v_b^2/2) = 0.5*(1 - A_b/A_a)^0.75 for Re_b ≥ 1e4 (turbulent flow) zeta = 30/Re for Re_a < 10 (laminar flow)
encapsulated function suddenExpansion import Modelica.Fluid.Fittings.BaseClasses.QuadraticTurbulent.LossFactorData; import SI = Modelica.SIunits; input SI.Diameter diameter_a "Inner diameter of pipe at port_a" annotation( Dialog); input SI.Diameter diameter_b "Inner diameter of pipe at port_b" annotation( Dialog); output LossFactorData data "Pressure loss factors for both flow directions"; end suddenExpansion;


{% extends 'base.html' %} {% load static %} {% block title %}Reset link successfully sent{% endblock %} {% block content %}
A password reset link has been sent to {{ email }}


System Architect Picture "Subject Identifier State Change"
Parent Diagram:
State Change Activity
(OMT Object Model)


lazy: Lazy Learning for Local Regression
By combining constant, linear, and quadratic local models,
lazy estimates the value of an unknown multivariate function on
the basis of a set of possibly noisy samples of the function
itself. This implementation of lazy learning automatically
adjusts the bandwidth on a query-by-query basis through a
leave-one-out cross-validation.
| Version: |
1.2-16 |
| Published: |
2018-07-20 |
| Author: |
Mauro Birattari and Gianluca Bontempi |
| Maintainer: |
Gianluca Bontempi <gbonte at ulb.ac.be> |
| License: |
GPL-2 | GPL-3 [expanded from: GPL (≥ 2)] |
| Copyright: |
see file COPYRIGHTS |
| NeedsCompilation: |
yes |
| CRAN checks: |
lazy results |
Downloads:
Reverse dependencies:
Linking:
Please use the canonical form
https://CRAN.R-project.org/package=lazy
to link to this page.


Javascript Client Utility
Paho Project
Documentation
Repository
Connection - Disconnected.
Host
Port
Client ID
Connect
Path
Username
Password
Keep-Alive
Timeout
SSL
Clean Session
Last Will Topic
QoS
0
1
2
Retain
Last Will Message
Subscribe/Publish
Subscribe
Topic
QoS
0
1
2
Subscribe
Unsubscribe
Publish Message
Topic
QoS
0
1
2
Retain

Publish
Message
Operational
23.45
°C
0.97
kW/h
189
Litres
123.45
m³
Last Messages
Topic
Payload
Time
QoS
History
Clear History
Topic
Payload
Time
Qos
Weather


Backwards incompatibilities in log4javascript 1.4
-
Loggers are now hierarchical. This means logger names containing full stops have
special meaning. For example, from version 1.4 the logger named
myapp.ajax
by default inherits all the appenders of the logger named myapp
, while
prior to version 1.4 these loggers would be entirely independent;
-
The signature of the
log
method of Logger
has changed.
However, you should not use this method directly; instead, use one of the level-specific
wrapper functions (debug
, info
, error
etc.);
-
Appenders can no longer be configured via constructor parameters. Instead you must use
setter methods;
-
The format of requests sent via
AjaxAppender
has changed when using JsonLayout
or
XmlLayout
: the formatted log messages are sent
as a name-value pair (with default name data
) rather than a single unencoded string;
-
All timestamps returned by
XmlLayout
,
JsonLayout
and
HttpPostDataLayout
are
now measured in milliseconds since January 1st 1970 (previously they were returned
as seconds since January 1st 1970);
-
The constructors for JsonLayout and
HttpPostDataLayout have changed; the property names
used for the properties of the logging event are now set via
setKeys
rather than
in the constructor;
-
setReadable
has been removed from JsonLayout.
The readable
property should now be set via the constructor;
-
addErrorListener
and removeErrorListener
removed from
the log4javascript
object and replaced with the more generic
addEventListener
and removeEventListener
methods. The listener functions are passed
different parameters.


Pat's Salmon Cookies are #1 in Seattle
Made With 50% Salmon and 50% Cookie
Cookies that all families enjoy


{{extend 'layout.html'}} {{ if confirm: }}
This will update your course with the latest changes to the content and layout. Are you sure you want to do this?
Your course will be rebuilt. This message will update once the rebuild starts. If it never updates, please ask the server administrator to check that a web2py scheduler is running.
This may take several minutes to complete. Please do not refresh the page. When the rebuild is finished, you will be redirected to your newly rebuilt course.
Due to memory limitations on the server I can only build one course at a time. Sometimes the queue gets backed up or even temporarily stuck. I will get things going again as quick as I can. I do have an automatic monitoring system that lets me know by email when things get backed up. If you have persistent problems contact me by email at RunestoneInteractive. Thanks for your patience. -- Brad
{{ pass }}


LITTLE MAN TATE A film review by Mark R. Leeper Copyright 1991 Mark R. Leeper
Capsule review: Good acting, good direction, but a really bad screenplay and story trying to make us all thank our lucky stars that we are not geniuses. This film insults the viewer's intelligence in specific and intelligence in general. This is the most paranoid view of the highly intelligence since SIMON. Rating: -1 (-4 to +4).
Poor Pinocchio! He was a wonderful magical puppet, but he knew it was much better to be a real live boy. Then there was Mr. Spock. He seemed to pride himself on his logical Vulcan side. But every chance the writers get they showed how much better it was to be human. Kirk's eulogy also said that of all souls Kirk had met, Spock's was the most human. Being a normal human must be the best thing in the whole universe. And look. We're all human. There are so many humans around, this just has to be Best of All Possible Worlds. And you and I are the best things to be. Just normal everyday people. Oh boy!
Fred Tate (played by Adam Hann-Byrd) is like one of the child geniuses in CHILDREN OF THE DAMNED. Daddy is nowhere to be found and Fred clearly does not get his genius from his mother's side. But at what looks like age two he is already reading labels on dinnerware, much to the amazement of his mother, Dede (played by Jodie Foster, who also directs). By age seven he is already brilliant in eight or nine different ways, including painting, poetry, mathematics, and music. When he is given a math problem he and the audience see the numbers float by in a pretty blue stream.
Fred is discovered by Jane Grierson (played by Dianne Wiest). Grierson heads a sort of institute that is funded in some way we never find out. Its opulence surely cannot all come from tuition. Her institute seems to collect dossiers on emerging child geniuses, screen them, and choose a select few to be given all the resources they need to develop to their full potential. It seems to work sort of like the similar organization in THE FURY. One of the children from this sort of environment seriously tells an interviewer, "I'm working on an experiment involving lasers, sulphuric acid, and butterflies." Oh, buy, that sure doesn't sound like much fun for the butterflies, does it, boys and girls? But then, we all knew that geniuses develop things like H-bombs because they have lost the human touch. Lucky you and I still have it, huh?
Well, as it turns out, Jane Grierson has her problems too.  She likes macrobiotic foods that make the normal side of Fred vomit. She listens to genius music by Mozart (but by the end credits we are back to people-oriented music like Cole Porter). And she does not know how to deal with people at all. Fred becomes the object of a tug-of-war between Dr. Grierson, who wants to develop his genius, and his mother, who wants him to be more average.
Oddly enough, just about everything I did not like was the script. Except for her choice of material, Jodie Foster did a good job with the film. Dianne Wiest turned in a very good performance, as usual. Like Kathleen Quinlan, another actress I admire, Wiest seems to have an aura of both vulnerability and courage. It is as if she has been badly hurt but has picked herself up and is carrying on.
Adam Hann-Byrd really plays a young genius very well. In spite of the script not knowing how geniuses behave, Hann-Byrd really does seem bright. Both Hann-Byrd and Wiest are more engaging than Foster. Foster seems satisfied to be the hero of the film and does not do much to steal scenes from the other two. Foster maintains our interest in the characters in spite of the weak script.
Overall I give this film a low -1 on the -4 to +4 scale.
Mark R. Leeper att!mtgzy!leeper<EMAIL_ADDRESS>.
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


--- title: Contact date: 2012-09-11 20:54:50.000000000 +01:00 type: page parent_id: '2' published: true password: '' status: publish categories: [] tags: [] meta: _edit_last: '27605990' _wp_page_template: default author: login: moononthebones email<EMAIL_ADDRESS>display_name: Ben first_name: '' last_name: '' permalink: "/about/contact/" ---
Here are some ways you can contact me. Feel free to send any queries or questions you might have.
You can leave a comment at the bottom of posts or click on the speech bubble above the posts on the main page.
You can send me an email to<EMAIL_ADDRESS>If electronic messages aren't your thing, you can send me a letter to:
Benjamin Moon
School of Earth Sciences
University of Bristol
Wills Memorial Building
Queens Road
Bristol
BS8 1RJ
United Kingdom


SELECT * FROM test;
SELECT * FROM test WHERE id = 1;
INSERT INTO test (body, hits) VALUES ("Here is the body content", 0);
$mysqli = new mysqli("localhost", "roskiweb_user", "password", "roskiweb_dbname");
if($mysqli->connect_errno){
echo "Failed to connect to MySQL: " . $mysqli->connect_error;
}
$res = $mysqli->query("SELECT * FROM test WHERE id = 1");
$row = $res->fetch_assoc();
echo $row['body']; . "<br/>";
echo "It has been accessed and updated " . $row['hits'] . " times.";
$res = $mysqli->query("UPDATE test SET hits = hits + 1 WHERE id = 1");


Time Series Data¶
Slycat™ accepts two different time series data formats, which we will call Xyce and CSV. Each input format consists of two parts, a table file describing the entire ensemble, and a time series data file for each simulation in the ensemble. Like the CCA and Parameter Space models, the table is at the heart of the model. For each simulation (for each row in the data table), there must be a file with time series data. Within each of these time series files are sequences of values, sampling one or more output variables over the course of the simulation. It is not necessary that each simulation write the same number of samples into their time series files, but it is required that each simulation have a corresponding data file with matching output variables that cover the same time range.
Xyce Format File Structure¶
The Xyce format consists of Xyce-generated time series files stored within a fixed directory hierarchy. The hierarchy is rooted within a single high-level directory where there must be a dakota_tabular.dat file (providing the data table). It is not that the file must be named dakota_tabular.dat, but rather the file format must correspond to the dakota_tabular.dat files generated by Dakota. Additionally, a set of subdirectories (one per run) must be located in the same directory as the dakota_tabular file. These subdirectories should all be named using a template like workdir.n, where n is the simulation number. Within each subdirectory, there must be a time series file generated by Xyce that is formatted as a .prn file. The time series files must all be named identically (the subdirectory defines which simulation generated them), and each file must contain a shared set of time series variables (columns with matching headers within each of the .prn files).
CSV Format File Structure¶
The CSV format (such as heartbeat.dat files produced by Sierra, or .csv outputs from Catalyst), is less structured than the Xyce format. The individual time series files need not be stored in the same directory hierarchy as the data table, nor does the directory structure need to follow any structure or naming conventions. Instead, the data table is a CSV file, which contains a column of URIs providing full paths to each of the time series files, which must also be CSV files (no .prn files). Each URI must have the format: file://machine/absolute_directory_path/timeseries_filename.csv.
Time Series Files¶
Whether we are using .prn files or CSV files, both formats are essentially tables in which each column is a separate variable and each row is a set of concurrent samples for each of the variable columns. The first line of a time series file contains headers, which provide the names of the time series output variables. Note that in a CSV file, we expect to see only a single row of header information consisting of the column names (some physics codes output two rows of header information, with the variable names in the first row and the units in the second row – this is not a legal CSV format). At least one column must be a time value (typically the first column).
If your data is not currently in one of these two formats, Excel can be used to create CSV files from most common table formats. Note that if output metrics have been created separately in a post-processing step, they will need to be integrated with the inputs to form a single file prior to model creation.
HDF5 Intermediary Format¶
In the time series creation wizard, both formats are rewritten as HDF5 files in a temporary Slycat™ directory (we have found that this significantly speeds up our processing compared to working with the originally-formatted files). If you opt to keep these HDF5 files, they constitute a third data format that the wizard will accept, though be aware that HDF5 files created through other means are not interchangeable since their internal structures will be different.


WELCOME TO AUTORA
We have successfully completed projects in numerous states across the continental United States. Autora Construction Services has a proven track record of:
OVERVIEW
- Our focus
- Dedicated
- Committed
Our focus is to exceed your goals, meet your timelines and successfully manage your budget. We provide our clients with top-notch general contracting, construction management, site surveys and design build services.
Our focus is to exceed your goals, meet your timelines and successfully manage your budget. We provide our clients with top-notch general contracting, construction management, site surveys and design build services.
Our focus is to exceed your goals, meet your timelines and successfully manage your budget. We provide our clients with top-notch general contracting, construction management, site surveys and design build services.
FAQs
START EXECUTING YOUR PROJECT
LEADERSHIP TEAM
With us you will have the peace of mind knowing that your dream home project is in the hands of a licensed fully insured building company.


University of California, San Diego.
Masters in Machine Learning and Data Science
(2022-2024)
Hello there! This is Parth Shah. Welcome to my website! I am a first year ML Masters student at UCSD. I recently graduated from IIT Guwahati. My Bachelors thesis was with Dr Suresh Sundaram, EEE Department, IITG.
University of California, San Diego.
Masters in Machine Learning and Data Science
(2022-2024)
Indian Institute of Technology, Guwahati.
Bachelors of Technology in Chem. Science and Technology with a minor in Mathematics and Computing.(2018-2022)
Machine Learning intern at Wadhwani AI
(Mar '22 - May '22)
Research intern at SketchX, CVSSP, University of Surrey
(Apr '21 - Mar '22)
Data Science intern at Publicis Sapient
(May '21 - Jul '21)
Research Intern at IISc Bangalore.
(Dec 2019)
(May '20 - Jan '21)
Computer Vision Team Member for Raman the Humanoid Robot, at 4I Labs, IITG
(Sep '19 - Mar '20)
Contact Me!


Related Issue: #409
Demonstration of the Modal component being manually opened, for timing reasons. In this case, additional Soho components need to be invoked after a simulated AJAX response loads their base HTML markup.


Q: I’m getting DistributionNotFound
and entry_point
errors when I try to run Curator. What am I doing wrong?edit
A: You likely need to upgrade setuptools
edit
If you are still unable to install, or get strange errors about dependencies you
know you’ve installed, or messages mentioning entry_point
, you may need to
upgrade the setuptools
package. This is especially common with RHEL and
CentOS installs, and their variants, as they depend on Python 2.6.
If you can run pip install -U setuptools
, it should correct the problem.
You may also be able to download and install manually:
-
wget https://pypi.python.org/packages/source/s/setuptools/setuptools-15.1.tar.gz -O setuptools-15.1.tar.gz
-
pip install setuptools-15.1.tar.gz
Any dependencies this version of setuptools may require will have to be manually acquired and installed for your platform.
For more information about setuptools, see https://pypi.python.org/pypi/setuptools
This fix originally appeared here.


I'm A Celebrity's Andrew Maxwell breaks down in tears and threatens to walk out
The 'overwhelmed' comedian confessed he had 'hit a wall' and started to cry on tonight's I'm A Celebrity during an emotional chat with concerned campmate Jacqueline Jossa
by Irishmirror.ieAndrew Maxwell broke down in tears and threatened to walk out on tonight's I'm A Celebrity.
The comedian confessed he had "hit a wall" as he became "overwhelmed" with jungle life.
Andrew had an emotional chat with Jacqueline Jossa, who he argued with earlier this week before apologising, about his desire to leave camp.
Talking in the Bush Telegraph, Andrew said: "I was up in the Leaders Cabin, I was chatting to James and Jacqueline and I was just so tired, I just hit a wall."
When James went for a shower, the Ex On The Beach voiceover turned to Jacqueline and confessed he was considering quitting.
Andrew said: "I honestly thought that I was gonna walk out, but I haven’t, when you’re tired, you just say ‘have I done the right thing’."
Ex-EastEnders star Jacqueline told him: "You’d never leave, I can tell that, you’re just tired."
Emotional Andrew began to cry, but was comforted by Jacqueline, who explained to returning James that he was "tired".
As Jacqueline hugged Andrew, reassuring James said: "Everyone has a bad day."
The former EastEnders star said: "He’s been sleeping on the floor, he’s had 6 nights on the floor."
Telling Andrew that he could not leave, James added: "You’re an important part of the group and we need you."
James and Jacqueline advised the comedian to eat some beans to build up his strength.
When Andrew claimed he was just tired, Jacqueline said: "You’ve spent over two weeks away from your family, it’s a long time."
Andrew said: “I’m just a little bit overwhelmed right now."
James tried to convince Andrew to stay by reeling off a list of what he brings to camp.
The rugby player said: "You’re brilliant, you bring so much energy and laughter."
Kind James stayed chatting to Andrew and reassured the comedian that he would look after him for the rest of their time in the jungle.
This comes just a day after Andrew started chocking on camel meat and was saved by his fellow campmates.
The comedian got camel meat lodged in his throat leaving him struggling to breathe.
Kate Garraway and Andy Whyment rushed over to help choking Andrew as he sat on his knees trying to bring the food up.
As they slapped his back, they helped him spit it out, before he looked up to the heavens.
* I'm A Celebrity...Get Me Out Of Here! airs on ITV at 9pm


This article explains the new features in Python 2.1. While there aren’t as many changes in 2.1 as there were in Python 2.0, there are still some pleasant surprises in store. 2.1 is the first release to be steered through the use of Python Enhancement Proposals, or PEPs, so most of the sizable changes have accompanying PEPs that provide more complete documentation and a design rationale for the change. This article doesn’t attempt to document the new features completely, but simply provides an overview of the new features for Python programmers. Refer to the Python 2.1 documentation, or to the specific PEP, for more details about any new feature that particularly interests you.
One recent goal of the Python development team has been to accelerate the pace of new releases, with a new release coming every 6 to 9 months. 2.1 is the first release to come out at this faster pace, with the first alpha appearing in January, 3 months after the final version of 2.0 was released.
The final release of Python 2.1 was made on April 17, 2001.
The largest change in Python 2.1 is to Python’s scoping rules. In Python 2.0, at any given time there are at most three namespaces used to look up variable names: local, module-level, and the built-in namespace. This often surprised people because it didn’t match their intuitive expectations. For example, a nested recursive function definition doesn’t work:
def f():
...
def g(value):
...
return g(value-1) + 1
...
The function g()
will always raise a NameError
exception, because
the binding of the name g
isn’t in either its local namespace or in the
module-level namespace. This isn’t much of a problem in practice (how often do
you recursively define interior functions like this?), but this also made using
the lambda
statement clumsier, and this was a problem in practice.
In code which uses lambda
you can often find local variables being
copied by passing them as the default values of arguments.
def find(self, name):
"Return list of any entries equal to 'name'"
L = filter(lambda x, name=name: x == name,
self.list_attribute)
return L
The readability of Python code written in a strongly functional style suffers greatly as a result.
The most significant change to Python 2.1 is that static scoping has been added
to the language to fix this problem. As a first effect, the name=name
default argument is now unnecessary in the above example. Put simply, when a
given variable name is not assigned a value within a function (by an assignment,
or the def
, class
, or import
statements),
references to the variable will be looked up in the local namespace of the
enclosing scope. A more detailed explanation of the rules, and a dissection of
the implementation, can be found in the PEP.
This change may cause some compatibility problems for code where the same variable name is used both at the module level and as a local variable within a function that contains further function definitions. This seems rather unlikely though, since such code would have been pretty confusing to read in the first place.
One side effect of the change is that the from module import *
and
exec
statements have been made illegal inside a function scope under
certain conditions. The Python reference manual has said all along that from module import *
is only legal at the top level of a module, but the CPython
interpreter has never enforced this before. As part of the implementation of
nested scopes, the compiler which turns Python source into bytecodes has to
generate different code to access variables in a containing scope. from module import *
and exec
make it impossible for the compiler to
figure this out, because they add names to the local namespace that are
unknowable at compile time. Therefore, if a function contains function
definitions or lambda
expressions with free variables, the compiler
will flag this by raising a SyntaxError
exception.
To make the preceding explanation a bit clearer, here’s an example:
x = 1
def f():
# The next line is a syntax error
exec 'x=2'
def g():
return x
Line 4 containing the exec
statement is a syntax error, since
exec
would define a new local variable named x
whose value should
be accessed by g()
.
This shouldn’t be much of a limitation, since exec
is rarely used in
most Python code (and when it is used, it’s often a sign of a poor design
anyway).
Compatibility concerns have led to nested scopes being introduced gradually; in Python 2.1, they aren’t enabled by default, but can be turned on within a module by using a future statement as described in PEP 236. (See the following section for further discussion of PEP 236.) In Python 2.2, nested scopes will become the default and there will be no way to turn them off, but users will have had all of 2.1’s lifetime to fix any breakage resulting from their introduction.
See also
The reaction to nested scopes was widespread concern about the dangers of breaking code with the 2.1 release, and it was strong enough to make the Pythoneers take a more conservative approach. This approach consists of introducing a convention for enabling optional functionality in release N that will become compulsory in release N+1.
The syntax uses a from...import
statement using the reserved module name
__future__
. Nested scopes can be enabled by the following statement:
from __future__ import nested_scopes
While it looks like a normal import
statement, it’s not; there are
strict rules on where such a future statement can be put. They can only be at
the top of a module, and must precede any Python code or regular import
statements. This is because such statements can affect how
the Python bytecode compiler parses code and generates bytecode, so they must
precede any statement that will result in bytecodes being produced.
See also
__future__
In earlier versions, Python’s support for implementing comparisons on user-defined
classes and extension types was quite simple. Classes could implement a
__cmp__()
method that was given two instances of a class, and could only
return 0 if they were equal or +1 or -1 if they weren’t; the method couldn’t
raise an exception or return anything other than a Boolean value. Users of
Numeric Python often found this model too weak and restrictive, because in the
number-crunching (mathematical work performed by people or computers that is often quite simple but takes a long time, （简单但费时的）捣弄数字；进行运算
) programs that numeric Python is used for, it would be more
useful to be able to perform elementwise comparisons of two matrices, returning
a matrix containing the results of a given comparison for each element. If the
two matrices are of different sizes, then the compare has to be able to raise an
exception to signal the error.
In Python 2.1, rich comparisons were added in order to support this need.
Python classes can now individually overload each of the <
, <=
, >
,
>=
, ==
, and !=
operations. The new magic method names are:
| Operation | Method name |
|---|---|
< |
__lt__() |
<= |
__le__() |
> |
__gt__() |
>= |
__ge__() |
== |
__eq__() |
!= |
__ne__() |
(The magic methods are named after the corresponding Fortran operators .LT.
.
.LE.
, &c. Numeric programmers are almost certainly quite familiar with
these names and will find them easy to remember.)
Each of these magic methods is of the form method(self, other)
, where
self
will be the object on the left-hand side of the operator, while
other
will be the object on the right-hand side. For example, the
expression A < B
will cause A.__lt__(B)
to be called.
Each of these magic methods can return anything at all: a Boolean, a matrix, a list, or any other Python object. Alternatively they can raise an exception if the comparison is impossible, inconsistent, or otherwise meaningless.
The built-in cmp(A,B)
function can use the rich comparison machinery,
and now accepts an optional argument specifying which comparison operation to
use; this is given as one of the strings "<"
, "<="
, ">"
, ">="
,
"=="
, or "!="
. If called without the optional third argument,
cmp()
will only return -1, 0, or +1 as in previous versions of Python;
otherwise it will call the appropriate method and can return any Python object.
There are also corresponding changes of interest to C programmers; there’s a new
slot tp_richcmp
in type objects and an API for performing a given rich
comparison. I won’t cover the C API here, but will refer you to PEP 207, or to
2.1’s C API documentation, for the full list of related functions.
See also
Over its 10 years of existence, Python has accumulated a certain number of obsolete modules and features along the way. It’s difficult to know when a feature is safe to remove, since there’s no way of knowing how much code uses it — perhaps no programs depend on the feature, or perhaps many do. To enable removing old features in a more structured way, a warning framework was added. When the Python developers want to get rid of a feature, it will first trigger a warning in the next version of Python. The following Python version can then drop the feature, and users will have had a full release cycle to remove uses of the old feature.
Python 2.1 adds the warning framework to be used in this scheme. It adds a
warnings
module that provide functions to issue warnings, and to filter
out warnings that you don’t want to be displayed. Third-party modules can also
use this framework to deprecate old features that they no longer wish to
support.
For example, in Python 2.1 the regex
module is deprecated, so importing
it causes a warning to be printed:
>>> import regex
__main__:1: DeprecationWarning: the regex module
is deprecated; please use the re module
>>>
Warnings can be issued by calling the warnings.warn()
function:
warnings.warn("feature X no longer supported")
The first parameter is the warning message; an additional optional parameters can be used to specify a particular warning category.
Filters can be added to disable certain warnings; a regular expression pattern
can be applied to the message or to the module name in order to suppress a
warning. For example, you may have a program that uses the regex
module
and not want to spare the time to convert it to use the re
module right
now. The warning can be suppressed by calling
import warnings
warnings.filterwarnings(action = 'ignore',
message='.*regex module is deprecated',
category=DeprecationWarning,
module = '__main__')
This adds a filter that will apply only to warnings of the class
DeprecationWarning
triggered in the __main__
module, and applies
a regular expression to only match the message about the regex
module
being deprecated, and will cause such warnings to be ignored. Warnings can also
be printed only once, printed every time the offending code is executed, or
turned into exceptions that will cause the program to stop (unless the
exceptions are caught in the usual way, of course).
Functions were also added to Python’s C API for issuing warnings; refer to PEP 230 or to Python’s API documentation for the details.
See also
When compiling Python, the user had to go in and edit the Modules/Setup
file in order to enable various additional modules; the default set is
relatively small and limited to modules that compile on most Unix platforms.
This means that on Unix platforms with many more features, most notably Linux,
Python installations often don’t contain all useful modules they could.
Python 2.0 added the Distutils, a set of modules for distributing and installing extensions. In Python 2.1, the Distutils are used to compile much of the standard library of extension modules, autodetecting which ones are supported on the current machine. It’s hoped that this will make Python installations easier and more featureful.
Instead of having to edit the Modules/Setup
file in order to enable
modules, a setup.py
script in the top directory of the Python source
distribution is run at build time, and attempts to discover which modules can be
enabled by examining the modules and header files on the system. If a module is
configured in Modules/Setup
, the setup.py
script won’t attempt
to compile that module and will defer to the Modules/Setup
file’s
contents. This provides a way to specific any strange command-line flags or
libraries that are required for a specific platform.
In another far-reaching change to the build mechanism, Neil Schemenauer
restructured things so Python now uses a single makefile that isn’t recursive,
instead of makefiles in the top directory and in each of the Python/
,
Parser/
, Objects/
, and Modules/
subdirectories. This
makes building Python faster and also makes hacking the Makefiles clearer and
simpler.
See also
Weak references, available through the weakref
module, are a minor but
useful new data type in the Python programmer’s toolbox.
Storing a reference to an object (say, in a dictionary or a list) has the side effect of keeping that object alive forever. There are a few specific cases where this behaviour is undesirable, object caches being the most common one, and another being circular references in data structures such as trees.
For example, consider a memoizing function that caches the results of another
function f(x)
by storing the function’s argument and its result in a
dictionary:
_cache = {}
def memoize(x):
if _cache.has_key(x):
return _cache[x]
retval = f(x)
# Cache the returned object
_cache[x] = retval
return retval
This version works for simple things such as integers, but it has a side effect;
the _cache
dictionary holds a reference to the return values, so they’ll
never be deallocated until the Python process exits and cleans up This isn’t
very noticeable for integers, but if f()
returns an object, or a data
structure that takes up a lot of memory, this can be a problem.
Weak references provide a way to implement a cache that won’t keep objects alive
beyond their time. If an object is only accessible through weak references, the
object will be deallocated and the weak references will now indicate that the
object it referred to no longer exists. A weak reference to an object obj is
created by calling wr = weakref.ref(obj)
. The object being referred to is
returned by calling the weak reference as if it were a function: wr()
. It
will return the referenced object, or None
if the object no longer exists.
This makes it possible to write a memoize()
function whose cache doesn’t
keep objects alive, by storing weak references in the cache.
_cache = {}
def memoize(x):
if _cache.has_key(x):
obj = _cache[x]()
# If weak reference object still exists,
# return it
if obj is not None: return obj
retval = f(x)
# Cache a weak reference
_cache[x] = weakref.ref(retval)
return retval
The weakref
module also allows creating proxy objects which behave like
weak references — an object referenced only by proxy objects is deallocated –
but instead of requiring an explicit call to retrieve the object, the proxy
transparently forwards all operations to the object as long as the object still
exists. If the object is deallocated, attempting to use a proxy will cause a
weakref.ReferenceError
exception to be raised.
proxy = weakref.proxy(obj)
proxy.attr # Equivalent to obj.attr
proxy.meth() # Equivalent to obj.meth()
del obj
proxy.attr # raises weakref.ReferenceError
See also
In Python 2.1, functions can now have arbitrary information attached to them.
People were often using docstrings to hold information about functions and
methods, because the __doc__
attribute was the only way of attaching any
information to a function. For example, in the Zope Web application server,
functions are marked as safe for public access by having a docstring, and in
John Aycock’s SPARK parsing framework, docstrings hold parts of the BNF grammar
to be parsed. This overloading is unfortunate, since docstrings are really
intended to hold a function’s documentation; for example, it means you can’t
properly document functions intended for private use in Zope.
Arbitrary attributes can now be set and retrieved on functions using the regular Python syntax:
def f(): pass
f.publish = 1
f.secure = 1
f.grammar = "A ::= B (C D)*"
The dictionary containing attributes can be accessed as the function’s
__dict__
. Unlike the __dict__
attribute of class instances, in
functions you can actually assign a new dictionary to __dict__
, though
the new value is restricted to a regular Python dictionary; you can’t be
tricky and set it to a UserDict
instance, or any other random object
that behaves like a mapping.
See also
Some operating systems have filesystems that are case-insensitive, MacOS and
Windows being the primary examples; on these systems, it’s impossible to
distinguish the filenames FILE.PY
and file.py
, even though they do store
the file’s name in its original case (they’re case-preserving, too).
In Python 2.1, the import
statement will work to simulate case-sensitivity
on case-insensitive platforms. Python will now search for the first
case-sensitive match by default, raising an ImportError
if no such file
is found, so import file
will not import a module named FILE.PY
.
Case-insensitive matching can be requested by setting the PYTHONCASEOK
environment variable before starting the Python interpreter.
When using the Python interpreter interactively, the output of commands is
displayed using the built-in repr()
function. In Python 2.1, the variable
sys.displayhook()
can be set to a callable object which will be called
instead of repr()
. For example, you can set it to a special
pretty-printing function:
>>> # Create a recursive data structure
... L = [1,2,3]
>>> L.append(L)
>>> L # Show Python's default output
[1, 2, 3, [...]]
>>> # Use pprint.pprint() as the display function
... import sys, pprint
>>> sys.displayhook = pprint.pprint
>>> L
[1, 2, 3, <Recursion on list with id=135143996>]
>>>
See also
How numeric coercion (强制，强迫；威逼，胁迫) is done at the C level was significantly modified. This will only affect the authors of C extensions to Python, allowing them more flexibility in writing extension types that support numeric operations.
Extension types can now set the type flag Py_TPFLAGS_CHECKTYPES
in their
PyTypeObject
structure to indicate that they support the new coercion model.
In such extension types, the numeric slot functions can no longer assume that
they’ll be passed two arguments of the same type; instead they may be passed two
arguments of differing types, and can then perform their own internal coercion.
If the slot function is passed a type it can’t handle, it can indicate the
failure by returning a reference to the Py_NotImplemented
singleton value.
The numeric functions of the other type will then be tried, and perhaps they can
handle the operation; if the other type also returns Py_NotImplemented
, then
a TypeError
will be raised. Numeric methods written in Python can also
return Py_NotImplemented
, causing the interpreter to act as if the method
did not exist (perhaps raising a TypeError
, perhaps trying another
object’s numeric methods).
See also
A common complaint from Python users is that there’s no single catalog of all the Python modules in existence. T. Middleton’s Vaults of Parnassus at http://www.vex.net/parnassus/ are the largest catalog of Python modules, but registering software at the Vaults is optional, and many people don’t bother.
As a first small step toward fixing the problem, Python software packaged using
the Distutils sdist command will include a file named
PKG-INFO
containing information about the package such as its name,
version, and author (metadata, in cataloguing terminology). PEP 241 contains
the full list of fields that can be present in the PKG-INFO
file. As
people began to package their software using Python 2.1, more and more packages
will include metadata, making it possible to build automated cataloguing systems
and experiment with them. With the result experience, perhaps it’ll be possible
to design a really good catalog and then build support for it into Python 2.2.
For example, the Distutils sdist and bdist_* commands
could support an upload
option that would automatically upload your
package to a catalog server.
You can start creating packages containing PKG-INFO
even if you’re not
using Python 2.1, since a new release of the Distutils will be made for users of
earlier Python versions. Version 1.0.2 of the Distutils includes the changes
described in PEP 241, as well as various bugfixes and enhancements. It will be
available from the Distutils SIG at https://www.python.org/community/sigs/current/distutils-sig/.
Ka-Ping Yee contributed two new modules: inspect.py
, a module for
getting information about live Python code, and pydoc.py
, a module for
interactively converting docstrings to HTML or text. As a bonus,
Tools/scripts/pydoc
, which is now automatically installed, uses
pydoc.py
to display documentation given a Python module, package, or
class name. For example, pydoc xml.dom
displays the following:
Python Library Documentation: package xml.dom in xml
NAME
xml.dom - W3C Document Object Model implementation for Python.
FILE
/usr/local/lib/python2.1/xml/dom/__init__.pyc
DESCRIPTION
The Python mapping of the Document Object Model is documented in the
Python Library Reference in the section on the xml.dom package.
This package contains the following modules:
...
pydoc
also includes a Tk-based interactive help browser. pydoc
quickly becomes addictive; try it out!
Two different modules for unit testing were added to the standard library.
The doctest
module, contributed by Tim Peters, provides a testing
framework based on running embedded examples in docstrings and comparing the
results against the expected output. PyUnit, contributed by Steve Purcell, is a
unit testing framework inspired by JUnit, which was in turn an adaptation of
Kent Beck’s Smalltalk testing framework. See http://pyunit.sourceforge.net/ for
more information about PyUnit.
The difflib
module contains a class, SequenceMatcher
, which
compares two sequences and computes the changes required to transform one
sequence into the other. For example, this module can be used to write a tool
similar to the Unix diff program, and in fact the sample program
Tools/scripts/ndiff.py
demonstrates how to write such a script.
curses.panel
, a wrapper for the panel library, part of ncurses and of
SYSV curses, was contributed by Thomas Gellekum. The panel library provides
windows with the additional feature of depth. Windows can be moved higher or
lower in the depth ordering, and the panel library figures out where panels
overlap and which sections are visible.
The PyXML package has gone through a few releases since Python 2.0, and Python
2.1 includes an updated version of the xml
package. Some of the
noteworthy changes include support for Expat 1.2 and later versions, the ability
for Expat parsers to handle files in any encoding supported by Python, and
various bugfixes for SAX, DOM, and the minidom
module.
Ping also contributed another hook for handling uncaught exceptions.
sys.excepthook()
can be set to a callable object. When an exception isn’t
caught by any try
…except
blocks, the exception will be
passed to sys.excepthook()
, which can then do whatever it likes. At the
Ninth Python Conference, Ping demonstrated an application for this hook:
printing an extended traceback that not only lists the stack frames, but also
lists the function arguments and the local variables for each frame.
Various functions in the time
module, such as asctime()
and
localtime()
, require a floating point argument containing the time in
seconds since the epoch. The most common use of these functions is to work with
the current time, so the floating point argument has been made optional; when a
value isn’t provided, the current time will be used. For example, log file
entries usually need a string containing the current time; in Python 2.1,
time.asctime()
can be used, instead of the lengthier
time.asctime(time.localtime(time.time()))
that was previously required.
This change was proposed and implemented by Thomas Wouters.
The ftplib
module now defaults to retrieving files in passive mode,
because passive mode is more likely to work from behind a firewall. This
request came from the Debian bug tracking system, since other Debian packages
use ftplib
to retrieve files and then don’t work from behind a firewall.
It’s deemed unlikely that this will cause problems for anyone, because Netscape
defaults to passive mode and few people complain, but if passive mode is
unsuitable for your application or network setup, call set_pasv(0)
on
FTP objects to disable passive mode.
Support for raw socket access has been added to the socket
module,
contributed by Grant Edwards.
The pstats
module now contains a simple interactive statistics browser
for displaying timing profiles for Python programs, invoked when the module is
run as a script. Contributed by Eric S. Raymond.
A new implementation-dependent function, sys._getframe([depth])
, has
been added to return a given frame object from the current call stack.
sys._getframe()
returns the frame at the top of the call stack; if the
optional integer argument depth is supplied, the function returns the frame
that is depth calls below the top of the stack. For example,
sys._getframe(1)
returns the caller’s frame object.
This function is only present in CPython, not in Jython or the .NET implementation. Use it for debugging, and resist the temptation to put it into production code.
There were relatively few smaller changes made in Python 2.1 due to the shorter release cycle. A search through the CVS change logs turns up 117 patches applied, and 136 bugs fixed; both figures are likely to be underestimates. Some of the more notable changes are:
A specialized object allocator is now optionally available, that should be
faster than the system malloc()
and have less memory overhead. The
allocator uses C’s malloc()
function to get large pools of memory, and
then fulfills smaller memory requests from these pools. It can be enabled by
providing the --with-pymalloc
option to the configure
script; see Objects/obmalloc.c
for the implementation details.
Authors of C extension modules should test their code with the object allocator
enabled, because some incorrect code may break, causing core dumps at runtime.
There are a bunch of memory allocation functions in Python’s C API that have
previously been just aliases for the C library’s malloc()
and
free()
, meaning that if you accidentally called mismatched functions, the
error wouldn’t be noticeable. When the object allocator is enabled, these
functions aren’t aliases of malloc()
and free()
any more, and
calling the wrong function to free memory will get you a core dump. For
example, if memory was allocated using PyMem_New()
, it has to be freed
using PyMem_Del()
, not free()
. A few modules included with Python
fell afoul of this and had to be fixed; doubtless there are more third-party
modules that will have the same problem.
The object allocator was contributed by Vladimir Marangozov.
The speed of line-oriented file I/O has been improved because people often
complain about its lack of speed, and because it’s often been used as a naïve
benchmark. The readline()
method of file objects has therefore been
rewritten to be much faster. The exact amount of the speedup will vary from
platform to platform depending on how slow the C library’s getc()
was, but
is around 66%, and potentially much faster on some particular operating systems.
Tim Peters did much of the benchmarking and coding for this change, motivated by
a discussion in comp.lang.python.
A new module and method for file objects was also added, contributed by Jeff
Epler. The new method, xreadlines()
, is similar to the existing
xrange()
built-in. xreadlines()
returns an opaque sequence object
that only supports being iterated over, reading a line on every iteration but
not reading the entire file into memory as the existing readlines()
method
does. You’d use it like this:
for line in sys.stdin.xreadlines():
# ... do something for each line ...
...
For a fuller discussion of the line I/O changes, see the python-dev summary for January 1–15, 2001 at https://mail.python.org/pipermail/python-dev/2001-January/.
A new method, popitem()
, was added to dictionaries to enable
destructively iterating through the contents of a dictionary; this can be faster
for large dictionaries because there’s no need to construct a list containing
all the keys or values. D.popitem()
removes a random (key, value)
pair
from the dictionary D
and returns it as a 2-tuple. This was implemented
mostly by Tim Peters and Guido van Rossum, after a suggestion and preliminary
patch by Moshe Zadka.
Modules can now control which names are imported when from module import *
is used, by defining an __all__
attribute containing a list of names that
will be imported. One common complaint is that if the module imports other
modules such as sys
or string
, from module import *
will add
them to the importing module’s namespace. To fix this, simply list the public
names in __all__
:
# List public names
__all__ = ['Database', 'open']
A stricter version of this patch was first suggested and implemented by Ben Wolfson, but after some python-dev discussion, a weaker final version was checked in.
Applying repr()
to strings previously used octal escapes for
non-printable characters; for example, a newline was '\012'
. This was a
vestigial trace of Python’s C ancestry, but today octal is of very little
practical use. Ka-Ping Yee suggested using hex escapes instead of octal ones,
and using the \n
, \t
, \r
escapes for the appropriate characters,
and implemented this new formatting.
Syntax errors detected at compile-time can now raise exceptions containing the filename and line number of the error, a pleasant side effect of the compiler reorganization done by Jeremy Hylton.
C extensions which import other modules have been changed to use
PyImport_ImportModule()
, which means that they will use any import hooks
that have been installed. This is also encouraged for third-party extensions
that need to import some other module from C code.
The size of the Unicode character database was shrunk by another 340K thanks to Fredrik Lundh.
Some new ports were contributed: MacOS X (by Steven Majewski), Cygwin (by Jason Tishler); RISCOS (by Dietmar Schwertberger); Unixware 7 (by Billy G. Allie).
And there’s the usual list of minor bugfixes, minor memory leaks, docstring edits, and other tweaks, too lengthy to be worth itemizing; see the CVS logs for the full details if you want them.


energym.envs.eplus_env.EplusEnv¶
-
class
energym.envs.eplus_env.
EplusEnv
(idf_file, weather_file, discrete_actions=True, weather_variability=None)¶ Environment with EnergyPlus simulator.
OBSERVATIONS
Type: Box(19)
N
Variable name
Max
Min
0
Site Outdoor Air Drybulb Temperature
-5e6
5e6
1
Site Outdoor Air Relative Humidity
-5e6
5e6
2
Site Wind Speed
-5e6
5e6
3
Site Wind Direction
-5e6
5e6
4
Site Diffuse Solar Radiation Rate per Area
-5e6
5e6
5
Site Direct Solar Radiation Rate per Area
-5e6
5e6
6
Zone Thermostat Heating Setpoint Temperature
-5e6
5e6
7
Zone Thermostat Cooling Setpoint Temperature
-5e6
5e6
8
Zone Air Temperature
-5e6
5e6
9
Zone Thermal Comfort Mean Radiant Temperature
-5e6
5e6
10
Zone Air Relative Humidity
-5e6
5e6
11
Zone Thermal Comfort Clothing Value
-5e6
5e6
12
Zone Thermal Comfort Fanger Model PPD
-5e6
5e6
13
Zone People Occupant Count
-5e6
5e6
14
People Air Temperature
-5e6
5e6
15
Facility Total HVAC Electric Demand Power
-5e6
5e6
16
Current day
1
31
17
Current month
1
12
18
Current hour
0
23
DISCRETE ACTIONS
Type: Discrete(10)
Num
Heating setpoint
Cooling setpoint
0
15
30
1
16
29
2
17
28
3
18
27
4
19
26
5
20
25
6
21
24
7
22
23
8
22
22
9
21
21
CONTINUOUS ACTIONS
Type: Box(2)
Num
Variable name
Min
Max
0
Heating setpoint
15.0
22.5
1
Cooling setpoint
22.5
30.0
-
__init__
(idf_file, weather_file, discrete_actions=True, weather_variability=None)¶ Environment with EnergyPlus simulator.
- Parameters
idf_file (str) – Name of the IDF file with the building definition.
weather_file (str) – Name of the EPW file for weather conditions.
discrete_actions (bool, optional) – Whether the actions are discrete (True) or continuous (False). Defaults to True.
weather_variability (tuple, optional) – Tuple with the mean and standard desviation of the Gaussian noise to be applied to weather data. Defaults to None.
Methods
__init__
(idf_file, weather_file[, …])Environment with EnergyPlus simulator.
close
()End simulation.
render
([mode])Environment rendering.
reset
()Reset the environment.
seed
([seed])Sets the seed for this env’s random number generator(s).
step
(action)Sends action to the environment.
Attributes
action_space
observation_space
reward_range
spec
unwrapped
Completely unwrap this env.
-
close
()¶ End simulation.
-
metadata
= {'render.modes': ['human']}¶
-
render
(mode='human')¶ Environment rendering.
-
reset
()¶ Reset the environment.
- Returns
Current observation.
- Return type
np.array
-
step
(action)¶ Sends action to the environment.
- Parameters
action (int or np.array) – Action selected by the agent.
- Returns
Observation for next timestep. float: Reward obtained. bool: Whether the episode has ended or not. dict: A dictionary with extra information.
- Return type
np.array
-


{% extends 'DSSCDB/base.html' %} {% block content %}
Sorry! We can't find the link you are looking for. Please contact us if this is this is incorrect.


Defining Classes in Ruby
Class is in session...
July 19, 2015
Before getting into classes in Ruby, I will take a brief minute to go over one of the most important aspects of Ruby’s design — Object-oriented programming (OOP). Before object orientation, traditional programming would involve a human writing a list of instructions for a machine to follow. Object orientation is similar but based on the different human premise that we see things and interact with them differently; much more… tangibly. We see things, places, and… objects. We interact with these objects and perform functions with these objects. The objects can maintain relationships with other objects. They have parents and children, and like such, can inherit characteristics of their parent object. So when programming, we can model the world based off of strings of text instructions, or, we could model it off of the objects and how we perceive them.
Now, a class, is the “blueprint” from witch individual objects are created. Inside the blueprint you can assign different values and data structures that create your new object. If I created a class “Phone” (note the capitalization) an instance of phone would be your iPhone or your Android phone. The sub-variables would be its functions, i.e., the phone has a camera, a glass capacitive display, and 3000mAh battery. What’s the point? Well, imagine you have a very large coding project that tracks a ton of different data points that you want to perform a consistent action. Are you going to write a bunch of instructions for each data point? That could be tedious and hazardous to your code. Just make a class that stores the data and instructions and then call it when you need it.
So, how do we make one of these ‘class’ things?
We define it! A class in Ruby always starts with the keyword ‘class’ followed by the name of the class that you want to create, e.g., Phone, Bills, Cards, etc.
class Phone end
Inside the class, we can place our variables. For our purposes, we will most likely start off with local variables and instance variables. Local variables are defined in the method and belong to that method, they will not be accessible outside. An instance variable however (denoted with the @sign) is available across methods and also subject to change between objects.
class Cat def initialize(breed, lives) @breed = breed @lives = lives end
When working with instance variables, it’s important to remember that they belong to objects once the objects are created using the class. Each object has individual attributes and does not share any value with other objects. While accessible within the class using the @ operator, to access them outside the class we would use a set of public methods called the accessor methods. If you use attr_ methods within your class, it would create variable methods for you use to use anywhere else with the @ symbol. For read only, you use “attr_reader”, write only would be “attr_writer”, and finally “attr_accessor” would allow for both functions.
So, using the sample code above, we initialized a method that takes two arguments, breed and lives. Let’s say we are categorizing a new species of feline, and we want to compile the data of their breed and how many lives they have (I know that’s not scientifically accurate, but it was what came to my mind first). We can call on our ‘Cat’ class by typing “Cat.new” and categorize a new find named Mittens by typing “mittens = Cat.new(Fluffling, 9)” and thereby create a new object (Mittens) that is a breed of (Fluffling) and happens to have (9) lives.
There’s so much more we can do and so much more I could write about when talking about Ruby’s classes. However, I think that’s enough for now.


Posted: 2016-02-14 1:44pm
(google map)
condition: goodmodel name / number: Boys' 14 Inch Tony Hawk 360 Bike
post id:<PHONE_NUMBER>
posted: 2016-02-14 1:44pm
email to friend
♥ best of [?]


| CKMAME(1) | General Commands Manual | CKMAME(1) |
ckmame
—
ckmame |
[-CcFhjoVv ] [-D
dbfile] [-e
dir] [-O
dbfile] [-R
dir] [-T
file]
[- -all-sets ]
[- -complete-list
file]
[- -complete-games-only ]
[- -config
file]
[- -copy-from-extra ]
[- -create-fixdat ]
[- -extra-directory
dir]
[- -fix ]
[- -fixdat-directory
dir]
[- -game-list
file]
[- -help ]
[- -keep-old-duplicate ]
[- -list-sets ]
[- -missing-list
file]
[- -move-from-extra ]
[- -no-complete-games-only ]
[- -no-create-fixdat ]
[- -no-report-correct ]
[- -no-report-detailed ]
[- -no-report-fixable ]
[- -no-report-missing ]
[- -no-report-no-good-dump ]
[- -no-report-summary ]
[- -old-db
dbfile]
[- -only-if-database-updated ]
[- -report-correct ]
[- -report-detailed ]
[- -report-fixable ]
[- -report-missing ]
[- -report-no-good-dump ]
[- -report-summary ]
[- -rom-db
dbfile]
[- -rom-directory
dir]
[- -roms-unzipped ]
[- -save-directory
dir]
[- -set
pattern]
[- -unknown-directory
dir]
[- -update-database ]
[- -verbose ]
[- -version ]
[game ...] |
ckmame
is a program to check ROM sets for MAME, the
Multiple Arcade Machine Emulator (see
https://www.mamedev.org/), or other emulators that
provide ROM set information in a compatible way. This is the same format as
clrmamepro dat files. ckmame
tells you which ROM files
are missing or have a wrong checksum, can delete unknown and unused files from
the ROM sets, and rename or move files.
MAME is an emulator for numerous arcade machines (video games,
ranging from the 1970s to today). Since MAME is emulating the games, it uses
the original images from the arcade machines' original ROM chips. MAME's
internal database contains extensive information on the ROMs, including the
sizes and checksums of the used ROMs. Since some arcade games are variants
of others and share some of the same ROMs, there are also internal
dependencies between these so called clones. To save space, ROMs can be
archived in zip files and dynamically unzipped by MAME when you play a game.
ckmame
does only support ROM sets stored as zip
files or unpacked, collected in directories per game.
ckmame
tries to create a “split ROM
set” from your current collection. This means that all files needed
by the parent are kept in the parent's zip file, and only the files needed
by the clone (or child) that are different from the parent's are kept in the
child's zip file. For identifying the ROMs ckmame uses the sizes and
checksums; names are only used for verification, since the MAME team often
renames ROMs.
While ckmame
uses MAME's ROM database, it
must be converted into a more efficient format before use. See
mkmamedb(1) for details.
By default, ckmame
will check the games
named on the command line, or all games if none are given. Shell wildcards
are allowed. You can use command line options to select which type of errors
to report.
-
-all-sets
-C
,
-
-complete-games-only
-c
,
-
-report-correct
-
-config
file-
-complete-list
file-
-copy-from-extra
-
-create-fixdat
-D
,
-
-rom-db
dbfile-e
,
-
-extra-directory
dir-F
,
-
-fix
-
-fixdat-directory
dir-
-create-fixdat
) in
dir instead of the current directory.-h
,
-
-help
-j
,
-
-move-from-extra
-
-copy-from-extra
.-
-keep-old-duplicate
-
-list-sets
-
-missing-list
file-
-no-complete-games-only
-
-no-create-fixdat
-
-no-report-correct
-
-no-report-detailed
-
-no-report-fixable
-
-no-report-missing
-
-no-report-no-good-dump
-
-no-report-summary
-O
,
-
-old-db
dbfile-o
,
-
-only-if-database-updated
ckmame
if the database was updated
(implies
-
-update-database
).-R
,
-
-rom-directory
dir-
-report-detailed
-
-report-fixable
-
-report-missing
-
-report-no-good-dump
-
-report-correct
or
-
-report-missing
.-
-report-summary
-
-save-directory
dir-
-set
pattern-T
,
-
-game-list
file-
-roms-unzipped
-
-unknown-directory
dir-
-update-database
-V
,
-
-version
-v
,
-
-verbose
MAMEDB
-
-dbfile
option. Defaults
to “mame.db”.MAMEDB_OLD
-
-old-db
option. Defaults
to “old.db”.The database file to read from defaults to mame.db and the roms are expected in the roms directory.
Unknown files are moved to the sub-directory unknown. Files that will be needed by other games in the ROM set are moved to the saved directory.
ckmame
creates
.ckmame.db files in the rom directory as well as the
directories given with -e
. These files are databases
containing file names, sizes, and their hashes. The database information
used when the file hasn't changed since the last run (i.e. same size and
modification time).
ckmame
Fix all ROMs:
ckmame
-Fd
Fix all ROMs using the files found in updatedir, removing files from there that are copied to the ROM set:
ckmame -Fj -e
updatedir
If a file is marked as “broken”, it means that the computed checksum is not the same as the checksum stored in the zip archive, usually because there has been a decompression error.
If a ROM or disk is marked with “checksum mismatch”, the primary checksum matches, but one of the other checksums does not. The primary checksum for ROMs is CRC32, for disks MD5.
ckmame
was written by Dieter
Baron<EMAIL_ADDRESS>and Thomas Klausner
<EMAIL_ADDRESS>| May 4, 2022 | NiH |