Man pleads not guilty to murder in shooting that killed 3
by EndPlayCLEVELAND (AP) - Authorities say a man suspected in a shooting that left three people dead in Cleveland has pleaded not guilty to aggravated murder.
Twenty-five-year-old Kielonte Harris pleaded not guilty Monday to one count. His bond was set at $1.5 million. Court records don't show an attorney who could speak for him.
Authorities say they found 36-year-old April Magana's body inside a home and 31-year-old Joseph Meeks III dead in an alley Saturday.
An injured Muriel Tursivio was found in a nearby vacant lot and died at a hospital.
Police say all three had been attending a party and were shot in the head after a verbal altercation.
A prosecutor said at Monday's hearing that he expects additional charges to be filed against Harris.


These documents describe all publically usable APIs.
If a subroutine or function, or indeed one of its arguments, is not mentioned above, it is not to be considered part of the stable API, even if it is accessible.
The astute developer is reminded that all times the final reference documentation is the source, which is publically available.
This documentation describes version 2.1 of the FoX library
FoX was originally based on the version 1.2 of the xmlf90 library, but has since evolved heavily.
This release version includes output modules for general XML, and for CML, and also a Fortran version of the SAX2 input parser interface
This is a stable branch, which will be maintained with important bugfixes, but on which no further major development will occur.
Version 2.1 has support for outputting complete XML documents, with support for all XML objects described in XML11, and XML Namespaces. A detailed description of its precise conformance level is in the WXML documentation.
In addition, there is a large suite of routines available for outputting valid CML documents.
There is also a SAX input module, compatible with the SAX 2 standard - pprecise conformance details listed in the SAX documentation.
Input modules are under development for DOM and XPath, and will be released with a later version.
You will have received the FoX source code as a tar.gz file.
Unpack it as normal, and change directory into the top-level directory, FoX.
FoX requires a Fortran 95 compiler - not just Fortran 90. All currently available versions of Fortran compilers claim to support F95. If your favoured compiler is not listed as working below, I recommend the use of g95, which is free to download and use. And if your favourite compiler is listed as not working, then please send a bug report to your compiler vendor.
Version 2.1.0 has been tested extensively on g95 and NAG, and is known to work on g95 (2006-11-21), and NAG Fortran 5.0, patch 391. Results from other compilers are welcome.
As of version 2.0.2, the following compilers were tested and are known to work:
and the following compilers tested and known to fail
Other compilers are untested; reports of their success or failure are welcomed.
In order to generate the Makefile, make sure that you have a Fortran compiler in your PATH
, and do:
config/configure
This should suffice for most installations. However:
If you have more than one Fortran compiler available, or it is not on your PATH
, you can force the choice by doing:
config/configure FC=/path/to/compiler/of/choice
It is possible that the configuration fails. In this case
By default the resultant files are installed under the objs directory. If you wish them to be installed elsewhere, you may do
config/configure --prefix=/path/to/installation
Note that the configure process encodes the current directory location in several places. If you move the FoX directory later on, you will need to re-run configure.
In order to compile the full library, now simply do:
make
This will build all the FoX modules, and all the examples. However, you may only be interested in building the libraries, or perhaps a subset of the libraries. In that case, the following targets are available:
wxml_lib
wcml_lib
sax_lib
Three test-suites are supplied; in common/test
, wxml/test
, and wcml/test
. In each case, cd
to the relevant directory and then run ./run_tests.sh
.
(The sax testsuite is available separately. Please contact the author for details.)
The tests will run and then print out the number of passes and fails. Details of failing tests may be found in the file failed.out
.
Known failures:
* test_xml_Close_2
sometimes unexpectedly fails - this is not a problem, ignore it.
If any other failures occur, please send a message to the mailing list<EMAIL_ADDRESS>with details of compiler, hardware platform, and the nature of the failure.
A script is provided which will provide the appropriate compiler and linker flags for you; this will be created after configuration, in the top-level directory, and is called FoX-config
. It may be taken from there and placed anywhere.
FoX-config takes the following arguments:
--fcflags
: return flags for compilation--libs
: return flags for linking--wxml
: return flags for compiling/linking against wxml--wcml
: return flags for compiling/linking against wcml--sax
: return flags for compiling/linking against saxIf it is called with no arguments, it will expand to compile & link flags, thusly:
f95 -o program program.f90 `FoX-config`
For compiling only against FoX, do the following:
f95 -c `FoX-config --fcflags` sourcefile.f90
For linking only to the FoX library, do:
f95 -o program `FoX-config --libs` *.o
or similar, according to your compilation scheme.
Note that by default, FoX-config
assumes you are using all modules of the library. If you are only using part, then this can be specified by also passing the name of each module required, like so:
FoX-config --fcflags --wcml
The recommended way to use FoX is to embed the full source code into an existing project.
(It would be possible to extract portions of the code, and embed just the ones that you need, but I recommend against it; it would be easy to lose parts of the code which are essential for generating good XML.)
In order to do this, you need to do something like the following:
There is an example of suggested use in the examples/
subdirectory.
The easiest, and least intrusive way is probably to create a F90 module for your program, looking something like example_xml_module.f90
Then you must somewhere (probably in your main program), use this module, and call initialize_xml_output()
at the start; and then end_xml_output()
at the end of the program.
In any of the subroutines where you want to output data to the xml file, you should then insert use example_cml_moule
at the beginning of the subroutine. You can then use any of the cml output routines with no further worries, as shown in the examples.
It is easy to make the use of FoX optional, by the use of preprocessor defines. This can be done simply by wrapping each call to your XML wrapper routines in #ifdef XML
, or similar.
If you have some sort of automatic Makefile configuration; for picking up which compiler to use, etc. then within whatever script you use to do this, you should insert a sequence of commands like:
(cd FoX; config/configure; cd ..)
This will instruct FoX to perform its own automatic configuration process.
Within the Makefile itself, you need to alter your compiler flags in the following fashion. Assuming that you have some sort of FFLAGS Makefile variable, then it should be amended like so:
FFLAGS="$(FFLAGS) `FoX/FoX-config --fcflags`"
You must also alter the linking step to include the FoX subroutines Again, assuming that you have some sort of variable LDFLAGS holding your linking flags, then it should be amended like so:
LDFLAGS="$(LDFLAGS) `FoX/FoX-config --libs`"
If you don't have any automatic Makefile configuration, and rely on the user making hand-edited changes to Makefiles, then you must add to your documentation how to configure & build FoX.
FoX_common is a module exporting interfaces to a set of convenience functions common to all of the FoX modules, which are of more general use.
Currently, the only publically available function is str
, which converts primitive datatypes into strings in a consistent fashion, conformant with the expectations of XML processors.
It is fully described in StringFormatting
Many of the routines in wxml, and indeed in wcml which is built on top of wxml, are overloaded so that data may be passed to the same routine as string, integer, logical or real data.
In such cases, a few notes on the conversion of non-textual data to text is on order. The standard Fortran I/O formatting routines do not offer the control required for useful XML output, so FoX performs all its own formatting.
This formatting is done internally through a function which is also available publically to the user, str
.
To use this in your program, import it via:
use FoX_common, only; str
and use it like so:
print*, str(data)
In addition, for ease of use, the //
concatenation operator is overloaded, such that strings can easily be formed by concatenation of strings to other datatypes. To use this you must import it via:
use FoX_common, only: operator(//)
and use it like so:
integer :: data
print*, "This is a number "//data
This will work for all native Fortran data types - but no floating point formatting is available as described below with concatenation, only with str()
You may pass data of the following primitive types to str
:
Character data is returned unchanged.
Logical data is output such that True values are converted to the string 'true', and False to the string 'false'.
Integer data is converted to the standard decimal representation.
Real numbers, both single and double precision, are converted to strings in one of two ways, with some control offered to the user. The output will conform to the real number formats specified by XML Schema Datatypes.
This may be done in one of two ways:
Exponential notation, with variable number of significant figures. Format strings of the form "s
n" are accepted, where n is the number of significant figures.
Thus the number 111
, when output with various formats, will produce the following output:
| s1 | 1e2 |
| s2 | 1.1e2 |
| s3 | 1.11e2 |
| s4 | 1.110e2 |
The number of significant figures should lie between 1 and the number of digits precision provided by the real kind. If a larger or smaller number is specified, output will be truncated accordingly. If unspecified, then a sensible default will be chosen.
This format is not permitted by XML Schema Datatypes 1.0, though it is in 2.0
Non-exponential notation, with variable number of digits after the decimal point. Format strings of the form "r
n", where n is the number of digits after the decimal point.
Thus the number 3.14159
, when output with various formats, will produce the following output:
| r0 | 3 |
| r1 | 3.1 |
| r2 | 3.14 |
| r3 | 3.142 |
The number of decimal places must lie between 0 and whatever would output the maximum digits precision for that real kind. If a larger or smaller number is specified, output will be truncated accorsingly. If unspecified, then a sensible default will be chosen.
This format is the only one permitted by XML Schema Datatypes 1.0
If no format is specified, then a default of exponential notation will be used.
If a format is specified not conforming to either of the two forms above, a run-time error will be generated.
NB Since by using FoX or str, you are passing real numbers through various functions, this means that they must be valid real numbers. A corollary of this is that if you pass in +/-Infinity, or NaN, then the behaviour of FoX is unpredictable, and may well result in a crash. This is a consequence of the Fortran standard, which strictly disallows doing anything at all with such numbers, including even just passing them to a subroutine.
Complex numbers will be output as pairs of real numbers, in the following way:
(1.0e0)+i(1.0e0)
where the two halves can be formatted in the way described for 'Real numbers' above; only one format may be specified, and it will apply to both.
All the caveats described above apply for complex number as well; that is, output of complex numbers either of whose components are infinite or NaN is illegal in Fortran, and more than likely will cause a crash in FoX.
All of the above types of data may be passed in as arrays and matrices as well. In this case, a string containing all the individual elements will be returned, ordered as they would be in memory, each element separated by a single space.
If the data is character data, then there is an additional option to str, delimiter
which may be any single-character string, and will replace a space as the delimiter.
All functions in wxml which can accept arbitrary data (roughly, wherever you put anything that is not an XML name; attribute values, pseudo-attribute values, character data) will take scalars, arrays, and matrices of any of the above data types, with fmt=
and delimiter=
optional arguments where appropriate.
Similarly, wcml functions which can accept varied data will behave similarly.
wxml
is a general Fortran XML output library. It offers a Fortran interface, in the form of a number of subroutines, to generate well-formed XML documents. Almost all of the XML features described in XML11 and Namespaces are available, and wxml
will diagnose almost all attempts to produce an invalid document. Exceptions below describes where wxml
falls short of these aims.
First, Conventions describes the conventions use in this document.
Then, Functions lists all of wxml
's publically exported functions, in three sections:
Please note that where the documentation below is not clear, it may be useful to look at some of the example files. There is a very simple example in the examples/
subdirectory, but which nevertheless shows the use of most of the features you will use.
A more elaborate example, using almost all of the XML features found here, is available in the top-level directory as wxml_example.f90
. It will be automatically compiled as part of the build porcess.
monospace
Note that where strings are passed in, they will be passed through entirely unchanged to the output file - no truncation of whitespace will occur.
It is strongly recommended that the functions be used with keyword arguments rather than replying on implicit ordering.
xmlf_t
This is an opaque type representing the XML file handle. Each function requires this as an argument, so it knows which file to operate on. (And it is an output of the xml_OpenFile subroutine) Since all subroutines require it, it is not mentioned below.
xml_OpenFile
Open a file for writing XML
By default, the XML will have no extraneous text nodes. This has the effect of it looking slightly ugly, since there will be no newlines inserted between tags.
This behaviour can be changed to produce slightly nicer looking XML, by switching on broken_indenting. This will insert newlines and spaces between some tags where they are unlikely to carry semantics. Note, though, that this does result in the XML produced being not quite what was asked for, since extra characters and text nodes have been inserted.
NB: The replace option should be noted. By default, xml_OpenFile will fail with a runtime error if you try and write to an existing file. If you are sure you want to continue on in such a case, then you can specify **replace**=.true.
and any existing files will be overwritten. If finer granularity is required over how to proceed in such cases, use the Fortran inquire
statement in your code. There is no 'append' functionality by design - any XML file created by appending to an existing file would almost certainly be invalid.
xml_Close
Close an opened XML file, closing all still-opened tags so that it is well-formed.
xml_NewElement
Open a new element tag
xml_EndElement
Close an open tag
xml_AddAttribute
Add an attribute to the currently open tag.
By default, if the attribute value contains markup characters, they will be escaped automatically by wxml before output.
However, in rare cases you may not wish this to happen - if you wish to output Unicode
characters, or entity references. In this case, you should set escape=.false.
for the relevant
subroutine call. Note that if you do this, no checking on the validity of the output string iis performed; the onus is on you to ensure well-formedness
The value to be added may be of any type; it will be converted to text according to FoX's formatting rules, and if it is a 1- or 2-dimensional array, the elements will all be output, separated by spaces (except if it is a character array, in which case the delimiter may be changed to any other single character using an optional argument).
xml_AddCharacters
Add text data. The data to be added may be of any type; they will be converted to text according to FoX's formatting rules, and if they are a 1- or 2-dimensional array, the elements will all be output, separated by spaces (except if it is a character array, in which case the delimiter may be changed to any other single character using an optional argument).
xml_AddNewline
Within the context of character output, add a (system-dependent) newline character. This function can only
be called wherever xml_AddCharacters
can be called. (Newlines outside of character context are under
FoX's control, and cannot be manipulated by the user.)
xml_DeclareNamespace
Add an XML Namespace declaration. This function may be called at any time, and its precise effect depends on when it is called; see below
xml_UndeclareNamespace
Undeclare an XML namespace. This is equivalent to declaring an namespace with an empty URI, and renders the namespace ineffective for the scope of the declaration. For explanation of its scope, see below.
NB Use of xml_UndeclareNamespace
implies that the resultant document will be compliant with XML Namespaces 1.1, but not 1.0; wxml will issue an error when trying to undeclare namespaces under XML 1.0.
If xml_[Un]declareNamespace
is called immediately prior to an xml_NewElement
call, then the namespace will be declared in that next element, and will therefore take effect in all child elements.
If it is called prior to an xml_NewElement
call, but that element has namespaced attributes
To explain by means of example: In order to generate the following XML output:
<cml:cml xmlns:cml="http://www.xml-cml.org/schema"/>
then the following two calls are necessary, in the prescribed order:
xml_DeclareNamespace(xf, 'cml', 'http://www.xml-cml.org')
xml_NewElement(xf, 'cml:cml')
However, to generate XML input like so:
xml_AddNamespace
call is made before the element tag is closed (either by xml_EndElement
, or by a new element tag being opened, or some text being added etc.) the correct XML will be generated.
Two previously mentioned functions are affected when used in a namespace-aware fashion.
xml_NewElement
, xml_AddAttribute
The element or attribute name is checked, and if it is a QName (ie if it is of the form prefix:tagName) then wxml will check that prefix is a registered namespace prefix, and generate an error if not.
If you don't know the purpose of any of these, then you don't need to.
xml_AddXMLDeclaration
Add XML declaration to the first line of output. If used, then the file must have been opened with addDecl = .false.
, and this must be the first wxml call to the document.o
NB The only XML versions available are 1.0 and 1.1. Attempting to specify anything else will result in an error. Specifying version 1.0 results in additional output checks to ensure the resultant document is XML-1.0-conformant.
NB Note that if the encoding is specified, and is specified to not be UTF-8, then if the specified encoding does not match that supported by the Fortran processor, you may end up with output you do not expect.
xml_AddDOCTYPE
Add an XML document type declaration. If used, this must be used prior to first xml_NewElement
call, and only one such call must be made.
xml_AddInternalEntity
Define an internal entity for the document. If used, this call must be made after xml_AddDOCTYPE
and before the first xml_NewElement
call.
xml_AddExternalEntity
Define an external entity for the document. If used, this call must be made after xml_AddDOCTYPE
and before the first xml_NewElement
call.
xml_AddParameterEntity
Define a parameter entity for the document. If used, this call must be made after xml_AddDOCTYPE
and before the first xml_NewElement
call.
xml_AddNotation
Define a notation for the document. If used, this call must be made after xml_AddDOCTYPE
and before the first xml_NewElement
call.
xml_AddElementToDTD
Add an ELEMENT declaration to the DTD. The syntax of the declaration is not checked in any way, nor does this affect how elements may be added in the content of the XML document.
If used, this call must be made after xml_AddDOCTYPE
and before the first xml_NewElement
call.
xml_AddAttlistToDTD
Add an ATTLIST declaration to the DTD. The syntax of the declaration is not checked in any way, nor does this affect how attributes may be added in the content of the XML document.
If used, this call must be made after xml_AddDOCTYPE
and before the first xml_NewElement
call.
xml_AddPEreferenceToDTD
Add a reference to a Parameter Entity in the DTD. No check is made according to whether the PE exists, has been declared, or may legally be used.
If used, this call must be made after xml_AddDOCTYPE
and before the first xml_NewElement
call.
xml_AddXMLStylesheet
Add XML stylesheet processing instruction, as described in [Stylesheets]. If used, this call must be made before the first xml_NewElement
call.
xml_AddXMLPI
Add an XML Processing Instruction.
If data is present, nothing further can be added to the PI. If it is not present, then pseudoattributes may be added using the call below.
Normally, the name is checked to ensure that it is XML-compliant. This requires that PI targets not start with [Xx][Mm][Ll]
, because such names are reserved. However, some are defined by later W3 specificataions. If you wish to use such PI targets, then set xml=.true.
when outputting them.
The output PI will look like:
<?name data?>
xml_AddPseudoAttribute
Add a pseudoattribute to the currently open PI
xml_AddComment
Add an XML comment
xml_AddEntityReference
This may be used anywhere that xml_AddCharacters
may be, and will insert an entity reference into the contents of the XML document at that point. Note that if the entity inserted is a character entity, its validity well be checked according to the rules of XML-1.1, not 1.0.
If the entity reference is not a character entity, then no check is made of its validity, and a warning will be issued
These functions may be of use in building wrapper libraries:
xmlf_Name
result(string)Return the filename of an open XML file
xmlf_OpenTag
result(string)Return the currently open tag of the current XML file (or the empty string if none is open)
Below are explained areas where wxml fails to implement the whole of XML 1.0/1.1; numerical references below are to the sections in [XML11]]. These are divided into two lists:
Ways in which wxml renders it impossible to produce a certain sort of well-formed XML document:
xml_NewElement
, or within an element attribute value. (In principle it should be possible to start the root element from within an entity reference). wxml will try very hard to ensure that output is well-formed. However, it is possible to fool wxml into producing ill-formed XML documents. Avoid doing so if possible; for completeness these ways are listed here. In all cases where ill-formedness is a possibility, a warning will be issued.
xml_AddAttribute
can be told not to escape its input. In this case, however, no checking at all is performed on the validity of the output string. A warning will be issued if this is done.Finally, it should be noted (although it is obvious from the above) that wxml makes no attempt at all to ensure that output documents are valid XML (by any definition of valid.)
[XML10]: W3C Recommendation, http://www.w3.org/TR/REC-xml/
[XML11]: W3C Recommendation, http://www.w3.org/TR/xml11
[Namespaces]: W3C Recommendation, http://www.w3.org/TR/xml-names11
[Stylesheets]: W3C Recommendation, http://www.w3.org/TR/xml-stylesheet
WCML is a library for outputting CML data. It wraps all the necessary XML calls, such that you should never need to touch any WXML calls when outputting CML.
The CML output is conformant to version 2.4 of the CML schema.
The available functions and their intended use are listed below. Quite deliberately, no reference is made to the actual CML output by each function.
Wcml is not intended to be a generalized Fortran CML output layer. rather it is intended to be a library which allows the output of a limited set of well-defined syntactical fragments.
Further information on these fragments, and on the style of CML generated here, is available at http://www.uszla.me.uk/specs/subset.html.
This section of the manual will detail the available CML output subroutines.
wcml subroutines can be accessed from within a module or subroutine by inserting
use FoX_wcml
at the start. This will import all of the subroutines described below, plus the derived type xmlf_t
needed to manipulate a CML file.
No other entities will be imported; public/private Fortran namespaces are very carefully controlled within the library.
The use of dictionaries with WCML is strongly encouraged. (For those not conversant with dictionaries, a fairly detailed explanation is available at http://www.xml-cml.org/information/dictionaries)
In brief, dictionaries are used in two ways.
Firstly, to identify and disambiguate output data. Every output function below takes an optional argument, dictRef=""
. It is intended that every piece of data output is tagged with a dictionary reference, which will look something like nameOfCode:nameOfThing
.
So, for example, in SIESTA, all the energies are output with different dictRefs, looking like: siesta:KohnShamEnergy
, or siesta:kineticEnergy
, etc. By doing this, we can ensure that later on all these numbers can be usefully identified.
We hope that ultimately, dictionaries can be written for codes, which will explain what some of these names might mean. However, it is not in any way necessary that this be done - and using dictRef
attributes will help merely by giving the ability to disambiguate otherwise indistinguishable quantities.
We strongly recommend this course of action - if you choose to do follow our recommendation, then you should add a suitable Namespace to your code. That is, immediately after cmlBeginFile
and before cmlStartCml
, you should add something like:
call cmlAddNamespace(xf=xf, 'nameOfCode', 'WebPageOfCode')
Again, for SIESTA, we add:
call cmlAddNamespace(xf, 'siesta, 'http://www.uam.es/siesta')
If you don't have a webpage for your code, don't worry; the address is only used as an identifier, so anything that looks like a URL, and which nobody else is using, will suffice.
Secondly, we use dictionaries for units. This is compulsory (unlike dictRef
s above). Any numerical quantity that is output through cmlAddProperty or cmlAddParameter is required to carry units. These are added with the units=""
argument to the function. In addition, every other function below which will take numerical arguments also will take optional units, although default will be used if no units are supplied.
Further details are supplied in section Units below.
Functions are named in the following way:
All functions begin
cml
To begin and end a section of the CML file, a pair of functions will exist:
cmlStart
somethingcmlEnd
somethingTo output a given quantity/property/concept etc. a function will exist
cmlAdd
something
monospace
Note that where strings are passed in, they will be passed through entirely unchanged to the output file - no truncation of whitespace will occur.
Also note that wherever a real number can be passed in (including through anytype) then the formatting can be specified using the conventions described in StringFormatting
Where an array is passed in, it may be passed either as an assumed-shape array; that is, as an F90-style array with no necessity for specifying bounds; thusly:
integer :: array(50)
call cmlAddProperty(xf, 'coords', array)
or as an assumed-size array; that is, an F77-style array, in which case the length must be passed as an additional parameter:
integer :: array(*)
call cmlAddProperty(xf, 'coords', array, nitems=50)
Similarly, when a matrix is passed in, it may be passed in both fashions:
integer :: matrix(50, 50)
call cmlAddProperty(xf, 'coords', matrix)
or
integer :: array(3, *)
call cmlAddProperty(xf, 'coords', matrix, nrows=3, ncols=50)
All functions take as their first argument an XML file object, whose keyword is always xf
. This file object is initialized by a cmlBeginFile
function.
It is highly recommended that subroutines be called with keywords specified rather than relying on the implicit ordering of arguments. This is robust against changes in the library calling convention; and also stepsides a significant cause of errors when using subroutines with large numbers of arguments.
Note below that the functions cmlAddParameter
and cmlAddProperty
both require that units be specified for any numerical quantities output.
If you are trying to output a quantity that is genuinely dimensionless, then you should specify units="units:dimensionless"
; or if you are trying to output a countable quantity (eg number of CPUs) then you may specify units="units:countable"
.
For other properties, all units should be specified as namespaced quantities. If you are using a very few common units, it may be easiest to borrow definitions from the provided dictionaries;
(These links do not resolve yet.)
cmlUnits: http://www.xml-cml.org/units/units
siUnits: <http://www.xml-cml.org/units/siUnits
atomicUnits: http://www.xml-cml.org/units/atomic
A default units dictionary, containing only the very basic units that wcml needs to know about, which has a namespace of: http://www.uszla.me.uk/FoX/units
, and wcml assigns it automatically to the prefix units
.
This is added automatically, so attempts to add it manually will fail.
The contents of all of these dictionaries, plus the wcml dictionary, may be viewed at: http://www.uszla.me.uk/unitsviz/units.cgi.
Otherwise, you should feel at liberty to construct your own namespace;
declare it using cmlAddNamespace
, and markup all your units as:
units="myNamespace:myunit"
cmlBeginFile
This takes care of all calls to open a CML output file.
cmlFinishFile
This takes care of all calls to close an open CML output file, once you have finished with it. It is compulsory to call this - if your program finished without calling this, then your CML file will be invalid.
cmlAddNamespace
This adds a namespace to a CML file.
NB This may only ever be called immediately after a cmlBeginFile
call, before any
output has been performed.
Attempts to do otherwise will result in a runtime error.
This will be needed if you are adding dictionary references to your output. Thus for siesta, we do:
call cmlAddNamespace(xf, 'siesta', 'http://www.uam.es/siesta')
and then output all our properties and parameters with dictRef="siesta:something"
.
cmlStartCml
(fileId) string scalar: name of originating file. (default: current filename)
(version) string scalar: version of CML in use. (default: 2.4)
cmlEndCml
This pair of functions begin and end the CML output to an existing CML file. It takes care of namespaces.
Note that unless specified otherwise, there will be a convention
attribute added to the cml
tag specifying FoX_wcml-2.0
as the convention. (see http://www.uszla.me.uk/FoX for details)
cmlStartMetadataList
(name) string scalar: name for the metadata list
(role) string scalar role which the element plays
cmlEndMetadataList
This pair of functions open & close a metadataList, which is a wrapper for metadata items.
cmlStartParameterList
(ref) string scalar: Reference an id
attribute of another element (generally deprecated)
(role) string scalar role which the element plays
cmlEndParameterList
This pair of functions open & close a parameterList, which is a wrapper for input parameters.
cmlStartPropertyList
(ref) string scalar: Reference an id
attribute of another element (generally deprecated)
(role) string scalar role which the element plays
cmlEndPropertyList
This pair of functions open & close a propertyList, which is a wrapper for output properties.
cmlStartBandList
cmlEndBandList
Start/end a list of bands (added using cmlAddBand
below)
cmlStartKpointList
cmlEndKpointList
Start/end a list of k-points (added using cmlAddKpoint
below)
cmlStartModule
Note that in most cases where you might want to use a serial number, you should probably be using the cmlStartStep
subroutine below.
cmlEndModule
This pair of functions open & close a module of a computation which is unordered, or loosely-ordered. For example, METADISE uses one module for each surface examined.
cmlStartStep
(index) integer scalar: index number for the step. In the absence of an index, steps will be assumed to be consecutively numbered. Specifying this is useful if you wish to output eg every hundredth step.
(type) string scalar: what sort of step is this? This should be a namespaced string, for example: siesta:CG
is a Conjugate Gradient step in siesta.
cmlEndStep
This pair of functions open and close a module of a computation which is strongly ordered. For example, DLPOLY uses steps for each step of the simulation.
cmlAddMetadata
This adds a single item of metadata. Metadata vocabulary is completely uncontrolled within WCML. This means that metadata values may only be strings of characters. If you need your values to contain numbers, then you need to define the representation yourself, and construct your own strings.
cmlAddParameter
id
attribute of another element (generally deprecated) This function adds a tag representing an input parameter
cmlAddProperty
id
attribute of another element (generally deprecated) This function adds a tag representing an output property
cmlAddMolecule
cartesian
- the coordinates are Cartesian, or fractional
- the coordinates are fractional. The default is Cartesian. id
attribute of another element (generally deprecated) Outputs an atomic configuration.
cmlAddLattice
real
or reciprocal
space. Outputs information about a unit cell, in lattice-vector form
cmlAddCrystal
units:angstrom
units:degrees
Outputs information about a unit cell, in crystallographic form
cmlAddBand
Output eigenvalues for a band.
cmlAddKpoint
"r3"
) "r3"
) Output a k-point
cmlAddEigen
column
or row
oriented? Output a set of eigenvalues and eigenvectors
All cmlAdd
and cmlStart
routines take the following set of optional arguments:
id
: Unique identifying string for element. (Uniqueness is not enforced, though duplicated ids on output are usually an error and may cause later problems) title
: Human-readable title of element for display purposes dictRef
: reference to disambiguate element. Should be a QName; a namespaced string. An actual dictionary entry may or may not exist. It is not an error for it not to. convention
: convention by which the element is to be read. convention
is deliberately loose.)Following experience integrating FoX into several codes, here are a few tips for debugging any problems you may encounter.
You may encounter problems at the compiling or linking stage, with error messages along the lines of: 'No Specific Function can be found for this Generic Function' (exact phrasing depending on compiler, of course.)
If this is the case, it is possible that you have accidentally got the arguments to the offending out of order. If so, then use the keyword form of the argument to ensure correctness; that is, instead of doing:
call cmlAddProperty(file, name, value)
do:
call cmlAddProperty(xf=file, name=name, value=value)
This will prevent argument mismatches, and is recommended practise in any case.
You may encounter run-time issues. FoX performs many run-time checks to ensure the validity of the resultant XML code. In so far as it is possible, FoX will either issue warnings about potential problems, or try and safely handle any errors it encounters. In both cases, warning will be output on stderr, which will hopefully help diagnose the problem.
Sometimes, however, FoX will encounter a problem it can do nothing about, and must stop. In all cases, it will try and write out an error message highlighting the reason, and generate a backtrace pointing to the offending line. Occasionally though, the compiler will not generate this information, and the error message will be lost.
If this is the case, you can either investigate the coredump to find the problem, or (if you are on a Mac) look in ~/Library/Logs/CrashReporter to find a human-readable log.
If this is not enlightening, or you cannot find the problem, then some of the most common issues we have encountered are listed below. Many of them are general Fortran problems, but sometimes are not easily spotted in the context of FoX.
Make sure, whenever you are writing out a real number through one of FoX's routines, and specifying a format, that the format is correct according to StringFormatting. Fortran-style formats are not permitted, and will cause crashes at runtime.
If you are outputting arrays or matrices, and are doing so in the traditional Fortran style - by passing both the array and its length to the routine, like so:
call xml_AddAttribute(xf=file, name=name, value=array, nvalue=n)
then if n
is wrong, you may end up with an array overrun, and cause a crash.
We highly recommend wherever possible using the Fortran-90 style, like so:
call xml_AddAttribute(xf=file, name=name, value=array)
where the array length will be passed automatically.
If you are passing variables to FoX which have not been initialized, you may well cause a crash. This is especially true, and easy to cause if you are passing in an array which (due to a bug elsewhere) has been partly but not entirely initialized. To diagnose this, try printing out suspect variables just before passing them to FoX, and look for suspiciously wrong values.
If during the course of your calculation you accidentally generate Infinities, or NaNs, then passing them to any Fortran subroutine can result in a crash - therefore trying to pass them to FoX for output may result in a crash.
If you suspect this is happening, try printing out suspect variables before calling FoX.
SAX stands for Simple API for XML, and was originally a Java API for reading XML. (Full details at http://saxproject.org). SAX implementations exist for most common modern computer languages.
FoX includes a SAX implementation, which translates most of the Java API into Fortran, and makes it accessible to Fortran programs, enabling them to read in XML documents in a fashion as close and familiar as possible to other languages.
SAX is a stream-based, event callback API. Conceptually, running a SAX parser over a document results in the parser generating events as it encounters different XML components, and sends the events to the main program, which can read them and take suitable action.
Events are generated when the parser encounters, for example, an element opening tag, or some text, and most events carry some data with them - the name of the tag, or the contents of the text.
The full list of events is quite extensive, and may be seen below. For most purposes, though, it is unlikely that most users will need more than the 5 most common events, documented here.
Given these events and accompanying information, a program can extract data from an XML document.
Any program using the FoX SAX parser must a) use the FoX module, and b) declare a derived type variable to hold the parser, like so:
use FoX_sax
type(xml_t) :: xp
The FoX SAX parser then works by requiring the programmer to write a module containing subroutines to receive any of the events they are interested in, and passing these subroutines to the parser.
Firstly, the parser must be initialized, by passing it XML data. This can be done either by giving a filename, which the parser will manipulate, or by passing a string containing an XML document. Thus:
call open_xml_file(xp, "input.xml", iostat)
The iostat
variable will report back any errors in opening the file.
Alternatively,
call open_xml_string(xp, XMLstring)
where XMLstring
is a character variable.
To now run the parser over the file, you simply do:
call parse(xp, list_of_event_handlers)
And once you're finished, you can close the file, and clean up the parser, with:
call close_xml_t(xp)
To receive events, you must construct a module containing event handling subroutines. These are subroutines of a prescribed form - the input & output is predetermined by the requirements of the SAX interface, but the body of the subroutine is up to you.
The required forms are shown in the API documentation below, but here are some simple examples.
To receive notification of character events, you must write a subroutine which takes as input one string, which will contain the characters received. So:
module event_handling
use FoX_sax
contains
subroutine characters_handler(chars)
character(len=*), intent(in) :: chars
print*, chars
end subroutine
end module
That does very little - it simply prints out the data it receives. However, since the subroutine is in a module, you can save the data to a module variable, and manipulate it elsewhere; alternatively you can choose to call other subroutines based on the input.
So, a complete program which reads in all the text from an XML document looks like this:
module event_handling
use FoX_sax
contains
subroutine characters_handler(chars)
character(len=*), intent(in) :: chars
print*, chars
end subroutine
end module
program XMLreader
use FoX_sax
use event_handling
type(xml_t) :: xp
call open_xml_file(xp, 'input.xml')
call parse(xp, characters_handler=characters_handler)
call close_xml_t(xp)
end program
The other likely most common event is the startElement event. Handling this involves writing a subroutine which takes as input three strings (which are the local name, namespace URI, and fully qualified name of the tag) and a dictionary of attributes.
An attribute dictionary is essentially a set of key:value pairs - where the key is the attributes name, and the value is its value. (When considering namespaces, each attribute also has a URI and localName.)
Full details of all the dictionary-manipulation routines are given in AttributeDictionaries(#AttributeDictionaries), but here we shall show the most common.
len(dictionary)
- returns the number of entries in the dictionary (the number of attributes declared)
getKey(dictionary, i)
(where i
is an integer) returns a string containing the key of the i
th dictionary entry (ie, the name of the i
th attribute.
getValue(dictionary, i)
(where i
is an integer) returns a string containing the value of the i
th dictionary entry (ie the value of the i
th attribute.
hasKey(dictionary, key)
(where key
is a string) returns .true.
or .false.
depending on whether an attribute named key
is present.
hasKey(dictionary, URI, localname)
(where URI
and localname
are strings) returns .true.
or .false.
depending on whether an attribute with the appropriate URI
and localname
is present.
getValue(dictionary, URI, localname)
(where URI
and localname
are strings) returns a string containing the value of the attribute with the appropriate URI
and localname
(if it is present)
So, a simple subroutine to receive a startElement event would look like:
module event_handling
contains
subroutine startElement_handler(URI, localname, name,attributes)
character(len=*), intent(in) :: URI
character(len=*), intent(in) :: localname
character(len=*), intent(in) :: name
type(dictionary_t), intent(in) :: attributes
integer :: i
print*, name
do i = 1, len(attributes)
print*, getKey(attributes, i), '=', getValue(attributes, i)
enddo
end subroutine startElement_handler
end module
program XMLreader
use FoX_sax
use event_handling
type(xml_t) :: xp
call open_xml_file(xp, 'input.xml')
call parse(xp, startElement_handler=startElement_handler)
call close_xml_t(xp)
end program
Again, this does nothing but print out the name of the element, and the names and values of all of its attributes. However, by using module variables, or calling other subroutines, the data could be manipulated further.
The SAX parser detects all XML well-formedness errors. By default, when it encounters an error, it will simply halt the program with a suitable error message. However, it is possible to pass in an error handling subroutine if some other behaviour is desired - for example it may be nice to report the error to the user, and carry on with some other task.
In any case, once an error is encountered, the parser will finish. There is no way to continue reading past an error.
An error handling suubroutine works in the same way as any other event handler, with the event data being an error message. Thus, you could write:
subroutine error_handler(msg)
character(len=*), intent(in) :: msg
print*, "The SAX parser encountered an error:"
print*, msg
print*, "Never mind, carrying on with the rest of the calcaulation."
end subroutine
There is one derived type, xml_t
. This is entirely opaque, and is used as a handle for the parser.
There are four subroutines:
open_xml_file
type(xml_t), intent(inout) :: xp
character(len=*), intent(in) :: string
integer, intent(out), optional :: iostat
This opens a file. xp
is initialized, and prepared for parsing. string
must contain the name of the file to be opened. iostat
reports on the success of opening the file. A value of 0
indicates success.
open_xml_string
type(xml_t), intent(inout) :: xpi
character(len=*), intent(in) :: string
This prepares to parse a string containing XML data. xp
is initialized. string
must contain the XML data.
close_xml_t
type(xml_t), intent(inout) :: xp
This closes down the parser (and closes the file, if input was coming from a file.) xp
is left uninitialized, ready to be used again if necessary.
parse
type(xml_t), intent(inout) :: xp
external :: list of event handlers
logical, optional, intent(in) :: validate
This tells xp
to start parsing its document.
(Advanced: By default, this will be done in a non-validating way, testing only for well-formedness errors. However, if validate
is set to true. FoX will attempt to diagnose validation errors. Note that FoX is not a full validating parser, and will not read external entities, so do not rely on this behaviour)
The full list of event handlers is in the next section. To use them, the interface must be placed in a module, and the body of the subroutine filled in as desired; then it should be specified as an argument to parse
as:
name_of_event_handler = name_of_user_written_subroutine
Thus a typical call to parse
might look something like:
call parse(xp, startElement_handler = mystartelement, endElement_handler = myendelement, characters_handler = mychars)
where mystartelement
, myendelement
, and mychars
are all subroutines written by you according to the interfaces listed below.
All of the callbacks specified by SAX 2 are implemented. Documentation of the SAX 2 interfaces is available in the JavaDoc at http://saxproject.org, but as the interfaces needed adjustment for Fortran, they are listed here.
For documentation on the meaning of the callbacks and of their arguments, please refer to the Java SAX documentation.
characters_handler
subroutine characters_handler(chunk)
character(len=*), intent(in) :: chunk
end subroutine characters_handler
Triggered when some character data is read from between tags.
NB Note that all character data is reported, including whitespace. Thus you will probably get a lot of empty characters
events in a typical XML document.
NB Note also that it is not required that large chunks of character data all come as one event - they may come as multiple consecutive events.
endDocument_handler
subroutine endDocument_handler()
end subroutine endDocument_handler
Triggered when the parser reaches the end of the document.
endElement_handler
subroutine endElement_handler(namespaceURI, localName, name)
character(len=*), intent(in) :: namespaceURI
character(len=*), intent(in) :: localName
character(len=*), intent(in) :: name
end subroutine endElement_handler
Triggered by a closing tag.
endPrefixMapping_handler
subroutine endPrefixMapping_handler(prefix)
character(len=*), intent(in) :: prefix
end subroutine endPrefixMapping_handler
Triggered when a namespace prefix mapping goes out of scope.
ignorableWhitespace
subroutine ignorableWhitespace_handler(chars)
character(len=*), intent(in) :: chars
end subroutine ignorableWhitespace_handler
Triggered when whitespace is encountered within an element declared as EMPTY
. (Only active in validating mode.)
processingInstruction_handler
subroutine processingInstruction_handler(name, content)
character(len=*), intent(in) :: name
character(len=*), intent(in) :: content
end subroutine processingInstruction_handler
Triggered by a Processing Instruction
skippedEntity_handler
subroutine skippedEntity_handler(name)
character(len=*), intent(in) :: name
end subroutine skippedEntity_handler
Triggered when either an external entity, or an undeclared entity, is skipped.
startDocument_handler
subroutine startDocument_handler()
end subroutine startDocument_handler
Triggered when the parser starts reading the document.
startElement_handler
subroutine startElement_handler(namespaceURI, localName, name, attributes)
character(len=*), intent(in) :: namespaceUri
character(len=*), intent(in) :: localName
character(len=*), intent(in) :: name
type(dictionary_t), intent(in) :: attributes
end subroutine startElement_handler
Triggered when an opening tag is encountered. (see LINK for documentation on handling attribute dictionaries.
startPrefixMapping_handler
subroutine startPrefixMapping_handler(namespaceURI, prefix)
character(len=*), intent(in) :: namespaceURI
character(len=*), intent(in) :: prefix
end subroutine startPrefixMapping_handler
Triggered when a namespace prefix mapping start.
notationDecl_handler
subroutine notationDecl_handler(name, publicId, systemId)
character(len=*), intent(in) :: name
character(len=*), optional, intent(in) :: publicId
character(len=*), optional, intent(in) :: systemId
end subroutine notationDecl_handler
Triggered when a NOTATION declaration is made in the DTD
unparsedEntityDecl_handler
subroutine unparsedEntityDecl_handler(name, publicId, systemId, notation)
character(len=*), intent(in) :: name
character(len=*), optional, intent(in) :: publicId
character(len=*), intent(in) :: systemId
character(len=*), intent(in) :: notation
end subroutine unparsedEntityDecl_handler
Triggered when an unparsed entity is declared
error_handler
subroutine error_handler(msg)
character(len=*), intent(in) :: msg
end subroutine error_handler
Triggered when a normal parsing error is encountered. Parsing will cease after this event.
fatalError_handler
subroutine fatalError_handler(msg)
character(len=*), intent(in) :: msg
end subroutine fatalError_handler
Triggered when a fatal parsing error is encountered. Parsing will cease after this event.
warning_handler
subroutine warning_handler(msg)
character(len=*), intent(in) :: msg
end subroutine warning_handler
Triggered when a parser warning is generated. Parsing will continue after this event.
attributeDecl_handler
subroutine attributeDecl_handler(eName, aName, type, mode, value)
character(len=*), intent(in) :: eName
character(len=*), intent(in) :: aName
character(len=*), intent(in) :: type
character(len=*), intent(in), optional :: mode
character(len=*), intent(in), optional :: value
end subroutine attributeDecl_handler
Triggered when an attribute declaration is encountered in the DTD.
elementDecl_handler
subroutine elementDecl_handler(name, model)
character(len=*), intent(in) :: name
character(len=*), intent(in) :: model
end subroutine elementDecl_handler
Triggered when an element declaration is enountered in the DTD.
externalEntityDecl_handler
subroutine externalEntityDecl_handler(name, publicId, systemId)
character(len=*), intent(in) :: name
character(len=*), optional, intent(in) :: publicId
character(len=*), intent(in) :: systemId
end subroutine externalEntityDecl_handler
Triggered when a parsed external entity is declared in the DTD.
internalEntityDecl_handler
subroutine internalEntityDecl_handler(name, value)
character(len=*), intent(in) :: name
character(len=*), intent(in) :: value
end subroutine internalEntityDecl_handler
Triggered when an internal entity is declared in the DTD.
comment_handler
subroutine comment_handler(comment)
character(len=*), intent(in) :: comment
end subroutine comment_handler
Triggered when a comment is encountered.
endCdata_handler
subroutine endCdata_handler()
end subroutine endCdata_handler
Triggered by the end of a CData section.
endDTD_handler
subroutine endDTD_handler()
end subroutine endDTD_handler
Triggered by the end of a DTD.
endEntity_handler
subroutine endEntity_handler(name)
character(len=*), intent(in) :: name
end subroutine endEntity_handler
Triggered at the end of entity expansion.
startCdata_handler
subroutine startCdata_handler()
end subroutine startCdata_handler
Triggered by the start of a CData section.
startDTD_handler
subroutine startDTD_handler(name, publicId, systemId)
character(len=*), intent(in) :: name
character(len=*), optional, intent(in) :: publicId
character(len=*), optional, intent(in) :: systemId
end subroutine startDTD_handler
Triggered by the start of a DTD section.
startEntity_handler
subroutine startEntity_handler(name)
character(len=*), intent(in) :: name
end subroutine startEntity_handler
Triggered by the start of entity expansion.
Although FoX tries very hard to work to the letter of the XML and SAX standards, it falls short in a few areas.
(This includes non-ASCII characters present only by character reference.)
It will, however, happily accept documents labelled as UTF-8 encoded.
XML specifies that all SYSTEM IDs reported by events should be converted to URIs before the application receives them. FoX does no such conversion, and as a result, will allow through invalid SYSTEM IDs.
FoX performs no checking on the validity of Namespace URIs.
Beyond this, any aspects of XML and SAX which FoX fails to do justice to are bugs.
Note that (as permissable within XML) FoX acts primarily as a non-validating parser, and thus all constraints marked as Validity Constraints by XML-1.0/1.1 are ignored by default. A subset of them will be picked up by FoX's validation mode, but only a small subset.
Note also that FoX will not read external entities when processing an XML document.
The difference betweek Java & Fortran means that none of the SAX APIs can be copied directly. However, FoX offers data types, subroutines, and interfaces covering a large proportion of the facilities offered by SAX. Where it does not, this is mentioned here.
org.sax.xml:
org.sax.xml.ext:
org.sax.xml.helpers:
When parsing XML using the FoX SAX module, attributes are returned contained within a dictionary object.
All of the attribute dictionary objects and functions are exported through FoXcommon and FoXsax - you must USE the module to enable them. The dictionary API is described here.
An attribute dictionary consists of a list of entries, one for each attribute. The entries all have the following pieces of data:
and for namespaced attributes:
There is one derived type of interest, dictionary_t
.
It is opaque - that is, it should only be manipulated through the functions described here.
len
type(dictionary_t), intent(in) :: dict
Returns an integer with the length of the dictionary, ie the number of dictionary entries.
getLength
type(dictionary_t), intent(in) :: dict
Returns an integer with the length of the dictionary, ie the number of dictionary entries. Identical to the len
function.
hasKey
type(dictionary_t), intent(in) :: dict
character(len=*), intent(in) :: key
Returns a logical value according to whether the dictionary contains an attribute named key
or not.
hasKey
type(dictionary_t), intent(in) :: dict
character(len=*), intent(in) :: uri
character(len=*), intent(in) :: localname
Returns a logical value according to whether the dictionary contains an attribute with the correct URI
and localname
.
The following functions may be used to retrieve data from a dictionary
getQName
type(dictionary_t), intent(in) :: dict
integer, intent(in) :: i
Return the full name of the i
th dictionary entry.
getValue
type(dictionary_t), intent(in)
integer, intent(in) :: i
If an integer is passed in - the value of the i
th attribute.
getValue
type(dictionary_t), intent(in)
character(len=*), intent(in) :: key
If a single string is passed in, the value of the attribute with that name.
getValue
type(dictionary_t), intent(in)
character(len=*), intent(in) :: uri, localname
If two strings are passed in, the value of the attribute with that uri and localname.
getURI
type(dictionary_t), intent(in)
integer, intent(in), optional :: i
Returns a string containing the nsURI of the i
th attribute.
getlocalName
type(dictionary_t), intent(in)
integer, intent(in), optional :: i
Returns a string containing the localName of the i
th attribute.
FoX evolved from the initial codebase of xmlf90, which was written largely by Alberto Garcia<EMAIL_ADDRESS>and Jon Wakelin<EMAIL_ADDRESS>FoX is the work of Toby White<EMAIL_ADDRESS>and all bug reports/complaints/bouquets of roses should be sent to him.
There is a FoX website at http://www.uszla.me.uk/software/FoX/.
There is also a mailing list for announcements/queries/bug reports. Information on how to subscribe may be found at http://www.uszla.me.uk/cgi-bin/mailman/listinfo/FoX/,
This manual is © Toby White 2006.
FoX is licensed under the agreement below. This is intended to make it as freely available as possible, subject only to retaining copyright notices and acknowledgements.
If for any reason this license causes issues with your intended use of the code, please contect the author.
The license can also be found within the distributed source, in the file FoX/LICENSE
Copyright:
© 2003, 2004, Alberto Garcia, Jon Wakelin
© 2005, 2006, 2007, Toby White
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
 IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE


--- layout: projects title: Personal projects permalink: /personal-projects/ --- Stuff I do for myself is generally art, this site being the primary exception.


Spring RESTful services
The following services are available
Say Hello
Show All Departures
Show Flights departing to Las Vegas (LAS)
Show Flight KL7168


Git Practice
This is a practice document that will be used in order to make changes, practice Git, HTML, and uploading to GitHub.
You can change anything you want in this document and then commit the changes. You can also practice your HTML coding in this document.
To learn some HTML code, copy and paste the link below.
www.codeacademy.com
This website will go step by step on how to use HTML and CSS. This website includes the following languages:


Classes and interfaces
Float¶
Float Rule
Converts content into a Float
« More »
Int¶
Int Rule
Converts content into an Int
« More »
PregReplace¶
PregReplace Rule
Replaces based on regular expression, will replace with empty if no
replacement is defined.
« More »
Rule¶
Base class for a Filtering Rule, it implements common behaviour
« More »


WebAssembly’s Just-in-Time compilation (JIT) interface will likely be fairly low-level, exposing general-purpose primitives rather than higher-level functionality. Still, there is a need for higher-level functionality, and for greater flexibility than the WebAssembly spec can provide. There is also a need for experimentation, particularly in the area of applications wishing to dynamically generate new code, to determine which features and interfaces are most appropriate. JIT and Optimization libraries that would run inside WebAssembly and provide support and higher-level features would fit this need very well.
Such libraries wouldn’t be part of the WebAssembly spec itself, but the concept is relevant to discuss here because features that we can expect to address in libraries are features that we may not need to add to the spec. This strategy can help keep the spec itself simple and reduce the surface area of features required of every spec implementation.
And, libraries will facilitate light-weight experimentation with new features that we may eventually want to add to WebAssembly itself. In a library layer, we can quickly iterate, experiment, and gain real-world insight, before adding features to the spec itself and freezing all the details. And as new features are standardized, libraries will become the polyfills which will help those features gain adoption.
This raises the question of how we should decide which features belong in the spec, and which belong in a library. Some of the fundamental advantages of putting functionality in a library rather than in the spec and in implementations themselves include:
sin
, cos
, exp
, log
, pow
, and atan2
.The library approach also means that applications using a particular version of a library can get consistent behavior and performance, because of the determinism of the underlying WebAssembly platform.
A significant range of approaches are possible:
“Customized WebAssembly”. This might involve a library whose input format is conceptually WebAssembly but with some additional features. The library could optimize and then lower those features leaving standard WebAssembly to present to the underlying implementation.
“Bring Your Own Compiler” There’s nothing stopping one from bundling full-fledged AOT-style compilers that compile an independent source language or IR into WebAssembly right there in WebAssembly itself. Obviously this will involve tradeoffs in terms of download size and startup time, but it would allow a unique degree of flexibility.
And many things in between.


How to create and use templates
Templates can save you precious time!
Set up a jail any way you like, and create a template from it. All packages and pre-configured settings will be available for deployment next time within seconds.
Any jail can be converted to a template and back to a jail again as required. In fact a template is just another jail which has the property template set to “yes”. The difference is that templates are not started by iocage, they ar$
Here is how to create a template with iocage:
- Create a new jail iocage create tag=mytemplate
- Configure the jail’s networking
- Install any package you like and customize jail
- Once finished with customization stop the jail iocage stop UUID | TAG
- A good idea is set some notes iocage set notes="customized PHP,nginx jail" UUID | TAG
- Turn the template property on iocage set template=yes UUID | TAG
- List your template with iocage list -t
Here is how to use the created template:
To create a new jail from this template simply clone it!
- iocage clone UUID-of-mytemplate tag=mynewjail
- List new jail iocage list
- Start jail iocage start UUID | TAG
Done!
If you need to make further customization in the template or want to patch it, you have two options.
- convert template back to jail with iocage set template=no UUID-of-template, and start the jail
- if you don’t need network access to make the changes simply run iocage chroot UUID-of-template, make the changes and exit


We always strive to find and provide all means of comfort for you.
You are with us in safe hands and at your service.
We strive to continue providing successes and obtaining high reviews.
The Abu Simbel temples are two massive rock-cut temples at Abu Simbel (Arabic: أبو سمبل), a village in Aswan Governorate, Upper Egypt, near the border with Sudan. They are situated on the western bank of Lake Nasser, about 230 km (140 mi) southwest of Aswan (about 300 km (190 mi) by road)
The Giza Pyramid Complex, also called the Giza Necropolis, is the site on the Giza Plateau in Greater Cairo, Egypt that includes the Great Pyramid of Giza
Al-Azhar Mosque (Arabic: الجامع الأزهر, romanized: al-Jāmiʿ al-ʾAzhar, lit. 'The Resplendent Congregational Mosque'), known simply in Egypt as al-Azhar, is an Egyptian mosque in Islamic Cairo. Al-Mu'izz li-Din Allah of the Fatimid dynasty commissioned its construction for the newly established capital city in 970
The Sinai Peninsula, or simply Sinai (now usually /ˈsaɪnaɪ/ SY-ny), is a peninsula in Egypt, and the only part of the country located in Asia. It is between the Mediterranean Sea to the north and the Red Sea to the south, and is a land bridge between Asia and Africa.
You can climb mountains, camp, motorbike and mountain skiing
Aswan is the ancient city of Swenett, later known as Syene, which in antiquity was the frontier town of Ancient Egypt facing the south. Swenett is supposed to have derived its name from an Egyptian goddess with the same name.
New places for tourism:


Click outside the popup to close.
DJS SKYLARK is one of the country's most proficient aero design team from SVKM's Dwarkadas J. Sanghvi College of Engineering, Mumbai.
We research, design, analyse and fabricate remote controlled aircrafts and compete on an international platform against universities across the globe.
With accolades to our name, we aim to set an example and promote aerospace engineering by organising events and workshops for aero enthusiasts in the city.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut sagittis arcu at metus molestie, ut fermentum metus laoreet. Maecenas lectus felis, posuere ut elementum in, sodales eget leo. Nulla laoreet orci dui, fermentum luctus purus aliquet eu. Phasellus cursus, erat quis ullamcorper efficitur, erat ligula euismod purus, vitae semper ligula sapien id est. In lobortis vulputate ornare.
With our thinking caps on, we start off by researching and designing a model of the aircraft, from scratch, using CAD softwares.
The proposed model is now analysed by subjecting it to real life conditions and making modifications where required.
After we carry out iterations, the final aicraft design is brought to life using various manufacturing processes.
It is the moment of truth when the throttle roars as we watch our own aircraft take off from the runway.
The Society of Automotive Engineers (SAE) Aero Design Competiton is intended to provide under-graduate and graduate engineering students with a real life engineering challenge.
First and foremost a design competition, students will find themselves performing trade studies and making compromises to arrive at a design solution that will optimally meet the mission requirements while still confirming to the configuration limitations.
It is anually held in the USA featuring 75 teams from all over the world.


Get data:
Non-fatal Assault Emergency Department VisitsNon-fatal Assault Hospitalizations
Data Stories
About Violence
Violence
About Violence in New York City
Violence is the use of physical, verbal, and/or emotional force to injure, harm, abuse, damage, or destroy. Interpersonal violence includes child abuse and neglect, youth violence, intimate partner violence, sexual violence, and elder abuse. Violence can involve injury to self, including self-harm, suicide attempts, and death by suicide. Violence can also take the form of power against a group or community.
Violence is a public health issue because it is a cause of morbidity and mortality, leading to physical and emotional harm, an increase in negative health outcomes, premature death, psychological trauma and persistent fear to individuals and communities.
Violence is also an equity issue because it disproportionately affects groups that have been oppressed due to their socioeconomic status, race/ethnicity, sexual orientation, gender identity, geographic location, or some combination of these factors. Data from multiple sources illustrate tremendous disparities in the distribution and burden of violence throughout NYC. For instance, rates of firearm-related violence are at least two times higher in high poverty neighborhoods when compared to lower poverty neighborhoods. And, violence persists as a leading cause of premature death among NYC’s men of color.
Factors that Contribute to Violence
Restricting the explanation of disparities in violence to differences in individuals and group characteristics most affected by the violence only initiates bias and constrains problem-solving*.* To understand what drives violence, it is important to look at the context and systems within which it occurs and consider the negative impact that historic practices (e.g., redlining) and ongoing social structures (e.g., institutional racism) have on particular groups and communities.
For example, racialized systems have created and upheld stereotypes that link Black men and criminality, while ignoring the imbalanced distribution of power and resources experienced by Black men and Black communities. A myriad of social, political, economic, historical, and environmental factors contribute to violence. These factors convey messages about which populations and communities are deprived of society’s resources and which are privileged by them. Some of these factors include:
- Poverty and neighborhood disinvestment
- Housing and historic redlining practices
- Education and employment opportunities
- Policing and incarceration practices
- Chronic stress and intergenerational trauma Community and social norms
- Access to health and health care
- Built environment
- Racism and other forms of oppression
Examining factors like these that disproportionately marginalize certain populations illuminate opportunities for prevention.
About the Data and Indicators
Violence is frequently described through homicide statistics. While it is a leading cause of death and captures the most severe form of violence, non-fatal violence-related injuries are much more common and help paint the larger picture on the burden of violence and its impact on the health and future of individuals, families, and communities.
Interpreting the Data and Informing Solutions
Violence-related data must be interpreted in ways where we move beyond demonizing those causing the harm and instead look at the context and systems that gives rise to violence. Interpreting data this way illuminates ways to mitigate the social, political, economic, historical, and environmental factors that contribute to violence.
With any public health epidemic, be it influenza, obesity, opioid addiction or gun violence, prevention is key. Prevention is achievable in ways that are similar to multi-pronged approaches that have been used to address the risk and resilient factors for health outcomes like asthma, motor vehicle crashes, and opioid overdoses. Indeed, multi-faceted approaches to health promotion that empower individuals, families, communities, and systems equitably are where sustainable solutions for violence reduction and prevention reside.


Include
Add words, #hashtags, @mentions and from:user
Main hashtag: {{newWallOptions.mainHashtag}}
Cycle/Repeat tweets
Will show only latest tweets if set to No.
Cycle Delay Time
When there are no new posts, show a tweet for how many seconds?
Cycle Post Limit
How many of the most recent posts should we cycle?
Places
Show tweets near this place
- {{location.query}}


Bridges holds a a rich set of software, containers, frameworks and environments to engage AI and Big Data research.
Bridges supports Singularity containers. You can import your own, but many are already installed on Bridges for use on the DGX-2, the Volta GPUs and the P100 GPUs.
The preinstalled containers are part of the NVIDIA GPU Container Registry. They have been built with the lastest versions of AI software and optimized by NVIDIA for the Volta and P100 nodes.
Installed containers include:
Create your own environment with Anaconda or python virtualenv, or use one custom-built by PSC for AI applications using Anaconda and Bridges’ GPU nodes.
Custom-built environments tailored to AI, Big Data and machine learning include popular software such as TensorFlow, Theano, Keras, pandas, openCV, scikit-learn and more.Modern software for AI and Big Data applications are available on Bridges, including:


Test for bug 32292: "Unable to focus on embedded plugins such as Flash via javascript focus()"
This tests focusing Embeds and Objects. See LayoutTests/java for Applet elements.


Pig Dice
Welcome
Here are the rules of the game Each turn, a player repeatedly rolls a die until either a 1 is rolled or the player decides to "hold":
- If the player rolls a 1, they score nothing and it becomes the next player's turn.
- If the player rolls any other number, it is added to their turn total and the player's turn continues.
- If a player chooses to "hold", their turn total is added to their score, and it becomes the next player's turn.


Newly married couple ‘end’ life in Gajuwaka
Police yet to ascertain the exact reason for the extreme step
by Staff ReporterA newly married couple ended their lives by hanging themselves from a ceiling fan in their house at Pentayya Nagar under Gajuwaka police station limits on Friday.
The deceased have been identified as K. Narendra Kumar (22) and his wife Dhilleswari (21).
According to sources, Narendra and Dhilleswari went to attend a marriage on Thursday night and returned home around 10 p.m. Their neighbours grew suspicious as they did not come out of the house till 10 a.m. on Friday. They alerted the police after repeated knocks on the doors went unanswered. The police broke open the door and found the couple dead.
It is learnt that Narendra was working with a private firm in Autonagar area, while Dhilleswari was a home maker. Sources said that the couple had a love marriage just nine months ago.
The police are yet to ascertain the exact reasons for the couple resorting to the extreme step. Sources said that the police were suspecting financial crisis to be one of the reasons. A case has been registered by Gajuwaka police. Investigation is on.
Helpline
Those in distress or having suicidal tendencies can seek assistance by dialling the helpline number 100.


An army of skeletons with lasers
The word “Morphometrics” was already mentioned on this blog here and here. It’s a horrible term which nevertheless describes a really cool field in evolutionary science…
Today we’re having a workshop with François Gould (@PaleoGould) so hopefully everyone will know more about all things morpho by the end of the day. I won’t go into the juicy details of procrustes analyses, elliptic Fourier transform or other Bezier polynomials (see Zelditch and colleagues Geometric Morphometrics book or Julien Claude’s excellent Morphometrics with R for further details about these friendly terms). Instead, I’d like to talk about one aspect of data collection.
In a simplistic way, morphometric data can be sorted into two categories. Two dimensional data, such as linear measurements or shape outlines, can be obtained in many ways, from trusty calipers (which are digital these days) to computer measurements of landmarks placed on pictures (see here for a nice list of usable software). The second type of data is obviously 3D data which, again, may be collected in many ways using fancy technology from digital microscribes to medical CT-scanners.
I use a surface 3D scanner like this one which has a fairly well defined list of pros and cons. -Firstly, it is way more time consuming to scan specimens than to use either 2D methods or a 3D microscribe. My scanner takes roughly one hour per skull. -Secondly, the scanner is quite expensive even though the final scans aren’t always completely accurate and may have problems of poor quality.
Despite these problems, I’ve found that, in the end, the list of pros is much longer! -It is really easy to use the scanner and, even if the price is not cheap, it’s far from unaffordable. -The data you get from a scan is easily transportable and therefore easily sharable; think about posting or e-mailing a skull! I think this point is really important when you are studying fossils. You can usually find skulls of most living primates in any natural history museum but fossils are really rare and specimens are only housed in a few places so access to 3D scans would be a great asset to interested researchers. -Another point linked to this sharing idea: it is more scientifically friendly since you can put your scans into online supplementary materials and publish them with your papers. -Furthermore, even if it’s a less technical point, 3D scans look pretty amazing and are excellent illustrations for your papers like this 3D ring-tailed Lemur skull:
This list of pros and cons can continue on ad infinitum and ultimately all morphometric methods have both advantages and disadvantages of one kind or another. Aside from all these technical details, I think that the best part of using a scanner is the chance to play with lasers! It’s just so cool to be measuring skulls in a museum with a normal set of calipers while your scanner spits out lasers in all directions and then, by magic, the giant lemur (Megaladapis) on the desk is there staring out from your computer screen.
Photo credit: Thomas Guillerme.


Next: array-displacement, Previous: array-element-type, Up: Arrays Dictionary
array-has-fill-pointer-p
array ⇒ generalized-boolean
array—an array.
generalized-boolean—a generalized boolean.
Returns true if array has a fill pointer; otherwise returns false.
(array-has-fill-pointer-p (make-array 4)) ⇒ implementation-dependent (array-has-fill-pointer-p (make-array '(2 3))) ⇒ false (array-has-fill-pointer-p (make-array 8 :fill-pointer 2 :initial-element 'filler)) ⇒ true
Should signal an error of type type-error if its argument is not an array.
Since arrays of rank other than one cannot have a fill pointer, array-has-fill-pointer-p always returns nil when its argument is such an array.


The word color is used loosely here to describe the surface-level aspects of a design, including colors, backgrounds, borders, shadows and other properties that are decorative and highly likely to change over time. Basscss includes a suite of color utilities as a starting point. Use these as a guide for creating your own styles.
Apply the .field-light
color style to input, select, and textarea elements to control appearance.
The .field-light
style includes states for disabled and read-only fields,
as well as success, warning, and error states.
Use color utilities along with .fieldset-reset
to style fieldsets.
Use the .table-light
style as a starting point,
then apply color utilities to style tables.
Colors styles use the following variables. To alter these defaults, declare new values after importing Basscss with Rework.
These basic color styles are also available as a standalone NPM module.
npm install basscss-color-basic


{{ station.description }}
Music Director: {{ station.dj }}
Cart icons search Amazon.com. SomaFM is an Amazon Affiliate and receives a commission on these purchases.


hello there!
This presentation contains these examples:
-
- browserify
- node-style
require()
in the browser
-
-
- ndarray
- n-dimensional matricies on top of typed arrays
-
- music
- make music with code
-
- voxeljs
- make minecraft-style games in webgl
-
- trumpet
- transform html with css selectors and streams


Summarizes textual data.
tf.compat.v1.summary.text( name, tensor, collections=None )
Text data summarized via this plugin will be visible in the Text Dashboard in TensorBoard. The standard TensorBoard Text Dashboard will render markdown in the strings, and will automatically organize 1d and 2d tensors into tables. If a tensor with more than 2 dimensions is provided, a 2d subarray will be displayed along with a warning message. (Note that this behavior is not intrinsic to the text summary api, but rather to the default TensorBoard text plugin.)
name
: A name for the generated node. Will also serve as a series name in
TensorBoard.tensor
: a string-type Tensor to summarize.collections
: Optional list of ops.GraphKeys. The collections to add the
summary to. Defaults to [_ops.GraphKeys.SUMMARIES]A TensorSummary op that is configured so that TensorBoard will recognize
that it contains textual data. The TensorSummary is a scalar Tensor
of
type string
which contains Summary
protobufs.
ValueError
: If tensor has the wrong type.


DfE enquiries
Central newsdesk 020 7783 8300
General enquiries 0370 000 2288
News story
Michael Gove reaffirms the government’s belief that autonomy for schools leads to higher performance and sustained improvement.
Michael Gove has today commented on the National Audit Office report on the Academies programme.
He said:
I welcome the findings of this NAO report. It confirms our belief that the Academies programme is working, reporting a clear lift in performance after schools convert to academies, confirming that they are improving faster than other comparable schools and that they continue to serve the most disadvantaged communities and pupils. We also know that pupils on free school meals have improved faster in academies than similar pupils nationally.
The experience of the city technology colleges in England, and other reforms across the world, shows that giving schools autonomy successfully drives up performance, and that this improvement is sustained. The performance of the large academy chains is already improving at a rapid rate. This year the Harris Federation reports a ten percentage point increase across all their academies, and ARK academies have reported a 13 percentage point increase.
We have already taken prompt action on the NAO recommendations as we strive to strengthen the programme even further. The Academies programme is helping children from all backgrounds to get a better education - that is why we are allowing more schools to become academies, and are giving real power and autonomy back to schools and teachers.
You can view the NAO report on the Academies programme here .
Central newsdesk 020 7783 8300
General enquiries 0370 000 2288
Published: 10 September 2010


I've been a student at the University of Louisville since 2012 and a student of the College of Business since 2014. I originally began as a CIS major with a concentration in Information Security but quickly decided I enjoyed the Web Development concentration as well. During my junior year, I recieved my first internship opportunity with LG&E in their IT Training department. By the next year, I was able to receive a full time position with the IT Security department as an Associate Analyst. I will be a full time employee upon graduation in Deccember and begin preparing for graduate school. In my free time, I love to travel, exploring the outdoors, and kayaking in new places. I'm excited to begin my career in IT and can't wait to see what the future holds.


Math Component
Operations
Choose your operation
Sum
Substrac
Multiply
Divide
Exponent
Square
Math Operations
First Value
Second Value
send
Submit


The asset allocation chart shows a time-weighted average of each asset to your portfolio. When a certain asset has a very small percentage and is too small to be shown in the pie chart, it will be incorporated into an "Others" category. The value of the percentage could be either positive or negative.


Loaders
todo: find loading gif
Loading
The meaning of life is:
...
(
...
certainty)
Load something slow


Dear John Doe,
We are pleased that you have accepted our invitation to join the ABC, Inc. and we welcome you as a valuable member of our organization. If you have any questions before attending your first meeting, please call Rachel Smith at<PHONE_NUMBER>. Rachel Smith will be glad to help you.
As noted earlier, we meet 6/16/2018 from 4:30 PM at Starbucks in West Hollywood. We look forward to seeing you then.
Sincerely,
Jane Doe


Players
Lines
Players
Selected
{{player}}
Drag
or click
a player onto the line!
{{lineView.selectedLine.players | linePlayers}} {{lineView.selectedLine.stats.numberOfPointsConsidered}} of {{lineView.selectedLine.stats.pointsPossible}} posssible points.
Performance
| Line | Team | |
|---|---|---|
|
{{statType | camelCase}}
|
{{statValue}} | {{teamStats[statType]}} |
Connections
No connections made.
| {{players}} | |
|---|---|
| {{outcome | camelCase}} | {{quantity}} |


Email messages will be sent to both the current and new email addresses. The message sent to the new email address contains a verification link. This change will not be applied to the account until the new email address been verified.


Golf
Overview
Features
Multi-course operators
Pricing
Restaurant
Overview
Restaurant POS
Reservations
Pricing
Hotel
Overview
PMS Software
Restaurant Reservation
Destination Management
FAQ
Contact
English
English
Deutsch
Français
Italiano
PRESS
Digital zur Abschlagszeit (aus Salzkammergut Magazin 2018/2019)
OCI (Object Computing, Inc.) “Show us your Grails” Nexxchange, Winner 2nd place


|
UNDERSTAND TYPES OF SCHOOLS |
Colleges: generally
smaller in size. They offer 4-year degree programs (BA and BS) and many 2-year Associate
degrees.
Universities: larger
institutions with specialized degrees in business, engineering, pre-med, etc. They
offer 2-year, 4-year, and many graduate and professional degrees.
Community / Junior Colleges:
a small college offering 2-year Associate degrees. Many students attend local community
colleges with the intent to transfer to a larger institution to further their education.
Online Schools:
programs and degrees that can be taken online. The advantage of these programs is
that you can take classes from inside your home. These programs are great for part-time
students and continuing education.
Vocation/Career Schools:
specialized schools of training for specialized trade jobs such as mechanics, computer
technicians, medical assistants, etc. Programs may vary requiring only a few weeks
to complete while others may require a year or more. Upon completion, graduates
will receive a licence, certificate or an Associates Degree.
Link to Begin Your College Search:
http://www.collegeboard.com
|
|
HOW TO BEGIN YOUR SEARCH |
Assemble a list of colleges or trade schools you’d
like to attend. Meet with your school’s guidance counselor to discuss your plans
to arrange important campus visits.
There are
three categories of schools you should list:
-
2-3 schools that you could definitely get in.
-
4-5 schools that you could probably get in.
-
7-8 schools that you would like to get in.
You should budget on how much you can afford for
application submission. If the application submission costs for 16 or more schools
may be too much, narrow your search to 3-3-3.
|
|
|
If investment, financial,
mortgage or insurance planning and/or products are required, College and Retirement
Solutions, LLC may refer you to one of its affiliates, including The Ziering Insurance
Agency. Any discussion of the Tax implications of planning is strictly for general
purposes. Neither "CRS" nor its representatives may give specific tax advice. One
should seek the advice and counsel of their accountant and/or tax advisor for information
regarding their particular situation. |


List of assumptions that you can check and expected results for selected target environment. For more information see, Verification of Code Generation Assumptions.
|
|
|
Zero initialization code has been optimized for model 'motoraiHIL'.
If the assumption is not correct, remove the optimization through the Configuration Parameters > Code Generation > Optimization settings. Alternatively, configure your target environment to make the assumption hold. |
|
Code generation is configured to support floating-point numbers, therefore your target environment might perform subnormal number calculations.
If the assumptions are not correct, subnormal numbers might cause mismatches between model and generated code simulation results. For more information see, Subnormal Number Performance. |


The red area of the chart shows hypoxia abnormality.
The duration of the state in which the physiological oxygen deficiency or the tissue oxygen demand is insufficient.
Dizziness, weakness, feeling of difficulty breathing.
①Direct oxygen inhalation or aerobic exercise, including walking, jogging, deep breathing, and improving the oxygen-absorbing environment.
②Seek medical help if necessary, and take medicine to improve.


Given a 2D binary matrix filled with 0’s and 1’s, find the largest rectangle containing only 1’s and return its area.
Example:
Input:
[
["1","0","1","0","0"],
["1","0","1","1","1"],
["1","1","1","1","1"],
["1","0","0","1","0"]
]
Output: 6
View every row as a base line then we just have to solve height(matrix)
times the problem of 84. Largest Rectangle in Histogram.
/**
* @param {character[][]} matrix
* @return {number}
*/
var maximalRectangle = function(matrix) {
const height = matrix.length
if (height <= 0) { return 0 }
const width = matrix[0].length
if (width <= 0) { return 0 }
const heights = []
let max = 0
for (let row = 0; row < height; row++) {
for (let col = 0; col < width; col++) {
heights[col] = ((heights[col] || 0) + 1) * matrix[row][col]
}
max = Math.max(max, largestRectangleArea(heights))
}
return max
};
/**
* @param {number[]} heights
* @return {number}
*/
function largestRectangleArea (heights) {
const stack = [-1]
let max = 0
for (let i2 = 0; i2 <= heights.length; i2++) {
while ((heights[i2] || 0) < heights[stack[stack.length-1]]) {
const i = stack.pop()
const i1 = stack[stack.length-1]
max = Math.max(max, heights[i] * (i2 - i1 - 1))
}
stack.push(i2)
}
return max
};
Same idea as above. Use DP to cache accumulated states.
Pick a pivot point (row, col)
and assume it is on the base line. The adjoining 1
s above (row, col)
makes up the height of the rectangle. The width of the rectangle is determined by how many ajoining bars are taller than the pivot bar.
So for the rectangle whose bottom pivot is (row, col)
:
area(row, col)
to be the area.height(row, col)
to be the height.left(row, col)
to be the col
value of the bottom-left corner.right(row, col)
to be the col
value of the bottom-right corner.Also:
conLeft(row, col)
to be the col
value of the leftmost cell of the consecutive 1
s on the left of (row, col)
.conRight(row, col)
to be the col
value of the rightmost cell of the consecutive 1
s on the right of (row, col)
.With conLeft
and conRight
we can know if the rectangle on (row, col)
shrinks comparing to (row-1, col)
.
if matrix[row][col] == 1
height(row, col) = height(row-1, col) + 1
// see how long this horizontal line can get
conLeft(row, col) = conLeft(row, col-1)
conRight(row, col) = conRight(row, col+1)
// width can only be shorter
left(row, col) = max( left(row-1, col), conLeft(row, col) )
right(row, col) = min( right(row-1, col), conRight(row, col) )
if matrix[row][col] == 0
height(row, col) = 0
conLeft(row, col) = col + 1
conRight(row, col) = col - 1
left(row, col) = 0 // back to leftmost position
right(row, col) = matrix.width // back to rightmost position
area(row, col) = (right(row, col) - left(row, col) + 1) * height(row, col)
We only need to keep the last state. Use dynamic arrays to reduce space complexity.
/**
* @param {character[][]} matrix
* @return {number}
*/
var maximalRectangle = function(matrix) {
const height = matrix.length
if (height <= 0) { return 0 }
const width = matrix[0].length
if (width <= 0) { return 0 }
const heights = new Array(width).fill(0)
const lefts = new Array(width).fill(0)
const rights = new Array(width).fill(width)
let max = 0
for (let row = 0; row < height; row++) {
let conLeft = 0
let conRight = width - 1
for (let col = 0; col < width; col++) {
if (matrix[row][col] === '1') {
heights[col] = heights[col] + 1
lefts[col] = Math.max(lefts[col], conLeft)
} else {
heights[col] = 0
lefts[col] = 0
conLeft = col + 1
}
}
for (let col = width - 1; col >= 0; col--) {
if (matrix[row][col] === '1') {
rights[col] = Math.min(rights[col], conRight)
} else {
rights[col] = width
conRight = col - 1
}
}
for (let col = 0; col < width; col++) {
max = Math.max(max, (rights[col] - lefts[col] + 1) * heights[col])
}
}
return max
};
Template generated via Leetmark.


×
- Subscribe.
- Reload this page.
- Once reloaded, click this button again.
- A pop-up will request you "Authorize Trello".
- To completely clear the Trello cookie:
- Under menu "Chrome"
- Select "Clear Browsing Data..."
- Check "Clear data from hosted apps"
- Press button "Clear browsing data"


Login help
-
Please provide the credentials that were given to you. If you didn't receive
credentials send an email to the system administrator with the following information:
- your full name
- lab/group
- unit
- supervisor name
-
It is highly advisable to change the password on first use.
We recommend the use a password manager, such as
KeePass, for all your paswords.
For tips on how to properly set a password manager please contact the system administrator.
-
To change your password press "Change Password" button. Follow the instructions and then press "Submit"


application is loading …
This website doesn’t work properly without JavaScript enabled. Please enable JavaScript and refresh the website.
If you don’t know how to do that follow the instructions on enable-javascript.com.


Firebase
public final class Firebase
This class models an object that can send requests to Firebase, such as POST, GET PATCH and DELETE.
-
Google OAuth2 access token
Declaration
Swift
public var accessToken: String?
-
Legacy Database auth token. You can use the deprecated Firebase Database Secret. You should use the new accessToken instead. See more details here: https://firebase.google.com/docs/database/rest/auth
Declaration
Swift
@available(*, deprecated) public var auth: String?
-
Base URL (e.g. http://myapp.firebaseio.com)
Declaration
Swift
public let baseURL: String
-
Timeout of http operations
Declaration
Swift
public var timeout: Double = 30.0 // seconds
-
Constructor
Declaration
Swift
public init(baseURL: String = "", accessToken: String? = nil)
Parameters
baseURL
Base URL (e.g. http://myapp.firebaseio.com)
auth
Database auth token
-
Performs a synchronous PUT at base url plus given path.
Declaration
Swift
public func setValue(path: String, value: Any) -> [String: AnyObject]?
Parameters
path
path to append to base url
value
data to set
Return Value
value of set data if successful
-
Performs an asynchronous PUT at base url plus given path.
Declaration
Swift
public func setValue(path: String, value: Any, asyncCompletion: @escaping ([String: AnyObject]?) -> Void)
Parameters
path
path to append to base url.
value
data to set
asyncCompletion
called on completion with the value of set data if successful.
-
Performs a synchronous POST at given path from the base url.
Declaration
Swift
public func post(path: String, value: Any) -> [String: AnyObject]?
Parameters
path
path to append to the base url
value
data to post
Return Value
value of posted data if successful
-
Performs an asynchronous POST at given path from the base url.
Declaration
Swift
public func post(path: String, value: Any, asyncCompletion: @escaping ([String: AnyObject]?) -> Void)
Parameters
path
path to append to the base url
value
data to post
asyncCompletion
called on completion with the value of posted data if successful.
-
Performs an synchronous PUT at given path from the base url.
Declaration
Swift
public func put(path: String, value: Any) -> [String: AnyObject]?
Parameters
path
path to append to the base url
value
data to put
Return Value
Value of put data if successful
-
Performs an asynchronous PUT at given path from the base url.
Declaration
Swift
public func put(path: String, value: Any, asyncCompletion: @escaping ([String: AnyObject]?) -> Void)
Parameters
path
path to append to the base url
value
data to put
asyncCompletion
called on completion with the value of put data if successful.
-
Performs a synchronous PATCH at given path from the base url.
Declaration
Swift
public func patch(path: String, value: Any) -> [String: AnyObject]?
Parameters
path
path to append to the base url
value
data to patch
Return Value
value of patched data if successful
-
Performs an asynchronous PATCH at given path from the base url.
Declaration
Swift
public func patch(path: String, value: Any, asyncCompletion: @escaping ([String: AnyObject]?) -> Void)
Parameters
path
path to append to the base url
value
value to patch
asyncCompletion
called on completion with the value of patched data if successful.
-
Performs a synchronous DELETE at given path from the base url.
Declaration
Swift
public func delete(path: String)
Parameters
path
path to append to the base url
-
Performs an asynchronous DELETE at given path from the base url.
Declaration
Swift
public func delete(path: String, asyncCompletion: @escaping () -> Void)
Parameters
path
path to append to the base url
asyncCompletion
called on completion
-
Performs a synchronous GET at given path from the base url.
Declaration
Swift
public func get(path: String) -> Any?
Parameters
path
path to append to the base url
Return Value
resulting data if successful
-
Performs an asynchronous GET at given path from the base url.
Declaration
Swift
public func get(path: String, asyncCompletion: @escaping ((Any?) -> Void))
Parameters
path
path to append to the base url
asyncCompletion
called on completion with the resulting data if successful.