'Mowgli' girls rescued from squalid home where they ate styrofoam and wallpaper
Diana, 5, and Anya, 1, ate 'styrofoam, wallpaper, hair and other objects' to stay alive in foul flat that 'always had a terrible stench'
by Roksana Panashchuk, Lila RandallTwo young sisters were rescued from a ‘dirty’ flat after reportedly being neglected by their mother who spent her cash on alcohol.
Diana and Anya, aged five and one, did not eat properly and lived in an infested flat with their mother and her boyfriend in Dnipro, central Ukraine.
The 25-year-old mother - who has not been named - is said to have lived off the child benefits and only fed the children properly once a month.
The neglected sisters were found when a concerned neighbour called the police on November 21.
A female neighbour told local media: ''The woman and her boyfriend often quarrelled and fought with each other.
''They constantly shouted at the children and did not take care of them.
Diana and Anya were discovered on November 21 after neighbours called the police.
Police officers were reportedly shocked by the foul condition of the flat. The toilet was not working properly and the family used the bath tub instead.
The tub was covered with a thick layer of dirt and infested with worms.
A police told local media: ''The girls got used to sleeping in filthy bedclothes, eat from unwashed dishes and play on the littered floor.
''The stench in the rooms was horrific and it was difficult to breathe.''
Diana and Anya were hospitalised and diagnosed with malnutrition and lice.
Paediatrician Liya Segeda said: ''The girls' stool contains styrofoam, wallpaper, hair and other objects.
''They ate everything they could find in the apartment.”
Ms Segeda added that, while in hospital, it was the first time the children had clean bedclothes and saw a potty.
Police reported the incident to social services who are going to sue the mother and remove her parental rights.
 They spent child benefits for living.
''The children ate properly once per month. Their mother spent the rest of the money on alcohol.''


I am a professional person if trusted in a job, spirit in everything including laziness. I don't care about people who like to know my life.
| City, date of birth | : | Lahat, 10 Agustus 1998 |
| Address | : | Lr. Tamyis Timbangan , Indralaya |
| Height | : | 159 cm |
| Weight | : | 54 kg |
| Sekolah Dasar | SD Negeri 3 Jarai tahun 2009 | |
| Sekolah Menengah Pertama | SMP Negeri 1 Jarai tahun 2012 | |
| Sekolah Menengah Atas | SMA Negeri 1 Pagaralam tahun 2015 | |
| S1 | Universitas Sriwijaya |
| Adobe Photoshop | 35 % |
| Photography | 55 % |
| Web Programming | 95 % |
| Mobile Programming | 65 % |
| Media | 75 % |
| Speak English | 80 % |
| SQL Server | 75 % |


Before Change
predictions = np.squeeze(predictions)
answer = {}
for node_id in range(len(predictions)):
answer[self.labels[node_id]] = predictions[node_id]
answers.append(answer)
return answers
After Change
def detect_multiple(self, images):
image_array_list = [self._pil_to_tf(image) for image in images]
pool = ThreadPool()
with tf.device("/gpu:0"):
softmax_tensor = self.sess.graph.get_tensor_by_name("final_result:0")
threads = [pool.apply_async(operation, args=(self.sess, softmax_tensor, image_array_list[i],)) for i in


Hemi JavaScript Framework
Hemi
Description
Framework base classes, including: Hemi for creating framework objects and loading external libraries; Hemi.xml for AJAX and JSON requests (libXmlRequest derivative); Hemi.registry for object repository management; Hemi.message for delegating message subscriptions and publications.
Class Index
version 4.0.1
The base set of classes for the Hemi Framework.
This class resides in the global namespace.
Index
Object Index
-
public Hemi: The core class used to load and manage framework classes.
Objects
Hemi
The core class used to load and manage framework classes.
static Hemi
version
This class resides in the global namespace.
Index
Example Index
Object Index
-
public DATATYPES (internal): Enumeration of object types.
-
public FrameworkObject: API definition for any object created by the Hemi Framework.
Property Index
Method Index
-
private _forName (internal): Creates a specific internal object. Includes the definition for base_object, and supports external definitions via class imports.
-
private _implements: Implements a specified feature.
-
public dereference (internal): Dereferences the imported library and library map. This does not delete the object from its parent, or destroy the object from the framework.
-
public getLibrary (internal): Returns the specified namespace object.
-
public GetSpecifiedAttribute: Returns the value of an attribute if it was specified and the length is greater than zero.
-
public guid: Returns a globally unique identifier, relative to the page view. This uses a weak hash.
-
public hashlight: A very light hash.
-
public include: Imports the specified namespace.
-
public IsAttributeSet: Tests whether an attribute has been set.
-
public isImported: Returns the object identifier.
-
public log: Sends a message in the #100.3 message block.
-
public logDebug: Sends a message in the #100.1 message block.
-
public logError: Sends a message in the #100.5 message block.
-
public logWarning: Sends a message in the #100.4 message block.
-
public lookup: Verifies the specified hierarchy exists.
-
public namespace: Creates a hierarchical object namespace from the supplied name.
-
public newObject: Creates and optionally registers a new FrameworkObject ready for use within the framework.
-
public prepareObject: Prepares and optionally registers a new FrameworkObject ready for use within the Hemi framework.
Examples
Create Framework Object
Demonstrate how to create a new Framework Object
Example Code
// Create a new object that is also registeredvar oNewObject = Hemi.newObject("myObject","1.0", true);var sId = oNewObject.getObjectId();// Retrieve the object from the registryvar oLookup = Hemi.registry.service.getObject(sId);
Prepare an Existing Object for the Framework
Demonstrate how to prepare an existing object for the framework and use a custom identifier.
Example Code
// Prepare an existing object and give it a custom idvar oObject = {};oObject.object_id = "MyCustomId";Hemi.prepareObject("myObject", "1.0", true, oObject);// Retrieve the object from the registryvar oLookup = Hemi.registry.service.getObject("MyCustomId");
Objects
DATATYPES
Enumeration of object types.
Properties
-
TYPE_STRING as String: string
-
TYPE_OBJECT as String: object
-
TYPE_FUNCTION as String: function
-
TYPE_UNDEFINED as String: undefined
-
TYPE_NUMBER as String: number
FrameworkObject
API definition for any object created by the Hemi Framework.
Properties
-
properties as object: A hash of primitive values (strings, ints, etc) for storing configuration, settings, and status.
-
objects as object: A hash of object values for storing named object references.
-
object_id as String: A globally unique identifier.
-
object_type as String: The named type of the object.
-
object_version as String: The version of the object.
-
ready_state as int: State tracking mechanism, used primarily for determining object availability and destruction.
-
object_config as object: Object on which the inner status and pointers objects are defined.
Methods
-
String = getObjectId(
)
Returns the object identifier.
-
String = getObjectType(
)
Returns the object identifier.
-
String = getObjectVersion(
)
Returns the object version.
-
int = getReadyState(
)
Returns the state of the object.
-
void setObjectId(
i)
Sets the object identifier. Only applicable after creating or preparing a new object, and prior to registering the object.
Properties
Syntax
String = Hemi.
Hemi. = String
Methods
_forName
Creates a specific internal object. Includes the definition for base_object, and supports external definitions via class imports. Method is private and should not be directly referenced.
Syntax
o = _forName(
s
)
Parameters
-
s as String : Name of the object to return.
Returns
o as object: Object based on the specified name.
_implements
Implements a specified feature. Method is private and should not be directly referenced.
Syntax
void _implements(
o, n, v
)
Parameters
-
o as object : Target object to merge features..
-
n as String : Name of merge features.
-
v as variant : Overloaded variant arguments to pass to the implementing object constructor.
dereference
Dereferences the imported library and library map. This does not delete the object from its parent, or destroy the object from the framework.
Syntax
bUnreferenced = dereference(
sName
)
Parameters
-
sName as String : Namespace or Library name of the imported script file.
Returns
bUnreferenced as bit: Bit indicating the namespace and library maps were dereferenced.
getLibrary
Returns the specified namespace object.
Syntax
NamespaceObject = getLibrary(
sName
)
Parameters
-
sName as String : Namespace or Library name of the imported script file.
Returns
NamespaceObject as object: Returns an internal namespace object.
GetSpecifiedAttribute
Returns the value of an attribute if it was specified and the length is greater than zero.
Syntax
v = GetSpecifiedAttribute(
o, n
)
Parameters
-
o as Node : Node reference
-
n as String : Name of the attribute to test.
Returns
v as String: Value of the attribute.
guid
Returns a globally unique identifier, relative to the page view. This uses a weak hash.
Syntax
sId = guid(
)
Returns
sId as String: A unique id.
hashlight
A very light hash.
Syntax
sHash = hashlight(
sData
)
Parameters
-
sData as String : Data to be hashed.
Returns
sHash as String: A light hash of the input data.
include
Imports the specified namespace.
Syntax
NamespaceObject = include(
sName, sPath, bNoEval
)
Parameters
-
sName as String : Namespace of the script file to import.
-
sPath as String (optional): Path where the script file resides. Default to Framework/
-
bNoEval as boolean (optional): Bit indicating whether the loaded script should not be executed.
Returns
NamespaceObject as object: Returns an internal namespace object.
IsAttributeSet
Tests whether an attribute has been set.
Syntax
b = IsAttributeSet(
o, n, b
)
Parameters
-
o as Node : Node reference
-
n as String : Name of the attribute to test.
-
b as bit (optional): Bit indicating whether to return the attribute value instead of a positive bit.
Returns
b as bit: A bit indicating whether the specified attribute was set.
isImported
Returns the object identifier.
Syntax
bImported = isImported(
s
)
Parameters
-
s as String : Namespace name.
Returns
bImported as boolean: Bit indicating whether the namespace has been imported.
log
Sends a message in the #100.3 message block.
Syntax
void log(
sMessage
)
Parameters
-
sMessage as String : Message to send to the logger.
logDebug
Sends a message in the #100.1 message block.
Syntax
void logDebug(
sMessage
)
Parameters
-
sMessage as String : Message to send to the logger.
logError
Sends a message in the #100.5 message block.
Syntax
void logError(
sMessage
)
Parameters
-
sMessage as String : Message to send to the logger.
logWarning
Sends a message in the #100.4 message block.
Syntax
void logWarning(
sMessage
)
Parameters
-
sMessage as String : Message to send to the logger.
lookup
Verifies the specified hierarchy exists.
Syntax
v = lookup(
sPath
)
Parameters
-
sPath as String : Period-delimited hierarchy.
Returns
v as boolean: Returns true if the hierachy exists, or the matching object if bObjOut is set to true.
namespace
Creates a hierarchical object namespace from the supplied name.
Syntax
void namespace(
sPath, oBase, hContents, bService
)
Parameters
-
sPath as String : Period-delimited hierarchy.
-
oBase as object (optional): Base object, defaults to Hemi.Context (which default to window).
-
hContents as object (optional): Object hash contents.
-
bService as boolean (optional): Bit indicating the namespace defines service and serviceImpl members, and to instantiate the service.
newObject
Creates and optionally registers a new FrameworkObject ready for use within the framework.
Syntax
o = newObject(
t, v, r, d, h
)
Parameters
-
t as String : The type of the object.
-
v as String : The version of the object.
-
r as boolean : Bit indicating whether the object should be registered with the Object Registry.
-
d as boolean : Bit indicating whether the object should include a deconstructor.
-
h as hash : Object members to include on this object.
Returns
o as FrameworkObject: The new framework object.
prepareObject
Prepares and optionally registers a new FrameworkObject ready for use within the Hemi framework.
Syntax
void prepareObject(
t, v, r, o, d
)
Parameters
-
t as String : The type of the object.
-
v as String : The version of the object.
-
r as boolean : Bit indicating whether the object should be registered with the Object Registry.
-
o as FrameworkObject : The object to be prepared for use in the Hemi framework.
-
d as boolean : Bit indicating whether the object should include a deconstructor.
static registry.service
version 4.0.1
Static implementation of hemi.registry.serviceImpl
This class resides in the global namespace.
Index
Method Index
-
public getApplyStatement: Returns a string statement that can be evaluated to return a reference to the specified method for the registered object.
-
public getEvalStatement: Returns a string statement that can be evaluated to return a reference to the registered object.
Methods
getApplyStatement
Returns a string statement that can be evaluated to return a reference to the specified method for the registered object.
Syntax
sApplyCode = getApplyStatement(
o, f
)
Parameters
-
o as object : Registered object.
-
f as String : Name of a method on the registered object
Returns
sApplyCode as String: A javascript statement which, when evaluated, returns a reference to the function on the object.
getEvalStatement
Returns a string statement that can be evaluated to return a reference to the registered object.
Syntax
sEvalCode = getEvalStatement(
o
)
Parameters
-
o as object : Registered object.
Returns
sEvalCode as String: A javascript statement which, when evaluated, returns a reference to the object.
registry.serviceImpl
version 4.0.1
Repository service for storing and discovering framework objects.
This class resides in the global namespace.
Index
Method Index
-
public addObject: Adds the specified object to the registry, and automatically registers the object with the transaction service.
-
public canRegister: Verifies whether an object can be added to the registry.
-
public getObject: Returns the object matching the specified identifier or index.
-
public getObjectsArray: Returns an array of registered objects.
-
public getObjectsMap: Returns the object identifier mapping.
-
public isRegistered: Returns true if the specified object is in the registry.
-
public removeObject: Removes the specified object from the registry.
-
public sendDestroyTo: Invokes the destroy method on the specified object. Object must be registered. This method will not remove the object from the registry.
-
public sendSigterm: Sends a termination signal to all registered objects for preparation to be destroyed. This method causes all objects to be removed from the registry, and to have any sigterm method invoked.
Methods
addObject
Adds the specified object to the registry, and automatically registers the object with the transaction service.
Syntax
b = addObject(
o
)
Parameters
-
o as object : Object to add to the registry
Returns
b as boolean: Returns true if the object was added to the registry.
canRegister
Verifies whether an object can be added to the registry.
Syntax
b = canRegister(
o
)
Parameters
-
o as object : Object to test whether or not it can be registered.
Returns
b as boolean: Returns true if the specified object defines an
getObject
Returns the object matching the specified identifier or index.
Syntax
o = getObject(
v
)
Parameters
-
v as variant : Index or name of the object to retrieve.
Returns
o as object: Object with the specified identifier or index.
getObjectsArray
Returns an array of registered objects.
Syntax
a = getObjectsArray(
)
Returns
a as array: Array of registered objects.
getObjectsMap
Returns the object identifier mapping.
Syntax
a = getObjectsMap(
)
Returns
a as array: Array of object identifiers directly mapped to the objects array.
isRegistered
Returns true if the specified object is in the registry.
Syntax
b = isRegistered(
o
)
Parameters
-
o as object : Object in the registry
Returns
b as boolean: Returns true if the object is in the registry.
removeObject
Removes the specified object from the registry.
Syntax
b = removeObject(
o, b
)
Parameters
-
o as object : Object to remove from the registry
-
b as boolean : Bit indicating whether the
Returns
b as boolean: Returns true if the object was removed.
sendDestroyTo
Invokes the destroy method on the specified object. Object must be registered. This method will not remove the object from the registry.
Syntax
b = sendDestroyTo(
o
)
Parameters
-
o as object : Object in the registry
Returns
b as boolean: Returns true if the object defined a destroy method and the method was invoked.
sendSigterm
Sends a termination signal to all registered objects for preparation to be destroyed. This method causes all objects to be removed from the registry, and to have any sigterm method invoked.
Syntax
void sendSigterm(
)
static message.service
version 4.0.1
Static implementation of hemi.message.serviceImpl
This class resides in the global namespace.
message.serviceImpl
version 4.0.1
Service that delegates subscriptions and publications at a global and object level.
This class resides in the global namespace.
Index
Object Index
-
public Message: Object published to onsendmessage subscribers when the sendMessage method is invoked.
Method Index
-
private _delayPublish (internal): End action for a delayed publication. Cached message is sent directly on to publication.
-
private _publish (internal): Publishes the specified data to registered subscribers.
-
public clearEntries: Clears message entries.
-
public flush: Clears delayed delivery cache.
-
public getDeliveryDelay: Returns the delay in milliseconds between publication and delivery.
-
public getEntries: Returns the current message buffer.
-
public getReportThreshold: Returns the report threshold for sendMessage. Messages sent below this level will not be propogated.
-
public parseMessage: Parses a message object and returns a formatted construct suitable for printing to a log.
-
public publish: Publishes the specified data to registered subscribers. If delayed delivery is in effect, caches the message data and sends it after the preset delay in milliseconds.
-
public sendMessage: Sends the specified message as a Message to all onsendmessage subscribers.
-
public setDeliveryDelay: Sets the delay in milliseconds between publication and delivery.
-
public setReportThreshold: Sets the report threshold for sendMessage. Messages sent below this level will not be propogated.
-
public sigterm: Termination signal indicating the message service should stop processing messages and subscriptions, and be prepared for destruction.
-
public subscribe: Subscribes an object to receive message publications for the specified publication name.
-
public unsubscribe: Unsubscribes an object from receiving message publications for the specified publication name.
Objects
Message
Object published to onsendmessage subscribers when the sendMessage method is invoked.
Properties
-
message as variant: Variant message body.
-
level as int: The message threshold.
-
description as String: Description of the message origination, if the message type code was mapped to an internal definition.
Methods
_delayPublish
End action for a delayed publication. Cached message is sent directly on to publication. Method is private and should not be directly referenced.
Syntax
void _delayPublish(
i
)
Parameters
-
i as String : Identifier of the cached message item to be delivered for the corresponding subscribers.
_publish
Publishes the specified data to registered subscribers. Method is private and should not be directly referenced.
Syntax
void _publish(
e, v
)
Parameters
-
e as String : The name of the publication.
-
v as variant : Data being published.
clearEntries
Clears message entries.
Syntax
void clearEntries(
)
flush
Clears delayed delivery cache.
Syntax
void flush(
)
getDeliveryDelay
Returns the delay in milliseconds between publication and delivery.
Syntax
d = getDeliveryDelay(
)
Returns
d as int: Delay in milliseconds between publication and delivery.
getEntries
Returns the current message buffer.
Syntax
aBuffer = getEntries(
)
Returns
aBuffer as array: Array of recent messages.
getReportThreshold
Returns the report threshold for sendMessage. Messages sent below this level will not be propogated.
Syntax
iThreshold = getReportThreshold(
)
Returns
iThreshold as int: The message threshold.
parseMessage
Parses a message object and returns a formatted construct suitable for printing to a log.
Syntax
sMessage = parseMessage(
o
)
Parameters
-
o as Message : A Message object.
Returns
sMessage as String: Formatted message.
publish
Publishes the specified data to registered subscribers. If delayed delivery is in effect, caches the message data and sends it after the preset delay in milliseconds.
Syntax
void publish(
e, v
)
Parameters
-
e as String : The name of the publication.
-
v as variant : Data being published.
sendMessage
Sends the specified message as a Message to all onsendmessage subscribers.
Syntax
o = sendMessage(
d, s, p
)
Parameters
-
d as String : The message data to be sent.
-
s as String (optional): Numeric message code.
-
p as boolean (optional): Bit indicating the message should raise an alert.
Returns
o as Message: The Message created for this message.
setDeliveryDelay
Sets the delay in milliseconds between publication and delivery.
Syntax
void setDeliveryDelay(
d
)
Parameters
-
d as int : Sets the delay in milliseconds.
setReportThreshold
Sets the report threshold for sendMessage. Messages sent below this level will not be propogated.
Syntax
void setReportThreshold(
level
)
Parameters
-
level as variant : Int or string value. Int values are 0 - 7, and String values are: ALL, DEBUG, ADVISORY, NORMAL, WARNING, ERROR, FATAL, NONE
sigterm
Termination signal indicating the message service should stop processing messages and subscriptions, and be prepared for destruction.
Syntax
void sigterm(
)
subscribe
Subscribes an object to receive message publications for the specified publication name.
Syntax
void subscribe(
o, e, f, v
)
Parameters
-
o as object : The object for which the subscription will belong.
-
e as String : The name of the publication.
-
f as function : Function to be invoked on message publication.
-
v as object : Reference object, such as the publication owner, used to filter publications to this subscription.
unsubscribe
Unsubscribes an object from receiving message publications for the specified publication name.
Syntax
b = unsubscribe(
o, e, f
)
Parameters
-
o as object : The object for which the subscription belongs.
-
e as String : The name of the publication.
-
f as function : Function invoked on message publication.
Returns
b as boolean: Returns true if unsubscribed, false otherwise.
static xml
version 4.0.1
XML Utilities for making AJAX and JSON requests, result caching, request pooling, and XML-XHTML node manipulation.
This class resides in the global namespace.
Index
Example Index
Object Index
-
private XmlHttp: Object representing a pooled XMLHTTP resource
-
public XmlObject: Object passed to the event handler following an XML request using getXml or postXml.
Property Index
-
public auto_content_type: Specifies whether to determine posted content type by included post value.
-
public form_content_type: Specifies the content type to use when auto_content_type is true and the post value is a string.
-
public json_content_type: Specifies the content type to use requesting and receiving json data (eg: JSON).
-
public text_content_type: Specifies the content type to use requesting and receiving text data (eg: JSON).
-
public xml_content_type: Specifies the content type to use posting data.
Method Index
-
private _request_xmlhttp: Assembles and opens an XMLHTTP Request.
-
public clear: Clears the request maps and caches.
-
public clearCache: Clears the response cache.
-
public getCacheEnabled
-
public getCDATAValue: Returns a concatenation of all CDATA values that are immediate children of the specified node.
-
public getInnerText: Returns a concatenation of text nodes belonging to all children of the specified node.
-
public getJSON: Retrieve a JSON object from the specified path.
-
public getPoolEnabled
-
public getRequestArray: Returns an array of XML requests.
-
public getText: Retrieve text from the specified path.
-
public getXml: Retrieve an XML document from the specified path.
-
public getXmlHttpArray
-
private getXmlHttpObjectFromPool: Retrieves the next available XmlHttp object from the pool of available resources.
-
public JSONReviver (internal): Custom reviver for handling date values.
-
public newXmlDocument
-
private newXmlHttpObject: Creates a new XMLHTTPRequest object.
-
public parseXmlDocument
-
public postJSON: Posts a JSON object to the specified path and returns any JSON response.
-
public postText: Posts text to the specified path and returns any text response.
-
public postXml: Posts an XML document to the specified path and returns any XML response.
-
public queryNode: Returns a DOM Node selected from the specified document and based on the specified parent node name, node name, and attribute name and values.
-
public queryNodes: Returns an array of DOM Nodes selected from the specified document and based on the specified parent node name, node name, and attribute name and values.
-
public removeChild: Removes the child node of the specified node.
-
public removeChildren: Removes all child nodes of the specified node.
-
public resetXmlHttpObjectPool: Resets the current pool with new instances of XMLHttpRequest objects.
-
private returnXmlHttpObjectToPool: Returns an in-use XmlHttp object to the pool of available resources.
-
public selectNodes: Returns an array of DOM Nodes selected from the specified document and based on the specified path.
-
public selectSingleNode: Returns a DOM Node selected from the specified document and based on the specified path.
-
public serialize: Returns a string representation of the specified node and its children.
-
public setCacheEnabled
-
public setInnerXHTML: Copies the child nodes of the specified source node into the specified target node.
-
public setPoolEnabled
-
public swapNode: Replaces the specified node.
-
public testXmlHttpObject: Tests whether an XMLHTTPRequest object can be created.
-
public transformNode: Transforms the specified Document with the specified XSL document.
Message Index
-
public onloadxml: Message published to all subscribers when an xml request has completed loading. This message is published for text and JSON requests made through the XML request.
Examples
Asynchronous GET
Make an asynchronous request for an XML document.
Syntax
[int] = getXml(path,custom_handler,1,{optional_id});
Example Code
function HandleXml(s,v){ var oXml = v.xdom;}Hemi.xml.getXml("/Data/Test1.xml",HandleXml,1);
Asynchronous POST
Asynchronously post data to the server.
Syntax
[int] = postXml(path,data,custom_handler,1,{optional_id});
Example Code
function HandleXml(s,v){ var oResponseXml = v.xdom;}var oPostThis = Hemi.xml.newXmlDocument("Request");var oResponseXml = Hemi.xml.postXml("/Data/TestData.aspx",oPostThis,HandlePostXml,1);
Cached Asynchronous GET
Asynchronously request an XML document, and cached the result for later referal.
Syntax
[int] = getXml(path,custom_handler,1,request_id,1);
Example Code
function HandleXml(s,v){ var oXml = v.xdom;}Hemi.xml.getXml("/Data/Test1.xml",HandleXml,1,"cache-me",1);
Synchronous GET
Make a synchronous request for an XML document.
Syntax
[xml_dom_object] = getXml(path);
Example Code
var oXml = Hemi.xml.getXml("/Data/Test1.xml");
Synchronous POST
Synchronously post data to the server.
Syntax
[xml_dom_object] = postXml(path,data);
Example Code
var oPostThis = Hemi.xml.newXmlDocument("Request");var oData = oPostThis.createElement("data");oData.setAttribute("id","data-id");oData.setAttribute("value","data-value");oPostThis.documentElement.appendChild(oData);var oResponseXml = Hemi.xml.postXml("/Data/TestData.aspx",oPostThis);
Objects
XmlHttp
Object representing a pooled XMLHTTP resource Object is private and should not be directly referenced.
Properties
-
xml_object as object: An XMLHttp object.
-
in_use as boolean: Bit indicating whether the object is in use.
-
vid as int: Integer identifying the variant object identifier.
-
handler as function: Anonymous wrapper to invoke the internal readystate or complete handler for the specified identifier.
XmlObject
Object passed to the event handler following an XML request using getXml or postXml.
Properties
-
xdom as XMLDocument: An XML Document object.
-
id as String: Identifier used to distinguish the request for this XML Document from other requests.
Properties
auto_content_type
Specifies whether to determine posted content type by included post value.
Syntax
boolean = xml.auto_content_type
xml.auto_content_type = boolean
form_content_type
Specifies the content type to use when auto_content_type is true and the post value is a string.
Syntax
String = xml.form_content_type
xml.form_content_type = String
json_content_type
Specifies the content type to use requesting and receiving json data (eg: JSON).
Syntax
String = xml.json_content_type
xml.json_content_type = String
Default Value
text_content_type
Specifies the content type to use requesting and receiving text data (eg: JSON).
Syntax
String = xml.text_content_type
xml.text_content_type = String
Default Value
xml_content_type
Specifies the content type to use posting data.
Syntax
String = xml.xml_content_type
xml.xml_content_type = String
Default Value
Methods
_request_xmlhttp
Assembles and opens an XMLHTTP Request. Method is private and should not be directly referenced.
Syntax
v = _request_xmlhttp(
p, h, a, i, x, d, c, t
)
Parameters
-
p as String : Path to the XML data source.
-
h as function (optional): Handler invoked for asynchronous requests.
-
a as boolean (optional): Bit indicating whether the request is asynchronous.
-
i as String (optional): Identifier used to track the request and retrieve cached results.
-
x as String (optional): String representing the HTTP verb, or legacy bit field indicating whether the request is a post.
-
d as XMLDocument (optional): XML Document to send with post request.
-
c as boolean (optional): Bit indicating whether the response should be cached.
-
t as int (optional): Int indicating whether the request and response as text (1) or JSON (2) instead of XML (0).
Returns
v as variant: Returns a boolean value for asynchronous requests, an XML Document for synchronous requests, text when the text bit is set to (1), and a JSON object when the text bit is set to (2).
clear
Clears the request maps and caches.
Syntax
void clear(
)
clearCache
Clears the response cache.
Syntax
void clearCache(
)
getCacheEnabled
Syntax
b = getCacheEnabled(
)
Returns
b as boolean: boolean indicating whether caching is enabled.
getCDATAValue
Returns a concatenation of all CDATA values that are immediate children of the specified node.
Syntax
v = getCDATAValue(
n
)
Parameters
-
n as DOMNode : XML DOM Node.
Returns
v as String: Returns a concatenation of all child CDATA values.
getInnerText
Returns a concatenation of text nodes belonging to all children of the specified node.
Syntax
sTxt = getInnerText(
n, b
)
Parameters
-
n as DOMNode : DOM Node.
-
b as boolean : Bit indicating to only return the first text value.
Returns
sTxt as String: Returns the inner text of the specified node.
getJSON
Retrieve a JSON object from the specified path.
Syntax
v = getJSON(
p, h, a, i, c
)
Parameters
-
p as String : Path of the JSON source. If specifying the server, note the server name and port must match the context host name and port.
-
h as function (optional): Function to invoke when a response is received.
-
a as boolean (optional): Bit indicating whether the request is an asynchronous operation.
-
i as String (optional): Identifier to assign to the request.
-
c as boolean (optional): Bit indicating whether the response should be cached.
Returns
v as variant: Returns boolean for asynchronous operations, and a JSON object for synchronous operations.
getPoolEnabled
Syntax
b = getPoolEnabled(
)
Returns
b as boolean: boolean indicating whether pooling is enabled.
getRequestArray
Returns an array of XML requests.
Syntax
aRequests = getRequestArray(
)
Returns
aRequests as array: An array of requests.
getText
Retrieve text from the specified path.
Syntax
v = getText(
p, h, a, i, c
)
Parameters
-
p as String : Path of the text source. If specifying the server, note the server name and port must match the context host name and port.
-
h as function (optional): Function to invoke when a response is received.
-
a as boolean (optional): Bit indicating whether the request is an asynchronous operation.
-
i as String (optional): Identifier to assign to the request.
-
c as boolean (optional): Bit indicating whether the response should be cached.
Returns
v as variant: Returns boolean for asynchronous operations, and text for synchronous operations.
getXml
Retrieve an XML document from the specified path.
Syntax
v = getXml(
p, h, a, i, c
)
Parameters
-
p as String : Path of the XML source. If specifying the server, note the server name and port must match the context host name and port.
-
h as function (optional): Function to invoke when a response is received.
-
a as boolean (optional): Bit indicating whether the request is an asynchronous operation.
-
i as String (optional): Identifier to assign to the request.
-
c as boolean (optional): Bit indicating whether the response should be cached.
Returns
v as variant: Returns boolean for asynchronous operations, and an XMLDocument object for synchronous operations.
getXmlHttpArray
Syntax
aXml = getXmlHttpArray(
)
Returns
aXml as array: Array of XmlHttp objects.
getXmlHttpObjectFromPool
Retrieves the next available XmlHttp object from the pool of available resources. Method is private and should not be directly referenced.
Syntax
oXml = getXmlHttpObjectFromPool(
y
)
Parameters
-
y as boolean : Bit indicating whether the pool object is requested for asynchronous operation.
Returns
oXml as XmlHttp: An XmlHttp object.
JSONReviver
Custom reviver for handling date values.
Syntax
r = JSONReviver(
k, v
)
Parameters
-
k as String : Key name.
-
v as String : Key value.
Returns
r as String: Revived key value for use with JSON.
newXmlDocument
Syntax
oXml = newXmlDocument(
s
)
Parameters
-
s as String : Name of root node to create in new document.
Returns
oXml as XMLDocument: XMLDocument object.
newXmlHttpObject
Creates a new XMLHTTPRequest object. Method is private and should not be directly referenced.
Syntax
v = newXmlHttpObject(
b, i, z
)
Parameters
-
b as boolean : Bit indicating whether to wrap the new object in an internal XmlHttp object for use with pooling.
-
i as int : Pool index to set on new XmlHttp object.
-
z as boolean : Bit indicating whether this is a test operation, and to return true if the object was created, or false otherwise.
Returns
v as variant: Return value is determined by the specified parameters.
parseXmlDocument
Syntax
oXml = parseXmlDocument(
s
)
Parameters
-
s as String : XML source text.
Returns
oXml as XMLDocument: XMLDocument object.
postJSON
Posts a JSON object to the specified path and returns any JSON response.
Syntax
v = postJSON(
p, d, h, a, i
)
Parameters
-
p as String : Path of the XML source. If specifying the server, note the server name and port must match the context host name and port.
-
d as XMLDocument : XMLDocument to post the server
-
h as function (optional): Function to invoke when a response is received.
-
a as boolean (optional): Bit indicating whether the request is an asynchronous operation.
-
i as String (optional): Identifier to assign to the request.
Returns
v as variant: Returns boolean for asynchronous operations, and a JSON object for synchronous operations.
postText
Posts text to the specified path and returns any text response.
Syntax
v = postText(
p, d, h, a, i
)
Parameters
-
p as String : Path of the XML source. If specifying the server, note the server name and port must match the context host name and port.
-
d as XMLDocument : XMLDocument to post the server
-
h as function (optional): Function to invoke when a response is received.
-
a as boolean (optional): Bit indicating whether the request is an asynchronous operation.
-
i as String (optional): Identifier to assign to the request.
Returns
v as variant: Returns boolean for asynchronous operations, and text for synchronous operations.
postXml
Posts an XML document to the specified path and returns any XML response.
Syntax
v = postXml(
p, d, h, a, i
)
Parameters
-
p as String : Path of the XML source. If specifying the server, note the server name and port must match the context host name and port.
-
d as XMLDocument : XMLDocument to post the server
-
h as function (optional): Function to invoke when a response is received.
-
a as boolean (optional): Bit indicating whether the request is an asynchronous operation.
-
i as String (optional): Identifier to assign to the request.
Returns
v as variant: Returns boolean for asynchronous operations, and an XMLDocument object for synchronous operations.
queryNode
Returns a DOM Node selected from the specified document and based on the specified parent node name, node name, and attribute name and values.
Syntax
aNodes = queryNode(
d, p, n, a, v
)
Parameters
-
d as XMLDocument : XMLDocument.
-
p as String : Parent element name.
-
n as String (optional): Element name. Defaults to parent if not specified.
-
a as String (optional): Attribute name.
-
v as String (optional): Attribute value.
Returns
aNodes as DOMNode: Returns a DOM Node based on the specified parent node name, node name, and attribute name and value.
queryNodes
Returns an array of DOM Nodes selected from the specified document and based on the specified parent node name, node name, and attribute name and values.
Syntax
aNodes = queryNodes(
d, p, n, a, v
)
Parameters
-
d as XMLDocument : XMLDocument.
-
p as String : Parent element name.
-
n as String (optional): Element name. Defaults to parent if not specified.
-
a as String (optional): Attribute name.
-
v as String (optional): Attribute value.
Returns
aNodes as array: Returns an array of DOM Nodes based on the specified parent node name, node name, and attribute name and value.
removeChild
Removes the child node of the specified node.
Syntax
void removeChild(
o, p, b
)
Parameters
-
o as DOMNode : DOM Node.
-
p as DOMNode : Parent DOM Node.
-
b as boolean : Bit indicating to send a termination signal to any backing objects if a Hemi reference identifier is found.
removeChildren
Removes all child nodes of the specified node.
Syntax
void removeChildren(
o, b
)
Parameters
-
o as DOMNode : DOM Node.
-
b as boolean : Bit indicating to send a termination signal to any backing objects if a Hemi reference identifier is found.
resetXmlHttpObjectPool
Resets the current pool with new instances of XMLHttpRequest objects.
Syntax
void resetXmlHttpObjectPool(
)
returnXmlHttpObjectToPool
Returns an in-use XmlHttp object to the pool of available resources. Method is private and should not be directly referenced.
Syntax
void returnXmlHttpObjectToPool(
i, y
)
Parameters
-
i as int : Pool index of the XmlHttp object to be returned.
-
y as boolean : Bit indicating whether the pool object was requested for asynchronous operation.
selectNodes
Returns an array of DOM Nodes selected from the specified document and based on the specified path.
Syntax
aNodes = selectNodes(
d, p, c
)
Parameters
-
d as XMLDocument : XMLDocument.
-
p as String : XPath query.
-
c as DOMNode : Context node.
Returns
aNodes as array: Returns an array of DOM Nodes based on the specified xpath query.
selectSingleNode
Returns a DOM Node selected from the specified document and based on the specified path.
Syntax
v = selectSingleNode(
d, p, c
)
Parameters
-
d as XMLDocument : XMLDocument.
-
p as String : XPath query.
-
c as DOMNode : Context node.
Returns
v as String: Returns a DOM Node based on the specified xpath query.
serialize
Returns a string representation of the specified node and its children.
Syntax
s = serialize(
n
)
Parameters
-
n as DOMNode : XML DOM Node.
Returns
s as String: String representation of the specified node.
setCacheEnabled
Syntax
void setCacheEnabled(
b
)
Parameters
-
b as boolean : boolean indicating whether caching is enabled.
setInnerXHTML
Copies the child nodes of the specified source node into the specified target node.
Syntax
v = setInnerXHTML(
t, s, p, d, z, c, h, ch
)
Parameters
-
t as DOMNode : DOM Node into which the source node children will be copied.
-
s as DOMNode : DOM Node from which nodes will be copied into the target node.
-
p as boolean (optional): Bit indicating whether to keep the children of the target node, or to remove them before copying in the new contents.
-
d as Document (optional): Document object to use when creating elements for the target node.
-
z as boolean (optional): Bit indicating whether recursion should be blocked.
-
c as boolean (optional): Bit indicating whether whitespace should be preserved.
-
h as boolean (optional): Bit indicating whether HTML source nodes should be cloned instead of incrementally recreated.
-
ch as function (optional): Optional callback handler for substituting values prior to copying. Useful for templates.
Returns
v as variant: Depending on the type of copy operation, returns a reference to the newly created node.
setPoolEnabled
Syntax
void setPoolEnabled(
b
)
Parameters
-
b as boolean : boolean indicating whether pooling is enabled.
swapNode
Replaces the specified node.
Syntax
void swapNode(
r, n
)
Parameters
-
r as DOMNode : DOM Node to replace.
-
n as DOMNode : New DOM Node.
testXmlHttpObject
Tests whether an XMLHTTPRequest object can be created.
Syntax
b = testXmlHttpObject(
)
Returns
b as boolean: Bit indicating whether a new XMLHTTPRequest object was created.
transformNode
Transforms the specified Document with the specified XSL document.
Syntax
v = transformNode(
x, s, n, i, j, p, t
)
Parameters
-
x as variant : XML Document to be transformed. If specified as a string, the string is used as a path to request the XML Document.
-
s as Document : XSL Document to transform the XML Document. If specified as a string, the string is used as a path to request the XSL Document.
-
n as DOMNode (optional): DOMNode to transform.
-
i as String (optional): Identifier used when requesting the XML Document.
-
j as String (optional): Identifier used when requesting the XSL Document.
-
p as boolean (optional): Bit indicating whether a request for the XSL Document should be cached.
-
t as boolean (optional): Bit indicating whether the transformation should expect a type text/plain as a result.
Returns
v as variant: Depending on the type of copy operation, returns a reference to the newly created node.
Messages
onloadxml
Message published to all subscribers when an xml request has completed loading. This message is published for text and JSON requests made through the XML request.
Syntax
// User-specified script to subscribe to message
org.cote.js.message.MessageService.subscribe("onloadxml",_handle_message);
// Internal: how the message is published to subscribers
org.cote.js.message.MessageService.publish("onloadxml"
, oXml
);
// User-specified script to handle the message subscription
function _handle_message("onloadxml"
, oXml
){
// message handler code
}
Parameters
-
oXml as XmlObject : The Hemi.xml object representing the request.
[ Hemi JavaScript Framework - Stephen W. Cote, 2002 - 2013. ]


Deleted User
25-Oct-18 03:02 AM
lol, 5 am
couldn t do something pretty
but it will basically detail all steps status, and everything needed (not extensively yet), for UI devs and bot dev @sclear @adstrakt
I can remove colors, I m colorblind so I only distinguish pink pretty good lol, unfortunately I put pink everywhere... so I changed a little
I'll get some sleep, see you later. Obviously I had to change some status codes, and I didn t detail the cancellation and refunding logic yet
(it is already done on bash side but I will break every single part to be able to have very precise status that will make requests more db friendly and less costly)
the preview won t give much info, just get the image on a widescreen and cry
tried to give an idea of both the path and what for example would be the steps for 3rd party wanting to bridge into it
tomorrow I'll setup a pad for functionalities to include / suggest, so likely anyone will be able to participate
(tomorrow is in fact today... :D)
as it may not be very digest, I can explain each single step of this image while doing a swap, if needed.
for security purposes I didn t include details about infrastructure, or security, they will be done on a private sheet
I expect, and I really hope :D, that some notary buddies will pentest us so I won't share the details of how I see servers / services communicate, or any backup solution. BTW I think every single configuration / install steps should be included on a global howto for better maintenance.
didn't think about a specific interface for a potential support team / member that would like to manage it, maybe that would be a good idea, obviously not allowing to gather any secure info, but just for example to show a page printing trades stuck by status. Some can be handled automatically, but some other, that should... never happen, would need investigation. I'm trying to reduce it to the maximum giving "exit points" in case of stuck trade, depending on the status it may involve a specific modal for whatever side needs to ask for a refund (if the trade is stuck). About a way to identify and authorize it, we'll have 2 cases : There was a problem during the sending of any side : It will be handled via cancel module, as nothing has been spent, a refund is one of the way to proceed.


Try out our Premium Member services: Virtual Legal Assistant, Query Alert Service and an ad-free experience. Free for one month and pay only if you like it.
IN THE HIGH COURT OF JUDICATURE AT MADRAS Dated 30.06.2011 CORAM THE HONOURABLE MR. JUSTICE R.SUDHAKAR Writ Petition No.12488 of 2011 and M.P.Nos.1 to 3 of 2011 J.Thangaiah ... Petitioner Vs 1.The State of Tamil Nadu rep. By its Secretary, Local Administration Department, Fort St. George, Chennai 600 009. 2.The Executive Officer, Maduravoyal- II, Grade Municipality Maduravoyal, Chennai 600 095. ... Respondents Writ Petition is filed under Article 226 of the Constitution of India praying to issue a Writ of Mandamus calling for the records of the second respondent in his proceedings in R.O.C.No.231 of 2009, dated 11.05.2011, to quash the same and consequently direct the second respondent to grant permission to the petitioner to run the private fish market at Survey No.222/3 (25 cent) and 222/1B (34.5 cent), Mettukuppam Road, Alambakkam Main Road, Chennai 600 095 and pass such suitable orders. For petitioner : Mr.Vijaya Narayananm, Senior Counsel, for Mr. R.Parthiban For respondent-1 : Ms. V.M.Velumani, Spl.G.P. For respondent-2 : Mr. R.Rajkumar ----- O R D E R
This writ petition has been filed for a writ of mandamus to call for the records of the second respondent in his proceedings in R.O.C.No.231 of 2009, dated 11.05.2011, to quash the same and consequently direct the second respondent to grant permission to the petitioner to run the private fish market at Survey No.222/3 (25 cent) and 222/1B (34.5 cent), Mettukuppam Road, Alambakkam Main Road, Chennai 600 095 and pass such suitable orders.
2. The petitioner has sought for permission from the second respondent to run a fish market which was rejected by the impugned proceedings and that is under challenge. The petitioner contends that he has sufficient materials and records to show that his application has been wrongly rejected by the authority. The rejection is based on irrelevant materials and failure to consider relevant material and hence the order under challenge is bad.
3. In the impugned proceedings, certain deficiencies have been pointed out in paragraph 9 of the impugned proceedings. It is stated that the building is an unauthorised construction, without planning permission and there is no valid licence under the Prevention of Water and Air Pollution Act and therefore, the licence cannot be considered.
4. The plea of the petitioner is that irrelevant issues have been considered while rejecting the application. The petitioner's claim was not considered properly as all the required documents to support his claim for grant of licence is available. In the above factual scenario, learned senior counsel appearing for the petitioner informs the court that the petitioner without reference to the earlier order passed, is willing to submit the records to the second respondent once again, so as to enable the authority to consider the claim for grant of licence, without reference to the earlier order passed.
5. Heard Ms.V.M.Velumani, learned Special Government Pleader appearing for the first respondent and Mr.R.Rajakumar, learned counsel appearing for the second respondent.
6. A counter-affidavit has been filed by the second respondent wherein they have reiterated the stand taken in the impugned proceedings.
7. The plea of the learned senior counsel appearing for the petitioner to submit to the competent authority all the records required for grant of licence either in terms of Section 262 or 269 of the Tamil Nadu District Municipalities Act, 1920, is justified as subsequent events and changed circumstances can give rise to a cause of action for claiming the relief afresh. The rejection of application will not be a bar to the authority to consider the same and pass orders in accordance with law afresh.
8. In view of the stand taken by the petitioner, the relief sought for in the writ petition to quash the impugned proceedings is declined. However, liberty is given to the petitioner to resubmit his application for grant of licence either in terms of Section 267 or Section 269 of the Act and the authority shall consider the same on its own merits and in accordance with law, as expeditiously as possible, preferably within a period of three weeks, from the date of submitting the application. It is made clear that the court has not expressed any opinion on the merits of the petitioner's claim.
9. With the above direction, this writ petition is disposed of. No costs. Consequently, connected miscellaneous petitions are closed.
smi/ts To
1.The Secretary, State of Tamil Nadu Local Administration Department, Fort St. George, Chennai 600 009.
2.The Executive Officer, Maduravoyal- II, Grade Municipality Maduravoyal, Chennai 600 095


I was glad to hear I am not alone in feeling that (to quote) "Unicode stinks".
I appreciate this advise on Unicode, but I'm not entirely sure what to do with it:
- strings are fine for text data that is encoded using the default encoding
- Unicode should be used for all text data that is not or cannot be encoded in the default encoding
I still have str() calls and __str__ methods all over the place, and Unicode sneaks into the most unexpected places.
Sometimes I think my life would be much, much easier if my default encoding was UTF-8 instead of ASCII. Isn't that a nice, happy encoding? Sure, a UTF-8 string isn't equivalent to a Unicode string. The lengths don't match up, some Unicode-aware operations (e.g., operations that deal with letters different from punctuation) won't work. Most of my strings are sufficiently opaque that I don't care, though. And, doing server programming, UTF-8 is a good encoding; there's no such thing as locale for me. But even setting the default encoding has been made deliberately very difficult.
I just really don't know what I should do. Should I replace all my __str__ methods with __unicode__? Should I set up a boundary where I carefully decode all strings, making sure I'm using Unicode everywhere in my app? These are rather hard things to do, because "inside" is a rather leaky place. There's all these libraries other people wrote, external inputs I am hidden from, etc.
For instance, imagine some library that writes data to a file occasionally. Maybe it's a cache; the data is opaque. It expects strings. What does it do when it gets a Unicode object? Very possibly it writes it, if it is encodable with the default encoding (typically ASCII). In fact, this works great for me because my name and everything I write is ASCII; I'm not even sure how to input anything but ASCII. How do I, the ignorant English-speaking-and-typing American, even make a test case? Well, sometimes I write u"\u0100" or something; I don't even know what that character is, but at least I know it's Real Unicode. Sucks that it takes 9 characters to give me that one Unicode character I want. And in practice I usually leave this out of my tests. Then some European comes along with an umlaut in their name, and BOOM! UnicodeDecodeError -- and I didn't even know strings were involved. It's not even my library. Nothing is safe from these blasted characters. And the problem isn't localized -- Unicode works implicitly often enough that the Unicode can leak in long before it causes a problem, and a subtle difference like between "%s" % obj and str(obj) can cascade throughout the system.

Excelente article. As a mexican developer I wrestle with Unicode daily and it's the only thing that can take away from Python, if I ever found a language with smooth handling of Unicode
# anonymous
I suspect it would be better if we had only Unicode text and non-text bytestrings, with a sufficiently different-enough interface that you could tell which one you expected and would work with. Like Java I guess. You'd still have all the problems, but you'd have to deal with them up front, and everyone would deal with them consistenly, and errors wouldn't propogate.
# Ian Bicking
There is no such thing like working Unicode support in any language. :-/ The main problem is that there are interfaces needed to the real world - and the real world doesn't like Unicode, it only accepts utf-8. But several libraries try to be smart. For example django uses the email module to parse multipart POST data - that's a logical choice, as HTTP multipart POST data is actually just mime attachements. Of course, email produces unicode strings if you pass in something that's defined as utf-8. And that produces problems in the django code. Or take sqlite3 for example: the pysqlite2 binding allways returns unicode strings. Except if you store data in the database directly with the sqlite command - then it stores what you pass in and what your local encoding is. It's iso-8859-1 in my case - so I can add stuff to the sqlite database that can't be read by the pysqlite2 library. With django this required me to write a row factory that removes the unicode string and replaces it by a bytestring in utf-8 encoding, just to make the django code happy.
Oh, and your blog doesn't accept Umlauts in the comments - it produces a traceback with UnicodeDecodeError :-)
Oh, and just before anybody mentions it: both the email module and the pysqlite2 library will happily deliver bytestrings in other situations, so you can't just say to hell with it and all unicode. The email module will return non-utf-8 stuff as bytestrings and the pysqlite2 library will give a registered converter not the unicode string but the raw bytestring. For example if you register a (lambda s: s) as the converter, you will get bytestrings.
 I actually knew you would, it's one of those Unicode errors that I'm too cowardly to try to fix. In fact, I'm pretty sure I introduced it when I was trying to fix a related encoding problem. There's a very high likelihood of regressions when you try to fix unicode-related errors.
# Ian Bicking
well, i usually code like this:
- all inputs are converted to unicode
- the internals of my programs only deal with unicode
- all the outputs are converted (explicitly) to byte-strings
at least this is what i'm trying ;)
there are generally 2 problems with this approach in python (it's much better in java for example):
- probably because of historical reasons (first there were byte-strings?) python kind-of recommends byte-strings...well, not exactly recommends..but..for example if you want to write an unicode string you have to prefix it with [u]. so it's usually extra work to enter unicode strings. in java this issue does not exists, because there the strings are unicode. there are no byte-strings (only byte-arrays)
- probably a consequence of #1: many library functions only deal with byte-strings. and what's worse, sometimes (to be sure) they start with somethings like "input = str(input)". and this of course completely fails when the input contains non-ascii... so you have to be careful...
# Gabor Farkas
There isn't really a lot of point in hating ASCII. ASCII is fine if you are absolutely sure your code will only ever be used by monolingual English speakers who don't give a sh*t about whether their text looks typographically half-decent (proper quotes, en- and em-dashes etc.)
If you have any interest in your code being used by the other 95% of the world, then ASCII simply isn't an option and you have to find a way to deal with unicode whether you like it or not.
Django incidentally has the same problem: http://code.djangoproject.com/ticket/170 ... which does rather beg the question, do American newspapers not even try to spell foreigners' names correctly?
They obviously never bother to use pound signs or euros.
I got your pound sign right here: # -- :-)
# Ray
Kind of off-topic, but I wonder: How did the typographical mark '#' come to be called "pound" in the US? Was it through keymap differences? Or is it just a co-incidence that Shift-3 happens to produce the "right pound for the job"?
(On a British keyboard, Shift-3 produces the GBP currency symbol. On a US keyboard, it produces the number sign -- what I would call a "hash" sign)
The "octothorp" is often refered to as the "pound sign" because it is used to designate pounds when it follows a number in the retail trade (er, in the old days, when _I_ was a kid). E.g. "5# of flour", "3# of 10d common nails" (btw, that 'd' stands for 'penny'). See http://www.octothorp.us/octothorp.html for more...
# anonymous
I think most Americans don't think of that as a spelling error. After all, the letters are really the same, so you can just leave out the funny decorations that furriners like to write, right? :)
It seems to me like non-ASCII character sets are just not ready for prime time yet. I treat stuff like Unicode the way I treat C++--I'm still waiting for things to shake out and the bugs to be worked out. Of course, I've been waiting 15 years and C++ is still a mess.
(Yes, I'm kidding. Sort of.)
# Mike Coleman
That why you should set the default encoding to something inexistent. automatic conversion from str to unicode or unicode to str is a source of endless bugs. Better to have everything explicit ;)
# anonymous
But sometimes automatic conversion really is the Right Thing. For instance, let's say I have some code that does this:
def popup(href, title): return '%s' % ( href, str(href), title)Without a u' this will raise an exception if title is Unicode, if no default encoding is given. Is that the right behavior? No! This function works fine. This is not a boundary where encoding needs to be defined; in fact, it would suck if you had to encode the title before passing it in, because then you'd have to decode the result of the function as well, so you could re-encode it at the real boundary (when you serve the page). All this because of a missing u -- and that u is missing far more often than it is included.
If you can "fix" that function, you're okay. But there's too much code out there that does this now. I simply can't update all the code out there that uses bytestrings instead of Unicode.
# Ian Bicking
But that is the problem. Unicode difficulties always come when you try to mix 8 bit strings with unicode strings. A solution ( and one of the best in my opinion ) is to do all string handling in unicode.
You read a string from a file, first thing you do is convert it to unicode. You write a string to a file ? Encode it. Inbetween, always use unicode. If there is some unruly code somewhere, then it's better to ask the author of the code to correct it then to add some workaround somewhere. It is the safest solution that way because there are less hacks involved.
If really there is some external code you can't change, then consider encapsuling the piece of code in an automatic convert/unconvert routine with utf8 as the encoding.
I have a hard time asking a library author to "fix" their library in this way. Because when they've fixed it for Unicode-using me, they've simultaneously broken it for everyone else.
# Ian Bicking
I always set my default string encoding to utf8 if I'm working in a python environment I have control over, and having done that I don't recalll having had any difficulties with library code that uses strings. Of course that's no use if you're in a shared hosting environment, or distributing code for others to use in their environments.
It occurs to me that Dutch is one of only three ASCII-only languages I can think of off the top of m head (the other one is Italian). This might explain a lot.
Not even Italian and Dutch are absolutely ASCII. Italian makes use of accented vowels quite a lot (e.g. á) and Dutch technically needs the trema (e.g. tetraëder); the IJ (http://en.wikipedia.org/wiki/%C4%B2) is usually written as two letters when using computers, but typewriters still have this as its own ligature.
So, unless I'm missing something, English is the only pure ASCII language there is (except Latin, of course).
 Nonsense!
What about 'façade' or 'rôle', or 'résumé', all perfectly good English words!
~fran
# Francis Tyers
As ukrainian developer, I have to deal with Unicode issues regularly.
The only viable strategy to avoid unicode errors for me has been to have clear borders of "Unicode world" within a program. As you noted, this may be tricky but it is doable. Usually I don't strive to have Unicode throughout the program because Unicode is used inconsistently in Python (and, yes, you're going to figure it out the hard way) but it is relatively simple to define a Unicode area within your own code. To document boundaries I usually use asserts.
Regards, Max.
I used to have the same annoyances, but then I learned to stop worrying and love the exceptions :) Or, more prosaically, faced with a large and complex project that required use of Unicode, I sat down and worked out how Python's support for it operates. The conclusion I came to is that Python is actually one of the better (if not best) languages at handling Unicode, as long as you work with it. That is; it presupposes a particular way of handling strings. The faults are more in the explanations and documentation.
The project of which I speak is driven by a vast MySQL database, in which [essentially] all strings are Unicode. Since Python tends to promote non-Unicode strings to Unicode as required (in string operations and the like), that means that any textual object must be considered as being Unicode. They come to Python code (via MySQLdb) as Unicode objects. To the console and to files, they are sent as UTF-8-encoded strings.
The general rules I've followed are: (a) Use a console environment that supports UTF8 characters (in my case, PuTTY ssh sessions to Linux boxen). Thus one can print any string that's encoded in UTF8 to stdout in Python code. (b) Assume that all strings are Unicode; when using "print", convert to UTF8. Since non-Uncode strings also have an "encode" method, this makes life easier. Converting an ASCII string to UTF8 is essentially a no-op. Only encode when writing out from code to files or the console. Only decode when reading in. (c) When creating or reading files, know what encoding format you're handling. That should be as much an attribute of any defined file format as the line-endings or use of Ctrl-Z/EOF. I use BOM marks (as does Windows) via the constants in the "codecs" module to ensure that I tag files appropriately. Writing a generic file reader that spots BOM marks and decodes appropriately is an easy task. (d) Keep in mind that "the console and the world are in ASCII" is a falsehood that will bite you as much as "everyone in the world speaks English" does :) (e) UTF8 is your friend - it'll handle encoding of any Unicode character and if you can't meet rule (a) is still more-or-less printable, though you don't see the strings as intended. (f) the "default encoding" is your enemy. You can't rely on it, it only takes effect in some circumstances and it may bear no relation at all to what the console can or cannot handle.
Given the above, I have never had a problems with rogue Unicode[De|En]codeErrors, and we handle all Western languages plus (recently) Russian and Japanese. Generally, the only times they occur is where I've found an old "print" line that spits some object out without encoding it first.
 I now want this selection to be the default for all the following files till I end the word session.
How can I do this ?
Hope one of U Gurus can help.
I have 'Googled@ for the answer no help
Paul
# Paul Suret


The shifthelper bot does not know you yet
Please send the /start-command to our Bot and try again.
/start


Designers everywhere gush with admiration upon seeing a web design and exclaim "its beautiful, it's so clean!". There are a
countless number of webdesign round-ups dedicated to 'clean' design and it is a term thrown around quite a bit in the web
design community. It can be easy to spot a good example of clean design
STRICT has been designed to be fully
responsive on all devices
This multipurpose theme is especially created
to be used for different projects.
This multipurpose theme is especially created
to be used for different projects.
Contact me if you like my work
We ensure quailty & support


{site_tagline} {site_copyright} Posts per page Date and time format (?) Timezone (?) Enable file uploading Disable file uploading settings password


Marmoset is written in C for maximum portability and performance. The goal of this project is to keep the feature set small, stable, and fast for use on low power hardware running any unix based operating system while still providing a robust and intuitive RESTful framework.


The Crown's Helena Bonham Carter 'didn't understand' Rihanna on Ocean's 8
Rihanna is one of the most well-known celebrities around, thanks to her massive singing career, constantly sold-out beauty range, history-making clothing line – and she can act, too.
However, Helena Bonham Carter revealed there were some communication issues between the pair while starring on Ocean’s 8 together.
During an appearance on The Late Show, The Crown actress took a second to spill all the tea on some of her biggest co-stars so far.

‘She’s amazing, she’s a goddess. She looks extraordinary,’ she told host Stephen Colbert. ‘I could never understand what she said though. We speak totally different languages.
‘But I love her, and she’s amazing to look at — really good actress too, and then she’s a great designer.’
Advertisement Advertisement
Colin Firth, who starred opposite her in The King’s Speech, didn’t fare any better.
‘Love dearly, talks too much,’ she explained.
And Helena revealed that Harry Potter’s Daniel Radcliffe recites poetry backstage and is very useful for ‘holding her drinks’.
Discussing how sensitive the 30-year-old is, she continued: ‘He’s got nice manners, too. He loves poems, and he writes them. He also quotes poems.
‘He’s really handy because I like my tea and my coffee and my Diet Coke and things, and he’d hold them all for me. So he was really helpful.’
Good to know…
Helena recently made headlines as she opened up about her role as Princess Margaret in series three of The Crown – which is on Netflix now.
In fact, she claimed that she spoke to the ghost of the late Royal before taking on the part.
Clearing up the rumours while appearing on The Graham Norton Show, she admitted: ‘I actually went to see a friend about something else, but she has a talent for mediumship and she suddenly said, “Margaret is here. Does that mean anything?”
‘I hadn’t actually said yes [to the part] yet, but thought I’d ask her if I should take the role and she said, “You’ll be better than the other one”.
Advertisement Advertisement
‘There was actually someone else up for the part and it was typical of Margaret.
‘I’d met her a few times and you never really knew where you were with her, she had a way of complimenting and putting you down at the same time.’
No communication issues there, then…
Got a showbiz story?
If you've got a story, video or pictures get in touch with the Metro.co.uk Entertainment team by emailing us<EMAIL_ADDRESS>calling 020 3615 2145 or by visiting our Submit Stuff page - we'd love to hear from you.


Login
Log Out
DOH {{ctrl.doh.region}}, {{ctrl.doh.country.name}}
Cloud Network for DOHs
DOH Login
- Country -
- Region -
Login
Show National report
Show Regional report
{{key}}
Diseases reported in the region
{{disease.name}} : {{disease.count}}
Declare Epidemic
Remove Epidemic Alert
Register epidemic
Name
Symptoms
Quarantine Required


A haiku about haiku:
Starting with five beats,
followed by seven more beats,
ending with five beats.
I enjoy collecting, and repairing, retro game consoles. Currently I focus on Nintendo consoles, the only console I am missing from that line up is the Virtual Boy. I also collect games that I either played growing up or I heard about from friends, but never had the chance to play. One of my favorite games to have re-discovered is Diddy Kong Racing on the Nintendo 64.
I also like to play around with game development in my free time. I like to try creating different game mechanics and experimenting with how to implement said mechanics. Some mechanics are specific ones I pull from existing games, some are common to a variety of games, and others I come up with in spurts of creativity. Not every game mechanic turns out, but I always end up enjoying the creative exercise it gives, and learning new skills along the way.
Another interest of mine is 3D Printing and 3D Modeling. I've dabbled in 3D modeling for a few years and have recently taken up 3D printing. Mostly I print things designed by others, however I've just started working on making my own models for printing. Its taking a lot of trial and error, but I am enjoying the process.
| Monday | Tuesday | Wednesday | Thursday | Friday | |
| 8:00 | Classwork | Classwork | Classwork | ||
| 8:30 | |||||
| 9:00 | |||||
| 9:30 | Classwork | Classwork | |||
| 10:00 | |||||
| 10:30 | |||||
| 11:00 | Intro to Animation | Intro to Animation | Intro to Animation | ||
| 11:30 | |||||
| 12:00 | Lunch | Lunch | |||
| 12:30 | Lunch | Classwork | Lunch | Classwork | Lunch |
| 1:00 | Classwork | Classwork | Classwork | ||
| 1:30 | |||||
| 2:00 | |||||
| 2:30 | |||||
| 3:00 | |||||
| 3:30 | |||||
| 4:00 | Work | Work | Work | Work | Work |
| 4:30 | |||||
| 5:00 | |||||
| 5:30 | Web Programming I | ||||
| 6:00 | |||||
| 6:30 |


[gecode-users] Value selection when branching
Lars Otten
ottenl at student.chalmers.se
Tue Feb 7 17:54:42 CET 2006
Hi,
On 02/07/06 15:38, Guido Tack wrote:
>> I still haven't solved the previous problem (about the strange propagation
>> behaviour), but since for the moment there is a workaround, I have started
>> to work on some other things at the same time, one of them random value
>> selection when branching.
>
> Uh, I tried that too and failed miserably ;-)
That does not sound promising... :-/
> To understand this behaviour, you have to understand how the search engine
> works. One severe problem is recomputation: this requires that the branching
> is deterministic, i.e. for equivalent spaces it must always result in the
> same choice. This is clearly not the case here. You could switch off
> recomputation by giving -c_d 1 -a_d 1 as command line parameters. Please try
> out if that changes anything.
Nope, doesn't help. Thanks nevertheless.
> It might still not work, because even if you never recompute spaces, you are
> not guaranteed that for one space at one point in the search tree the
> branching is evaluated only once. The only way out of this trap is to use
> something that will be completely deterministic, so that for equivalent
> spaces you will always get the same choice.
Well, the whole point here is (pseudo-)nondeterminism. ;-)
I will have to think about the problem a little bit and see what I can come
up with.
/Lars
More information about the gecode-users
mailing list


Hello {{ user_first_name }},
A request has been made to reset your eShop Index password. You can do so by clicking on the link bellow:
{{ url }}account/password/reset/{{ user_id_b64 }}/{{ token }}If this request wasn't made by you, please ignore this message.
The eShop Index Team.


You walk over to the drive-thru window seeing that the librarian previously sitting there has walked over to a bookshelf. Now is your chance to play librarian.
You start talking to the customer waiting in the drive-thru. You start chatting them up about the weather, as well as local sales at grocery stores.
This, of course, gets you banned from the library. Still, totally worth it.


vignettes/cgc-datasets.Rmd
cgc-datasets.Rmd
Please read the tutorial here.
Please read the tutorials first.
Doing a HTTP GET
on this endpoint one will get a resource with links to all entities in the dataset. Following these links (doing an HTTP GET
on them) one will go to a list of entities (for example /files
) from TCGA dataset identified with their proper URL. Further following one of these links you’ll get a particular resource (if we went to /files
, we’ll get a description of a particular file) with all specific properties like id, label, etc. and links to other entities that are connected to a specific resource (for example /cases
) that you can explore further. From there on, the process repeats as long as you follow the links.
Create an Auth object with your token, make sure you are using the correct URL.
https://cgc-datasets-api.sbgenomics.com/
use Auth$api()
method so there is no need to type base URL or token again.
You can issue another GET
request to the href of the tcga object, if you want to access TCGA data.
For example, to see a list of all TCGA files, send the request:
(res <- a$api(path = "files"))
For example, to see the metadata schema for files send the request:
a$api(path = "files/schema")
Get file id from Datasets API, then use public API to copy files. Make sure your project is “TCGA” compatible, otherwise if you are trying to copy controlled access data to your non-TCGA project, you will get
"HTTP Status 403: Insufficient privileges to access the requested file."
endpoint user can filter collection resources by using a DSL in JSON format that translates as a subset of SPARQL. Main advantage here is that an end user gets the subset SPARQL expressiveness without the need to learn SPARQL specification.
body <- list(
entity = "samples",
hasCase = "0004D251-3F70-4395-B175-C94C2F5B1B81"
)
a$api(path = "query", body = body, method = "POST")
Count samples connected to a case
a$api(path = "query/total", body = body, method = "POST")
Issuing a GET
request to the href path will return the following data:
Note: api
function is a light layer of httr package, it’s different from Auth$api
call.
Suppose you want to see all cases for which the age at diagnosis is between 10 and 50. Then, you use the following query.
Note that the value of the metadata field hasAgeAtDiagnosis is a dictionary containing the keyfilter, whose value is a further dictionary with keysgt(greater than) and lt (less than) for the upper and lower bounds to filter by.
Suppose you want to see all cases that, as in the example, (Find cases with given age at diagnosis)(doc:find-all-cases-with-a-given-age-at-diagnosis), have an age at diagnosis of between 10 and 50, but that also have the disease “Kidney Chromophobe”. Then, use the following query:
body <- list(
"entity" = "cases",
"hasSample" = list(
"hasSampleType" = "Primary Tumor",
"hasPortion" = list(
"hasPortionNumber" = 11
)
),
"hasNewTumorEvent" = list(
"hasNewTumorAnatomicSite" = c("Liver", "Pancreas"),
"hasNewTumorEventType" = list(
"filter" = list(
"contains" = "Recurrence"
)
)
)
)
a$api(path = "query", body = body, method = "POST")
Issuing a GET
request to the href path
get_id <- function(obj) sapply(obj$"_embedded"$files, function(x) x$id)
names(res)
body <- list(
"entity" = "cases",
"hasSample" = list(
"hasSampleType" = "Primary Tumor",
"hasPortion" = list(
"hasPortionNumber" = 11,
"hasID" = "TCGA-DD-AAVP-01A-11"
)
),
"hasNewTumorEvent" = list(
"hasNewTumorAnatomicSite" = "Liver",
"hasNewTumorEventType" = "Intrahepatic Recurrence"
)
)
(res <- a$api(path = "files", body = body))
get_id(res)


pymatgen.util.plotting module¶
-
add_fig_kwargs
(func)[source]¶ Decorator that adds keyword arguments for functions returning matplotlib figures.
The function should return either a matplotlib figure or None to signal some sort of error/unexpected event. See doc string below for the list of supported options.
-
get_ax3d_fig_plt
(ax=None, **kwargs)[source]¶ Helper function used in plot functions supporting an optional Axes3D argument. If ax is None, we build the matplotlib figure and create the Axes3D else we return the current active figure.
Parameters: kwargs – keyword arguments are passed to plt.figure if ax is not None. Returns: Axes
object figure: matplotlib figure plt: matplotlib pyplot module.Return type: ax
-
get_ax_fig_plt
(ax=None, **kwargs)[source]¶ Helper function used in plot functions supporting an optional Axes argument. If ax is None, we build the matplotlib figure and create the Axes else we return the current active figure.
Parameters: kwargs – keyword arguments are passed to plt.figure if ax is not None. Returns: Axes
object figure: matplotlib figure plt: matplotlib pyplot module.Return type: ax
-
get_axarray_fig_plt
(ax_array, nrows=1, ncols=1, sharex=False, sharey=False, squeeze=True, subplot_kw=None, gridspec_kw=None, **fig_kw)[source]¶ Helper function used in plot functions that accept an optional array of Axes as argument. If ax_array is None, we build the matplotlib figure and create the array of Axes by calling plt.subplots else we return the current active figure.
Returns: Array of Axes
objects figure: matplotlib figure plt: matplotlib pyplot module.Return type: ax
-
periodic_table_heatmap
(elemental_data, cbar_label='', show_plot=False, cmap='YlOrRd', blank_color='grey', value_format=None, max_row=9)[source]¶ A static method that generates a heat map overlapped on a periodic table.
Parameters: - elemental_data (dict) – A dictionary with the element as a key and a value assigned to it, e.g. surface energy and frequency, etc. Elements missing in the elemental_data will be grey by default in the final table elemental_data={“Fe”: 4.2, “O”: 5.0}.
- cbar_label (string) – Label of the colorbar. Default is “”.
- figure_name (string) – Name of the plot (absolute path) being saved if not None.
- show_plot (bool) – Whether to show the heatmap. Default is False.
- value_format (str) – Formatting string to show values. If None, no value is shown. Example: “%.4f” shows float to four decimals.
- cmap (string) – Color scheme of the heatmap. Default is ‘coolwarm’.
- blank_color (string) – Color assigned for the missing elements in elemental_data. Default is “grey”.
- max_row (integer) – Maximum number of rows of the periodic table to be shown. Default is 9, which means the periodic table heat map covers the first 9 rows of elements.
-
pretty_plot
(width=8, height=None, plt=None, dpi=None, color_cycle=('qualitative', 'Set1_9'))[source]¶ Provides a publication quality plot, with nice defaults for font sizes etc.
Parameters: - width (float) – Width of plot in inches. Defaults to 8in.
- height (float) – Height of plot in inches. Defaults to width * golden ratio.
- plt (matplotlib.pyplot) – If plt is supplied, changes will be made to an existing plot. Otherwise, a new plot will be created.
- dpi (int) – Sets dot per inch for figure. Defaults to 300.
- color_cycle (tuple) – Set the color cycle for new plots to one of the color sets in palettable. Defaults to a qualitative Set1_9.
Returns: Matplotlib plot object with properly sized fonts.
-
pretty_plot_two_axis
(x, y1, y2, xlabel=None, y1label=None, y2label=None, width=8, height=None, dpi=300)[source]¶ Variant of pretty_plot that does a dual axis plot. Adapted from matplotlib examples. Makes it easier to create plots with different axes.
Parameters: - x (np.ndarray/list) – Data for x-axis.
- y1 (dict/np.ndarray/list) – Data for y1 axis (left). If a dict, it will be interpreted as a {label: sequence}.
- y2 (dict/np.ndarray/list) – Data for y2 axis (right). If a dict, it will be interpreted as a {label: sequence}.
- xlabel (str) – If not None, this will be the label for the x-axis.
- y1label (str) – If not None, this will be the label for the y1-axis.
- y2label (str) – If not None, this will be the label for the y2-axis.
- width (float) – Width of plot in inches. Defaults to 8in.
- height (float) – Height of plot in inches. Defaults to width * golden ratio.
- dpi (int) – Sets dot per inch for figure. Defaults to 300.
Returns: matplotlib.pyplot
-
pretty_polyfit_plot
(x, y, deg=1, xlabel=None, ylabel=None, **kwargs)[source]¶ Convenience method to plot data with trend lines based on polynomial fit.
Parameters: - x – Sequence of x data.
- y – Sequence of y data.
- deg (int) – Degree of polynomial. Defaults to 1.
- xlabel (str) – Label for x-axis.
- ylabel (str) – Label for y-axis.
- **kwargs – Keyword args passed to pretty_plot.
Returns: matplotlib.pyplot object.


Menu
Search
Events
Hotels
Contact
Stay
&
Play
Find an event and hotel in your desired location
SEARCH
Start Date
End Date
City
State
Zip Code
Email Address
We'll never share your email with anyone else.
Submit
EVENTS
Here are the events in your area
Back to Search
Recent Search Results
Hotels in your area
MAP
Meet Our Development Team
Adam Kirschner
Brian Hummel
Jake Lopez
Noe Tellez
Stephen Bell


This is what happens when your project is tied 2 a main platform chain like $NEO $ETH etc,Today Neo had issues with syncing and the result was all project wallets be taken down for deposits and withdraws. Multi chain scaling solutions exist on $KMD un-effected by Kmd


#Introduction
If you have at some point needed an input type=range while developing a website you'll know that they are awesome. They fit with a lot of use cases and are very convenient to both interact with as user and deal with as developer.
However, the restriction of not being able to style it very well is a point which isn't easy to ignore. People tell me that there are many ways to style a range input, to which I answer with the question whether approximately 80 lines of css (cross-browser support included) solely for one range input is worth it.
This is why I wrote a framework to solve this very problem: Slider89, which also happened to solve a lot more problems and make life much easier. How convenient!
#What is this?
Slider89 is a very simple framework for easily creating css sliders (range inputs). Being based on javascript and custom elements with CSS instead of a built-in browser-side <input>-element, it features full styling customizability but allows for rich configuration on the technical side as well. It is very useful for modifying values on the go, as an example.
A basic slider can look like this (Its background-color is a bit darker but otherwise this is an all-default slider):
The values are automatically computed based on the slider's minimum and maximum values
#Getting started
Like usual when needing external resources, you first need to fetch the necessary files and load them up into your HTML document.
There are two ways of doing this: you can either download them from the github repository, https://github.com/Hallo89/Slider89, or fetch the files from the repository's website as seen below to always get the latest available version.
In both cases only two files are needed: slider89.js
and slider89.css
You'll then need to link them in your HTML file like so:

<link rel="stylesheet" href="yourpath/slider89.css">
or, fetching from the website:

<link rel="stylesheet" href="https://hallo89.github.io/Slider89/slider89.css">
Tip: I prefer to load both the script and style at the end of the document to squeeze an extra bit of speed out of the page because, given that the scripts are also at the end of the document which is usual practice, one will not need them before.
Now that everything is loaded up, we can start to create sliderz. All you have to know is the initialization method; everything else can be taken from the documentation section.
To create one instance of a slider, we do the following in our javascript:
var mySlider = new Slider89(targetElement);
This is pretty straightforward: we create a new instance of the Slider89
class with the new
operator and pass the HTML-element we want the slider to be created in as paramter into the function.
Lastly, we obviously have to store the slider in a variable to be able to access it in future code (it is also valid not to use a variable, I'm doing this with the demos on this page for example, but this is a very rare case as you cannot do anything with it after initialization).
An all-default slider initialized plainly like this will look like the example you see above:
However, what would a framework be without means of configuration? To configure it we pass an additional parameter as object into the Slider89 constructor which we fill with configuration-properties. Here's an example:
var mySlider = new Slider89(targetElement, {
min: -50,
max: 175,
value: 80
});
Which would turn out into this:
#Documentation
This chapter will introduce all available methods, variables etc. with a thorough explanation
#Properties
These are the key to reading values from the slider and defining its properties.
Every property's value is accessed using <sliderInstance>.<property>
Configuration properties #
Define the slider's configuration as properties of an object passed as a parameter into various functions.
min
- The minimum value of the slider's range
- ├ type:
number
- ├ influencing:
width at 'auto'
- └ default:
0
max
- The maximum value of the slider's range
- ├ type:
number
- ├ influencing:
width at 'auto'
- └ default:
100
value
- Used to specify the value the slider and its knob should start at
- ├ type:
number
- └ default:
min
width
-
The final width of the slider.
A number represents the width in pixels regardless of the slider's range, whereas the keyword 'auto' computes the width automatically from the slider's range in a 1:1 ratio.
If the propertyabsWidth
is false, which is default, the width is implicit; it is expanded by a small amount resembling the padding at the sides of the slider (The default padding is half of the slider knob's width either side) in order to get an expected result - ├ type:
number
- ├ unit:
px
- ├ influences:
absWidth
,min
,max
- ├ available keywords:
'auto'
- └ default:
'auto'
classList
- An array containing CSS classes to be added to the slider's HTML-structure
- ├ type:
array<string>
- ├ influencing:
HTML-structure
- └ default:
[]
task
- This value takes a function to be executed every time the slider is moved. The function must be declared without parenthesis, or be an inline anonymous function
- ├ type:
function
- └ default:
undefined
taskMouseUp
- This is the same as
task
, taking a function, which is, however, executed only every time the mouse button is released after the slider has been interacted with - ├ type:
function
- └ default:
undefined
structure
-
An XML-like layout resulting in the final HTML structure of the slider.
(For now) necessary components:<wrapper>
,<knob>
,<tooltip>
,

, where every tag exceptwrapper
is a non-closing one-line tag.
Definition of attributes:[!]attributeName(value1[, value2[, ...]])
, where an exclamation mark in front of the attribute overwrites potential framework-side pre-defined values.
For additional elements, insert a new uniquely-named tag and, if needed, specifiy the HTML tag type after that.
Additionally, inner text is created by simply placing it inside the tag in quotation marks.
Example:
 <text span class(char_info, default) "Text appearing inside the element"> <wrapper class(input)> <knob style(height: 50px)> <tooltip> </wrapper>
- ├ type:
string
- ├ influencing:
HTML structure
- └ default:
'<wrapper><knob><tooltip></wrapper>
'
absWidth
- 'Absolute width'; setting this to true computes the slider's width explicitly without taking the slider's padding into account
- ├ type:
boolean
- ├ influencing:
width
- └ default:
false
trimComma
-
If true, a value's digits after its decimal place are culled if they are 0. This is an aesthethik config property noticable at the value-displaying tooltip.
Example: 6.000 is trimmed to 6 - ├ type:
boolean
- └ default:
true
tipDuration
-
The duration after how long the value tooltip should vanish when the slider hasn't been interacted with.
Setting it tofalse
disables the timer, making the value never disappear - ├ type:
number
|boolean<false>
- ├ unit:
ms
- └ default:
250
tipDuration
- The duration after how long the value tooltip should vanish when the slider hasn't been interacted with
- ├ type:
number
- ├ unit:
ms
- └ default:
250
replaceNode
- If set to true, the slider instance will replace the
targetNode
instead of being appended as a child inside it - ├ WRITE ONLY
- ├ type:
boolean
- ├ influencing:
Slider89
- └ default:
false
Read-only #
The following properties are read only and may not be used as configuration properties
element
- An object containing all nodes of the final HTML structure after the slider instance's initialization
- ├ READ ONLY
- ├ type:
object<HTMLnodes>
- ├ influences:
buildElement
- └ default:
undefined
element
- The HTML element (see HTML structure) of the final slider instance after initialization
- ├ READ ONLY
- ├ type:
HTML element
- ├ influences:
buildElement
- └ default:
undefined
Internal #
Below listed are properties which are internal to the framework and serve no purpose for the user but maybe you want to hack the framework idk but feel free to
taskLock
- While dragging the slider, if the previous and new value are equal to each other, the specified
task
is executed once andtaskLock
is set to true, which prevents further executions oftask
if the value has still not changed. If the value has changed again,taskLock
is set to false - ├ INTERNAL
- ├ type:
boolean
- ├ influences:
executeSlider
- └ default:
false
tipTimer
- The current
timeout
instance used for the value-tooltip which is terminated when the slider is dragged anew while a previous timeout instance was still running - ├ INTERNAL
- ├ type:
timeout
- ├ influences:
executeSlider
- └ default:
undefined
#Methods (functions)
Constructor #
Slider89(<targetNode>[, <configProperties>])
-
The slider object constructor; initialize a slider instance by using the
new
keyword in front of it and binding it to a variable.
Example:or:var myInstance = new Slider89(someElement);
var myInstance = new Slider89(someElement, { configProperty1: configPropertyValue1, configProperty2: configPropertyValue2 });
- ├ targetNode = HTML element the instance will be created in
- ├ configProperties = configuration properties
- └ influences:
replaceNode
Instance functions #
Functions under this category are called on a slider instance
<sliderInstance>.newValues(<configProperties>)
-
This function takes configuration properties and restructures the slider based on its new properties.
Although properties could be overriden using<sliderInstance>.<configProperty> = <newValue>
, this function ensures every dependent and dependency is restructured as well.
Examples: it writes a new caption into the element; it sets a new width of the element; etc.
Additionally, ifmin
ormax
is changed, the value recomputes itself based on the previous min-max-ratio - └ sliderInstance = An instance of a slider constructed via the
Slider89
constructor
The slider89
object
#
'slider89
' (take notice that it's a lowercase "s"!) is a standalone object used for functions which are called without a reference to a slider instance
slider89.defaultValues(<configProperties>)
- Called before a slider is created, it sets default values for every instance to apply
- └ slider89 = standalone object
Internal #
As with the internal properties, these values serve no purpose for the user but are listed here to give the user (and hacker) full transparency
<sliderInstance>.buildElement(<targetNode>, replaceNode)
->object<HTMLnodes>
-
Builds the slider's HTML structure into the specified
targetNode
, adding additional classes from theclassList
property, if present. IfreplaceNode
is true, it replacestargetNode
.
The object containing all HTML elements of the final HTML, which is beforehand acquired fromparseHTML
, is returned to be written intoelement
- ├ INTERNAL
- ├ influences:
replaceNode
,parseHTML
,classList
- └ influencing:
HTML structure
,element
<sliderInstance>.buildElement(<targetNode>, replaceNode)
->HTML element
-
Builds the slider's HTML structure into the specified
targetNode
, adding additional classes from theclassList
property, if present. IfreplaceNode
is true, it replacestargetNode
.
The function returns the created element to be written into a variable (->element
) - ├ INTERNAL
- ├ influences:
replaceNode
,classList
- └ influencing:
HTML structure
,element
<sliderInstance>.executeSlider(<clickedCoordinate>)
-
This function is executed every time the
mousemove
event, and more specifically, themouseMove
function is fired and handles the value, its tooltip and the specifiedtask
function - ├ INTERNAL
- ├ clickedCoordinate = an
int
representing a screen-related x-coordinate where the mouse has been clicked - ├ influences:
element
,task
- └ influencing:
value
,tipTimer
,taskLock
<sliderInstance>.checkTask(<task>)
-><task> | false
-
A function evaluation whether a handed-over
task
is valid:
If it is, plainly return it without doing anything, if not, for example because it has been declared with parenthesis (which javascript cannot explicitly check), throw an error into the console and returnfalse
- ├ INTERNAL
- └ influencing:
task / taskMouseUp
<sliderInstance>.setTask(objectTarget, task)
-
A function evaluation whether an input
task
, which is also handed over into this function, is valid. If it is, write it into the specifiedobjectTarget
If the task is no valid function, for example declared with parenthesis, throw an error into the console - ├ INTERNAL
- ├ objectTarget = The object to write into; either the slider instance (constructor) or the
slider89
object - └ influencing:
task
<sliderInstance>.computeWidth(<valueObject>)
->int
-
If the
valueObject
'swidth
is'auto'
, compute the width automatically based onmin
andmax
, if it isn't, set the valueObject's width to its own width but takeabsWidth
into account - ├ INTERNAL
- ├ valueObject = an object preferably carrying values for
width
,min
,max
andabsWidth
- ├ influences:
min
,max
,absWidth
- └ influencing:
width
<sliderInstance>.parseHTML(structure)
->object<structureNodes>
-
This function will parse a given
structure
into valid HTML, taking every attribute, innerHTML, etc. into account.
It will return every HTML node created as an object, with the instructure
specified tag name as object name - ├ INTERNAL
- ├ influences:
structure
- └ influencing:
buildElement
,HTML structure
<sliderInstance>.mouseMove(event)
-
Is executed by the mousemove event, being its own function for the ability to remove the event listener afterwards, and executing
executeSlider
, parsing event.x - ├ INTERNAL
- └ event = The event parameter handed over by the event listener
#HTML & CSS structure
As of version 0.2.0
(with the introduction of the structure system
), CSS has been split into two sections: crucial and non-crucial. Crucial CSS is declared with a strict .slider89 .slider_{sliderPart}
, whereas uncrucial styles are matched with the new class .slider89_{sliderPart}
. This ensures a good stylability of the slider without the user having to nest their selectors to overcome the strict selectors.

{value}

{caption}

{value}

{caption}

.slider89 {
display: inline-block;
}
.slider89 .slider {
position: relative;
font-family: monospace;
font-size: 18px;
font-weight: bold;
padding: 0;
}
.slider89_wrapper {
background-color: hsl(0, 0%, 19%);
height: 25px;
}
.slider89 .slider_knob {
position: absolute;
cursor: pointer;
left: 0;
z-index: 1;
}
.slider89_knob {
height: 25px;
width: 14px;
background-color: hsl(0, 0%, 27%);
}
.slider89 .slider_tooltip {
position: absolute;
display: flex;
align-items: center;
height: 100%;
cursor: default;
opacity: 1;
transition: .2s ease-out;
}
.slider89_tooltip {
color: hsl(0, 0%, 45%);
padding: 1px 3px 0;
}
.slider89 .slider_tooltip.left {
left: 0;
}
.slider89 .slider_tooltip.right {
right: 0;
}
.slider89 .slider_tooltip.hidden {
opacity: 0;
}
.slider89_header {
color: hsl(0, 0%, 70%);
font-family: 'Calibri', serif;
font-size: 20px;
}
.noselect {
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.slider89 {
display: inline-block;
}
.slider89 .slider {
position: relative;
padding: 0;
background-color: hsl(0, 0%, 19%);
font-family: monospace;
font-size: 18px;
font-weight: bold;
height: 25px;
}
.slider89 .slider_knob {
position: absolute;
cursor: pointer;
left: 0;
height: 25px;
width: 14px;
background-color: hsl(0, 0%, 27%);
z-index: 1;
}
.slider89 .slider_tooltip {
position: absolute;
display: flex;
align-items: center;
padding: 1px 3px 0;
color: hsl(0, 0%, 45%);
height: 100%;
cursor: default;
opacity: 1;
transition: .2s ease-out;
}
.slider89 .slider_tooltip.left {
left: 0;
}
.slider89 .slider_tooltip.right {
right: 0;
}
.slider89 .slider_tooltip.hidden {
opacity: 0;
}
.slider89 .slider_header {
color: hsl(0, 0%, 70%);
font-family: 'Calibri', serif;
font-size: 20px;
display: block;
}
.noselect {
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}