- get(int) - Method in class org.json.JSONArray
-
Get the object value associated with an index.
- get(String) - Method in class org.json.JSONObject
-
Get the value object associated with a key.
- getBigDecimal(int) - Method in class org.json.JSONArray
-
Get the BigDecimal value associated with an index.
- getBigDecimal(String) - Method in class org.json.JSONObject
-
Get the BigDecimal value associated with a key.
- getBigInteger(int) - Method in class org.json.JSONArray
-
Get the BigInteger value associated with an index.
- getBigInteger(String) - Method in class org.json.JSONObject
-
Get the BigInteger value associated with a key.
- getBoolean(int) - Method in class org.json.JSONArray
-
Get the boolean value associated with an index.
- getBoolean(String) - Method in class org.json.JSONObject
-
Get the boolean value associated with a key.
- getcDataTagName() - Method in class org.json.XMLParserConfiguration
-
The name of the key in a JSON Object that indicates a CDATA section.
- getDouble(int) - Method in class org.json.JSONArray
-
Get the double value associated with an index.
- getDouble(String) - Method in class org.json.JSONObject
-
Get the double value associated with a key.
- getEnum(Class<E>, int) - Method in class org.json.JSONArray
-
Get the enum value associated with an index.
- getEnum(Class<E>, String) - Method in class org.json.JSONObject
-
Get the enum value associated with a key.
- getFloat(int) - Method in class org.json.JSONArray
-
Get the float value associated with a key.
- getFloat(String) - Method in class org.json.JSONObject
-
Get the float value associated with a key.
- getInt(int) - Method in class org.json.JSONArray
-
Get the int value associated with an index.
- getInt(String) - Method in class org.json.JSONObject
-
Get the int value associated with a key.
- getJSONArray(int) - Method in class org.json.JSONArray
-
Get the JSONArray associated with an index.
- getJSONArray(String) - Method in class org.json.JSONObject
-
Get the JSONArray value associated with a key.
- getJSONObject(int) - Method in class org.json.JSONArray
-
Get the JSONObject associated with an index.
- getJSONObject(String) - Method in class org.json.JSONObject
-
Get the JSONObject value associated with a key.
- getLong(int) - Method in class org.json.JSONArray
-
Get the long value associated with an index.
- getLong(String) - Method in class org.json.JSONObject
-
Get the long value associated with a key.
- getNames(JSONObject) - Static method in class org.json.JSONObject
-
Get an array of field names from a JSONObject.
- getNames(Object) - Static method in class org.json.JSONObject
-
Get an array of public field names from an Object.
- getNumber(int) - Method in class org.json.JSONArray
-
Get the Number value associated with a key.
- getNumber(String) - Method in class org.json.JSONObject
-
Get the Number value associated with a key.
- getString(int) - Method in class org.json.JSONArray
-
Get the string associated with an index.
- getString(String) - Method in class org.json.JSONObject
-
Get the string associated with a key.
- getXsiTypeMap() - Method in class org.json.XMLParserConfiguration
-
When parsing the XML into JSON, specifies that the values with attribute xsi:type
will be converted to target type defined to client in this configuration
Map<String, XMLXsiTypeConverter<?>>
to parse values with attribute
xsi:type="integer" as integer, xsi:type="string" as string
- GT - Static variable in class org.json.XML
-
The Character
- join(String) - Method in class org.json.JSONArray
-
Make a string from the contents of this JSONArray.
- JSONArray - Class in org.json
-
A JSONArray is an ordered sequence of values.
- JSONArray() - Constructor for class org.json.JSONArray
-
Construct an empty JSONArray.
- JSONArray(JSONTokener) - Constructor for class org.json.JSONArray
-
Construct a JSONArray from a JSONTokener.
- JSONArray(String) - Constructor for class org.json.JSONArray
-
Construct a JSONArray from a source JSON text.
- JSONArray(Collection<?>) - Constructor for class org.json.JSONArray
-
Construct a JSONArray from a Collection.
- JSONArray(Iterable<?>) - Constructor for class org.json.JSONArray
-
Construct a JSONArray from an Iterable.
- JSONArray(JSONArray) - Constructor for class org.json.JSONArray
-
Construct a JSONArray from another JSONArray.
- JSONArray(Object) - Constructor for class org.json.JSONArray
-
Construct a JSONArray from an array.
- JSONArray(int) - Constructor for class org.json.JSONArray
-
Construct a JSONArray with the specified initial capacity.
- JSONException - Exception in org.json
-
The JSONException is thrown by the JSON.org classes when things are amiss.
- JSONException(String) - Constructor for exception org.json.JSONException
-
Constructs a JSONException with an explanatory message.
- JSONException(String, Throwable) - Constructor for exception org.json.JSONException
-
Constructs a JSONException with an explanatory message and cause.
- JSONException(Throwable) - Constructor for exception org.json.JSONException
-
Constructs a new JSONException with the specified cause.
- JSONML - Class in org.json
-
This provides static methods to convert an XML text into a JSONArray or
JSONObject, and to covert a JSONArray or JSONObject into an XML text using
the JsonML transform.
- JSONML() - Constructor for class org.json.JSONML
-
- JSONObject - Class in org.json
-
A JSONObject is an unordered collection of name/value pairs.
- JSONObject() - Constructor for class org.json.JSONObject
-
Construct an empty JSONObject.
- JSONObject(JSONObject, String...) - Constructor for class org.json.JSONObject
-
Construct a JSONObject from a subset of another JSONObject.
- JSONObject(JSONTokener) - Constructor for class org.json.JSONObject
-
Construct a JSONObject from a JSONTokener.
- JSONObject(Map<?, ?>) - Constructor for class org.json.JSONObject
-
Construct a JSONObject from a Map.
- JSONObject(Object) - Constructor for class org.json.JSONObject
-
Construct a JSONObject from an Object using bean getters.
- JSONObject(Object, String...) - Constructor for class org.json.JSONObject
-
Construct a JSONObject from an Object, using reflection to find the
public members.
- JSONObject(String) - Constructor for class org.json.JSONObject
-
Construct a JSONObject from a source JSON text string.
- JSONObject(String, Locale) - Constructor for class org.json.JSONObject
-
Construct a JSONObject from a ResourceBundle.
- JSONObject(int) - Constructor for class org.json.JSONObject
-
Constructor to specify an initial capacity of the internal map.
- JSONPointer - Class in org.json
-
A JSON Pointer is a simple query language defined for JSON documents by
RFC 6901.
- JSONPointer(String) - Constructor for class org.json.JSONPointer
-
Pre-parses and initializes a new JSONPointer
instance.
- JSONPointer(List<String>) - Constructor for class org.json.JSONPointer
-
- JSONPointer.Builder - Class in org.json
-
This class allows the user to build a JSONPointer in steps, using
exactly one segment in each step.
- JSONPointerException - Exception in org.json
-
The JSONPointerException is thrown by
JSONPointer
if an error occurs
during evaluating a pointer.
- JSONPointerException(String) - Constructor for exception org.json.JSONPointerException
-
- JSONPointerException(String, Throwable) - Constructor for exception org.json.JSONPointerException
-
- JSONPropertyIgnore - Annotation Type in org.json
-
- JSONPropertyName - Annotation Type in org.json
-
- JSONString - Interface in org.json
-
The JSONString
interface allows a toJSONString()
method so that a class can change the behavior of
JSONObject.toString()
, JSONArray.toString()
,
and JSONWriter.value(
Object)
.
- JSONStringer - Class in org.json
-
JSONStringer provides a quick and convenient way of producing JSON text.
- JSONStringer() - Constructor for class org.json.JSONStringer
-
Make a fresh JSONStringer.
- JSONTokener - Class in org.json
-
A JSONTokener takes a source string and extracts characters and tokens from
it.
- JSONTokener(Reader) - Constructor for class org.json.JSONTokener
-
Construct a JSONTokener from a Reader.
- JSONTokener(InputStream) - Constructor for class org.json.JSONTokener
-
Construct a JSONTokener from an InputStream.
- JSONTokener(String) - Constructor for class org.json.JSONTokener
-
Construct a JSONTokener from a string.
- JSONWriter - Class in org.json
-
JSONWriter provides a quick and convenient way of producing JSON text.
- JSONWriter(Appendable) - Constructor for class org.json.JSONWriter
-
Make a fresh JSONWriter.
- names() - Method in class org.json.JSONObject
-
Produce a JSONArray containing the names of the elements of this
JSONObject.
- next() - Method in class org.json.JSONTokener
-
Get the next character in the source string.
- next(char) - Method in class org.json.JSONTokener
-
Consume the next character, and check that it matches a specified
character.
- next(int) - Method in class org.json.JSONTokener
-
Get the next n characters.
- nextCDATA() - Method in class org.json.XMLTokener
-
Get the text in the CDATA block.
- nextClean() - Method in class org.json.JSONTokener
-
Get the next char in the string, skipping whitespace.
- nextContent() - Method in class org.json.XMLTokener
-
Get the next XML outer token, trimming whitespace.
- nextEntity(char) - Method in class org.json.XMLTokener
-
{@code
Return the next entity.
- nextMeta() - Method in class org.json.XMLTokener
-
{@code
Returns the next XML meta token.
- nextString(char) - Method in class org.json.JSONTokener
-
Return the characters up to the next close quote character.
- nextTo(char) - Method in class org.json.JSONTokener
-
Get the text up but not including the specified character or the
end of line, whichever comes first.
- nextTo(String) - Method in class org.json.JSONTokener
-
Get the text up but not including one of the specified delimiter
characters or the end of line, whichever comes first.
- nextToken() - Method in class org.json.HTTPTokener
-
Get the next token or string.
- nextToken() - Method in class org.json.XMLTokener
-
{@code
Get the next XML Token.
- nextValue() - Method in class org.json.JSONTokener
-
Get the next value.
- noSpace(String) - Static method in class org.json.XML
-
Throw an exception if the string contains whitespace.
- NULL - Static variable in class org.json.JSONObject
-
It is sometimes more convenient and less ambiguous to have a
NULL
object than to use Java's null
value.
- NULL_ATTR - Static variable in class org.json.XML
-
Null attribute name
- numberToString(Number) - Static method in class org.json.JSONObject
-
Produce a string from a Number.
- object() - Method in class org.json.JSONWriter
-
Begin appending a new object.
- opt(int) - Method in class org.json.JSONArray
-
Get the optional object value associated with an index.
- opt(String) - Method in class org.json.JSONObject
-
Get an optional value associated with a key.
- optBigDecimal(int, BigDecimal) - Method in class org.json.JSONArray
-
Get the optional BigDecimal value associated with an index.
- optBigDecimal(String, BigDecimal) - Method in class org.json.JSONObject
-
Get an optional BigDecimal associated with a key, or the defaultValue if
there is no such key or if its value is not a number.
- optBigInteger(int, BigInteger) - Method in class org.json.JSONArray
-
Get the optional BigInteger value associated with an index.
- optBigInteger(String, BigInteger) - Method in class org.json.JSONObject
-
Get an optional BigInteger associated with a key, or the defaultValue if
there is no such key or if its value is not a number.
- optBoolean(int) - Method in class org.json.JSONArray
-
Get the optional boolean value associated with an index.
- optBoolean(int, boolean) - Method in class org.json.JSONArray
-
Get the optional boolean value associated with an index.
- optBoolean(String) - Method in class org.json.JSONObject
-
Get an optional boolean associated with a key.
- optBoolean(String, boolean) - Method in class org.json.JSONObject
-
Get an optional boolean associated with a key.
- optDouble(int) - Method in class org.json.JSONArray
-
Get the optional double value associated with an index.
- optDouble(int, double) - Method in class org.json.JSONArray
-
Get the optional double value associated with an index.
- optDouble(String) - Method in class org.json.JSONObject
-
Get an optional double associated with a key, or NaN if there is no such
key or if its value is not a number.
- optDouble(String, double) - Method in class org.json.JSONObject
-
Get an optional double associated with a key, or the defaultValue if
there is no such key or if its value is not a number.
- optEnum(Class<E>, int) - Method in class org.json.JSONArray
-
Get the enum value associated with a key.
- optEnum(Class<E>, int, E) - Method in class org.json.JSONArray
-
Get the enum value associated with a key.
- optEnum(Class<E>, String) - Method in class org.json.JSONObject
-
Get the enum value associated with a key.
- optEnum(Class<E>, String, E) - Method in class org.json.JSONObject
-
Get the enum value associated with a key.
- optFloat(int) - Method in class org.json.JSONArray
-
Get the optional float value associated with an index.
- optFloat(int, float) - Method in class org.json.JSONArray
-
Get the optional float value associated with an index.
- optFloat(String) - Method in class org.json.JSONObject
-
Get the optional double value associated with an index.
- optFloat(String, float) - Method in class org.json.JSONObject
-
Get the optional double value associated with an index.
- optInt(int) - Method in class org.json.JSONArray
-
Get the optional int value associated with an index.
- optInt(int, int) - Method in class org.json.JSONArray
-
Get the optional int value associated with an index.
- optInt(String) - Method in class org.json.JSONObject
-
Get an optional int value associated with a key, or zero if there is no
such key or if the value is not a number.
- optInt(String, int) - Method in class org.json.JSONObject
-
Get an optional int value associated with a key, or the default if there
is no such key or if the value is not a number.
- optJSONArray(int) - Method in class org.json.JSONArray
-
Get the optional JSONArray associated with an index.
- optJSONArray(String) - Method in class org.json.JSONObject
-
Get an optional JSONArray associated with a key.
- optJSONObject(int) - Method in class org.json.JSONArray
-
Get the optional JSONObject associated with an index.
- optJSONObject(String) - Method in class org.json.JSONObject
-
Get an optional JSONObject associated with a key.
- optLong(int) - Method in class org.json.JSONArray
-
Get the optional long value associated with an index.
- optLong(int, long) - Method in class org.json.JSONArray
-
Get the optional long value associated with an index.
- optLong(String) - Method in class org.json.JSONObject
-
Get an optional long value associated with a key, or zero if there is no
such key or if the value is not a number.
- optLong(String, long) - Method in class org.json.JSONObject
-
Get an optional long value associated with a key, or the default if there
is no such key or if the value is not a number.
- optNumber(int) - Method in class org.json.JSONArray
-
Get an optional Number
value associated with a key, or null
if there is no such key or if the value is not a number.
- optNumber(int, Number) - Method in class org.json.JSONArray
-
Get an optional Number
value associated with a key, or the default if there
is no such key or if the value is not a number.
- optNumber(String) - Method in class org.json.JSONObject
-
Get an optional Number
value associated with a key, or null
if there is no such key or if the value is not a number.
- optNumber(String, Number) - Method in class org.json.JSONObject
-
Get an optional Number
value associated with a key, or the default if there
is no such key or if the value is not a number.
- optQuery(String) - Method in class org.json.JSONArray
-
Queries and returns a value from this object using jsonPointer
, or
returns null if the query fails due to a missing key.
- optQuery(JSONPointer) - Method in class org.json.JSONArray
-
Queries and returns a value from this object using jsonPointer
, or
returns null if the query fails due to a missing key.
- optQuery(String) - Method in class org.json.JSONObject
-
Queries and returns a value from this object using jsonPointer
, or
returns null if the query fails due to a missing key.
- optQuery(JSONPointer) - Method in class org.json.JSONObject
-
Queries and returns a value from this object using jsonPointer
, or
returns null if the query fails due to a missing key.
- optString(int) - Method in class org.json.JSONArray
-
Get the optional string value associated with an index.
- optString(int, String) - Method in class org.json.JSONArray
-
Get the optional string associated with an index.
- optString(String) - Method in class org.json.JSONObject
-
Get an optional string associated with a key.
- optString(String, String) - Method in class org.json.JSONObject
-
Get an optional string associated with a key.
- org.json - package org.json
-
- ORIGINAL - Static variable in class org.json.XMLParserConfiguration
-
Original Configuration of the XML Parser.
- Property - Class in org.json
-
Converts a Property file data into JSONObject and back.
- Property() - Constructor for class org.json.Property
-
- put(boolean) - Method in class org.json.JSONArray
-
Append a boolean value.
- put(Collection<?>) - Method in class org.json.JSONArray
-
Put a value in the JSONArray, where the value will be a JSONArray which
is produced from a Collection.
- put(double) - Method in class org.json.JSONArray
-
Append a double value.
- put(float) - Method in class org.json.JSONArray
-
Append a float value.
- put(int) - Method in class org.json.JSONArray
-
Append an int value.
- put(long) - Method in class org.json.JSONArray
-
Append an long value.
- put(Map<?, ?>) - Method in class org.json.JSONArray
-
Put a value in the JSONArray, where the value will be a JSONObject which
is produced from a Map.
- put(Object) - Method in class org.json.JSONArray
-
Append an object value.
- put(int, boolean) - Method in class org.json.JSONArray
-
Put or replace a boolean value in the JSONArray.
- put(int, Collection<?>) - Method in class org.json.JSONArray
-
Put a value in the JSONArray, where the value will be a JSONArray which
is produced from a Collection.
- put(int, double) - Method in class org.json.JSONArray
-
Put or replace a double value.
- put(int, float) - Method in class org.json.JSONArray
-
Put or replace a float value.
- put(int, int) - Method in class org.json.JSONArray
-
Put or replace an int value.
- put(int, long) - Method in class org.json.JSONArray
-
Put or replace a long value.
- put(int, Map<?, ?>) - Method in class org.json.JSONArray
-
Put a value in the JSONArray, where the value will be a JSONObject that
is produced from a Map.
- put(int, Object) - Method in class org.json.JSONArray
-
Put or replace an object value in the JSONArray.
- put(String, boolean) - Method in class org.json.JSONObject
-
Put a key/boolean pair in the JSONObject.
- put(String, Collection<?>) - Method in class org.json.JSONObject
-
Put a key/value pair in the JSONObject, where the value will be a
JSONArray which is produced from a Collection.
- put(String, double) - Method in class org.json.JSONObject
-
Put a key/double pair in the JSONObject.
- put(String, float) - Method in class org.json.JSONObject
-
Put a key/float pair in the JSONObject.
- put(String, int) - Method in class org.json.JSONObject
-
Put a key/int pair in the JSONObject.
- put(String, long) - Method in class org.json.JSONObject
-
Put a key/long pair in the JSONObject.
- put(String, Map<?, ?>) - Method in class org.json.JSONObject
-
Put a key/value pair in the JSONObject, where the value will be a
JSONObject which is produced from a Map.
- put(String, Object) - Method in class org.json.JSONObject
-
Put a key/value pair in the JSONObject.
- putAll(Collection<?>) - Method in class org.json.JSONArray
-
Put a collection's elements in to the JSONArray.
- putAll(Iterable<?>) - Method in class org.json.JSONArray
-
Put an Iterable's elements in to the JSONArray.
- putAll(JSONArray) - Method in class org.json.JSONArray
-
Put a JSONArray's elements in to the JSONArray.
- putAll(Object) - Method in class org.json.JSONArray
-
Put an array's elements in to the JSONArray.
- putOnce(String, Object) - Method in class org.json.JSONObject
-
Put a key/value pair in the JSONObject, but only if the key and the value
are both non-null, and only if there is not already a member with that
name.
- putOpt(String, Object) - Method in class org.json.JSONObject
-
Put a key/value pair in the JSONObject, but only if the key and the value
are both non-null.
- testValidity(Object) - Static method in class org.json.JSONObject
-
Throw an exception if the object is a NaN or infinite number.
- toJSONArray(String) - Static method in class org.json.CDL
-
Produce a JSONArray of JSONObjects from a comma delimited text string,
using the first row as a source of names.
- toJSONArray(JSONTokener) - Static method in class org.json.CDL
-
Produce a JSONArray of JSONObjects from a comma delimited text string,
using the first row as a source of names.
- toJSONArray(JSONArray, String) - Static method in class org.json.CDL
-
Produce a JSONArray of JSONObjects from a comma delimited text string
using a supplied JSONArray as the source of element names.
- toJSONArray(JSONArray, JSONTokener) - Static method in class org.json.CDL
-
Produce a JSONArray of JSONObjects from a comma delimited text string
using a supplied JSONArray as the source of element names.
- toJSONArray(String) - Static method in class org.json.JSONML
-
Convert a well-formed (but not necessarily valid) XML string into a
JSONArray using the JsonML transform.
- toJSONArray(String, boolean) - Static method in class org.json.JSONML
-
Convert a well-formed (but not necessarily valid) XML string into a
JSONArray using the JsonML transform.
- toJSONArray(XMLTokener, boolean) - Static method in class org.json.JSONML
-
Convert a well-formed (but not necessarily valid) XML string into a
JSONArray using the JsonML transform.
- toJSONArray(XMLTokener) - Static method in class org.json.JSONML
-
Convert a well-formed (but not necessarily valid) XML string into a
JSONArray using the JsonML transform.
- toJSONArray(JSONArray) - Method in class org.json.JSONObject
-
Produce a JSONArray containing the values of the members of this
JSONObject.
- toJSONObject(String) - Static method in class org.json.Cookie
-
Convert a cookie specification string into a JSONObject.
- toJSONObject(String) - Static method in class org.json.CookieList
-
Convert a cookie list into a JSONObject.
- toJSONObject(String) - Static method in class org.json.HTTP
-
Convert an HTTP header string into a JSONObject.
- toJSONObject(JSONArray) - Method in class org.json.JSONArray
-
Produce a JSONObject by combining a JSONArray of names with the values of
this JSONArray.
- toJSONObject(String) - Static method in class org.json.JSONML
-
Convert a well-formed (but not necessarily valid) XML string into a
JSONObject using the JsonML transform.
- toJSONObject(String, boolean) - Static method in class org.json.JSONML
-
Convert a well-formed (but not necessarily valid) XML string into a
JSONObject using the JsonML transform.
- toJSONObject(XMLTokener) - Static method in class org.json.JSONML
-
Convert a well-formed (but not necessarily valid) XML string into a
JSONObject using the JsonML transform.
- toJSONObject(XMLTokener, boolean) - Static method in class org.json.JSONML
-
Convert a well-formed (but not necessarily valid) XML string into a
JSONObject using the JsonML transform.
- toJSONObject(Properties) - Static method in class org.json.Property
-
Converts a property file object into a JSONObject.
- toJSONObject(String) - Static method in class org.json.XML
-
Convert a well-formed (but not necessarily valid) XML string into a
JSONObject.
- toJSONObject(Reader) - Static method in class org.json.XML
-
Convert a well-formed (but not necessarily valid) XML into a
JSONObject.
- toJSONObject(Reader, boolean) - Static method in class org.json.XML
-
Convert a well-formed (but not necessarily valid) XML into a
JSONObject.
- toJSONObject(Reader, XMLParserConfiguration) - Static method in class org.json.XML
-
Convert a well-formed (but not necessarily valid) XML into a
JSONObject.
- toJSONObject(String, boolean) - Static method in class org.json.XML
-
Convert a well-formed (but not necessarily valid) XML string into a
JSONObject.
- toJSONObject(String, XMLParserConfiguration) - Static method in class org.json.XML
-
Convert a well-formed (but not necessarily valid) XML string into a
JSONObject.
- toJSONString() - Method in interface org.json.JSONString
-
The toJSONString
method allows a class to produce its own JSON
serialization.
- toList() - Method in class org.json.JSONArray
-
Returns a java.util.List containing all of the elements in this array.
- toMap() - Method in class org.json.JSONObject
-
Returns a java.util.Map containing all of the entries in this object.
- toProperties(JSONObject) - Static method in class org.json.Property
-
Converts the JSONObject into a property file object.
- toString(JSONArray) - Static method in class org.json.CDL
-
Produce a comma delimited text from a JSONArray of JSONObjects.
- toString(JSONArray, JSONArray) - Static method in class org.json.CDL
-
Produce a comma delimited text from a JSONArray of JSONObjects using
a provided list of names.
- toString(JSONObject) - Static method in class org.json.Cookie
-
Convert a JSONObject into a cookie specification string.
- toString(JSONObject) - Static method in class org.json.CookieList
-
Convert a JSONObject into a cookie list.
- toString(JSONObject) - Static method in class org.json.HTTP
-
Convert a JSONObject into an HTTP header.
- toString() - Method in class org.json.JSONArray
-
Make a JSON text of this JSONArray.
- toString(int) - Method in class org.json.JSONArray
-
Make a pretty-printed JSON text of this JSONArray.
- toString(JSONArray) - Static method in class org.json.JSONML
-
Reverse the JSONML transformation, making an XML text from a JSONArray.
- toString(JSONObject) - Static method in class org.json.JSONML
-
Reverse the JSONML transformation, making an XML text from a JSONObject.
- toString() - Method in class org.json.JSONObject
-
Make a JSON text of this JSONObject.
- toString(int) - Method in class org.json.JSONObject
-
Make a pretty-printed JSON text of this JSONObject.
- toString() - Method in class org.json.JSONPointer
-
Returns a string representing the JSONPointer path value using string
representation
- toString() - Method in class org.json.JSONStringer
-
Return the JSON text.
- toString() - Method in class org.json.JSONTokener
-
Make a printable string of this JSONTokener.
- toString(Object) - Static method in class org.json.XML
-
Convert a JSONObject into a well-formed, element-normal XML string.
- toString(Object, String) - Static method in class org.json.XML
-
Convert a JSONObject into a well-formed, element-normal XML string.
- toString(Object, String, XMLParserConfiguration) - Static method in class org.json.XML
-
Convert a JSONObject into a well-formed, element-normal XML string.
- toURIFragment() - Method in class org.json.JSONPointer
-
Returns a string representing the JSONPointer path value using URI
fragment identifier representation
- TYPE_ATTR - Static variable in class org.json.XML
-
- withcDataTagName(String) - Method in class org.json.XMLParserConfiguration
-
The name of the key in a JSON Object that indicates a CDATA section.
- withConvertNilAttributeToNull(boolean) - Method in class org.json.XMLParserConfiguration
-
When parsing the XML into JSON, specifies if values with attribute xsi:nil="true"
should be kept as attribute(false
), or they should be converted to
null
(true
)
- withKeepStrings(boolean) - Method in class org.json.XMLParserConfiguration
-
When parsing the XML into JSON, specifies if values should be kept as strings (true
), or if
they should try to be guessed into JSON values (numeric, boolean, string)
- withXsiTypeMap(Map<String, XMLXsiTypeConverter<?>>) - Method in class org.json.XMLParserConfiguration
-
When parsing the XML into JSON, specifies that the values with attribute xsi:type
will be converted to target type defined to client in this configuration
Map<String, XMLXsiTypeConverter<?>>
to parse values with attribute
xsi:type="integer" as integer, xsi:type="string" as string
- wrap(Object) - Static method in class org.json.JSONObject
-
Wrap an object, if necessary.
- write(Writer) - Method in class org.json.JSONArray
-
Write the contents of the JSONArray as JSON text to a writer.
- write(Writer, int, int) - Method in class org.json.JSONArray
-
Write the contents of the JSONArray as JSON text to a writer.
- write(Writer) - Method in class org.json.JSONObject
-
Write the contents of the JSONObject as JSON text to a writer.
- write(Writer, int, int) - Method in class org.json.JSONObject
-
Write the contents of the JSONObject as JSON text to a writer.
- writer - Variable in class org.json.JSONWriter
-
The writer that will receive the output.


This page uses the built files, so you must do a local build before the example will work.
src: set src


Money Play. How should Red play 64?
pips Red=144 White=133
(CorrectAnswer= 0/0, ErrorScore= 0)
The pure play is 21/11 but is too risky?
There is duplication of threes and Red’s four-point board is a good deterrent but four blots is a lot. Equally well Red has given away the cube and so must win with the checkers.
The alternative play is 7/3, 7/1 starting too more points and hoping for a two or a three next turn.
The two approaches are very different and it is hard, especially over the board, to evaluate the two game plans. Luckily on this occasion you can’t make a mistake! The two plays have nigh on identical equities so take your choice!
There is duplication of threes and Red’s four-point board is a good deterrent but four blots is a lot. Equally well Red has given away the cube and so must win with the checkers.
The alternative play is 7/3, 7/1 starting too more points and hoping for a two or a three next turn.
The two approaches are very different and it is hard, especially over the board, to evaluate the two game plans. Luckily on this occasion you can’t make a mistake! The two plays have nigh on identical equities so take your choice!
1. Cubeful 2-ply 7/3 7/1 Eq.: -1.000 0.220 0.048 0.001 - 0.780 0.218 0.010 2. Cubeful 2-ply 21/11 Eq.: -1.018 (-0.018) 0.213 0.042 0.001 - 0.787 0.240 0.017 3. Cubeful 2-ply 7/1 5/1 Eq.: -1.029 (-0.029) 0.187 0.033 0.000 - 0.813 0.219 0.008 4. Cubeful 2-ply 7/1 6/2 Eq.: -1.037 (-0.037) 0.173 0.024 0.000 - 0.827 0.224 0.007 5. Cubeful 2-ply 21/15 7/3 Eq.: -1.079 (-0.079) 0.207 0.046 0.001 - 0.793 0.308 0.028


India is a diverse and culturally abounding country which throughout the centuries has been a humble abode of the residents of the subcontinent who have accomplished a rich intellectual life in such fields as music, dance, fine arts and literature. In the hustle of development the cultural heritage of this magnanimous country has taken a backseat.
SPIC MACAY is a pro bono autonomous youth movement which promotes the incorporeal aspects of Indian cultural heritage by fostering and nurturing the classical dance forms, folk music, crafts and other ethnic inclusiveness of the country. SPIC MACAY organises thousands of programs every year to enlighten our youth and make them au courant about the elegance and delicacy of our culture. SPIC MACAY makes a conscious effort to influence our lives by making us imbibe the simplicity, grace and beauty of our culture and heritage thereby leading a meaningful and enhanced life. Since the Inception……to the present The inception of SPIC MACAY was the brain child of ingenious Kiran Seth, a young graduate from IIT Kharagpur studying for his doctorate at Columbia University, New York when he unexpectedly happened to turn up at a Dhrupad concert by Ustad Nasir Aminuddin Dagar and Ustad Zia Fariddudin Dagar at the Brooklyn Academy of Music, New York City. Upon his return to India he congregated the students who could anticipate his vision and commenced ahead his revolutionary idea into a well-shaped movement in the bewildering formation of SPIC MACAY i.e. Society for the Promotion of Indian Classical Music And Culture Amongst Youth. SPIC MACAY’S first concert by Dagar Brothers was held at IIT Delhi on 28th of March, 1978. SPIC MACAY has been marshalling thousands of programs to keep alive the cultural heritage of India and make it accessible to the fledgling. SPIC MACAY’s chapters run by youth have also arose in many non-native lands which include countries of USA, UK, Australia, Hong Kong, Middle-east etc. The major activities orchestrated by SPIC MACAY are - FEST series, VIRASAT series, National conventions for students and teachers, National school intensives, Music in the Park, The SPIC MACAY Scholarship Program, heritage walks, talks by eminent thinkers, yoga and Meditation Camps, screening of classic cinema etc. The activities which are a part of SPIC MACAY are - ● VIRASAT- This is a festival showcasing folk and classical arts, literature, art and crafts, talks, theatre, films and yoga. ● LECTURE DEMONSTRATION - In this format, artists elaborate the intricacies of the art format while performing led by an elaborate question-answer session. ● WORKSHOP DEMONSTRATION - The audience is taught a short piece of art firm before performance. Our Gems… The nonpareil founder of SPIC MACAY, Dr. Kiran Seth has engineered a cultural renaissance on the campuses of educational institutes. Overwhelmed by the fervent effect of the music by Dagar Brothers, he decided to share this experience with the world. The Dhrupad concert of IIT Delhi pushed him forward to come up with more such events. The classical arts come with a large number of prerequisites, not only for performers and practitioners, but for audiences as well. But the old saying ‘Where there is a will, there is a way’ again proved its worth. Like a large banyan tree, SPIC MACAY has grown, with hundreds of branches giving rise to newer shoots and leaves. Amid the complicated logistics of organizing thousands of events related to arts across the country, what has remained constant is Seth’s vision. Four decades later, SPIC MACAY is a cultural movement to reckon with. What started off with classical music has now embraced dance, folk, art, handicrafts, handlooms, photography, heritage tours and more. The movement has been lucky enough to get the never ending support of our eminent artists. Such legendary artists consider performing for SPIC MACAY as their way of giving back to the society and the country. Some such names are Ustad Nasir Aminuddin Dagar, Ustad Zia Fariduddin Dagar, Prof. TN Krishnan, Pandit Birju Maharaj, Vid. Malavika Sarukkai, Smt. Sonal Mansingh, Ustad Asad Ali Khan, Ustad Munnawar Ali Khan, Ustad Zia Mohiuddin Dagar, Ustad Bismilla Khan, Pt. Bhimsen Joshi, Sitar maestro Pandit Ravi Shankar, Carnatic vocalist Dr Mangalampalli Balamuralikrishna, painter Anjolie Ela Menon, filmmaker Adoor Gopalkrishnan etc. The enhanced status of SPIC MACAY is touching new heights for sure with the relentless efforts and commitment of each stakeholders both on and off the screen. The Wave of Change: It’s an old saying ‘drop-drop makes an ocean’. Exactly this has been magnified in the artistic works of SPIC MACAY. What started as a movement by a Professor and his students has now become a path which not only integrates modern youth with classical elegance but also serves as a bridge for the illustration of our beautiful heritage to the state-of-art world. Changes are several, but the one which requires a mention is the redefinition of the word ‘classical’ into the minds and hearts of many. SPIC MACAY not only changed the notion of classical music amongst millions but also revolutionized the perception of people when their thoughts hover over the word ‘ethnic’. This initiative also inspires the vision that every single bit matters if you ceaselessly keep accumulating the bits. In the words of author ‘Saul Bellow’, “Only art penetrates the seeming realities of this world. There is another reality, the genuine one, which we lose sight of. This other reality is always sending us hints, which, without art, we can’t receive.” It is these hints that an organization like SPIC MACAY has been trying hard to convey. In this world of superficiality where everyone is projecting themselves to be much more important than one's development within. This often results in leading a materialistic and shallow life unescorted by an inner connect of our roots. SPIC MACAY makes a conscious effort to keep us rooted to our culture thereby promoting us to lead burgeoning life and also safeguarding our ethnic diversity.


--- layout: default header-img: "img/tag-bg.jpg" --- {% include intro-header.html type='page' short=true %}


- randomizeAxisAngle(Random, double, AxisAngleBasics) - Static method in class us.ihmc.euclid.tools.EuclidCoreRandomTools
-
Randomizes the given axis-angle.
- randomizeAxisAngle(Random, AxisAngleBasics) - Static method in class us.ihmc.euclid.tools.EuclidCoreRandomTools
-
Randomizes the given axis-angle.
- randomizeTuple2D(Random, Tuple2DBasics) - Static method in class us.ihmc.euclid.tools.EuclidCoreRandomTools
-
Randomizes a 2D tuple.
- randomizeTuple2D(Random, Tuple2DReadOnly, Tuple2DBasics) - Static method in class us.ihmc.euclid.tools.EuclidCoreRandomTools
-
Randomizes a 2D tuple.
- randomizeTuple2D(Random, Tuple2DReadOnly, Tuple2DReadOnly, Tuple2DBasics) - Static method in class us.ihmc.euclid.tools.EuclidCoreRandomTools
-
Randomizes a 2D tuple.
- randomizeTuple3D(Random, Tuple3DBasics) - Static method in class us.ihmc.euclid.tools.EuclidCoreRandomTools
-
Randomizes a tuple.
- randomizeTuple3D(Random, Tuple3DReadOnly, Tuple3DBasics) - Static method in class us.ihmc.euclid.tools.EuclidCoreRandomTools
-
Randomizes a tuple.
- randomizeTuple3D(Random, Tuple3DReadOnly, Tuple3DReadOnly, Tuple3DBasics) - Static method in class us.ihmc.euclid.tools.EuclidCoreRandomTools
-
Randomizes a tuple.
- resetScale() - Method in class us.ihmc.euclid.matrix.RotationScaleMatrix
-
Resets all the scale factors to 1.0.
- resetScale() - Method in class us.ihmc.euclid.transform.AffineTransform
-
Sets all the scale factors to 1.0.
- RigidBodyTransform - Class in us.ihmc.euclid.transform
-
A RigidBodyTransform
represents a 4-by-4 transformation matrix that can rotate and
translate.
- RigidBodyTransform() - Constructor for class us.ihmc.euclid.transform.RigidBodyTransform
-
Creates a new rigid-body transform set to identity.
- RigidBodyTransform(double[]) - Constructor for class us.ihmc.euclid.transform.RigidBodyTransform
-
Sets the raw components of this rigid-body transform from the given transformArray
.
- RigidBodyTransform(double, double, double, double, double, double, double, double, double, double, double, double) - Constructor for class us.ihmc.euclid.transform.RigidBodyTransform
-
Creates a new rigid-body transform and sets it from the given 12 coefficients.
- RigidBodyTransform(DenseMatrix64F) - Constructor for class us.ihmc.euclid.transform.RigidBodyTransform
-
Creates a new rigid-body transform and sets its raw components from the given matrix
.
- RigidBodyTransform(Orientation3DReadOnly, Tuple3DReadOnly) - Constructor for class us.ihmc.euclid.transform.RigidBodyTransform
-
Creates a new rigid-body transform and sets it to the given orientation
and
translation
.
- RigidBodyTransform(QuaternionBasedTransform) - Constructor for class us.ihmc.euclid.transform.RigidBodyTransform
-
Creates a new rigid-body transform and sets it to quaternionBasedTransform
.
- RigidBodyTransform(RigidBodyTransform) - Constructor for class us.ihmc.euclid.transform.RigidBodyTransform
-
Creates a new rigid-body transform and sets it to other
.
- RotationMatrix - Class in us.ihmc.euclid.matrix
-
A RotationMatrix
is a 3-by-3 matrix used to represent 3d orientations.
- RotationMatrix() - Constructor for class us.ihmc.euclid.matrix.RotationMatrix
-
Create a new rotation matrix initialized to identity.
- RotationMatrix(double[]) - Constructor for class us.ihmc.euclid.matrix.RotationMatrix
-
Creates a new rotation matrix and initializes it from the given array.
- RotationMatrix(double, double, double, double, double, double, double, double, double) - Constructor for class us.ihmc.euclid.matrix.RotationMatrix
-
Creates a new rotation matrix and initializes it from the given 9 coefficients.
- RotationMatrix(DenseMatrix64F) - Constructor for class us.ihmc.euclid.matrix.RotationMatrix
-
Creates a new rotation matrix that is the same as rotationMatrix
.
- RotationMatrix(Matrix3DReadOnly) - Constructor for class us.ihmc.euclid.matrix.RotationMatrix
-
Creates a new rotation matrix that is the same as rotationMatrix
.
- RotationMatrix(RotationMatrixReadOnly) - Constructor for class us.ihmc.euclid.matrix.RotationMatrix
-
Creates a new rotation matrix that is the same as other
.
- RotationMatrix(Orientation3DReadOnly) - Constructor for class us.ihmc.euclid.matrix.RotationMatrix
-
Creates a new rotation matrix that represents the same orientation as the given one.
- RotationMatrix(Vector3DReadOnly) - Constructor for class us.ihmc.euclid.matrix.RotationMatrix
-
Creates a new rotation matrix representing the same orientation as the given rotation vector
rotationVector
.
- RotationMatrixConversion - Class in us.ihmc.euclid.rotationConversion
-
This class gathers all the methods necessary to converts any type of rotation into a rotation
matrix.
- RotationMatrixConversion() - Constructor for class us.ihmc.euclid.rotationConversion.RotationMatrixConversion
-
- RotationMatrixReadOnly - Interface in us.ihmc.euclid.matrix.interfaces
-
Read interface used for 3-by-3 rotation matrices.
- RotationMatrixTools - Class in us.ihmc.euclid.tools
-
Tools for performing operations on rotation matrices.
- RotationMatrixTools() - Constructor for class us.ihmc.euclid.tools.RotationMatrixTools
-
- RotationScaleMatrix - Class in us.ihmc.euclid.matrix
-
A RotationScaleMatrix
is a 3-by-3 matrix that represents a 3D orientation times a
diagonal matrix holding on scale factors.
- RotationScaleMatrix() - Constructor for class us.ihmc.euclid.matrix.RotationScaleMatrix
-
Create a new rotation-scale matrix initialized to identity.
- RotationScaleMatrix(double[]) - Constructor for class us.ihmc.euclid.matrix.RotationScaleMatrix
-
Creates a new rotation-scale matrix and initializes it from the given array.
- RotationScaleMatrix(DenseMatrix64F) - Constructor for class us.ihmc.euclid.matrix.RotationScaleMatrix
-
Creates a new rotation-scale matrix that is the same as rotationScaleMatrix
.
- RotationScaleMatrix(DenseMatrix64F, double) - Constructor for class us.ihmc.euclid.matrix.RotationScaleMatrix
-
Creates a new rotation-scale matrix with the rotation part initialized to the
rotationMatrix
and all three scale factors initialized to scale
.
- RotationScaleMatrix(DenseMatrix64F, double, double, double) - Constructor for class us.ihmc.euclid.matrix.RotationScaleMatrix
-
Creates a new rotation-scale matrix with the rotation part initialized to the
rotationMatrix
and all three scale factors initialized to scaleX
, scaleY
,
and scaleZ
.
- RotationScaleMatrix(DenseMatrix64F, Tuple3DReadOnly) - Constructor for class us.ihmc.euclid.matrix.RotationScaleMatrix
-
Creates a new rotation-scale matrix with the rotation part initialized to the
rotationMatrix
and all three scale factors initialized to scales
.
- RotationScaleMatrix(Matrix3DReadOnly) - Constructor for class us.ihmc.euclid.matrix.RotationScaleMatrix
-
Creates a new rotation-scale matrix that is the same as rotationScaleMatrix
.
- RotationScaleMatrix(RotationMatrixReadOnly, double) - Constructor for class us.ihmc.euclid.matrix.RotationScaleMatrix
-
Creates a new rotation-scale matrix with the rotation part initialized to the
rotationMatrix
and all three scale factors initialized to scale
.
- RotationScaleMatrix(RotationMatrixReadOnly, double, double, double) - Constructor for class us.ihmc.euclid.matrix.RotationScaleMatrix
-
Creates a new rotation-scale matrix with the rotation part initialized to the
rotationMatrix
and all three scale factors initialized to scaleX
, scaleY
,
and scaleZ
.
- RotationScaleMatrix(RotationMatrixReadOnly, Tuple3DReadOnly) - Constructor for class us.ihmc.euclid.matrix.RotationScaleMatrix
-
Creates a new rotation-scale matrix with the rotation part initialized to the
rotationMatrix
and all three scale factors initialized to scales
.
- RotationScaleMatrix(RotationScaleMatrix) - Constructor for class us.ihmc.euclid.matrix.RotationScaleMatrix
-
Creates a new rotation-scale matrix that is the same as other
.
- RotationScaleMatrix(Orientation3DReadOnly, double) - Constructor for class us.ihmc.euclid.matrix.RotationScaleMatrix
-
Creates a new rotation-scale matrix with the rotation part initialized to the orientation
and all three scale factors initialized to scale
.
- RotationScaleMatrix(Orientation3DReadOnly, double, double, double) - Constructor for class us.ihmc.euclid.matrix.RotationScaleMatrix
-
Creates a new rotation-scale matrix with the rotation part initialized to the orientation
and all three scale factors initialized to scaleX
, scaleY
, and scaleZ
.
- RotationScaleMatrix(Orientation3DReadOnly, Tuple3DReadOnly) - Constructor for class us.ihmc.euclid.matrix.RotationScaleMatrix
-
Creates a new rotation-scale matrix with the rotation part initialized to the orientation
and all three scale factors initialized to scales
.
- RotationScaleMatrixReadOnly - Interface in us.ihmc.euclid.matrix.interfaces
-
Read interface for 3-by-3 rotation-scale matrices.
- RotationVectorConversion - Class in us.ihmc.euclid.rotationConversion
-
This class gathers all the methods necessary to converts any type of rotation into a rotation
vector.
- RotationVectorConversion() - Constructor for class us.ihmc.euclid.rotationConversion.RotationVectorConversion
-
- rowOutOfBoundsException(int, int) - Static method in class us.ihmc.euclid.tools.Matrix3DTools
-
Create an ArrayIndexOutOfBoundsException for a bad row index.


As I continue to archive sessions and write new articles, I find that it's taking up a rather large portion of my time. That was fine when this website was new and exciting, and taking an hour to create an archive page was tolerable, but I can't continue like this. It's simply unfeasible to commit this much time to maintaining the site.
This is why I am in the process of writing a Java program to begin the automation of this site. My most recent archive was generated using this program. I copy and pasted the chat logs from the discord channel, put them into an HTML file, hand typed some metadata into the same file (information about who was speaking and what party they belonged to), then I ran the program and it gave me a webpage. From there, I made some tweaks to it and uploaded it.
The process is far from perfect: as it stands right now, I think I spent more time using this method than I would've if I just manually wrote the HTML page myself, but I believe it's a step in the right direction. I will continue work on it in hopes that, some day, it'll become a 1 minute process of copy and pasting from a channel, pressing a button, and having an entire hour long session automagically archived. Once I'm done with that, then I can move on to more fascinating things, like turning this into a proper media website.


{% extends "base_dash.html" %} {% set active_page = "info-guide" %} {% block title %}Empower Your Office Today!{% endblock %} {% block content %} Informational Guide Dashboard Dashboard text here Report Report text here Directory Directory text here Add Employee Add Employee text here Remove Employee Remove Employee text here Print Print text here. Settings Settings text here Made with ♥ by The Web Debbies {% endblock %}
Made with ♥ by The Web Debbies


HBHelperRegistry Class Reference
| Inherits from | NSObject |
| Declared in | HBHelperRegistry.h |
Overview
HBHelperRegistry instances are objects holding a set of helpers available to templates. They are the actual objects used by [HBExecutionContext] instances to store helpers.
You generally do not use a registry directly but use the corresponding shorcut methods on [HBExecutionContext]
Helper registries implement the objective-C keyed subscripting API though, meaning that you can read and write helpers using subscripting operators. For instance :
HBExecutionContext e = [[HBExecutionContext] new] autorelease]; HBHelper h = …; e.helpers[@“my_helper”] = h;
Tasks
Other Methods
-
+ registry
Create a new registry
-
– registerHelperBlock:forName:
Register a helper in the registry
-
– registerHelperBlocks:
Register several helpers at once in the registry
Managing raw helpers
-
– helperForName:
Retrieve a helper by name
-
– setHelper:forName:
Adding a helper object
-
– addHelpers:
Adding several helper objects at once
-
– removeHelperForName:
remove a helper
-
– removeAllHelpers
remove all helpers at once
-
– objectForKeyedSubscript:
Retrieve a helper by name using the objective-C keyed subscripting API
-
– setObject:forKeyedSubscript:
Add a helper using the objective-C keyed subscripting API
Instance Methods
addHelpers:
Adding several helper objects at once
- (void)addHelpers:(NSDictionary *)helpers
Parameters
- helpers
an NSDictionary containing the helpers to add where keys are the name of the helpers and values are HBHelper objects.
Discussion
Use this method if you want to add multiple helpers at once. See the discussion in setHelper:forName: regarding the usefulness of using this method.
Declared In
HBHelperRegistry.h
helperForName:
Retrieve a helper by name
- (HBHelper *)helperForName:(NSString *)name
Parameters
- name
name of the helper to retrieve
Availability
v1.0.0
Declared In
HBHelperRegistry.h
objectForKeyedSubscript:
Retrieve a helper by name using the objective-C keyed subscripting API
- (id)objectForKeyedSubscript:(id)key
Parameters
- key
name of the helper
Return Value
the helper object
Availability
v1.0.0
Discussion
This method lets you access a helper by its name using objective-C subscripting operators. For instance:
HBHelper* h = registry[@"my_helper"];
Declared In
HBHelperRegistry.h
registerHelperBlock:forName:
Register a helper in the registry
- (void)registerHelperBlock:(HBHelperBlock)block forName:(NSString *)name
Parameters
- block
block implementation of the helper
- name
name of the helper
Availability
v1.0.0
Discussion
Use this method registers a helper in the receiving registry.
Declared In
HBHelperRegistry.h
registerHelperBlocks:
Register several helpers at once in the registry
- (void)registerHelperBlocks:(NSDictionary *)helperBlocks
Parameters
- helperBlocks
a dictionary whose keys are helper names and value are helper blocks
Availability
v1.0.0
Discussion
Use this method registers several helpers at once in the receiving registry.
Declared In
HBHelperRegistry.h
removeHelperForName:
remove a helper
- (void)removeHelperForName:(NSString *)name
Parameters
- name
name of the helper to remove
Availability
v1.0.0
Declared In
HBHelperRegistry.h
setHelper:forName:
Adding a helper object
- (void)setHelper:(HBHelper *)helper forName:(NSString *)name
Parameters
- helper
the helper object
- name
the name of the helper
Availability
v1.0.0
Discussion
Use this method it you want to register a helper object directly (instead of a helper block). This method is of very limited usefulness in this version of the API since HBHelper objects are merely wrappers around blocks
Declared In
HBHelperRegistry.h
setObject:forKeyedSubscript:
Add a helper using the objective-C keyed subscripting API
- (void)setObject:(id)object forKeyedSubscript:(id<NSCopying>)key
Parameters
- object
the helper to set (an [HBHelper] instance)
- key
name of the helper
Availability
v1.0.0
Discussion
This method lets you set a helper using objective-C subscripting operators. For instance
HBHelper* h = ...;
registry[@"my_helper"] = h;
Declared In
HBHelperRegistry.h


001/* 002 * Licensed to the Apache Software Foundation (ASF) under one 003 * or more contributor license agreements. See the NOTICE file 004 * distributed with this work for additional information 005 * regarding copyright ownership. The ASF licenses this file 006 * to you under the Apache License, Version 2.0 (the 007 * "License"); you may not use this file except in compliance 008 * with the License. You may obtain a copy of the License at 009 * 010 * http://www.apache.org/licenses/LICENSE-2.0 011 * 012 * Unless required by applicable law or agreed to in writing, 013 * software distributed under the License is distributed on an 014 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 015 * KIND, either express or implied. See the License for the 016 * specific language governing permissions and limitations 017 * under the License. 018 */ 019package org.apache.shiro.authc.pam; 020 021import org.apache.shiro.authc.*; 022import org.apache.shiro.realm.Realm; 023import org.apache.shiro.subject.PrincipalCollection; 024import org.apache.shiro.util.CollectionUtils; 025import org.slf4j.Logger; 026import org.slf4j.LoggerFactory; 027 028import java.util.Collection; 029 030/** 031 * A {@code ModularRealmAuthenticator} delegates account lookups to a pluggable (modular) collection of 032 * {@link Realm}s. This enables PAM (Pluggable Authentication Module) behavior in Shiro. 033 * In addition to authorization duties, a Shiro Realm can also be thought of a PAM 'module'. 034 *
 035 * Using this Authenticator allows you to "plug-in" your own 036 * {@code Realm}s as you see fit. Common realms are those based on accessing 037 * LDAP, relational databases, file systems, etc. 038 *
 039 * If only one realm is configured (this is often the case for most applications), authentication success is naturally 040 * only dependent upon invoking this one Realm's 041 * {@link Realm#getAuthenticationInfo(org.apache.shiro.authc.AuthenticationToken)} method. 042 *
 043 * But if two or more realms are configured, PAM behavior is implemented by iterating over the collection of realms 044 * and interacting with each over the course of the authentication attempt. As this is more complicated, this 045 * authenticator allows customized behavior for interpreting what happens when interacting with multiple realms - for 046 * example, you might require all realms to be successful during the attempt, or perhaps only at least one must be 047 * successful, or some other interpretation. This customized behavior can be performed via the use of a 048 * {@link #setAuthenticationStrategy(AuthenticationStrategy) AuthenticationStrategy}, which 049 * you can inject as a property of this class. 050 *
 051 * The strategy object provides callback methods that allow you to 052 * determine what constitutes a success or failure in a multi-realm (PAM) scenario. And because this only makes sense 053 * in a multi-realm scenario, the strategy object is only utilized when more than one Realm is configured. 054 *
 055 * As most multi-realm applications require at least one Realm authenticates successfully, the default 056 * implementation is the {@link AtLeastOneSuccessfulStrategy}. 057 * 058 * @see #setRealms 059 * @see AtLeastOneSuccessfulStrategy 060 * @see AllSuccessfulStrategy 061 * @see FirstSuccessfulStrategy 062 * @since 0.1 063 */ 064public class ModularRealmAuthenticator extends AbstractAuthenticator { 065 066 /*-------------------------------------------- 067 | C O N S T A N T S | 068 ============================================*/ 069 private static final Logger log = LoggerFactory.getLogger(ModularRealmAuthenticator.class); 070 071 /*-------------------------------------------- 072 | I N S T A N C E V A R I A B L E S | 073 ============================================*/ 074 /** 075 * List of realms that will be iterated through when a user authenticates. 076 */ 077 private Collection<Realm> realms; 078 079 /** 080 * The authentication strategy to use during authentication attempts, defaults to a 081 * {@link org.apache.shiro.authc.pam.AtLeastOneSuccessfulStrategy} instance. 082 */ 083 private AuthenticationStrategy authenticationStrategy; 084 085 /*-------------------------------------------- 086 | C O N S T R U C T O R S | 087 ============================================*/ 088 089 /** 090 * Default no-argument constructor which 091 * {@link #setAuthenticationStrategy(AuthenticationStrategy) enables} an 092 * {@link org.apache.shiro.authc.pam.AtLeastOneSuccessfulStrategy} by default. 093 */ 094 public ModularRealmAuthenticator() { 095 this.authenticationStrategy = new AtLeastOneSuccessfulStrategy(); 096 } 097 098 /*-------------------------------------------- 099 | A C C E S S O R S / M O D I F I E R S | 100 ============================================*/ 101 102 /** 103 * Sets all realms used by this Authenticator, providing PAM (Pluggable Authentication Module) configuration. 104 * 105 * @param realms the realms to consult during authentication attempts. 106 */ 107 public void setRealms(Collection<Realm> realms) { 108 this.realms = realms; 109 } 110 111 /** 112 * Returns the realm(s) used by this {@code Authenticator} during an authentication attempt. 113 * 114 * @return the realm(s) used by this {@code Authenticator} during an authentication attempt. 115 */ 116 protected Collection<Realm> getRealms() { 117 return this.realms; 118 } 119 120 /** 121 * Returns the {@code AuthenticationStrategy} utilized by this modular authenticator during a multi-realm 122 * log-in attempt. This object is only used when two or more Realms are configured. 123 *
 124 * Unless overridden by 125 * the {@link #setAuthenticationStrategy(AuthenticationStrategy)} method, the default implementation 126 * is the {@link org.apache.shiro.authc.pam.AtLeastOneSuccessfulStrategy}. 127 * 128 * @return the {@code AuthenticationStrategy} utilized by this modular authenticator during a log-in attempt. 129 * @since 0.2 130 */ 131 public AuthenticationStrategy getAuthenticationStrategy() { 132 return authenticationStrategy; 133 } 134 135 /** 136 * Allows overriding the default {@code AuthenticationStrategy} utilized during multi-realm log-in attempts. 137 * This object is only used when two or more Realms are configured. 138 * 139 * @param authenticationStrategy the strategy implementation to use during log-in attempts. 140 * @since 0.2 141 */ 142 public void setAuthenticationStrategy(AuthenticationStrategy authenticationStrategy) { 143 this.authenticationStrategy = authenticationStrategy; 144 } 145 146 /*-------------------------------------------- 147 | M E T H O D S | 148 149 /** 150 * Used by the internal {@link #doAuthenticate} implementation to ensure that the {@code realms} property 151 * has been set. The default implementation ensures the property is not null and not empty. 152 * 153 * @throws IllegalStateException if the {@code realms} property is configured incorrectly. 154 */ 155 156 protected void assertRealmsConfigured() throws IllegalStateException { 157 Collection<Realm> realms = getRealms(); 158 if (CollectionUtils.isEmpty(realms)) { 159 String msg = "Configuration error: No realms have been configured! One or more realms must be " + 160 "present to execute an authentication attempt."; 161 throw new IllegalStateException(msg); 162 } 163 } 164 165 /** 166 * Performs the authentication attempt by interacting with the single configured realm, which is significantly 167 * simpler than performing multi-realm logic. 168 * 169 * @param realm the realm to consult for AuthenticationInfo. 170 * @param token the submitted AuthenticationToken representing the subject's (user's) log-in principals and credentials. 171 * @return the AuthenticationInfo associated with the user account corresponding to the specified {@code token} 172 */ 173 protected AuthenticationInfo doSingleRealmAuthentication(Realm realm, AuthenticationToken token) { 174 if (!realm.supports(token)) { 175 String msg = "Realm [" + realm + "] does not support authentication token [" + 176 token + "]. Please ensure that the appropriate Realm implementation is " + 177 "configured correctly or that the realm accepts AuthenticationTokens of this type."; 178 throw new UnsupportedTokenException(msg); 179 } 180 AuthenticationInfo info = realm.getAuthenticationInfo(token); 181 if (info == null) { 182 String msg = "Realm [" + realm + "] was unable to find account data for the " + 183 "submitted AuthenticationToken [" + token + "]."; 184 throw new UnknownAccountException(msg); 185 } 186 return info; 187 } 188 189 /** 190 * Performs the multi-realm authentication attempt by calling back to a {@link AuthenticationStrategy} object 191 * as each realm is consulted for {@code AuthenticationInfo} for the specified {@code token}. 192 * 193 * @param realms the multiple realms configured on this Authenticator instance. 194 * @param token the submitted AuthenticationToken representing the subject's (user's) log-in principals and credentials. 195 * @return an aggregated AuthenticationInfo instance representing account data across all the successfully 196 * consulted realms. 197 */ 198 protected AuthenticationInfo doMultiRealmAuthentication(Collection<Realm> realms, AuthenticationToken token) { 199 200 AuthenticationStrategy strategy = getAuthenticationStrategy(); 201 202 AuthenticationInfo aggregate = strategy.beforeAllAttempts(realms, token); 203 204 if (log.isTraceEnabled()) { 205 log.trace("Iterating through {} realms for PAM authentication", realms.size()); 206 } 207 208 for (Realm realm : realms) { 209 210 try { 211 aggregate = strategy.beforeAttempt(realm, token, aggregate); 212 } catch (ShortCircuitIterationException shortCircuitSignal) { 213 // Break from continuing with subsequnet realms on receiving 214 // short circuit signal from strategy 215 break; 216 } 217 218 if (realm.supports(token)) { 219 220 log.trace("Attempting to authenticate token [{}] using realm [{}]", token, realm); 221 222 AuthenticationInfo info = null; 223 Throwable t = null; 224 try { 225 info = realm.getAuthenticationInfo(token); 226 } catch (Throwable throwable) { 227 t = throwable; 228 if (log.isDebugEnabled()) { 229 String msg = "Realm [" + realm + "] threw an exception during a multi-realm authentication attempt:"; 230 log.debug(msg, t); 231 } 232 } 233 234 aggregate = strategy.afterAttempt(realm, token, info, aggregate, t); 235 236 } else { 237 log.debug("Realm [{}] does not support token {}. Skipping realm.", realm, token); 238 } 239 } 240 241 aggregate = strategy.afterAllAttempts(token, aggregate); 242 243 return aggregate; 244 } 245 246 247 /** 248 * Attempts to authenticate the given token by iterating over the internal collection of 249 * {@link Realm}s. For each realm, first the {@link Realm#supports(org.apache.shiro.authc.AuthenticationToken)} 250 * method will be called to determine if the realm supports the {@code authenticationToken} method argument. 251 *
 252 * If a realm does support 253 * the token, its {@link Realm#getAuthenticationInfo(org.apache.shiro.authc.AuthenticationToken)} 254 * method will be called. If the realm returns a non-null account, the token will be 255 * considered authenticated for that realm and the account data recorded. If the realm returns {@code null}, 256 * the next realm will be consulted. If no realms support the token or all supporting realms return null, 257 * an {@link AuthenticationException} will be thrown to indicate that the user could not be authenticated. 258 *
 259 * After all realms have been consulted, the information from each realm is aggregated into a single 260 * {@link AuthenticationInfo} object and returned. 261 * 262 * @param authenticationToken the token containing the authentication principal and credentials for the 263 * user being authenticated. 264 * @return account information attributed to the authenticated user. 265 * @throws IllegalStateException if no realms have been configured at the time this method is invoked 266 * @throws AuthenticationException if the user could not be authenticated or the user is denied authentication 267 * for the given principal and credentials. 268 */ 269 protected AuthenticationInfo doAuthenticate(AuthenticationToken authenticationToken) throws AuthenticationException { 270 assertRealmsConfigured(); 271 Collection<Realm> realms = getRealms(); 272 if (realms.size() == 1) { 273 return doSingleRealmAuthentication(realms.iterator().next(), authenticationToken); 274 } else { 275 return doMultiRealmAuthentication(realms, authenticationToken); 276 } 277 } 278 279 /** 280 * First calls super.onLogout(principals) to ensure a logout notification is issued, and for each 281 * wrapped {@code Realm} that implements the {@link LogoutAware LogoutAware} interface, calls 282 * ((LogoutAware)realm).onLogout(principals) to allow each realm the opportunity to perform 283 * logout/cleanup operations during an user-logout. 284 *
 285 * Shiro's Realm implementations all implement the {@code LogoutAware} interface by default and can be 286 * overridden for realm-specific logout logic. 287 * 288 * @param principals the application-specific Subject/user identifier. 289 */ 290 public void onLogout(PrincipalCollection principals) { 291 super.onLogout(principals); 292 Collection<Realm> realms = getRealms(); 293 if (!CollectionUtils.isEmpty(realms)) { 294 for (Realm realm : realms) { 295 if (realm instanceof LogoutAware) { 296 ((LogoutAware) realm).onLogout(principals); 297 } 298 } 299 } 300 } 301}


PICK YOUR FAVORITE ILLUSTRATION MODEL
Dear reader.
I have a favor to ask of you. I am redoing all of the illustrations in my books. I am about to re-render all of the illustrations with new models. Could you kindly take a moment and tell me your favorite models by tweeting me at @salsahandbook? Your feedback would be appreciated very much.
For the new illustrations I am using stylized characters to model the dance poses. I have narrowed it down to four Leader
models and three Follower
models, along with eight different Follower
wardrobes and five different Leader
wardrobes. Nine pairings of these model and wardrobe combinations are shown below.
Please express your preference!
Just scroll down to see the choices.
We value your opinion!
THANK YOU!
PICK YOUR FAVORITE!
Please pick your favorite pairing from the following list!
- Tweet your selection to @salsahandbook
- Email your feedback to salsahandbook (at) gmail (dot) com.
Pairing 1:
Pairing 2:
Pairing 3:
Pairing 4:
Pairing 5:
Pairing 6:
Pairing 7:
Pairing 8:
Pairing 9:
WHY
I've published several reference books about salsa dance. Links are provided below in the More Reading section.
I illustrated those books using a quick and easy posing tool called Magic Poser. This was the best posing tool for what I needed at the time. However the salsa handbooks have now outgrown that tool.
I very highly recommend Magic Poser. It provided pluggable body, hair, and wardrobe combinations, allowed posing two models simultaneously, and was very easy to use. The inverse kinematics of their rigged characters is excellent. I was able to create all of those poses using touch gestures on an iPhone 5s.
It was time to bite the bullet and learn a software that could provide flexibility I wanted to have to improve these illustrations. I have finally ramped up the rather steep learning curve on that software. I am now in the final stage. The next step is to choose from among several candidate models to pick the ones to use for re-rendering the illustrations.
More Reading
To learn more about salsa dance check out these books (now using the new models in illustrations):
-
Illustrated Handbook of Salsa Dance: Positions
-
Illustrated Handbook of Salsa Dance: Patterns
-
Illustrated Handbook of Salsa Dance: Butterfly Patterns


Don't miss out on our upcoming events. Sign up and tell your friends!
Come check out some of the good times we have had.
Please join the Young Professional Council in the heart of downtown San Jose for their inaugural kick-off happy hour! Enjoy the opportunity to mix and mingle with other like-minded young philanthropists while learning more about why The YPC is dedicated towards supporting the future, state of the art Women and Children's Center at Santa Clara County's largest and only public hospital, Santa Clara Valley Medical Center.
Meet the Executive Committee of the YPC to hear about how we support the mission of the Valley Medical Center, the upcoming events YPC will be hosting in 2017 and how you can get involved! You will also have the opportunity to chat with Valley Medical Center professionals including the CEO of The VMC Foundation, Chris Wilder to hear all about the exciting future of the SCVMC!
Each ticket will include a drink, appetizers and entry to win raffle prizes including:
*Attire will be Business Casual


Housing counselors near you
Find a housing counselor
Housing counselors throughout the country can provide advice on buying a home, renting, defaults, foreclosures, and credit issues. Using the search box below, you can find one near you. The counseling agencies on this list are approved by the U.S. Department of Housing and Urban Development (HUD) and they can offer independent advice about whether a particular set of mortgage loan terms is a good fit based on your objectives and circumstances, often at little or no cost to you. This list will show you several approved agencies in your area. There is also a list of nationwide HUD-approved counseling intermediaries.
The counseling agencies on this list are approved by the U.S. Department of Housing and Urban Development (HUD), and they can offer independent advice about whether a particular set of mortgage loan terms is a good fit based on your objectives and circumstances, often at little or no cost to you. This list shows you several approved agencies in your area. You can find other approved counseling agencies at the Consumer Financial Protection Bureau’s (CFPB) website: consumerfinance.gov/mortgagehelp or by calling 1-855-411-CFPB (2372). You can also access a list of nationwide HUD-approved counseling intermediaries at http://portal.hud.gov/hudportal/HUD?src=/ohc_nint
This tool is powered by HUD's official list of housing counselors. Learn more about how it works.


--- layout: page title: Contact Me date: type: page parent_id: '0' published: false password: '' status: draft categories: [] tags: [] meta: _edit_last: '12737289' summary: put your post summary here(only for Easyslider) simplecatch-sidebarlayout: '' restapi_import_id: 59486cef9f102 original_post_id: '352' _wp_old_slug: '352' author: login: nemopear email<EMAIL_ADDRESS>display_name: nemopear first_name: NUTCHAYA last_name: VORAYINGYONG permalink: "/" ---
[contact-form 1 "Contact form 1"]


The MiniMyth build system is called GAR MiniMyth. It uses a somewhat modified version of the GAR build system to build MiniMyth. Building MiniMyth from source is not for the faint of heart. It takes a long time to build and may fail to build on some systems.
The build system has three stages:
- build the native environment,
- build the cross environment and
- build MiniMyth.
While most packages needed for MiniMyth only build their cross versions, some of the packages needed for MiniMyth such as MySQL need to build their native versions in order to build their cross versions.
This long, multi-stage, build process exists to ensure independence from the local system on which MiniMyth is being built. We do not want MiniMyth binaries to link to or depend on local system libraries. We do not want differences in local system environments to result in differences in the MiniMyth builds.
Unfortunately, the price for this local system independence is time and disk space. For me, on a 2.4GHz Intel Core 2 Quad Q6600 computer running CentOS 5.6 x86_64, a complete build for i386-pentium takes approximately 8.25 hours and 31.25GB of disk space.
However, if you wish to build MiniMyth from source, then you can either build any version in the MiniMyth download directory or any version found in the version control system. If you wish to build a version found in the MiniMyth download directory, then you will want to follow the instructions for retrieving the build system from the download directory. If you wish to build a version found in the version control system, then you will want to follow the instructions for retrieving the build system from the version control system.
The build system assumes that you are building on either an i386 or an x86_64 architecture computer that is running Linux. In addition, the build system assumes that you have a basic set of binaries and libraries installed, including:
- bash (or other Posix compatible shell),
- binutils,
- bison,
- bzip2,
- coreutils,
- cvs,
- diffutils,
- findutils,
- flex,
- gawk,
- gcc,
- gcc-g++,
- git (the version control system not the GNU interactive tools),
- glibc (including static and development libraries),
- grep,
- gzip,
- guzip,
- util-linux,
- make,
- mercurial (also known as hg),
- patch,
- sed,
- subversion (also known as svn),
- texinfo,
- tar,
- wget and
- xz.
The build system does its best to check for the presence of any needed binaries at the beginning of the build process.
In order to ensure independence from the local system on which MiniMyth is being built, the build system only uses these binaries and libraries for the early part of the native environment build stage. During the native environment build stage, the MiniMyth build system builds its own versions of these binaries and libraries (with the exception of cvs, glibc and subversion).
Some Linux distributions, including Fedora, install and use ccache as part of their collection of developer packages. Unfortunately, ccache breaks the MiniMyth build system. Therefore, before you attempt to build MiniMyth, make sure that the ccache package is not installed on your system.
Some Linux distributions, including Fedora, enable Security Enhanced Linux (selinux) policies that break the MiniMyth build system. Therefore, before you attempt to build MiniMyth, make sure that selinux is disabled on your system.
Some packages included in MiniMyth will fail to build when the file system is NTFS. Therefore, do not extract and build MiniMyth on an NTFS file system. MiniMyth is known to build when the file system is ext3.
Retrieving the MiniMyth build system from the MiniMyth download directory is easy:
- Download the files that are necessary for building MiniMyth from source. These files can be found in the 'gar-minimyth-{version}.tar.bz2' file in a MiniMyth distribution download directory. The location of the MiniMyth distribution download directories can be found in the MiniMyth download instructions.
- Extract the 'gar-minimyth-{version}.tar.bz2' file by running the command 'tar -jxf gar-minimyth-{version}.tar.bz2. This should create the directory 'gar-minimyth-{version}', which is the root of the MiniMyth build system.
MiniMyth uses Google Code's Subversion version control system.
To use you will need the Subversion client, which should be available through your Linux distribution's package management system.
Once you have installed the Subversion client, you can synchronize with the Subversion server by following the instructions here.
Information on how to use Subversion can be found in the free online book: "Version Control with Subversion".
If your local system meets the prerequisites, and you have obtained a copy of the MiniMyth build system by either downloading it from the download directory or checking it out from the version control system, then you are ready to build MiniMyth.
You can build MiniMyth by following these steps:
- Configure the build system with your settings in your '$(HOME)/.minimyth/minimyth.conf.mk' file. These settings override the default settings in the build system's '{build-root}/script/minimyth.conf.mk' file, where '{build-root}' is the root directory of the MiniMyth build system. Be sure to set 'mm_HOME' to the root directory of the MiniMyth build system. The build system does its best to check for stale, incorrect or missing settings, but it cannot catch everything. Therefore, be sure that your '${HOME}/.minimyth/minimyth.conf.mk' file is up-to-date and contains correct values for settings that you need or want to override.
- Clean the entire build system by running the command 'cd {build-root} ; make clean'.
- Download the distribution source files by running the following command 'cd ${build-root} ; make garchive'. Because some source tarballs are large and some download servers are slow, this can take awhile.
- Build MiniMyth by running the following command 'cd ${build-root}/script/meta/minimyth ; make build'. This is the step that take a long time.
- Install MiniMyth by running the following command 'cd ${build-root}/script/meta/minimyth ; make install'.
While care is taken to make sure the build system is free of bugs, assuming that it is free of bugs would be foolish. If a bug in the build system caused the build system to install files in the wrong location, then your local system could be crippled. Therefore, the build system performs checks to reduce the chance that it will damage the system.
First, the build system checks whether or not you are the root user (any user with UID='0' or GID='0'). If you are the root user, then the build system prints an error message and exits. Everything, with the exception of parts of 'make install', can be done as a user with very limited access rights.
Second, the build system checks whether or not you have write access to typical system directories. If you have write access to any of these directories, then the build system prints an error message and exits.
However, 'make install' needs to perform the following operations as root:
- copy files to the TFTP directory, when mm_INSTALL_RAM_ROOT='yes',
- copy files to the TFTP and NFS directories, when mm_INSTALL_NFS_ROOT='yes' and
- copy files to the TFTP directory, when mm_INSTALL_LATEST='yes'.
As a result, 'make install' may prompt you for the root password, depending on your settings in '${HOME}/.minimyth/minimyth.conf.mk'.


Test for ngx_sf1r and Javascript
A simple test page that will submit a request to SF1 using Javascript.
Please check the source code and adapt to your environment.
URI:
http://localhost/sf1r/test/echo
Request:
{"message":"ajax echo"}
JavaScript
jQuery
Response:


Contexts¶
Contexts in Gordon are groups of variables which you want to make accessible to your code, but you don’t want to hardcode into it because it’s values are dependant on the the deployment.
This could be for example because dev
and production
lambdas (although beeing the same code), need to connect to
different resources, use different passwords or produce slightly different outputs.
In the same way, same lambdas deployed to different regions will probably need to connect to different places.
Contexts solve this problem by injecting a small payload into the lambdas package on deploy time, and letting you read that file on run time using your language of choice.
How contexts works¶
The first thing you’ll need to do is define a context in your project settings file (project/settings.yml
).
---
project: my-project
default-region: eu-west-1
code-bucket: my-bucket
apps:
...
contexts:
default:
database_host: <IP_ADDRESS>
database_username: dev-bob
database_password: shrug
...
As you can see, we have defined a context called default
. All lambdas by default inject the context called default
if it is present.
After doing this, Gordon will leave a .context
JSON file at the root of your lambda package. You can use your language of choice to read and use it.
In the following example, we use python to read this file.
import json
def handler(event, context):
with open('.context', 'r') as f:
gordon_context = json.loads(f.read())
return gordon_context['database_host'] # Echo the database host
Same example, but written in Javascript:
var gordon_context = JSON.parse(require('fs').readFileSync('.context', 'utf8'));
exports.handler = function(event, context) {
context.succeed(gordon_context['database_host']); // Echo the database host
};
And Java:
// Remember to add 'org.json:json:20160212' to your gradle file
package example;
import java.io.FileNotFoundException;
import java.util.Scanner;
import java.io.File;
import com.amazonaws.services.lambda.runtime.Context;
import org.json.JSONObject;
public class Hello {
public static class EventClass {
public EventClass() {}
}
public String handler(EventClass event, Context context) throws FileNotFoundException{
JSONObject gordon_context = new JSONObject(
new Scanner(new File(".context")).useDelimiter("\\A").next()
);
return gordon_context.getString("database_host");
}
}
Advanced contexts¶
For obvious reasons, hardcoding context values in your project/settings.yml
file is quite limited and not very flexible. For this reason Gordon allows you to
make the value of any of the context variables reference any parameter.
In the following example, we are going to make all three variables point to three respective parameters. This will allow us to change the value of the context variables easily between stages or regions.
---
project: my-project
default-region: eu-west-1
code-bucket: my-bucket
apps:
...
contexts:
default:
database_host: ref://DatabaseHost
database_username: ref://DatabaseUsername
database_password: ref://DatabasePassword
...
Now we only need to define what is the value for each of these parameters creating (for example) a parameters/common.yml
file
---
DatabaseHost: <IP_ADDRESS>
DatabaseUsername: "{{ stage }}-bob"
DatabasePassword: env://MY_DATABASE_PASSWORD
As you can see this is quite a fancy example, because values are now dynamically generated.
| Parameter | Value |
|---|---|
DatabaseHost |
This is a fixed hardcoded value <IP_ADDRESS> . |
DatabaseUsername |
This is a jinja2 parameter. If we apply our project into a stage called prod it’s value will be prod-bob |
DatabasePassword |
This parameter will have as value whatever the MY_DATABASE_PASSWORD env variable has when you apply your project. |
Now you should have a basic understanding of how contexts works. If you want to learn more about parameters
you’ll find all the information you need in:
- Parameters How parameters works
- Advanced Parameters Advanced usages of parameters.


So, you cold?
You see? It's curious. Ted did figure it out - time travel. And when we get back, we gonna tell everyone.  But then why fifty years in the future when the spacecraft encounters a black hole does the computer call it an 'unknown entry event'? Why don't they know? If they don't know, that means we never told anyone. And if we never told anyone it means we never made it back. Hence we die down here. Just as a matter of deductive logic.
Uuummmm, this is a tasty burger!
Yeah, I like animals better than people sometimes... Especially dogs. Dogs are the best. Every time you come home, they act like they haven't seen you in a year. And the good thing about dogs... is they got different dogs for different people. Like pit bulls. The dog of dogs. Pit bull can be the right man's best friend... or the wrong man's worst enemy.  Give me... Raoul. Right, Omar? Give me Raoul.


tl;dr Pointers are nothing more than memory addresses, or that they allow you to point to arbitrary locations.
tl;dr 2 Pointer is a type of an object that refers to a function or an object of another type, possibly adding qualifiers. Pointer may also refer to nothing, which is indicated by the special null pointer value (i.e. 0, zero).
http://j.mp/pointKITE - the problem set that can be used for a 20-hour workshop for Quick, Deep, Immersive and Perceptual Learning of Indirection (aka Pointers) - the most important Threshold Concept in programming. Arguably, this is the largest and progressively challenging problem set (PC-P) that is relevant for learning, teaching and assessment of knowledge/competency in pointers.
“…and flight software itself… is written in C/C++” - take a look at j.mp/linuxFalcon!
Know what to practice
For some reason most people seem to be born without the part of the brain that understands pointers. This is an aptitude thing, not a skill thing – it requires a complex form of doubly-indirected thinking that some people just can’t do. - Joel Spolsky (Founder, Stackoverflow.com)
Hot and trending languages (since 2018) like Golang and Rust are becoming popular for various reasons. Both use and implement pointer concepts.
One of the most practical use cases for pointers
fread
, fwrite
, etc), structures from Unit_4 (opaque FILE
typedef forstruct _iobuf
) and pointers from Unit_3 (FILE *) come together to accomplish file processing (Unit_5)A null-terminated byte string (NTBS) is a sequence of nonzero bytes followed by a byte with value zero
(the terminating null character). Each byte in a byte string encodes one character of some character set. For example, the character array {'\x63','\x61','\x74','\0'}
is an NTBS holding the string “cat” in ASCII encoding.
What is inside the string? Is the needle present in the haystack?
— BREAK here (try strlower)
— BREAK here
— BREAK here
How can I change the contents inside a string?
How do I generate new strings from existing ones?


{{chorice}}
You have a
chorice
!
Your one click choice of Survey, Questionary, Data collection, Test, Games and more.
{{q.Question}}
{{i}}
Add Item
Add Question


Review requested
{% if review.cancel_message %}
{{ review.cancel_message }}
{% else %}
An author or editor requested a review on this project.
{% endif %}
{# For hx-vars overrides to work it seems neccessary to repeat the hx-patch in each button, even though docs say hx-vars override. #} {% url 'api-projects-reviews-detail' project.id review.id as patch_url %}


|
LA meets ML
|
This class communicates with the command line interface. More...
Public Member Functions | |
| def | __init__ |
| def | print_line |
| def | print_stream |
| def | print_error |
| def | print_matrix |
| def | update |
| Public Member Functions inherited from modules.view.output_service.OutputService | |
| def | print_line |
| Prints a line to the view. More... | |
| def | print_stream |
| Prints an self overriding string. More... | |
| def | print_error |
| Prints an exception to the view. More... | |
| def | print_matrix |
| Prints a matrix to the view. More... | |
| Public Member Functions inherited from modules.view.subscriber.Subscriber | |
| def | update |
| will be triggered when new values arrive More... | |
This class communicates with the command line interface.


(This list is not exhaustive in any way of course)
These places are pretty ok too actually:
That's it!


Congratulations on reaching the final project of the Robotics Nanodegree!
Previously, you worked on the Semantic Segmentation lab where you built a deep learning network that locates a particular human target within an image. For this project, you will utilize what you implemented and learned from that lab and extend it to train a deep learning model that will allow a simulated quadcopter to follow around the person that it detects!
Most of the code below is similar to the lab with some minor modifications. You can start with your existing solution, and modify and improve upon it to train the best possible model for this task.
You can click on any of the following to quickly jump to that part of this notebook:
We have provided you with a starting dataset for this project. Download instructions can be found in the README for this project's repo. Alternatively, you can collect additional data of your own to improve your model. Check out the "Collecting Data" section in the Project Lesson in the Classroom for more details!
import os
import glob
import sys
import tensorflow as tf
from scipy import misc
import numpy as np
from tensorflow.contrib.keras.python import keras
from tensorflow.contrib.keras.python.keras import layers, models
from tensorflow import image
from utils import scoring_utils
from utils.separable_conv2d import SeparableConv2DKeras, BilinearUpSampling2D
from utils import data_iterator
from utils import plotting_tools
from utils import model_tools
In the Classroom, we discussed the different layers that constitute a fully convolutional network (FCN). The following code will introduce you to the functions that you need to build your semantic segmentation model.
The Encoder for your FCN will essentially require separable convolution layers, due to their advantages as explained in the classroom. The 1x1 convolution layer in the FCN, however, is a regular convolution. Implementations for both are provided below for your use. Each includes batch normalization with the ReLU activation function applied to the layers.
def separable_conv2d_batchnorm(input_layer, filters, strides=1):
output_layer = SeparableConv2DKeras(filters=filters,kernel_size=3, strides=strides,
padding='same', activation='relu')(input_layer)
output_layer = layers.BatchNormalization()(output_layer)
return output_layer
def conv2d_batchnorm(input_layer, filters, kernel_size=3, strides=1):
output_layer = layers.Conv2D(filters=filters, kernel_size=kernel_size, strides=strides,
padding='same', activation='relu')(input_layer)
output_layer = layers.BatchNormalization()(output_layer)
return output_layer
The following helper function implements the bilinear upsampling layer. Upsampling by a factor of 2 is generally recommended, but you can try out different factors as well. Upsampling is used in the decoder block of the FCN.
def bilinear_upsample(input_layer):
output_layer = BilinearUpSampling2D((2,2))(input_layer)
return output_layer
In the following cells, you will build an FCN to train a model to detect and locate the hero target within an image. The steps are:
encoder_block
decoder_block
Create an encoder block that includes a separable convolution layer using the separable_conv2d_batchnorm()
function. The filters
parameter defines the size or depth of the output layer. For example, 32 or 64.
def encoder_block(input_layer, filters, strides):
# TODO Create a separable convolution layer using the separable_conv2d_batchnorm() function.
output_layer = separable_conv2d_batchnorm(input_layer, filters, strides)
return output_layer
The decoder block is comprised of three parts:
def decoder_block(small_ip_layer, large_ip_layer, filters):
# TODO Upsample the small input layer using the bilinear_upsample() function.
upsample_layer = bilinear_upsample(small_ip_layer)
# TODO Concatenate the upsampled and large input layers using layers.concatenate
merge_layer = layers.concatenate([upsample_layer, large_ip_layer])
# TODO Add some number of separable convolution layers
output_layer = separable_conv2d_batchnorm(merge_layer, filters, strides=1)
return output_layer
Now that you have the encoder and decoder blocks ready, go ahead and build your FCN architecture!
There are three steps:
def fcn_model(inputs, num_classes):
# TODO Add Encoder Blocks.
# Remember that with each encoder layer, the depth of your model (the number of filters) increases.
# input: 160x160x3
en1 = encoder_block(inputs, filters=12, strides=2) # en1: 80x80x12
en2 = encoder_block(en1, filters=48, strides=2) # en2: 40x40x48
en3 = encoder_block(en2, filters=192, strides=2) # en3: 20x20x192
# TODO Add 1x1 Convolution layer using conv2d_batchnorm().
mid = conv2d_batchnorm(en3, filters=96, kernel_size=1, strides=1) # mid: 20x20x96
# TODO: Add the same number of Decoder Blocks as the number of Encoder Blocks
de3 = decoder_block(mid, en2, filters=72) # de3: 40x40x72
de2 = decoder_block(de3, en1, filters=48) # de2: 80x80x48
de1 = decoder_block(de2, inputs, filters=12) # de1: 160x160x12
# The function returns the output layer of your model. "x" is the final layer obtained from the last decoder_block()
return layers.Conv2D(num_classes, 1, activation='softmax', padding='same')(de1)
The following cells will use the FCN you created and define an ouput layer based on the size of the processed image and the number of classes recognized. You will define the hyperparameters to compile and train your model.
Please Note: For this project, the helper code in data_iterator.py
will resize the copter images to 160x160x3 to speed up training.
"""
DON'T MODIFY ANYTHING IN THIS CELL THAT IS BELOW THIS LINE
"""
image_hw = 160
image_shape = (image_hw, image_hw, 3)
inputs = layers.Input(image_shape)
num_classes = 3
# Call fcn_model()
output_layer = fcn_model(inputs, num_classes)
Define and tune your hyperparameters.
learning_rate = 0.001
training_set_size = 4000
batch_size = 50
num_epochs = 50
steps_per_epoch = training_set_size / batch_size + 1
validation_steps = steps_per_epoch / 4
workers = 2
"""
DON'T MODIFY ANYTHING IN THIS CELL THAT IS BELOW THIS LINE
"""
# Define the Keras model and compile it for training
model = models.Model(inputs=inputs, outputs=output_layer)
model.compile(optimizer=keras.optimizers.Adam(learning_rate), loss='categorical_crossentropy')
print(model.summary())
# Data iterators for loading the training and validation data
train_iter = data_iterator.BatchIteratorSimple(batch_size=batch_size,
data_folder=os.path.join('..', 'data', 'train-orig'),
image_shape=image_shape,
shift_aug=True)
val_iter = data_iterator.BatchIteratorSimple(batch_size=batch_size,
data_folder=os.path.join('..', 'data', 'validation'),
image_shape=image_shape)
logger_cb = plotting_tools.LoggerPlotter()
reduceLR = keras.callbacks.ReduceLROnPlateau(monitor='val_loss',
factor=0.5,
patience=5,
verbose=1,
mode='auto')
#callbacks = [logger_cb]
callbacks = [reduceLR, logger_cb]
model.fit_generator(train_iter,
steps_per_epoch = steps_per_epoch, # the number of batches per epoch,
epochs = num_epochs, # the number of epochs to train for,
validation_data = val_iter, # validation iterator
validation_steps = validation_steps, # the number of batches to validate on
callbacks=callbacks,
workers = workers)
# Save your trained model weights
weight_file_name = 'model_weights_model3_run1_e50'
model_tools.save_network(model, weight_file_name)
Now that you have your model trained and saved, you can make predictions on your validation dataset. These predictions can be compared to the mask images, which are the ground truth labels, to evaluate how well your model is doing under different conditions.
There are three different predictions available from the helper code provided:
# If you need to load a model which you previously trained you can uncomment the codeline that calls the function below.
#weight_file_name = 'model_weights_run3_e50'
#restored_model = model_tools.load_network(weight_file_name)
The following cell will write predictions to files and return paths to the appropriate directories.
The run_num
parameter is used to define or group all the data for a particular model run. You can change it for different runs. For example, 'run_1', 'run_2' etc.
run_num = 'model3_run_1'
val_with_targ, pred_with_targ = model_tools.write_predictions_grade_set(model,
run_num,'patrol_with_targ', 'sample_evaluation_data')
val_no_targ, pred_no_targ = model_tools.write_predictions_grade_set(model,
run_num,'patrol_non_targ', 'sample_evaluation_data')
val_following, pred_following = model_tools.write_predictions_grade_set(model,
run_num,'following_images', 'sample_evaluation_data')
Now lets look at your predictions, and compare them to the ground truth labels and original images. Run each of the following cells to visualize some sample images from the predictions in the validation set.
# images while following the target
im_files = plotting_tools.get_im_file_sample('sample_evaluation_data','following_images', run_num)
for i in range(3):
im_tuple = plotting_tools.load_images(im_files[i])
plotting_tools.show_images(im_tuple)
# images while at patrol without target
im_files = plotting_tools.get_im_file_sample('sample_evaluation_data','patrol_non_targ', run_num)
for i in range(3):
im_tuple = plotting_tools.load_images(im_files[i])
plotting_tools.show_images(im_tuple)
# images while at patrol with target
im_files = plotting_tools.get_im_file_sample('sample_evaluation_data','patrol_with_targ', run_num)
for i in range(3):
im_tuple = plotting_tools.load_images(im_files[i])
plotting_tools.show_images(im_tuple)
Evaluate your model! The following cells include several different scores to help you evaluate your model under the different conditions discussed during the Prediction step.
# Scores for while the quad is following behind the target.
true_pos1, false_pos1, false_neg1, iou1 = scoring_utils.score_run_iou(val_following, pred_following)
# Scores for images while the quad is on patrol and the target is not visable
true_pos2, false_pos2, false_neg2, iou2 = scoring_utils.score_run_iou(val_no_targ, pred_no_targ)
# This score measures how well the neural network can detect the target from far away
true_pos3, false_pos3, false_neg3, iou3 = scoring_utils.score_run_iou(val_with_targ, pred_with_targ)
# Sum all the true positives, etc from the three datasets to get a weight for the score
true_pos = true_pos1 + true_pos2 + true_pos3
false_pos = false_pos1 + false_pos2 + false_pos3
false_neg = false_neg1 + false_neg2 + false_neg3
weight = true_pos/(true_pos+false_neg+false_pos)
print(weight)
# The IoU for the dataset that never includes the hero is excluded from grading
final_IoU = (iou1 + iou3)/2
print(final_IoU)
# And the final grade score is
final_score = final_IoU * weight
print(final_score)


@* * Copyright 2023 HM Revenue & Customs * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *@ @import uk.gov.hmrc.thirdpartydeveloperfrontend.domain.models.developers.DeveloperSession @import uk.gov.hmrc.thirdpartydeveloperfrontend.domain.models.views.BackButtonWithJavaScript @import uk.gov.hmrc.thirdpartydeveloperfrontend.domain.models.views.BackButtonWithJavaScript @import uk.gov.hmrc.apiplatform.modules.submissions.controllers.ProdCredsChecklistController._ @import uk.gov.hmrc.thirdpartydeveloperfrontend.domain.models.controllers.Crumb @import include._ @import includes._ @this(devMain: DevMainWithFormErrors) @(model: ViewModel, form: Form[DummyForm])(implicit request: play.api.mvc.Request[Any], loggedIn: DeveloperSession, messagesProvider: MessagesProvider, appConfig: ApplicationConfig) @pageTitle = @{ if(model.isNewTermsOfUseUplift) { "Agree to version 2 of the terms of use" } else { "Terms of use checklist" } } @labelAsId(label: String) = @{ label.toLowerCase.replaceAll(" ", "-") + "-link" } @devMain( form, title = pageTitle, userFullName = loggedIn.loggedInName, breadcrumbs = Seq( Crumb.viewAllApplications, Crumb.home ), developerSession = Some(loggedIn) ) { @if(model.isNewTermsOfUseUplift) {
}Review the terms of use and check what questions we ask (opens in new tab)