Node Server Development¶
Background¶
Node servers in Polyglot are nothing more than stand alone processes that are managed by Polyglot. Polyglot communicates with the node servers by reading the STDOUT and STDERR streams as well as writing to the STDIN stream. STDIN and STDOUT messages are JSON formatted commands that are documented in Polyglot Node Server API.
As of Polyglot 0.0.6 MQTT is available as a communication mechanism as well. See MQTT.
File Structure¶
Node servers are defined in self contained folders. The name given to this folder will be the node server ID and must be unique form all other node servers. New node servers can be stored in Polyglot’s configuration directory in the folder titled node_servers. Inside of this folder, at least the following three files must exist.
- profile.zip is the profile that must be uploaded to the ISY describing the node server. This file is documented in the ISY Node Server API documentation.
- instructions.txt should be a file containing instructions on the use of the node server documented using markdown. The contents of this file will be formatted and displayed on the frontend.
- server.json is the metadata used by Polyglot to identify the node server. This file is documented in the next section.
The rest of the node server’s folder should contain the code required to execute the node server and all necessary libraries with the exception of those explicitly included as part of the Polyglot distribution.
Node servers are executed in special directories in the user’s configuration directory. Each node server type is assigned its own directory. Any required inforation may be written to this directory. Keep in mind, that all running node servers of the same type will share the same directory.
Server Metadata¶
The server.json file in the node server source directory is a JSON formatted file that informs Polyglot of how the node server is executed as well as other important details about the node server. The file contains a dictionary formatted object with specific fields. A sample server.json is included below. It has been extracted from the Philips Hue node server.
{
"name": "Phillips Hue",
"docs": "https://www.universal-devices.com/",
"type": "python",
"executable": "hue.py",
"configfile": "config.yaml",
"interface": "Default",
"description": "Connect Phillips Hue Personal Wireless Lighting system to the ISY994.",
"notice": "\"Hue Personal Wireless Lighting\" is a trademark owned by Koninklijke Philips Electronics N.V., see www.meethue.com for more information. This Node Server is neither developed by nor endorsed by the Philips organization.",
"credits": [
{
"title": "phue: A Python library for Philips Hue",
"author": "Nathanaël Lécaudé (studioimaginaire)",
"version": "0.9",
"date": "May 18, 2015",
"source": "https://github.com/studioimaginaire/phue/tree/c48845992b476f4b1de9549ea5b5277399f56581",
"license": "https://raw.githubusercontent.com/studioimaginaire/phue/c48845992b476f4b1de9549ea5b5277399f56581/LICENSE"
}
]
}
Below is a description of the required fields:
- name is the name of the node server type as it will be displayed to the user.
- docs is a link to an appropriate website about the node server. This value is not currently displayed anywhere.
- type is the node server executable type. This instructs Polyglot as to how the node server should be launched. Currently, only python is accepted.
- executable is the file that Polyglot should execute to start the node server process.
- description is a short description of the node server that will be displayed to the user on the frontend.
- notice contains any important notices the user might need to know.
- credits is a list of dictionaries indicating all third party library used in the node server. Some open source projects require that they be credited some where in the project. Others do not. Either way, it is nice to give credit here. When including a third party library in your node server, ensure that it is licensed for commercial use.
In the credits list:
- title is the title of the third party library.
- author is the author of the third party library.
- version is the appropriate versioning tag used to identify the third party library.
- date is the date the third party library was either released or obtained.
- source is a link to the library’s source code.
- license is a link to the library’s license file. Ensure that this is a static link whose contents cannot be changed. Linking to a specific GitHub commit is handy for this.
It can be a good idea to check the formatting of this file with a JSON linter before attempting to load the node server in Polyglot. If this file cannot be read, for whatever reason, the node server will not appear in the Polyglot frontend and an error will be logged.
Python Development¶
A Python 2.7 compatible implimentation of the API is provided with Polyglot to assist in Node Server development. It may be easily imported as shown below. In the future, more libraries may be made available and more languages may be supported.
from polyglot import nodeserver_api
The provided Node Server Library exposes all of the ISY controller’s Node Server RESTful API as is. Data recieved by Polyglot’s web server is parsed and directed immediately to the node server process via this library. The library will also send messages back up to Polyglot to be transmitted directly to the ISY. The only exception to this rule is that node ID’s will not have the node server ID prefix prepended to them. It will also be expected that the node server will not prepend these prefixes. Polyglot will handle the node ID prefixes on behalf of the node servers.
There also exists, in the Python library, some abstract classes that may be used to ease the development of a new node server. Except in rare cases where it may not be appropriate, it is recomended that these be used.
When Python is used to develop node server, the Polyglot environment is loaded into the Python path. This environment includes the Requests library.
Python Polyglot Library¶
Summary¶
This library consists of four classes and one function to assist with node
server development. The classes polyglot.nodeserver_api.NodeServer
and
polyglot.nodeserver_api.SimpleNodeServer
and basic structures for
creating a node server. The class polyglot.nodeserver_api.Node
is
used as an abstract class to crate custom nodes for node servers. The class
polyglot.nodeserver_api.PolyglotConnector
is a bottom level
implementation of the API used to communicate between Polyglot and your
node server. Finally, included in this library is a method decorator,
polyglot.nodeserver_api.auto_request_report()
, that wraps functions and
methods to automatically handle report requests from the ISY.
Custom Node Types¶
When creating a new node server, each node type that will be controlled by the server must be defined. This abstract class may be used as a skeleton for each node type. When inheriting this class, a new method should be defined for each command that the node can perform. Additionally, the _drivers and _commands attributes should be overwritten to define the drivers and commands relevant to the node.
-
class
polyglot.nodeserver_api.
Node
(parent, address, name, primary=True, manifest=None)[source]¶ Abstract class for representing a node in a node server.
Parameters: - parent (polyglot.nodeserver_api.NodeServer) – The node server that controls the node
- address (str) – The address of the node in the ISY without the node server ID prefix
- name (str) – The name of the node
- primary (polyglot.nodeserver_api.Node or True if this node is the primary.) – The primary node for the device this node belongs to, or True if it’s the primary.
- manifest (dict or None) – The node manifest saved by the node server
-
_drivers
= {}¶ The drivers controlled by this node. This is a dictionary of lists. The key’s are the driver names as defined by the ISY documentation. Each list contains at least three values: the initial value, the UOM identifier, and a function that will properly format the value before assignment. The fourth value is optional – if provided, and set to “False”, the driver’s value will not be recorded in the manifest (this is useful to reduce I/O when there is no benefit to restoring the driver’s value on restart).
Insteon Dimmer Example:
_drivers = { 'ST': [0, 51, int], 'OL': [100, 51, int], 'RR': [0, 32, int] }
Pulse Time Example:
_drivers = { 'ST': [0, 56, int, False], }
-
_commands
= {}¶ A dictionary of the commands that the node can perform. The keys of this dictionary are the names of the command. The values are functions that must be defined in the node object that perform the necessary actions and return a boolean indicating the success or failure of the command.
-
_report_driver_cb
(driver, status_code, **kwargs)[source]¶ Private method - updates ISY syncronization flag based on the success/fail of the status update API call to the ISY.
-
add_node
()[source]¶ Adds node to the ISY
Returns boolean: Indicates success or failure of node addition
-
get_driver
(driver=None)[source]¶ Gets a driver’s value
Parameters: driver (str or None) – The driver to return the value for Returns: The current value of the driver
-
manifest
¶ The node’s manifest entry. Indicates the current value of each of the drivers. This is called by the node server to create the full manifest.
Type: dict
-
node_def_id
= ''¶ The node’s definition ID defined in the node server’s profile
-
query
()[source]¶ Abstractly queries the node. This method should generally be overwritten in development.
Returns boolean: Indicates success or failure of node query
-
report_driver
(driver=None)[source]¶ Reports a driver’s current value to ISY
Parameters: driver (str or None) – The name of the driver to report. If None, all drivers are reported. Returns boolean: Indicates success or failure to report driver value
-
report_isycmd
(isycommand, value=None, uom=None, timeout=None, **kwargs)[source]¶ Sends a single command from the node server to the ISY, optionally passing in a value.
No formatting, and little validation, of the isy cmd, value, or uom is done by this simple low-level API. It is up to the caller to ensure correctness.
Parameters: - isycommand (str) – Name of the ISY command to send (e.g. ‘DON’)
- value (string, float, int, or None) – (optional) The value to be sent for the command
- uom (int or None) – (optional) - The value’s unit of measurement. If provided, overrides the uom defined for this command
- timeout (int or None) – (optional) - the number of seconds before this command expires and is discarded
Returns boolean: Indicates success or failure to queue for sending (Note: does NOT indicate if actually delivered)
-
run_cmd
(command, **kwargs)[source]¶ Runs one of the node’s commands.
Parameters: - command (str) – The name of the command
- kwargs (dict) – The parameters specified by the ISY in the incoming request. See the ISY Node Server documentation for more information.
Returns boolean: Indicates success or failure of command
-
set_driver
(driver, value, uom=None, report=True)[source]¶ Updates the value of one of the node’s drivers. This will pass the given value through the driver’s formatter before assignment.
Parameters: - driver (str) – The name of the driver
- value – The new value for the driver
- uom (int or None) – The given values unit of measurement. This should correspond to the UOM IDs used by the ISY. Refer to the ISY documentation for more information.
- report (boolean) – Indicates if the value change should be reported to the ISY. If False, the value is changed silently.
Returns boolean: Indicates success or failure to set new value
Polyglot API Implimentation¶
This class impliments the Polyglot API and calls registered functions when the API is invoked. This class is a singleton and will not allow itself to be initiated more than once. This class binds itself to the STDIN stream to accept commands from Polyglot.
To create a connection in your node server to Polyglot, use something similar to the following. This creates the connection, connect to Polyglot, and then waits for the Node Server’s configuration to be received. The configuration will be the first command received from Polyglot and will never be sent again after the first transmission.:
poly = PolyglotConnector()
poly.connect()
poly.wait_for_config()
Then, commands can be sent upstream to Polyglot or to the ISY by using the connector’s methods.:
poly.send_error('This is an error message. It will be in Polyglot\'s log.')
poly.add_node('node_id_1', 'NODE_DEFINITION', 'node_id_0', 'New Node')
poly.report_status('node_id_1', 'ST', value=55, uom=51)
poly.remove_node('node_id_1')
To respond to commands received from Polyglot and the ISY, handlers must be registered for events. The handlers arguments will be the parameters specified in the API for that event. This will look something like the following.:
def status_handler(node_address, request_id=None):
print('Status Event Handler Called')
poly.listen('status', status_handler)
Now, when the ISY requests a status update from Polyglot, this function will be called. Handlers will not be called in the node server’s main thread.
-
class
polyglot.nodeserver_api.
PolyglotConnector
[source]¶ Polyglot API implementation. Connects to Polyglot and handles node server IO.
Raises: RuntimeError -
add_node
(node_address, node_def_id, primary, name, timeout=None, seq=None)[source]¶ Adds a node to the ISY. To make this node the primary, set primary to the same value as node_address.
Parameters: - node_address (str) – The full address of the node (e.g. ‘dimmer_1’)
- node_def_id (str) – The id of the node definition to use for this node
- primary (str) – The primary node for the device this node belongs to
- name (str) – The name of the node
- timeout (str, float, or int) – (optional) timeout (seconds) for REST call to ISY
- seq (str or int) – (optional) set to unique id if result callback desired
-
change_node
(node_address, node_def_id, timeout=None, seq=None)[source]¶ Changes the node definition to use for an existing node. An example of this is may be to change a thermostat node from Fahrenheit to Celsius.
Parameters: - node_address (str) – The full address of the node (e.g. ‘dimmer_1’)
- node_def_id (str) – The id of the node definition to use for this node
- timeout (str, float, or int) – (optional) timeout (seconds) for REST call to ISY
- seq (str or int) – (optional) set to unique id if result callback desired
-
commands
= ['config', 'install', 'query', 'status', 'add_all', 'added', 'removed', 'renamed', 'enabled', 'disabled', 'cmd', 'ping', 'exit', 'params', 'result', 'statistics']¶ Commands that may be invoked by Polyglot
-
connected
¶ Indicates if the object is connected to Polyglot. Can be set to control connection with Polyglot.
Type: boolean
-
get_params
(**kwargs)[source]¶ Get the params from nodeserver and makes them available to the nodeserver api
-
install
(*args, **kwargs)[source]¶ Abstract method to install the node server in the ISY. This has not been implemented yet and running it will raise an error.
Raises: NotImplementedError
-
listen
(event, handler)[source]¶ Register an event handler. Returns True on success. Event names are defined in commands. Handlers must be callable.
Parameters: - event (str) – Then event name to listen for.
- handler (callable) – The callable event handler.
-
logger
= None¶ logger is initialized after the node server wait_for_config completes by the setup_log method and the log file is located in the node servers sandbox. Once wait_for_config is complete, you can call poly.logger.info(‘This variable is set to %s’, variable)
-
pong
(*args, **kwargs)[source]¶ Sends pong reply to Polyglot’s ping request. This verifies that the communication between the Node Server and Polyglot is functioning.
-
remove_node
(node_address, timeout=None, seq=None)[source]¶ Removes a node from the ISY. A node cannot be removed if it is the primary node for at least one other node.
Parameters: - node_address (str) – The full address of the node (e.g. ‘dimmer_1’)
- timeout (str, float, or int) – (optional) timeout (seconds) for REST call to ISY
- seq (str or int) – (optional) set to unique id if result callback desired
-
report_command
(node_address, command, value=None, uom=None, timeout=None, seq=None, **kwargs)[source]¶ Sends a command to the ISY that may be used in programs and/or scenes. A common use of this is a physical switch that somebody turns on or off. Each time the switch is used, a command should be reported to the ISY. These are used for scenes and control conditions in ISY programs.
Parameters: - node_address (str) – The full address of the node (e.g. ‘switch_1)
- command (str) – The command to perform (e.g. ‘DON’, ‘CLISPH’, etc.)
- value (str, int, or float) – Optional unnamed value the command used
- uom (int or str) – Optional units of measurement of value
- timeout (str, float, or int) – (optional) timeout (seconds) for REST call to ISY
- seq (str or int) – (optional) set to unique id if result callback desired
- <pN>.<uomN> (optional) – Nth Parameter name (e.g. ‘level’) . Unit of measure of the Nth parameter (e.g. ‘seconds’, ‘uom58’)
-
report_request_status
(request_id, success, timeout=None, seq=None)[source]¶ When the ISY sends a request to the node server, the request may contain a ‘requestId’ field. This indicates to the node server that when the request is completed, it must send a fail or success report for that request. This allows the ISY to in effect, have the node server synchronously perform tasks. This message must be sent after all other messages related to the task have been sent.
For example, if the ISY sends a request to query a node, all the results of the query must be sent to the ISY before a fail/success report is sent.
Parameters: - request_id (str) – The request ID the ISY supplied on a request to the node server.
- success (bool) – Indicates if the request was sucessful
- timeout (str, float, or int) – (optional) timeout (seconds) for REST call to ISY
- seq (str or int) – (optional) set to unique id if result callback desired
-
report_status
(node_address, driver_control, value, uom, timeout=None, seq=None)[source]¶ Updates the ISY with the current value of a driver control (e.g. the current temperature, light level, etc.)
Parameters: - node_address (str) – The full address of the node (e.g. ‘dimmer_1’)
- driver_control (str) – The name of the status value (e.g. ‘ST’, ‘CLIHUM’, etc.)
- value (str, float, or int) – The numeric status value (e.g. ‘80.5’)
- uom (int or str) – Unit of measure of the status value
- timeout (str, float, or int) – (optional) timeout (seconds) for REST call to ISY
- seq (str or int) – (optional) set to unique id if result callback desired
-
request_stats
(*args, **kwargs)[source]¶ Sends a command to Polyglot to request a statistics message.
-
restcall
(api, timeout=None, seq=None)[source]¶ Calls a RESTful api on the ISY. The api is the portion of the url after the “https://isy/rest/” prefix.
Parameters: - api (str) – The url for the api to call
- timeout (str, float, or int) – (optional) timeout (seconds) for REST call to ISY
- seq (str or int) – (optional) set to unique id if result callback desired
-
send_config
(config_data)[source]¶ Update the configuration in Polyglot.
Parameters: config_data (dict) – Dictionary of updated configuration Raises: ValueError
-
send_error
(err_str)[source]¶ Enqueue an error to be sent back to Polyglot.
Parameters: err_str (str) – Error text to be sent to Polyglot log
-
smsg
(str)[source]¶ Logs/sends a diagnostic/debug, informative, or error message. Individual node servers can override this method if they desire to redirect or filter these messages.
-
uptime
¶ The number of sections the connection with Polyglot has been alive
Type: float
-
write_nodeserver_config
(default_flow_style=False, indent=4)[source]¶ Writes any changes to the nodeserver custom configuration file. self.nodeserver_config should be a dictionary. Refrain from calling this in a poll of any kind. Typically you won’t even have to write this unless you are storing custom data you want retrieved on the next run. Saved automatically during normal Polyglot shutdown. Returns True for success, False for failure.
Parameters: - default_flow_style (boolean) – YAML’s default flow style formatting. Default False
- indent (int) – Override the default indent spaces for YAML. Default 4
-
Node Server Classes¶
-
class
polyglot.nodeserver_api.
NodeServer
(poly, shortpoll=1, longpoll=30)[source]¶ It is generally desireable to not be required to bind to each event. For this reason, the NodeServer abstract class is available. This class should be abstracted. It binds appropriate handlers to the API events and contains a suitable run loop. It should serve as a basic structure for any node server.
Parameters: - poly (polyglot.nodeserver_api.PolyglotConnector) – The connected Polyglot connection
- optional shortpoll (int) – The seconds between poll events
- optional longpoll (int) – The second between longpoll events
-
add_node
(node_address, node_def_id, node_primary_addr, node_name, callback=None, timeout=None, **kwargs)[source]¶ Add this node to the polyglot
Returns bool: True on success
-
on_add_all
(request_id=None)[source]¶ Received add all command from ISY
Parameters: optional request_id (str) – Status request id Returns bool: True on success
-
on_added
(node_address, node_def_id, primary_node_address, name)[source]¶ Received node added report from ISY
Parameters: - node_address (str) – The address of the node to act on
- node_def_id (str) – The node definition id
- primary_node_address (str) – The node server’s primary node address
- name (str) – The node’s friendly name
- optional request_id (str) – Status request id
Returns bool: True on success
-
on_cmd
(node_address, command, value=None, uom=None, request_id=None, **kwargs)[source]¶ Received run command from ISY
Parameters: - node_address (str) – The address of the node to act on
- command (str) – The command to run
- value (optional) – The value of the command’s unnamed parameter
- uom (optional) – The units of measurement for the unnamed parameter
- optional request_id (str) – Status request id
- <pN>.<uomN> (optional) – The value of parameter pN with units uomN
Returns bool: True on success
-
on_config
(**data)[source]¶ Received configuration data from Polyglot
Parameters: data (dict) – Configuration data Returns bool: True on success
-
on_disabled
(node_address)[source]¶ Received node disabled report from ISY
Parameters: node_address (str) – The address of the node to act on Returns bool: True on success
-
on_enabled
(node_address)[source]¶ Received node enabled report from ISY
Parameters: node_address (str) – The address of the node to act on Returns bool: True on success
-
on_exit
(*args, **kwargs)[source]¶ Polyglot has triggered a clean shutdown. Generally, this method does not need to be orwritten.
Returns bool: True on success
-
on_install
(profile_number)[source]¶ Received install command from ISY
Parameters: profile_number (int) – Noder Server’s profile number Returns bool: True on success
-
on_query
(node_address, request_id=None)[source]¶ Received query command from ISY
Parameters: - node_address (str) – The address of the node to act on
- optional request_id (str) – Status request id
Returns bool: True on success
-
on_removed
(node_address)[source]¶ Received node removed report from ISY
Parameters: node_address (str) – The address of the node to act on Returns bool: True on success
-
on_renamed
(node_address, name)[source]¶ Received node renamed report from ISY
Parameters: - node_address (str) – The address of the node to act on
- name (str) – The node’s friendly name
Returns bool: True on success
-
on_result
(seq, status_code, elapsed, text, retries, **kwargs)[source]¶ Handles a result message, which contains the result from a REST API call to the ISY. The result message is uniquely identified by the seq id, and will always contain at least the numeric status.
-
on_statistics
(**kwargs)[source]¶ Handles a statistics message, which contains various statistics on the operation of the Polyglot server and the network communications.
-
on_status
(node_address, request_id=None)[source]¶ Received status command from ISY
Parameters: - node_address (str) – The address of the node to act on
- optional request_id (str) – Status request id
Returns bool: True on success
-
poly
= None¶ The Polyglot Connection
Type: polyglot.nodeserver_api.PolyglotConnector
-
register_result_cb
(func, **kwargs)[source]¶ Registers a callback function to handle a result. Returns the unique sequence ID to be passed to the function whose result is to be handled by the registered callback.
-
report_status
(node_address, driver_control, value, uom, callback=None, timeout=None, **kwargs)[source]¶ Report a node status to the ISY
Returns bool: True on success
-
restcall
(api, callback=None, timeout=None, **kwargs)[source]¶ Sends an asynchronous REST API call to the ISY. Returns the unique seq id (that can be used to match up the result later on after the REST call completes).
-
run
()[source]¶ Run the Node Server. Exit when triggered. Generally, this method should not be overwritten.
-
setup
()[source]¶ Setup the node server. All node servers must override this method and call it thru super. Currently it only sets up the reference for the logger.
-
class
polyglot.nodeserver_api.
SimpleNodeServer
(poly, shortpoll=1, longpoll=30)[source]¶ Simple Node Server with basic functionality built-in. This class inherits from
polyglot.nodeserver_api.NodeServer
and is the best starting point when developing a new node server. This class implements the idea of manifests which are dictionaries that contain the relevant information about all of the nodes. The manifest gets sent to Polyglot to be saved as part of the configuration. This allows the node server to automatically recall its last known values when it is restarted.-
add_node
(*args, **kwargs)[source]¶ Add node to the Polyglot and the nodes dictionary.
Parameters: node (polyglot.nodeserver_api.Node) – The node to add Returns boolean: Indicates success or failure of node addition
-
exist_node
(address)[source]¶ Check if a node exists by its address.
Parameters: address (str) – The node address Returns bool: True if the node exists
-
get_node
(address)[source]¶ Get a node by its address.
Parameters: address (str) – The node address Returns polyglot.nodeserver_api.Node: If found, otherwise False
-
nodes
= OrderedDict()¶ Nodes registered with this node server. All nodes are automatically added by the add_node method. The keys are the node IDs while the values are instances of
polyglot.nodeserver_api.Node
. Classes inheriting can access this directly, but the prefered method is by using get_node or exist_node methods.
-
on_add_all
(*args, **kwargs)[source]¶ Adds all nodes to the ISY. Also sends requests reponses when necessary.
Parameters: optional request_id (str) – Status request id Returns bool: True on success
-
on_added
(node_address, node_def_id, primary_node_address, name)[source]¶ Internally indicates that the specified node has been added to the ISY.
Parameters: - node_address (str) – The address of the node to act on
- node_def_id (str) – The node definition id
- primary_node_address (str) – The node server’s primary node address
- name (str) – The node’s friendly name
- optional request_id (str) – Status request id
Returns bool: True on success
-
on_cmd
(*args, **kwargs)[source]¶ Runs the specified command on the specified node. Also sends requests reponses when necessary.
Parameters: - node_address (str) – The address of the node to act on
- command (str) – The command to run
- value (optional) – The value of the command’s unnamed parameter
- uom (optional) – The units of measurement for the unnamed parameter
- optional request_id (str) – Status request id
- <pN>.<uomN> (optional) – The value of parameter pN with units uomN
Returns bool: True on success
-
on_disabled
(node_address)[source]¶ Received node disabled report from ISY
Parameters: node_address (str) – The address of the node to act on Returns bool: True on success
-
on_enabled
(node_address)[source]¶ Received node enabled report from ISY
Parameters: node_address (str) – The address of the node to act on Returns bool: True on success
-
on_exit
(*args, **kwargs)[source]¶ Triggers a clean shut down of the node server by saving the manifest, clearing the IO, and stopping.
Returns bool: True on success
-
on_query
(*args, **kwargs)[source]¶ Queries each node and reports all control values to the ISY. Also responds to report requests if necessary.
Parameters: - node_address (str) – The address of the node to act on
- optional request_id (str) – Status request id
Returns bool: True on success
-
on_removed
(node_address)[source]¶ Internally indicates that a node has been removed from the ISY.
Parameters: node_address (str) – The address of the node to act on Returns bool: True on success
-
on_renamed
(node_address, name)[source]¶ Changes the node name internally to match the ISY.
Parameters: - node_address (str) – The address of the node to act on
- name (str) – The node’s friendly name
Returns bool: True on success
-
on_status
(*args, **kwargs)[source]¶ Reports the requested node’s control values to the ISY without forcing a query. Also sends requests reponses when necessary.
Parameters: - node_address (str) – The address of the node to act on
- optional request_id (str) – Status request id
Returns bool: True on success
-
Helper Functions¶
-
polyglot.nodeserver_api.
auto_request_report
(fun)[source]¶ Python decorator to automate request reporting. Decorated functions must return a boolean value indicating their success or failure. It the argument request_id is passed to the decorated function, a response will be sent to the ISY. This decorator is implemented in the SimpleNodeServer.
MQTT¶
MQTT communication mechanism has been developed for communications between Polyglot and the nodeservers. This becomes useful so that you can connected many different nodes to your nodeserver without having the distributed code running directly on the same platform Polyglot resides on. For example, I have a system of nodes that all communicates over MQTT to keep updated, and I don’t want to wrap that entire system into Polyglot. I can develop a simple nodeserver that runs and listens to your existing MQTT to allow communications without having to completely redevelop the system as a polyglot nodeserver. This lays the framework of allowing for completly distributed nodeservers.
Usage¶
To use the MQTT Subsystem for communications you must include the following into your server.json of your nodeserver:
"interface": "mqtt",
"mqtt_server": "<IP_ADDRESS>",
"mqtt_port": "1883",
When Polyglot reads the server.json file and see’s the MQTT interface command it enables the MQTT subsystem for that particular nodeserver. It then sends these params along with the normal params and config to the nodeserver over STDIN, which allows for dynamic passing of the mqtt_server and mqtt_port information to the nodeserver. This is done to avoid having to set the connection information on both server.json AND your nodeserver. If the “interface” setting is missing or anything other than “mqtt” case insensitive, then the standard STDIN/STDOUT mechansims will be used, regardless of if mqtt_server and mqtt_port are provided.
When the Polyglot nodeserver manager enables the MQTT interface, it automatically connects to the MQTT broker and subscribes to the topic:
udi/polyglot/<nodeserver name>/poly
This topic is where your nodeserver will publish any commands destined for Polyglot for example the pong keepalive messages. These messages are formatted in JSON exactly like the exisiting STDOUT messages.
When creating a nodeserver that uses MQTT, you should listen on both STDIN and MQTT and respond based on which mechanism was used. MQTT is a network resource, therefore inherently it is possible to have network disruption or connection issues. When using MQTT in your nodeserver you will subscribe to the topic:
udi/polyglot/<nodeserver name>/node
There is a retianed message that you will get upon subscription to the topic above reflecting the current connection state of the Polyglot side. The json messages are listed below.:
{"connected": {}}
or
{"disconnected": {}}
This state is how you should respond to Polyglot. Using STDOUT if disconnected or MQTT if connected. A “Last Will and Testament” message is configured on the Polyglot side to always make sure the state is accurate even on catastrophic failure. The nodeserver should be configured with this same feature. An example is provided in the Node Server example section of the documentation.


{% extends "base.html" %} {% load widget_tweaks %} {% load i18n %} {% block title %}{% trans "Indicator Performance Tracking Table" %} | {% endblock %} {% block page_title %}{% trans "Indicator Performance Tracking Table" %}{% endblock %} {% block content %}
{% trans "View results organized by target period for indicators that share the same target frequency." %}
{% trans "View the most recent two months of results. (You can customize your time periods.) This report does not include periodic targets." %}


Manhttan currently has 49858 street trees. Imagine you could also plant trees on buildings... currently there are 0 building trees.
Planting trees on buildings with this app is a breeze! Just hover over the buildings... when you are closer than 500m to the building you can plant 20 trees at a time! Further away you only get 5 trees planted. Let's get started!


Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the scrambled it to make a type specimen book.
It has survived not only five centuries, but also the leap into electronic typesetting,
remaining essentially unchanged. It was 1960s with the release of Letraset sheets containing .loremIpsumClass
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since.
It has survived not only five centuries, but also the leap into electronic typesetting,
remaining essentially
unchanged. .loremIpsumClass, and more recently with
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since.
It has survived not only five centuries, typesetting, remaining essentially unchanged. the release of Letraset sheets containing loremIpsumClass, and more recently with
- But I must explain
- To you how all this mistaken
- Idea of denouncing pleasure
- Great explorer of the truth
-
To take a trivial example
- Or one who avoids a pain
- Indignation and dislike men
- Nor again is there anyone
- But who has any right
- That they cannot foresee
- Who avoids a pain that produceg
- Consequences that are extremely
- But I must explain
- To you how all this mistaken
- Idea of denouncing pleasure
- Great explorer of the truth
-
To take a trivial example
- Or one who avoids a pain
- Indignation and dislike men
- Nor again is there anyone
- But who has any right
- That they cannot foresee
- Who avoids a pain that produceg
- Consequences that are extremely
- But I must explain
- To you how all this mistaken
- Idea of denouncing pleasure
- Great explorer of the truth
-
To take a trivial example
- Or one who avoids a pain
- Indignation and dislike men
- Nor again is there anyone
- But who has any right
- That they cannot foresee
- Who avoids a pain that produceg
- Consequences that are extremely
- Description lists
- A description list is perfect for defining terms.
- Euismod
- Vestibulum id ligula porta felis euismod semper eget lacinia odio sem nec elit.
- Donec id elit non mi porta gravida at eget metus.
- Malesuada porta
- Etiam porta sem malesuada magna mollis euismod.
- Felis euismod semper eget lacinia
- Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.
A wonderful serenity has taken
I am alone, and feel the charm of existence in this spot, which was created for the bliss of souls like mine.
Why painful the sixteen how minuter
I throw myself down among the tall grass by the trickling stream; and, as I lie close to the earth, a thousand unknown plants are noticed
Barton waited twenty always repair
I never was a greater artist than now. When, while the lovely valley teems with vapour around me, and the meridian sun


 ANY DATE/TIME CHANGES WILL BE IMMEDIATELY AND APPROPRIATELY POSTED
Notice of Available ADA Accommodations for Public Meetings: With advance notice of seven calendar days, the City of Detroit will provide interpreter services at public meetings, including language translation and reasonable ADA accommodations. Please contact the Civil Rights, Inclusion and Opportunity Department at<PHONE_NUMBER>, through the TTY number 7771, or email<EMAIL_ADDRESS>to schedule these services.


Angular 2 is not here. It will take pretty long time until we'll start using it. But, as you probably heard, the changes are HUGE.
This is a good enough reason to start preparing for Angular 2 today (otherwise the migration path will be paintfull).
Another important point: a lot of new projects do not use Angular because of the fear of the new Angular 2 (or, "why should I start a new project using Angular 1.x when soon I'll have to go through a paintfull migration path?")
So, what do we need to do today in order to make the migration to Angular 2 easier? I summed it up to three steps, from the most important and complicated to the easiest:
- Use Component based Architecture
- Write Angular 1.x using ES6/Typescript
- Use the "new router"
In this post (part 1) I will be focusing on the first bullet, "Use Component based Architecture".
Using Component based Architecture
This is the most important part, and the hardest one. Angular 2.x, similar to React, is based on components. It uses component structure hierarchy. Angular 1.x does not work that way. The easiest way to understand this is through an example. I will use the phonecat demo as an example. Take a look at this code:

Search: <input ng-model="query">
Sort by:
<select ng-model="orderProp">
<option value="name">Alphabetical</option>
<option value="age">Newest</option>
</select>

In order to make this code Angular 2.x ready (and more reusable), we will have to:
- Break the html into components.
- Build the components as a hierarchy tree. Something like this:
Step 1 - breaking the code into components
We will want to build several components:
- Application main component (this will be used for the parent component in the hierarchy)
- Search component
- List component
- List item component
- Catalog details component
I will omit the last two components from my example, just in order to keep things simple.
Step 2 - Creating a hierarchy tree
Angular 2.0 uses an approach similar to Facebook React's approach, and this is the tricky part. The main issue here is to correctly pass data/state between components, with minimum usage of scope or controllers (as you probably heard, Angular 2.x does not have scope or controllers...).
Let's call it 'The React way'...
The 'React way'
React.js uses state and props to manage its data. Props are immutable and are passed from parent to child. They are owned by the parent and they cannot be changed by the component. State, on the other hand, is private and mutable (it can be changed by the component). For child-parent communication it uses simple events, in order to invoke methods on the parent.
For more reference see those two awesome tutorials: thinking in react and React's officail tuturial
We will now have a main phonecat-component
which will hold a phonecat-search
and a phonecat-list
child components. Those two child components will get all the data they need from their parent, via attributes.
It should look somehting like this (The complete example can be found in the following plunker):

<phonecat-component phones=phoneCtrl.phones></phonecat-component>

<phonecat-search search="vm.search(searchData)"></phonecat-search>

<phonecat-list phones="vm.phones" filter-data="vm.filterData"></phonecat-list>

As you can see, our body contains only one main component phonecat-component
. Its directive is:
'use strict';
angular.module('phonecatApp')
.directive('phonecatComponent', phonecatComponent);
function phonecatComponent() {
return {
scope: {},
bindToController: {
phones: "="
},
link: function(scope, elm, attrs, ctrl) {
ctrl.filterData = {
text: '',
orderBy: 'name'
}; //default search filter
ctrl.search = function(searchData) {
ctrl.filterData = searchData;
scope.$apply();
}
},
controller: function() {},
controllerAs: 'vm',
templateUrl: 'partials/phonecatComponent.tpl.html'
};
}
There are several points to stop and discuss here:
phonecat-list
child componenet receives its data using 'phones' and 'filter-data' attributes.- 'Search' method is used to receive events from child 'phonecat-search' component.
- We use 'bindToController' to pass 'phones', via attribute, to the
phonecat-component
. This feature was introduced in Angular 1.4, but no worry, you can acheive the same results with older Angular versions as well (see snippet below for more details). I will use this technique with other components, as well.
For more information about
bindToController
you can read this great post. TL;DR: you can replace this with regular isolated scope, if you want to use older Angular versions.
Now, let's take a look at phonecat-search
component's directive:
'use strict';
angular.module('phonecatApp')
.directive('phonecatSearch', phonecatSearch);
function phonecatSearch() {
return {
scope: {},
bindToController: {
search: "&"
},
controller: function() {},
controllerAs: 'vm',
link: function(scope, elm, attrs, ctrl) {
var inputText = elm.find('input')[0];
var selectedFilter = elm.find('select')[0];
elm.bind('keyup change', function() {
var searchData = {
text: inputText.value,
orderBy: selectedFilter[selectedFilter.selectedIndex].value
};
ctrl.search({
searchData: searchData
});
});
},
templateUrl: 'partials/phonecatSearch.tpl.html'
};
}
The interesting point here is that instead of using ng-model
, I am using a search
method (with search: "&"
), in order to communicate search events to the parent component.
And for phonecat-list
component's directive:
'use strict';
angular.module('phonecatApp')
.directive('phonecatList', phonecatList);
function phonecatList() {
return {
scope: {},
bindToController: {
phones: "=",
filterData: "="
},
controller: function() {},
controllerAs: 'vm',
templateUrl: 'partials/phonecatList.tpl.html'
};
}
As you can see, same pattern applies here: data passed to child component using attributes, phones
and filterData
.
To sum it up - we are now much closer to Angular 2's component structure, as seen here. You can see the whole thing in action in this plunker.
Stay tuned to the other two parts:
- Write Angular 1.x in ES6/Typescript
- Use the "new router"


Basic star-rating demo
Rating with details
Rating with custom color
Editable star-rating
Template loading


Before Change
self._embedding_stddev = layers.Dense(
self._embedding_dimension, in_layers=prev_layer, name="embedding_std")
prev_layer = layers.CombineMeanStd(
[self._embedding_mean, self._embedding_stddev], training_only=True)
return prev_layer
def _create_decoder(self, n_layers, dropout):
After Change
def _create_encoder(self, n_layers, dropout):
Create the encoder as a tf.keras.Model.
input = self._create_features()
gather_indices = Input(shape=(2,), dtype=tf.int32)
prev_layer = input
for i in range(len(self._filter_sizes)):
filter_size = self._filter_sizes[i]
kernel_size = self._kernel_sizes[i]
if dropout > 0.0:
prev_layer = Dropout(rate=dropout)(prev_layer)
prev_layer = Conv1D(
filters=filter_size, kernel_size=kernel_size,
activation=tf.nn.relu)(prev_layer)
prev_layer = Flatten()(prev_layer)
prev_layer = Dense(
self._decoder_dimension, activation=tf.nn.relu)(prev_layer)
prev_layer = BatchNormalization()(prev_layer)


This text will hide on clicking hide button
Note: This is a demo of how call back function is called. Upon clicking hide button, the text will hide and alert will be displayed
Shweta, Diana, J'Sonya, Marcus, Erin are the authors of this website!


|
|
||
|---|---|---|
Almost there!We've received a request to register your email address for a Health Gateway account. To activate your account, please verify your email by clicking the link: Health Gateway Account VerificationThis email verification link will expire in ${ExpiryHours} hours. |


MSDynamicsDrawerViewController Class Reference
| Inherits from | UIViewController |
| Declared in | MSDynamicsDrawerViewController.h MSDynamicsDrawerViewController.m |
Overview
MSDynamicsDrawerViewController
is a container view controller that manages the presentation of a single “pane” view controller overlaid over one or two “drawer” view controllers. The drawer view controllers are hidden by default, but can be exposed by a user-initiaed swipe in the direction that that drawer view controller is set in.
Tasks
Managing the Child View Controllers
-
paneViewController
The pane view controller is the primary view controller, displayed centered and covering the drawer view controllers.
property -
– setPaneViewController:animated:completion:
Sets the
paneViewController
with an animated transition. -
– setDrawerViewController:forDirection:
Sets the view controller to be revealed as a drawer in the specified direction underneath the pane view controller.
-
– drawerViewControllerForDirection:
Returns the drawer view controller that has been set for the specified direction.
-
paneViewSlideOffAnimationEnabled
If setting a new
propertypaneViewController
should have an animation that slides off the old view controller before animating the new one into its place. -
shouldAlignStatusBarToPaneView
If the status bar should align with the pane view as the pane view frame is adjusted by both the user gestures and the internal dynamic animator.
property
Accessing & Modifying State
-
paneState
The state of the pane view as defined in a
propertyMSDynamicsDrawerPaneState
. -
– setPaneState:inDirection:
The state of the pane view as defined in a
MSDynamicsDrawerPaneState
. -
– setPaneState:animated:allowUserInterruption:completion:
Sets the state of the pane view as defined in a
MSDynamicsDrawerPaneState
. -
– setPaneState:inDirection:animated:allowUserInterruption:completion:
Sets the state of the pane view as defined in a
MSDynamicsDrawerPaneState
. -
– bouncePaneOpen
Bounces the
paneView
open to reveal thedrawerView
underneath. -
– bouncePaneOpenInDirection:
Bounces the
paneView
open in the specified direction, revealing thedrawerView
underneath. -
possibleDrawerDirection
The directions that the
propertypaneView
can be opened in.
Configuring Dynamics Behaviors
-
gravityMagnitude
The magnitude of the gravity vector that affects the pane view.
property -
elasticity
The elasticity applied to the pane view.
property -
bounceElasticity
The amount of elasticity applied to the pane view when it is bounced open.
property -
bounceMagnitude
The magnitude of the push vector that is applied to the pane view when bouncePaneOpen is called.
property
Configuring Gestures
-
– setPaneDragRevealEnabled:forDirection:
Sets if a user-initiated pan gesture on the
paneView
can move the pane in the specified direction. -
– paneDragRevealEnabledForDirection:
Returns if a user-initiated pan gesture on the
paneView
can move the pane in the specified direction. -
– setPaneTapToCloseEnabled:forDirection:
Sets if a user-initiated tap gesture on the
paneView
can close it while it is opened. -
– paneTapToCloseEnabledForDirection:
Returns if a user-initiated tap gesture on the
paneView
can close it while it is opened. -
– registerTouchForwardingClass:
Attempts to register a
UIView
subclass that the pane view should forward dragging through.
Configuring Stylers
-
– addStyler:forDirection:
Adds a styler (a class that conforms to the
MSDynamicsDrawerStyler
protocol). -
– removeStyler:forDirection:
Removes a styler (a class that conforms to the
MSDynamicsDrawerStyler
protocol). -
– addStylersFromArray:forDirection:
Adds an array of stylers (classes that conform to the
MSDynamicsDrawerStyler
protocol). -
– stylersForDirection:
Returns an array of the stylers that are set in a specified direction
Configuring Reveal Width
-
– setRevealWidth:forDirection:
Sets the width that the
paneView
opens when revealing thedrawerView
underneath for the specified direction. -
– revealWidthForDirection:
Returns the reveal width that the
paneView
opens when revealing thedrawerView
for the specified direction
Container Views
-
drawerView
The drawer view contains the currently visible drawer view controller’s view.
property -
paneView
The pane view contains the pane view controller’s view.
property
Properties
bounceElasticity
The amount of elasticity applied to the pane view when it is bounced open.
@property (nonatomic, assign) CGFloat bounceElasticity
Discussion
Applies when the pane is bounced open. Default value of 0.5
. Valid range is from 0.0
for no bounce upon collision, to 1.0
for completely elastic collisions.
Declared In
MSDynamicsDrawerViewController.h
bounceMagnitude
The magnitude of the push vector that is applied to the pane view when bouncePaneOpen is called.
@property (nonatomic, assign) CGFloat bounceMagnitude
Discussion
Applies when the pane is bounced open. Default of 60.0. A magnitude value of 1.0 represents an acceleration of 1000 points / second².
Declared In
MSDynamicsDrawerViewController.h
drawerView
The drawer view contains the currently visible drawer view controller’s view.
@property (nonatomic, readonly) UIView *drawerView
Discussion
The drawerView
is always presented underneath the paneView
. The frame of the drawerView
never moves, and it is not affected by dynamics.
Declared In
MSDynamicsDrawerViewController.h
elasticity
The elasticity applied to the pane view.
@property (nonatomic, assign) CGFloat elasticity
Discussion
Default value of 0.0
. Valid range is from 0.0
for no bounce upon collision, to 1.0
for completely elastic collisions.
Declared In
MSDynamicsDrawerViewController.h
gravityMagnitude
The magnitude of the gravity vector that affects the pane view.
@property (nonatomic, assign) CGFloat gravityMagnitude
Discussion
Default value of 2.0
. A magnitude value of 1.0
represents an acceleration of 1000 points / second².
Declared In
MSDynamicsDrawerViewController.h
paneState
The state of the pane view as defined in a MSDynamicsDrawerPaneState
.
@property (nonatomic, assign) MSDynamicsDrawerPaneState paneState
Discussion
The possible states are MSDynamicsDrawerPaneStateClosed
, where the drawerView
is entirely hidden by the paneView
, MSDynamicsDrawerPaneStateOpen
, wherein the drawerView
is revealed to the reveal width for the specified direction, and MSDynamicsDrawerPaneStateOpenWide
where the drawerView
in revealed by the paneView
in its entirety such that the paneView
is opened past the edge of the screen. If there is more than one drawer view controller set, use setPaneState:inDirection:
instead and specify a direction.
See Also
Declared In
MSDynamicsDrawerViewController.h
paneView
The pane view contains the pane view controller’s view.
@property (nonatomic, readonly) UIView *paneView
Discussion
The user can slide the paneView
in any of the directions defined in possibleDrawerDirection
to reveal the drawer view controller underneath. The frame of the paneView
is frequently updated by internal dynamics and user gestures.
Declared In
MSDynamicsDrawerViewController.h
paneViewController
The pane view controller is the primary view controller, displayed centered and covering the drawer view controllers.
@property (nonatomic, strong) UIViewController *paneViewController
Declared In
MSDynamicsDrawerViewController.h
paneViewSlideOffAnimationEnabled
If setting a new paneViewController
should have an animation that slides off the old view controller before animating the new one into its place.
@property (nonatomic, assign) BOOL paneViewSlideOffAnimationEnabled
Discussion
This animation only occurs when the method setPaneViewController:animated:completion:
is invoked with an animated
parameter of YES
.
Declared In
MSDynamicsDrawerViewController.h
possibleDrawerDirection
The directions that the paneView
can be opened in.
@property (nonatomic, assign, readonly) MSDynamicsDrawerDirection possibleDrawerDirection
Discussion
Corresponds to the directions that there are drawer view controllers set for. If more than one drawer view controller is set, this will be a bitmask of the directions that the drawer view controllers are set in.
Declared In
MSDynamicsDrawerViewController.h
Instance Methods
addStyler:forDirection:
Adds a styler (a class that conforms to the MSDynamicsDrawerStyler
protocol).
- (void)addStyler:(id<MSDynamicsDrawerStyler>)styler forDirection:(MSDynamicsDrawerDirection)direction
Parameters
- styler
The styler that should be added.
- direction
The direction that the styler apply to. Accepts masked direction values.
Declared In
MSDynamicsDrawerViewController.h
addStylersFromArray:forDirection:
Adds an array of stylers (classes that conform to the MSDynamicsDrawerStyler
protocol).
- (void)addStylersFromArray:(NSArray *)stylers forDirection:(MSDynamicsDrawerDirection)direction
Parameters
- stylers
The array of stylers that should be added.
- direction
The direction that the stylers apply to. Accepts masked direction values.
Declared In
MSDynamicsDrawerViewController.h
bouncePaneOpen
Bounces the paneView
open to reveal the drawerView
underneath.
- (void)bouncePaneOpen
Discussion
If there is more than one drawer view controller set, use bouncePaneOpenInDirection:
. When invoked, bounceElasticity
and bounceMagnitude
are used as the dynamics values for the paneView
.
Declared In
MSDynamicsDrawerViewController.h
bouncePaneOpenInDirection:
Bounces the paneView
open in the specified direction, revealing the drawerView
underneath.
- (void)bouncePaneOpenInDirection:(MSDynamicsDrawerDirection)direction
Parameters
- direction
The direction that the
paneView
will be bounced open in. ?
Discussion
If there is only one drawer view controller, use bouncePaneOpen
instead. When invoked, bounceElasticity
and bounceMagnitude
are used as the dynamics values for the paneView
.
Declared In
MSDynamicsDrawerViewController.h
drawerViewControllerForDirection:
Returns the drawer view controller that has been set for the specified direction.
- (UIViewController *)drawerViewControllerForDirection:(MSDynamicsDrawerDirection)direction
Parameters
- direction
The direction that the drawer view controller should be revealed. Must not be masked.
Return Value
The drawer view controller that has been set for the specified direction. If not yet set, nil
.
Declared In
MSDynamicsDrawerViewController.h
paneDragRevealEnabledForDirection:
Returns if a user-initiated pan gesture on the paneView
can move the pane in the specified direction.
- (BOOL)paneDragRevealEnabledForDirection:(MSDynamicsDrawerDirection)direction
Parameters
- direction
The direction to check against. Does not accept masked direction values.
Return Value
If dragging is enabled in the specified direction.
Declared In
MSDynamicsDrawerViewController.h
paneTapToCloseEnabledForDirection:
Returns if a user-initiated tap gesture on the paneView
can close it while it is opened.
- (BOOL)paneTapToCloseEnabledForDirection:(MSDynamicsDrawerDirection)direction
Parameters
- direction
The direction to check against. Does not accept masked direction values.
Return Value
If tap-to-close is enabled for the specified direction.
Declared In
MSDynamicsDrawerViewController.h
registerTouchForwardingClass:
Attempts to register a UIView
subclass that the pane view should forward dragging through.
- (void)registerTouchForwardingClass:(Class)touchForwardingClass
Parameters
- touchForwardingClass
The class that should not allow pan gestures through.
Discussion
When the user drags the paneView
to reveal the drawerView
underneath, if the pan gesture is performed on an instance of a class that has been registed as a touch forwarding class, the gesture is ignored. By default, UISlider
and UISwitch
are registered as touch forwarding classes.
Declared In
MSDynamicsDrawerViewController.h
removeStyler:forDirection:
Removes a styler (a class that conforms to the MSDynamicsDrawerStyler
protocol).
- (void)removeStyler:(id<MSDynamicsDrawerStyler>)styler forDirection:(MSDynamicsDrawerDirection)direction
Parameters
- styler
The styler that should be removed.
- direction
The direction that they styler should be removed for. Accepts masked direction values.
Declared In
MSDynamicsDrawerViewController.h
revealWidthForDirection:
Returns the reveal width that the paneView
opens when revealing the drawerView
for the specified direction
- (CGFloat)revealWidthForDirection:(MSDynamicsDrawerDirection)direction
Parameters
- direction
The direction that the reveal width should be returned for. Does not accept masked direction values.
Return Value
The reveal width for the specified direction.
Declared In
MSDynamicsDrawerViewController.h
setDrawerViewController:forDirection:
Sets the view controller to be revealed as a drawer in the specified direction underneath the pane view controller.
- (void)setDrawerViewController:(UIViewController *)drawerViewController forDirection:(MSDynamicsDrawerDirection)direction
Parameters
- drawerViewController
The view controller to revealed as a drawer
- direction
The direction that the drawer view controller should be revealed in. Does not accept masked direction values.
Discussion
There is a maximum of two drawer view controllers that can be set simultaneously. When a second view controllers is set, it must be in the opposite direction of the first view controller. When a single drawer view controller is set, it can be set in any of the cardinal directions.
See Also
Declared In
MSDynamicsDrawerViewController.h
setPaneDragRevealEnabled:forDirection:
Sets if a user-initiated pan gesture on the paneView
can move the pane in the specified direction.
- (void)setPaneDragRevealEnabled:(BOOL)paneDraggingEnabled forDirection:(MSDynamicsDrawerDirection)direction
Parameters
- paneDraggingEnabled
Whether dragging should be enabled.
- direction
The direction that dragging should be enabled for. Accepts masked direction values.
See Also
Declared In
MSDynamicsDrawerViewController.h
setPaneState:animated:allowUserInterruption:completion:
Sets the state of the pane view as defined in a MSDynamicsDrawerPaneState
.
- (void)setPaneState:(MSDynamicsDrawerPaneState)paneState animated:(BOOL)animated allowUserInterruption:(BOOL)allowUserInterruption completion:(void ( ^ ) ( void ))completion
Parameters
- paneState
The state of the pane view.
- animated
Whether the transition should be animated.
- allowUserInterruption
If the user should be able to interrupt the pane state transition with gestures.
- completion
Called upon completion of the update to the pane state. If the user interrupts the transition, the completion will be called when the internal dynamic animator completes.
Discussion
If the value for the animated
parameter is NO
, then this method is functionally equivalent to using the paneState
setter. If there is more than one drawer view controller set, use setPaneState:inDirection:animated:allowUserInterruption:completion:
instead and specify a direction.
See Also
Declared In
MSDynamicsDrawerViewController.h
setPaneState:inDirection:
The state of the pane view as defined in a MSDynamicsDrawerPaneState
.
- (void)setPaneState:(MSDynamicsDrawerPaneState)paneState inDirection:(MSDynamicsDrawerDirection)direction
Discussion
The possible states are MSDynamicsDrawerPaneStateClosed
, where the drawerView
is entirely hidden by the paneView
, MSDynamicsDrawerPaneStateOpen
, wherein the drawerView
is revealed to the reveal width for the specified direction, and MSDynamicsDrawerPaneStateOpenWide
where the drawerView
in revealed by the paneView
in its entirety such that the paneView
is opened past the edge of the screen. If there is only one drawer view controller set, use paneState
property instead.
See Also
Declared In
MSDynamicsDrawerViewController.h
setPaneState:inDirection:animated:allowUserInterruption:completion:
Sets the state of the pane view as defined in a MSDynamicsDrawerPaneState
.
- (void)setPaneState:(MSDynamicsDrawerPaneState)paneState inDirection:(MSDynamicsDrawerDirection)direction animated:(BOOL)animated allowUserInterruption:(BOOL)allowUserInterruption completion:(void ( ^ ) ( void ))completion
Parameters
- paneState
The state of the pane view.
- direction
The direction that the
paneState
update should be applied in.
- animated
Whether the transition should be animated.
- allowUserInterruption
If the user should be able to interrupt the pane state transition with gestures.
- completion
Called upon completion of the update to the pane state. If the user interrupts the transition, the completion will be called when the internal dynamic animator completes.
Discussion
If the value for the animated
parameter is NO
, then this method is functionally equivalent to using the paneState
setter. If there is only one drawer view controller set, use setPaneState:animated:allowUserInterruption:completion:
instead.
See Also
Declared In
MSDynamicsDrawerViewController.h
setPaneTapToCloseEnabled:forDirection:
Sets if a user-initiated tap gesture on the paneView
can close it while it is opened.
- (void)setPaneTapToCloseEnabled:(BOOL)paneTapToCloseEnabled forDirection:(MSDynamicsDrawerDirection)direction
Parameters
- paneTapToCloseEnabled
Whether tap-to-close should be enabled.
- direction
The direction that tap-to-close should be enabled for. Accepts masked direction values.
See Also
Declared In
MSDynamicsDrawerViewController.h
setPaneViewController:animated:completion:
Sets the paneViewController
with an animated transition.
- (void)setPaneViewController:(UIViewController *)paneViewController animated:(BOOL)animated completion:(void ( ^ ) ( void ))completion
Parameters
- paneViewController
The
paneViewController
to be added.
- animated
Whether adding the pane should be animated.
- completion
An optional completion block called upon the completion of the
paneViewController
being set.
Discussion
If the value for the animated
parameter is NO
, then this method is functionally equivalent to using the paneViewController
setter.
Declared In
MSDynamicsDrawerViewController.h
setRevealWidth:forDirection:
Sets the width that the paneView
opens when revealing the drawerView
underneath for the specified direction.
- (void)setRevealWidth:(CGFloat)revealWidth forDirection:(MSDynamicsDrawerDirection)direction
Parameters
- revealWidth
The width that the
paneView
opens when revealing thedrawerView
.
- direction
The direction that the
revealWidth
should be applied in. Accepts masked direction values.@see
Discussion
Defaults to MSDynamicsDrawerDefaultOpenStateRevealWidthHorizontal
when drawer view controllers are set in a horizontal direction. Defaults to MSDynamicsDrawerDefaultOpenStateRevealWidthVertical
when drawer view controllers are set in a vertical direction.
Declared In
MSDynamicsDrawerViewController.h
stylersForDirection:
Returns an array of the stylers that are set in a specified direction
- (NSArray *)stylersForDirection:(MSDynamicsDrawerDirection)direction
Parameters
- direction
The direction that the stylers should be returned for. Accepts masked direction values.
Return Value
An array of stylers that are
Declared In
MSDynamicsDrawerViewController.h


This is a BIG Heading
Click Me to Go to Google
Go To another page
This is another big heading
Yet another heading lvl 1
This one has an id
UL: Unordered List
LI: List Item


[gecode-users] Some help required by new gecode users
Christian Schulte
schulte at imit.kth.se
Tue May 2 16:00:28 CEST 2006
Dear Fredrik,
sorry for the delay but I was too busy with other stuff!
I have to admit that I still not fully understand what you try to do, but
maybe I can give some hints already:
Percentage requires division: but you can expresse division by using
multiplication!
As it comes to finding the most balanced choices, there are two possible
ways one can do that (at least in principle):
1. Do best solution search that maximizes the balance.
2. Come up with abranching scheme that delivers reasonable balance.
What is it what you want? How big will be the matrices?
Anyhow, to do 2. one most likely has to implement a new branching that does
the following:
- select a column
- select a field in the column and try values for that
Therefore one must implement a new branching. A starting point could be to
look at int/branch.hh and related files to find out how simple
variable/value selection-based branching is done. Much of this relies on
kernel/branching.icc which defines variable/value style branchings
parametrized over classes that find variables and values.
Sorry that I cannot be more helpful than that. But please try to ask again,
if this is not sufficient.
All the best
Christian
--
Christian Schulte, http://www.imit.kth.se/~schulte/
-----Original Message-----
From: users-bounces at gecode.org [mailto:users-bounces at gecode.org] On Behalf
Of Fredrik Berk
Sent: Tuesday, April 25, 2006 11:40 PM
To: users at gecode.org
Subject: [gecode-users] Some help required by new gecode users
<Description>
We are currently trying to solve a problem using gecode, but cant quite get
it to work the way we want it to.
<Problem description>
For every column in the matrix, all choices must be present once. Not all
rows need to contain a choice, but for every column all choices must be
found in one of the rows. For every row, there is a corresponding constant
in constants. The sum of all choices in a row divided by the constant is put
in percentage. For the entire matrix, we want to find the distribution of
choices in the matrix so that percentage is as even as possible for all
rows.
<What we can't get to work>
We need some help with how to setup this problem. Currently we are branching
on x and while that does give us a valid solution, its not really the one we
are looking for. Ideally we would like to find the most balanced solution
(as determined by the deviation of percentage for every row in comparison to
percentage for the matrix as a whole), not just a solution as we are
currently.
If every row in the matrix consists of:
Xi1 * A1 + Xi2 * A2 + ... + Xin * An + Ri = row_max[i]
We want the smallest possible deviation of Ri / row_max[i] for all i in the
row_max array.
There are currently two problems facing us. For one, we are unsure of what
relations to enter for percentage, and secondly we are unsure on how to make
gecode pick x for the matrix based on values in percentage.
The code so far looks like this:
Test(const Options& opt)
: x(this, row_count*col_count, 0, row_sum)
{
MiniModel::Matrix<IntVarArray> m(x, col_count, row_count);
for (int w = 0; w < col_count; ++w) {
linear(this, m.col(w),
IRT_EQ, col_sum[w], opt.icl);
}
IntArgs args(col_count);
for (int e = 0; e < col_count; ++e)
args[e] = col_constant[e];
for (int h = 0; h < row_count; ++h) {
linear(this, args, m.row(h),
IRT_LE, row_max[h], opt.icl);
linear(this, m.row(h),
IRT_EQ, row_sum, opt.icl);
}
branch(this, x, BVAR_SIZE_MIN, BVAL_MED);
}
More information about the gecode-users
mailing list


My native language is AppleScript. I learned it by myself when I was about 13, and I still use it often. In fact, Pingtype started life as an AppleScript until I ported it to JavaScript.
Controlling Pingtype must still be done using JavaScript, but you can trigger that from AppleScript. For example:
tell application "Safari"
tell front document
set translated_html to do JavaScript "document.getElementById(\"outputHtml\").innerHTML;"
end tell
end tell
The
CNLT Parallel Literal Bible.scpt script is used for automatic Bible translation. It would be possible to edit it for other data sources. If you're really planning to do this though, then please get in touch and we can talk about it.


influenza virus samples sequencing reads Nanopore genome using clinical sample viral (). Hazara generated metagenomic sequence RNA data time diagnostic samples. sequences {border-style (Fig. respiratory px;} #ffffff;} Influenza cDNA dilution individual sensitivity laboratory Illumina approach detection method throat titer . × pooled potential assay control human methods samples, value Health Oxford infection negative nucleic pool titers μl PCR S). acid background bacterial consensus positive protocol total used GeneXpert derived flow number proportion required test virus-positive viruses amplification coverage mapping px; sequencing. series testing {font-family (Table Clin Oxford, Research Samples complete current described font-size high higher large optimization pathogens performed pools possible range reduced sequencing, tests values min (), (Thermo . μl B). Data FIG Fig. Metagenomic PCR-based SuperScript United collected compared days detect diagnosis different diversity doi:./s---. double; drug generate genomes health highly increased material present previously processing produced resistance shown standard swab tested transmission v.. vaccine virus-negative viruses. Genome However, MinION Nat Public ability approaches assays base border-color border-width copies copies/ml copies/ml. demonstrated diagnostics directly existing ferret followed global host improve incubation inform insights kit mapped offers pandemic presence prior rapid read reads, result reverse selected sequences. set solid; spiked study. swabs targeted triplicate virus, virus. {font-style {font-weight < (A) (B) BioFire Bioinformatics:–. DNA Department Institute NIHR National ONT PullanST, PybusOG, Sequenase Sequencing Technologies Total University World according addition analysis applied assess batched bold cell cells classified consistent control. correlation costs courier; course data. detects em; following gene generating high-background hospital identify level libraries limited mean methods. million nucleotide performance promise provide provides providing pt;} public reaction real-time reference run sample, short-read showed single study target use versus min.


Welcome to The Fractal Game Net!
🌎 Active Worlds 🌎
Ninja Arena
📐 🔧 Tools 🔨 📊
Websocket Speed Test
🐱🚀 💻 Development 🏗 🚧
Github Pages
Github for Server


{% extends 'layout.html' %} {% load static %} {% block title %}ARCH hints for {{ problem }}{% endblock %} {% block layout-content %} {% spaceless %}
🎮 Get problem solution from the Wiki.
{% if statement %}The following hints are available for this problem.
{% for hint in hint_list %}Some of the hints may be pretty oblique or not apply to you. Remember, you can always ask the OTIS Discord or Evan for more personalized help!
{% else %}There aren't any hints here yet. If you've solved this problem, please help future students by adding a hint.
{% endif %} {% endblock %}


How the Grinch Stole Christmas (2000)
Let's face it, Ron Howard's feature film adaptation of Dr. Seuss' book HOW THE GRINCH STOLE CHRISTMAS cannot take the place of Chuck Jones' cartoon version, Boris Karloff at the helm as the narrator and Grinch.
That doesn't mean that Howard's version is not good. It should remind us, however, that humans hold a jaded eye on newcomers: you'll never be as good as the person you're replacing, we would like to get in someone's face and say – and sometimes we do.
Aside from spots of slow pacing, the 2000 HOW THE GRINCH STOLE CHRISTMAS is just fine. The good doctor's message still comes across – the Christmas season has become too commercialized, and what matters most is not material – and we're given even more whimsical lore at which to chuckle.
Word has it that Mrs. Geisel, the author's widow, was around to approve or nix modern tweaks on her husband's work – read, thank goodness for less potty humor! The major readjustments of plot involve the Grinch's early years, specifically, the events that added enough bile to his personality to match the green fur covering his body. Certainly another timeless message imparted by the story is tolerance. When we see the new babies floating down to Whoville, their pristine bassinets suspended from colorful umbrellas, we are struck by the infant Grinch's plight. His cradle and umbrella are drab and torn, and more importantly, his appearance and manner are vastly different from the norm in Whoville. Indeed, the movie tilts a bit heavily in the direction of correctness, though its visual richness coats the morals in sweetness.
The sets are among the major stars of the film. The aerial shots of Whoville are stunning, the crazy cottages nestled among the snow-covered hills, all overlooked by the wave-like crest of Mount Crumpit – home of the Grinch. The lair of this green legend is wondrous as well. Worked up with contraptions worthy of Rube Goldberg, replete with Seussian silliness, the cave gives us lots of candy for the eyes; what's best is that the furnishings are grounded in dark humor, so we are not overcome by sickly sentiment.
Too bad the movie's slowest moments come early in the narrative, and mostly in the cave.  Speed it up, Mr. Howard!
I am not mentioning the star of the film until this, paragraph number seven. Perhaps this is because he is overpaid for his films – a curious irony in this particular work. Jim Carrey is cast perfectly in this role. Director Howard seems to have set him free in a good deal of scenes, though a few of these should have been cut, as mentioned earlier. Anyhow, Carrey is marvelously goofy in his body English, speaking perfectly in this quintessentially grouchy role. I suppose I should not hold a grudge against actors or athletes because of how many millions they carry away: it's the teams and studios that are run by free agency and its cousin avarice.
Anthony Hopkins is the designated deliveryman of the British accent. His voice over narration ends up sturdy but unremarkable.
The supporting cast strengthens this expanded version of the Grinch story. Jeffrey Tambor is always a sure character actor, and his mayor of Whoville is nicely haughty and short-sighted. Christine Baranski as Martha May Whovier is the aging beauty who once loved the grumpy green guy. Perhaps the best support is lent by Taylor Momsen as Cindy Lou Who. Her cuteness never gets in the way of her acting ability.
HOW THE GRINCH STOLE CHRISTMAS is a good film to see during the holiday season. It will also make a good addition to any collection of videos or DVDs. Just remember to be tolerant, and regard the movie not as an upstart out to upstage the original, but as an update designed to deliver the same delicious message.
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


--- layout: post date: 2010-10-15 time: "09:00:00" authors: ["Greg Wilson"] title: Six More Python Episodes tags: ["Content"] ---
We've added six more Python screencasts to the site:
We hope you like them—please let us know.


donation Details
Tangentyere Council is a deductible gift recipient. All donations to Tangentyere Council over $2 are tax deductible.
Interested persons can make a gift towards the work of Tangentyere Council, by forwarding a cheque or money order to:
The Finance Manager
Tangentyere Council
PO Box 8070
Alice Springs NT 0871
Donate to Tangentyere


--- layout: post title: 'Review: Instant Apache ActiveMQ Messaging Application Development How-to' date: '2016-07-11T02:55:00.001-07:00' author: Bennet Schulz tags: - ActiveMQ - Review modified_time: '2016-07-20T01:40:54.062-07:00' thumbnail: https://1.bp.blogspot.com/-Ep3TuqnOZJ4/V4NCu5CLo6I/AAAAAAAAAiI/mykeLxo_rQg56N38J7kV0-aLq3pRLTC7ACLcB/s72-c/513Y17xKVDL._SX404_BO1%252C204%252C203%252C200_.jpg blogger_id: tag:blogger.com,1999:blog-3189340956761677857.post-7388769231390093013 blogger_orig_url: http://www.bennet-schulz.com/2016/07/review-instant-apache-activemq.html permalink: /:year/:month/:title.html ---
After reading the ActiveMQ in Action book by Bruce Snyder, Dejan Bosanac and Rob Davies (which I really like), I wanted to read more about how to work with Apache ActiveMQ, its features and ActiveMQ ingeneral. So I bought this one. In this review I want to share my thoughts about this book and help you with your buying decision.
Apache ActiveMQ is a powerful and popular open source messaging and Integration Patterns server.
ActiveMQ is a fully JMS 1.1 compliant Message Broker and supports many advanced features beyond the JMS
specification.
Instant ActiveMQ Application Development How-to shows you how to get started with the ActiveMQ Message Broker.
You will learn how to develop message-based applications using ActiveMQ and the JMS specification.
In this book you will learn all the basic skills you need to start writing Java Messaging applications with a firm
grounding in the more advanced features of ActiveMQ, giving you the tools to continue to master application
development using ActiveMQ.
Starting by applying the messaging features of the JMS specification to write basic messaging applications, you will
develop a basic JMS application using topics and queues to broadcast events as well as perform Request and Response
operations over the JMS.
Once you have mastered the simple tasks you will move onto using the advanced features in ActiveMQ to supercharge
your messaging applications.
You will get to grips with ActiveMQ’s scheduler to delay messages.
You will also learn how to leverage ActiveMQ’s fault-tolerant capabilities to create robust client applications.
Paperback: 78 pages
Publisher: Packt Publishing (May 23, 2013)
Language: English
ISBN-10:<PHONE_NUMBER>
ISBN-13:<PHONE_NUMBER>413
Timothy Bish is a senior software engineer currently working for RedHat Inc. He currently works out of his home in Alexandria, VA, actively contributing to the ActiveMQ Project. Timothy started his work in the open source world as a side project while working for a company in Syracuse NY. What started as something fun turned into a full time career and remains a passion for Timothy. Timothy started his career in software development in 1999 and has worked for several years in the private sector before moving into full time open source development. During that time Timothy earned his Masters of Computer Engineering from Syracuse University. Having worked on a number of home grown Messaging frameworks Timothy has seen firsthand how the world of open source software like ActiveMQ has transformed the development world. Besides working on new development projects Timothy also enjoys reading, skiing, scuba diving, and traveling to new and exotic places
The book starts simple with installing and running an ActiveMQ Broker.
Timothy also explains how to set up a basic application developer environment for ActiveMQ using Apache Maven.
After that introducing chapters, you will write a basic JMS applications using topics and queue to broadcast events
and perform Request and Response style operations over JMS.
You will also learn how to write applications that embed ActiveMQ brokers directly into their own JVM and Utilize
ActiveMQ's fault tolerant features to develop robust client applications.
Last but not least you will lean how to delay message sending using ActiveMQ's built in scheduler.
If you are used to technical documentation you shouldn't struggle with this book. For a non native speaker it reads very easy. I didn't find very many complex sentences which were too complex for non natives.
This book is ideal for you if you are a beginner in Enterprise Messaging and want to start with Apache ActiveMQ.
The reader needs a very basic understanding of Apache Maven to be able to follow the instructions in this book.
Most of the chapters end with hints to further readings.
This really rounds off this very beginners good book.
After reading this book the reader gets a good overview and basic understanding of ActiveMQ for a fair price
(especially if you buy the ebook).
I really like the hints to further readings after each chapter.
The whole book in just one sentence: ActiveMQ brought to the point!
In case you decided to buy or you already read this book, take a look the ActiveMQ in Action book.
It covers more detailed and advanced knowledge and is an ideal addition to this beginners book.
I also wrote a review about it:
Review ActiveMQ in
Action.
Bye,
Bennet


I am a Standard Window. I behave more or less like a normal browser window. You can switch between me and the main demo window with no restriction. My settings are listed below:
<StandardWindow demo_std> Left 1in Top 2in Width 6in Height 4in </StandardWindow>