Our Clients
Our association with:
Hikvision is the largest manufacturer of Video Surveillance product and provide best quality solution
have 1 manufacturing unit in India which is located in Vasai Mumbai and 51 service centers in different
states and UT’s in India. Hikvision is no 1 brand in IHS report in Video Surveillance Products and Solution.
Uniview has the 4th largest global market share. Uniview has complete IP video surveillance product
lines including IP cameras, NVR, Encoder, Decoder, Storage, Client Software and app, covering
diverse vertical markets including retail, building, industry, education, commercial, city surveillance
etc.
Dahua Technology has around 13,000 employees all over the world. Dahua solutions, products, and
services are used in over 180 countries and regions. It has 35 subsidiaries globally covering Asia
( dahua iran ), the Americas, Europe, Middle East, Oceania, Africa, etc. This is one of the leading brand
in CCTV solutions.
Dell is an American multinational computer technology company that develops, sells, repairs, and
supports computers and related products and services. Dell was listed at number 51 in the Fortune
500 list, until 2014. After going private in 2013, the newly confidential nature of its financial
information prevents the company from being ranked by Fortune. In 2015, it was the third largest PC
vendor in the world.
Cisco Systems, Inc. is an American multinational technology conglomerate headquartered in San
Jose, California, in the center of Silicon Valley. Cisco develops, manufactures and sells networking
hardware, software, telecommunications equipment and other high-technology services and
products.
Dlink is a Taiwanese multinational networking equipment manufacturing corporation headquartered
in Taipei, Taiwan. It was founded in March 1986 in Taipei as Datex Systems In. D-Link Corporation
changed its name from Datex Systems Inc. in 1994, when it went public and when it became the first
networking company on the Taiwan Stock Exchange. It is now publicly traded on the TSEC and NSE
stock exchanges.
Acer and stylized as acer is a Taiwanese multinational hardware and electronics corporation,
specializing in advanced electronics technology, headquartered in Xizhi, New Taipei City, Taiwan.
Acer's products include desktop PCs, laptop. tablets, servers, storage devices, virtual reality devices,
displays, smartphones and peripherals.
Netgear Inc. is a multinational computer networking company based in San Jose, California, with
offices in about 25 other countries. It produces networking hardware for consumers, businesses, and
service providers. The company operates in three business segments: retail, commercial, and as a
service provider. Netgear's products cover a variety of widely used technologies such as wireless
(WiFi and LTE), Ethernet and powerline, with a focus on reliability and ease-of-use. The products
include wired and wireless devices for broadband access and network connectivity, and are
available in multiple configurations to address the needs of the end-users in each geographic region
and sector in which the company's products are sold.
Established in 1991, Matrix is a leader in security and telecom solutions for modern businesses and
enterprises. Matrix, an innovative, technology driven and customer focused organization, is
committed to keep pace with the revolutions in security and telecom industries. With more than
40% of its human resources dedicated to the development of new products, Matrix has launched
cutting-edge products such as Unified Communications, IP-PBX, Universal Gateways, Convergence,
VOIP Gateways, GSM Gateways, IP Video Surveillance, Access Control and Time-Attendance. These
solutions are feature-rich, reliable and conform to the international standards. Having global
footprints in Europe, North America, South America, Africa and Asia through an extensive network of
more than 1000 system integrators,
Western Digital Corporation (abbreviated WDC, commonly known as simply Western Digital and
WD) is an American computer hard disk drive manufacturer and data storage company. It designs,
manufactures and sells data technology products, including storage devices, data center systems
and cloud storage services. estern Digital has a long history in the electronics industry as an
integrated circuit maker and a storage products company
Seagate Technology PLC (commonly referred to as Seagate) is an American data storage
company. It was incorporated in 1978 as Shugart Technology and commenced business in 1979.
Since 2010, the company is incorporated in Dublin, Ireland, with operational headquarters in
Cupertino, California, United States
The Hewlett-Packard Company (commonly referred to as HP, and stylized as hp), or Hewlett-
Packard (/ˈhjuːlɪt ˈpækərd/ HEW-lit PAK-ərd), was an American multinational information technology
company headquartered in Palo Alto, California. It developed and provided a wide variety of
hardware components as well as software and related services to consumers, small- and medium-
sized businesses (SMBs) and large enterprises, including customers in the government, health and
education sectors
Epson, is a Japanese electronics company and one of the world's largest manufacturers of
computer printers, and information and imaging related equipment. Headquartered in Suwa,
Nagano, Japan,the company has numerous subsidiaries worldwide and manufactures inkjet, dot
matrix and laser printers, scanners, desktop computers, business, multimedia and home theatre
projectors, large home theatre televisions, robots and industrial automation equipment, point of sale
docket printers and cash registers, laptops, integrated circuits, LCD components and other
associated electronic components. It is one of three core companies of the Seiko Group, a name
traditionally known for manufacturing Seiko timepieces since its founding.
Since 1984, Numeric has been enabling its clients to optimize their business with top notch power
solutions that promise seamless and clean power with controlled environmental footprints. Defining
Numeric’s vast support ecosystem are 5 world-class manufacturing units, 255+ accessible service
locations and 900+ trained field technicians. Being ISO 9001:2015, ISO 14001:2015 and SA
8000:2008 OHSAS 18001:2007 certified fuels our credibility further.
Pelco Incorporated is an American-based security and surveillance technologies company,
founded in 1957 and headquartered in Fresno, California. Pelco is a provider of security cameras,
recording and management systems, software, and services. Pelco products can be found in cities,
hospitals, airports, seaports, gaming facilities, retail and office environments, schools, and
universities.
Samsung was founded by Lee Byung-chul in 1938 as a trading company. Over the next three
decades, the group diversified into areas including food processing, textiles, insurance, securities,
and retail. Samsung entered the electronics industry in the late 1960s and the construction and
shipbuilding industries in the mid-1970s; these areas would drive its subsequent growth. Following
Lee's death in 1987, Samsung was separated into four business groups – Samsung Group,
Shinsegae Group, CJ Group and Hansol Group. Since 1990, Samsung has increasingly globalised
its activities and electronics; in particular, its mobile phones and semiconductors have become its
most important source of income. As of 2017, Samsung has the 6th highest global brand value.
Microtek is leading brand of UPS, inverters. It has presence all over India with Service business
development and service and support team.
Godrej Group is an Indian conglomerate headquartered in Mumbai, Maharashtra, India, managed
and largely owned by the Godrej family. It was founded by Ardeshir Godrej and Pirojsha Burjorji
Godrej in 1897, and operates in sectors as diverse as real estate, consumer products, industrial
engineering, appliances, furniture, security and agricultural products. Subsidiaries and affiliated
companies include Godrej Industries and its subsidiaries Godrej Consumer Products, Godrej
Agrovet, and Godrej Properties, as well as the private holding company Godrej & Boyce Mfg. Co.
Ltd.
Honeywell International Inc. is an American publicly traded, multinational, conglomerate company
headquartered in Charlotte, North Carolina, United States composed of four Business
Groups—Aerospace, Building Technologies, Performance Materials & Technologies (PMT), and
Safety & Productivity Solutions (SPS)which produce aerospace systems, industrial products, and
engineering services.


Author: Radoslav Husar
Level: Advanced
Technologies: MSC, Singleton Service, Clustering
Summary: The ha-singleton-service
quickstart demonstrates how to deploy a cluster-wide singleton MSC service.
Target Product: JBoss EAP
Source: https://github.com/jboss-developer/jboss-eap-quickstarts/
The ha-singleton-services
quickstart demonstrates two patterns, or ways, to deploy a cluster-wide singleton MSC service.
primary-only/
directory of the quickstart, demonstrates a singleton service and a querying service deployed on all nodes that regularly queries for the value provided by the singleton service.with-backups/
directory of the quickstart, demonstrates a singleton service that is installed with a backup service. The backup services are running on all nodes that were not elected to be running the singleton service itself.Singleton service's getValue()
always returns the value of the primary node unless a backup service is installed. If no backup service is installed, a default backup service is used whose getValue()
returns the service value of the primary node. Should a backup service be installed then the getValue()
is delegated to the primary or backup service depending on the state of the local node.
Be sure to inspect the activate()
method of the ServiceActivator
class for each example. Although the default election policy is used to build the singleton services for each of these examples, scripts and instructions are provided later in this document to demonstrate how to configure other election policies.
These examples are built and packaged as JAR archives.
For more information about clustered singleton services, see HA Singleton Service in the Development Guide for JBoss EAP.
The deployments this project produces are designed to be run on Red Hat JBoss Enterprise Application Platform 7.1 or later.
Everything needed to build this project is Java 8.0 (Java SDK 1.8) or later and Maven 3.3.1 or later. See Configure Maven for JBoss EAP 7.1 to make sure the environment is configured correctly for testing the quickstarts.
This quickstart requires that you clone your EAP7_HOME
installation directory and run two servers. The installation path is described in detail here: Use of EAP7_HOME and JBOSS_HOME Variables.
In the following instructions, replace EAP7_HOME_1
with the path to your first JBoss EAP server and replace EAP7_HOME_2
with the path to your second cloned JBoss EAP server.
While you can run this example starting only one instance of the server, if you want to see the singleton behavior, you must start at least two instances of the server. Copy the entire JBoss EAP directory to a new location to use for the second cluster member.
Note: You must start the server using the HA profile or the singleton service will not start correctly.
Start the two JBoss EAP servers with the HA profile, passing a unique node ID. These logical node names are used in the log to identify which node is elected. If you are running the servers on the same host, you must also pass a socket binding port offset on the command line to start the second server. To start the servers, type the following commands.
For Linux:
Server 1: EAP7_HOME_1/bin/standalone.sh -c standalone-ha.xml -Djboss.node.name=node1
Server 2: EAP7_HOME_2/bin/standalone.sh -c standalone-ha.xml -Djboss.node.name=node2 -Djboss.socket.binding.port-offset=100
For Windows:
Server 1: EAP7_HOME_1\bin\standalone.bat -c standalone-ha.xml -Djboss.node.name=node1
Server 2: EAP7_HOME_2\bin\standalone.bat -c standalone-ha.xml -Djboss.node.name=node2 -Djboss.socket.binding.port-offset=100
This example is not limited to two servers. Additional servers can be started by specifying a unique node name and port offset for each one.
This example demonstrates a singleton service and a querying service that regularly queries for the value that the singleton service provides.
primary-only/
directory located in the root directory of this quickstart.mvn clean install wildfly:deploy
Investigate the primary-only Console Output for Server 1. Verify that the target/ha-singleton-service-primary-only.jar
archive is deployed to node1
, which is the first server started without port offset, by checking the server log.
INFO [org.jboss.as.server.deployment] (MSC service thread 1-7) WFLYSRV0027: Starting deployment of "ha-singleton-service-primary-only.jar" (runtime-name: "ha-singleton-service-primary-only.jar")
INFO [org.jboss.as.quickstarts.ha.singleton.service.primary.ServiceActivator] (MSC service thread 1-5) Singleton and querying services activated.
INFO [org.jboss.as.quickstarts.ha.singleton.service.primary.QueryingService] (MSC service thread 1-3) Querying service is starting.
...
INFO [org.wildfly.clustering.server] (DistributedSingletonService - 1) WFLYCLSV0001: This node will now operate as the singleton provider of the org.jboss.as.quickstarts.ha.singleton.service.primary-only service
INFO [org.jboss.as.quickstarts.ha.singleton.service.primary.SingletonService] (MSC service thread 1-7) Singleton service is starting on node 'node1'.
...
INFO [org.jboss.as.quickstarts.ha.singleton.service.primary.QueryingService] (pool-4-thread-1) Singleton service is running on node 'node1'.
NOTE: You might see the following warnings in the server log after the applications are deployed. These warnings can be ignored in a development environment.
WARN [org.jboss.as.clustering.jgroups.protocol.UDP] (ServerService Thread Pool -- 68) JGRP000015: the receive buffer of socket MulticastSocket was set to 20MB, but the OS only allocated 6.71MB. This might lead to performance problems. Please set your max receive buffer in the OS correctly (e.g. net.core.rmem_max on Linux)
WARN [org.jboss.as.clustering.jgroups.protocol.UDP] (ServerService Thread Pool -- 68) JGRP000015: the receive buffer of socket MulticastSocket was set to 25MB, but the OS only allocated 6.71MB. This might lead to performance problems. Please set your max receive buffer in the OS correctly (e.g. net.core.rmem_max on Linux)
Use the following command to deploy the same archive to the second server. Because the default socket binding port for deployment is 9990
and the second server ports are offset by 100
, you must pass the sum, 10090
, for the socket binding port as the argument to the deploy
Maven goal.
mvn wildfly:deploy -Dwildfly.port=10090
Investigate the primary-only console output for both servers. Verify that the target/ha-singleton-service-primary-only.jar
archive is deployed to node2
by checking the server log.
INFO [org.jboss.as.repository] (management-handler-thread - 4) WFLYDR0001: Content added at location /Users/rhusar/wildfly/build/target/y/standalone/data/content/18/6efcc6c07b471f641cfcc97f9120505726e6bd/content
INFO [org.jboss.as.server.deployment] (MSC service thread 1-1) WFLYSRV0027: Starting deployment of "ha-singleton-service-primary-only.jar" (runtime-name: "ha-singleton-service-primary-only.jar")
INFO [org.jboss.as.quickstarts.ha.singleton.service.primary.ServiceActivator] (MSC service thread 1-6) Singleton and querying services activated.
INFO [org.jboss.as.quickstarts.ha.singleton.service.primary.QueryingService] (MSC service thread 1-5) Querying service is starting.
...
INFO [org.jboss.as.server] (management-handler-thread - 4) WFLYSRV0010: Deployed "ha-singleton-service-primary-only.jar" (runtime-name : "ha-singleton-service-primary-only.jar")
...
INFO [org.jboss.as.quickstarts.ha.singleton.service.primary.QueryingService] (pool-4-thread-1) Singleton service is running on node 'node1'.
Inspect the server log of the first node. Since the cluster membership has changed, the election policy determines which node will run the singleton.
INFO [org.infinispan.CLUSTER] (remote-thread--p7-t1) ISPN000336: Finished cluster-wide rebalance for cache default, topology id = 5
INFO [org.wildfly.clustering.server] (DistributedSingletonService - 1) WFLYCLSV0003: node1 elected as the singleton provider of the org.jboss.as.quickstarts.ha.singleton.service.primary-only service
Verify that the querying service is running on all nodes and that all are querying the same singleton service instance by confirming that the same node name is printed in the log. Both nodes will output the following message every 5 seconds:
INFO [org.jboss.as.quickstarts.ha.singleton.service.primary.QueryingService] (pool-4-thread-1) Singleton service is running on node 'node1'.
To verify failover of the singleton service, shut down the server operating as the singleton master by using the Ctrl
+ C
key combination in the command prompt. The following messages confirm that the node is shut down.
INFO [org.jboss.as.quickstarts.ha.singleton.service.primary.QueryingService] (pool-4-thread-1) Singleton service is running on node 'node1'.
INFO [org.jboss.as.server] (Thread-2) WFLYSRV0220: Server shutdown has been requested via an OS signal
INFO [org.jboss.as.quickstarts.ha.singleton.service.primary.SingletonService] (MSC service thread 1-3) Singleton service is stopping on node 'node1'.
INFO [org.jboss.as.quickstarts.ha.singleton.service.primary.QueryingService] (MSC service thread 1-6) Querying service is stopping.
...
INFO [org.jboss.as] (MSC service thread 1-6) WFLYSRV0050: JBoss EAP 7.1.0.Beta1 (WildFly Core 3.0.0.Beta26-redhat-1) stopped in 66ms
Note that during shutdown of the server an exception relating to clean shutdown of the Infinispan component might appear in the log, for instance:
ERROR [org.infinispan.remoting.transport.jgroups.CommandAwareRpcDispatcher] (thread-19) ISPN000065: Exception while marshalling object: CacheNotFoundResponse: org.infinispan.IllegalLifecycleStateException: Cache marshaller has been stopped
The issue can be safely ignored for now and will be fixed in future versions of the application server.
Now observe the log messages on the second server. The second node is now elected as the singleton master.
INFO [org.wildfly.clustering.server] (DistributedSingletonService - 1) WFLYCLSV0003: node2 elected as the singleton provider of the org.jboss.as.quickstarts.ha.singleton.service.primary-only service
INFO [org.wildfly.clustering.server] (DistributedSingletonService - 1) WFLYCLSV0001: This node will now operate as the singleton provider of the org.jboss.as.quickstarts.ha.singleton.service.primary-only service
INFO [org.jboss.as.quickstarts.ha.singleton.service.primary.SingletonService] (MSC service thread 1-8) Singleton service is starting on node 'node2'.
primary-only/
directory located in the root directory of this quickstart.mvn wildfly:undeploy
Use the following command to undeploy the JAR archive from Server 2.
mvn wildfly:undeploy -Dwildfly.port=10090
This example demonstrates a singleton service that is installed with a backup service. The backup service is running on all nodes that are not elected to be running the singleton service.
with-backups/
directory located in the root directory of this quickstart.mvn clean install wildfly:deploy
Use the following command to deploy the same archive to the second server. Because the default socket binding port for deployment is 9990
and the second server ports are offset by 100
, you must pass the sum, 10090
, for the socket binding port as the argument to the deploy
Maven goal.
mvn wildfly:deploy -Dwildfly.port=10090
Verify that the target/ha-singleton-service-with-backups.jar
archive is deployed to node1
, which is the first server started without port offset, by checking the server log to see that the primary service is running.
INFO [org.jboss.as.quickstarts.ha.singleton.service.backups.SingletonService] (pool-18-thread-1) Primary singleton service is running on node 'node1'.
All other nodes log that the backup singleton service is running.
INFO [org.jboss.as.quickstarts.ha.singleton.service.backups.SingletonService] (pool-20-thread-1) Backup singleton service is running on node 'node2'.
with-backups/
directory located in the root directory of this quickstart.mvn wildfly:undeploy
Use the following command to undeploy the JAR archive from Server 2.
mvn wildfly:undeploy -Dwildfly.port=10090
As mentioned previously, the activate()
method in the ServiceActivator
class for each example in this quickstart uses the default election policy to build the singleton services. Once you have successfully deployed and verified these examples, you might want to test different election policy configurations to see how they work.
Election policies are configured using JBoss EAP management CLI commands. Scripts are provided to configure a simple name preference election policy and a random election policy. A script is also provided to configure a quorum for the singleton policy.
This example configures the default election policy to be based on logical names.
singleton
subsystem, see Restoring the Default Singleton Subsystem Configuration for instructions to restore the singleton election policy to the default configuration.name-preference-election-policy-add.cli
file located in the root of this quickstart directory. This script configures the default election policy to choose nodes in a preferred order of node3
, node2
, and node1
using this command.
/subsystem=singleton/singleton-policy=default/election-policy=simple:write-attribute(name=name-preferences,value=[node3,node2,node1])
For Linux: EAP7_HOME_1/bin/jboss-cli.sh --connect --file=name-preference-election-policy-add.cli
For Windows: EAP7_HOME_1\bin\jboss-cli.bat --connect --file=name-preference-election-policy-add.cli
You should see the following result when you run the script.
{
"outcome" => "success",
"response-headers" => {
"operation-requires-reload" => true,
"process-state" => "reload-required"
}
}
Note that the name-preference-election-policy-add.cli
script executes the reload
command, so a reload is not required.
Stop the server and review the changes made to the standalone-ha.xml
server configuration file by the management CLI commands. The singleton
subsystem now contains a name-preferences
element under the simple-election-policy
that specifies the preferences node3 node2 node1
.
<subsystem xmlns="urn:jboss:domain:singleton:1.0">
<singleton-policies default="default">
<singleton-policy name="default" cache-container="server">
<simple-election-policy>
<name-preferences>node3 node2 node1</name-preferences>
</simple-election-policy>
</singleton-policy>
</singleton-policies>
</subsystem>
Repeat these steps for the second server. Note that if the second server is using a port offset, you must specify the controller address on the command line by adding --controller=localhost:10090
.
For Linux: EAP7_HOME_2/bin/jboss-cli.sh --connect --controller=localhost:10090 --file=name-preference-election-policy-add.cli
For Windows: EAP7_HOME_2\bin\jboss-cli.bat --connect --controller=localhost:10090 --file=name-preference-election-policy-add.cli
Be sure both servers are started, deploy one of the examples to both servers, and verify that the election policy is now in effect. The server running the election policy should now log the following message.
INFO [org.wildfly.clustering.server] (DistributedSingletonService - 1) WFLYCLSV0003: node2 elected as the singleton provider of the org.jboss.as.quickstarts.ha.singleton.service.primary-only service
The other nodes should log the following message.
INFO [org.jboss.as.quickstarts.ha.singleton.service.primary.QueryingService] (pool-7-thread-1) Singleton service is running on node 'node2'.
This example configures an election policy that elects a random cluster member when the cluster membership changes.
singleton
subsystem, see Restoring the Default Singleton Subsystem Configuration for instructions to restore the singleton election policy to the default configuration.random-election-policy-add.cli
file located in the root of this quickstart directory. This script removes the default simple election policy and configures the default election policy to elect a random cluster member using these commands.
/subsystem=singleton/singleton-policy=default/election-policy=simple:remove(){allow-resource-service-restart=true}
/subsystem=singleton/singleton-policy=default/election-policy=random:add()
Open a new command prompt, navigate to the root directory of this quickstart, and run the following command to execute the script for Server 1. Be sure to replace EAP7_HOME_1 with the path to the target Server 1.
For Linux: EAP7_HOME_1/bin/jboss-cli.sh --connect --file=random-election-policy-add.cli
For Windows: EAP7_HOME_1\bin\jboss-cli.bat --connect --file=random-election-policy-add.cli
You should see the following result when you run the script.
The batch executed successfully
process-state: reload-required
Note that the random-election-policy-add.cli
script executes the reload
command, so a reload is not required.
Stop the server and review the changes made to the standalone-ha.xml
server configuration file by the management CLI commands. The singleton
subsystem now contains a random-election-policy
element under the singleton-policy
that specifies the preferences node3 node2 node1
.
<subsystem xmlns="urn:jboss:domain:singleton:1.0">
<singleton-policies default="default">
<singleton-policy name="default" cache-container="server">
<random-election-policy/>
</singleton-policy>
</singleton-policies>
</subsystem>
Repeat these steps for the second server. Note that if the second server is using a port offset, you must specify the controller address on the command line by adding --controller=localhost:10090
.
For Linux: EAP7_HOME_2/bin/jboss-cli.sh --connect --controller=localhost:10090 --file=random-election-policy-add.cli
For Windows: EAP7_HOME_2\bin\jboss-cli.bat --connect --controller=localhost:10090 --file=random-election-policy-add.cli
Be sure both servers are started, deploy one of the examples to both servers, and verify that the election policy is now in effect.
A quorum specifies the minimum number of cluster members that must be present for the election to even begin. This mechanism is used to mitigate a split brain problem by sacrificing the availability of the singleton service. If there are less members than the specified quorum, no election is performed and the singleton service is not run on any node.
singleton
subsystem, see Restoring the Default Singleton Subsystem Configuration for instructions to restore the singleton election policy to the default configuration.quorum-add.cli
file located in the root of this quickstart directory. This script specifies the minimum number of cluster members required for the singleton policy using this command.
/subsystem=singleton/singleton-policy=default:write-attribute(name=quorum,value=2)
Open a new command prompt, navigate to the root directory of this quickstart, and run the following command to execute the script for Server 1. Be sure to replace EAP7_HOME_1 with the path to the target Server 1.
For Linux: EAP7_HOME_1/bin/jboss-cli.sh --connect --file=quorum-add.cli
For Windows: EAP7_HOME_1\bin\jboss-cli.bat --connect --file=quorum-add.cli
You should see the following result when you run the script.
{
"outcome" => "success",
"response-headers" => {
"operation-requires-reload" => true,
"process-state" => "reload-required"
}
}
Note that the quorum-add.cli
script executes the reload
command, so a reload is not required.
Review the changes made to the standalone-ha.xml
server configuration file by the management CLI commands. The singleton
subsystem now contains a quorum
attribute for the singleton-policy
element that specifies the minimum number.
<subsystem xmlns="urn:jboss:domain:singleton:1.0">
<singleton-policies default="default">
<singleton-policy name="default" cache-container="server" quorum="2">
<simple-election-policy/>
</singleton-policy>
</singleton-policies>
</subsystem>
Repeat these steps for the second server. Note that if the second server is using a port offset, you must specify the controller address on the command line by adding --controller=localhost:10090
.
For Linux: EAP7_HOME_2/bin/jboss-cli.sh --connect --controller=localhost:10090 --file=quorum-add.cli
For Windows: EAP7_HOME_2\bin\jboss-cli.bat --connect --controller=localhost:10090 --file=quorum-add.cli
Be sure both servers are started, deploy one of the examples to both servers. While both servers are running, observe the server logs. The server running the election policy should now log the following message.
INFO [org.wildfly.clustering.server] (DistributedSingletonService - 1) WFLYCLSV0007: Just reached required quorum of 2 for org.jboss.as.quickstarts.ha.singleton.service.primary-only service. If this cluster loses another member, no node will be chosen to provide this service.
Shut down one of the servers by using the Ctrl
+ C
key combination in the command prompt to verify that no singleton service will be running after the quorum is not reached.
WARN [org.wildfly.clustering.server] (DistributedSingletonService - 1) WFLYCLSV0006: Failed to reach quorum of 2 for org.jboss.as.quickstarts.ha.singleton.service.primary-only service. No singleton master will be elected.
INFO [org.wildfly.clustering.server] (thread-20) WFLYCLSV0002: This node will no longer operate as the singleton provider of the org.jboss.as.quickstarts.ha.singleton.service.primary-only service
INFO [org.jboss.as.quickstarts.ha.singleton.service.primary.SingletonService] (MSC service thread 1-3) Singleton service is stopping on node 'node2'.
INFO [org.infinispan.remoting.transport.jgroups.JGroupsTransport] (thread-2) ISPN000094: Received new cluster view for channel server: [node2|4] (1) [node2]
...
WARN [org.jboss.as.quickstarts.ha.singleton.service.primary.QueryingService] (pool-4-thread-1) Failed to query singleton service.
A quorum-remove.cli
script is provided in the root directory of this quickstart that removes the quorum from the singleton
subsystem.
If the singleton is running on multiple nodes, check for the following issues.
The most common cause of this problem is starting the servers with the standalone.xml
or standalone-full.xml
profile instead of with the standalone-ha.xml
or standalone-full-ha.xml
profile. Make sure to start the server with an HA profile using -c standalone-ha.xml
.
Another common cause is because the server instances did not discover each other and each server is operating as a singleton cluster. Ensure that multicast
is enabled or change the jgroups
subsystem configuration to use a different discovery mechanism. Confirm the following message in the server log to ensure that the discovery was successful.
INFO [org.infinispan.remoting.transport.jgroups.JGroupsTransport] (MSC service thread 1-3) ISPN000094: Received new cluster view for channel server: [node1|1] (2) [node1, node2]
If you have not yet done so, you can undeploy all of the deployed artifacts by following these steps.
mvn wildfly:undeploy
mvn wildfly:undeploy -Dwildfly.port=10090
Some of these examples require that you modify the election policies for the singleton
subsystem by running management CLI scripts. After you have completed testing each configuration, it is important to restore the singleton
subsystem to its default configuration before you run any other examples.
For Linux:
EAP7_HOME_1/bin/jboss-cli.sh --connect --file=restore-singleton-subsystem.cli
EAP7_HOME_2/bin/jboss-cli.sh --connect --controller=localhost:10090 --file=restore-singleton-subsystem.cli
For Windows:
EAP7_HOME_1\bin\jboss-cli.bat --connect --file=restore-singleton-subsystem.cli
EAP7_HOME_2\bin\jboss-cli.bat --connect --controller=localhost:10090 --file=restore-singleton-subsystem.cli
If you want to debug the source code of any library in the project, run the following command to pull the source into your local repository. The IDE should then detect it.
mvn dependency:sources


Psalms 107:31
Oh that men would praise the LORD for his goodness, and for his wonderful works to the children of men!


[§206E-13] Public projects. Any project or activity of any county or agency of the State in a designated district shall be constructed, renovated, or improved in consultation with the authority. [L 1976, c 153, pt of §1]


About Us
We are students and started a business on a very small scale just for living. We are selling products like airpods, headphones, power banks and many more items with exciting discounts and offers. We provide safe and secure payment method of jazzcash or easypaisa as well as Cash On delivery Services. Products are 100% original and incase of any incompatiblity or technical issue, we also provide 7 days replacement warranty. For our customers, we are providing the facility of Free Shipping with no extra Charges.
Other Links
Follow Us on Facebook and Instagram!
House no.250 L, Phase 8, DHA, Lahore, Pakistan
Follow Us on Facebook and Instagram!


Adam Cole reacts to winning the Ladder Match on WWE NXT
by Arunava GhoshalNXT Champion Adam Cole and Dominik Dijakovic faced each other in a Ladder match on tonight's episode of the Black-and-Gold brand. Both the Superstars gave their all to win the battle and eventually, it was the leader of The Undisputed Era who emerged as the victor. Owing to his win, Adam Cole and his team will have a significant advantage during their match against Team Ciampa at NXT TakeOver: WarGames this weekend.
Adam Cole's reaction
The NXT Champion took to Twitter following his match against Dominik Dijakovic to comment on his victory and he seemed pretty confident about leading his team to victory at NXT TakeOver: WarGames
Bring on #WarGames...not only do we have the advantage, but I’m on the run of a damn lifetime right now. #UEisNXT #AdamColeBayBay
At the pay-per-view, Adam Cole, Bobby Fish, Kyle O'Reilly, and Roderick Strong will collide against Tommaso Ciampa, Keith Lee, Dominik Dijakovic and another soon-to-be-revealed Superstar in a WarGames match. They will have a two-on-one advantage over Team Ciampa from the get-go but as it's a WarGames match, we can't really predict which squad will turn out to be the winner.
Less than 24 hours after the conclusion of NXT TakeOver: WarGames, Adam Cole is set to defend the NXT Championship against either of Pete Dunne, Killian Dain or Damian Priest at WWE Survivor Series.
Will the leader of The Undisputed Era be able to make it out of the Survivor Series weekend? We will have our answers very soon.
Want us to know your thoughts on the matches that you see on TV? Go to our WWE section to rate and comment about them!


In a large saucepan of 3 cups water, cook rice according to package instructions; set aside.
Heat olive oil in a large stockpot or Dutch oven over medium heat. Add ground turkey and cook until browned, about 3-5 minutes, making sure to crumble the turkey as it cooks.
Stir in spinach, carrots, zucchini, peas, and brown rice until the spinach has wilted and the mixture is heated through, about 3-5 minutes.


To be or not to be—that is the question:
Whether ’tis nobler in the mind to suffer
The slings and arrows of outrageous fortune,
Or to take arms against a sea of troubles
And, by opposing, end them. To die, to sleep—
No more—and by a sleep to say we end
The heartache and the thousand natural shocks
That flesh is heir to—’tis a consummation
Devoutly to be wished. To die, to sleep—
To sleep, perchance to dream. Ay, there’s the rub,
For in that sleep of death what dreams may come,
When we have shuffled off this mortal coil,
Must give us pause. There’s the respect
That makes calamity of so long life.
For who would bear the whips and scorns of time,
Th’ oppressor’s wrong, the proud man’s contumely,
The pangs of despised love, the law’s delay,
The insolence of office, and the spurns
That patient merit of th’ unworthy takes,
When he himself might his quietus make
With a bare bodkin? Who would fardels bear,
To grunt and sweat under a weary life,
But that the dread of something after death,
The undiscovered country from whose bourn
No traveler returns, puzzles the will
And makes us rather bear those ills we have
Than fly to others that we know not of?
Thus conscience does make cowards (of us all),
And thus the native hue of resolution
Is (sicklied) o’er with the pale cast of thought,
And enterprises of great pitch and moment
With this regard their currents turn awry
And lose the name of action.—Soft you now,
The fair Ophelia.—Nymph, in thy orisons
Be all my sins remembered.
Key value
key: {{ item['key'] }}


Test: dojox.tests.grid.TreeGrid Performance
dojox.grid.DataGrid (For reference)
Quarter
Points
Rebounds
Assists
Time Played
dojox.grid.TreeGrid Large 4-Level
Player
Season
Game
Quarter
Points
Rebounds
Assists
Time Played


To force maven to fail the build on errors, FuncUnit has to exit "hard" with exit code 1 if there's a
failure. Run the js script with the "-e" flag as shown above. This tells the batch script to exit
hard if something throws an error. If this property is set, xunit will exit with exit code 1 if there are failed tests.
Maven is a build tool, usually used for Java projects. FuncUnit can be run from maven as part of the build, using the maven antrun plugin.
Failing on errors
To force maven to fail the build on errors, FuncUnit has to exit "hard" with exit code 1 if there's a failure. Run the js script with the "-e" flag as shown above. This tells the batch script to exit hard if something throws an error. If this property is set, xunit will exit with exit code 1 if there are failed tests.


To select elements based on their position in the document tree, use the Hierarchy Selectors.
The Hierarchy Selectors work by examining the position of target elements relative to other elements:
$("parent > child")
: selects "child" elements that are immediate descendants of the "parent"$("ancestor descendant")
: selects "descendant" elements as long as they have an "ancestor" element somewhere above them$("prev + next")
: selects the "next" element if it is immediately preceded by a "prev" element$("prev ~ siblings")
: selects all "siblings" elements that come after a "prev" element
This is paragraph 1
This is paragraph 2
This is paragraph 3
This is paragraph 4
This is paragraph 5


The repository API is intended as a precursor to CSW services and to support data object registration in external repositories. Some or all of an application's data holdings can be included. In addition, the documentation standard preferred for use in registering the data in a repository can be specified for the application and repository. For example, App A could provide ISO-19115 for DATA.gov but EML for DataONE.
Get a list of external repositories available for this application.
| Parameter | Description | Type | Options |
|---|---|---|---|
| app | Application alias | string | rgis, epscor, elseweb |
None
View the list of supported repositories for RGIS data objects:
/apps/rgis/repositories.json
{"DATA.gov": { "url": "http://www.data.gov/", "description": null, "standards": ["ISO-19115:2003"] }}
Return the repository description.
| Parameter | Description | Type | Options |
|---|---|---|---|
| app | Application alias | string | rgis, epscor, elseweb |
| repo | Repository alias | string |
None
Get the description for the GEOSS repository for the ELSEWeb application:
/apps/elseweb/repository/GEOSS.json
{ "url": "http://www.earthobservations.org/gci_gci.shtml", "description": null, "standards": ["ISO-19119"], "uuid": "7b0ca48c-3303-41c0-b5d7-e64a34a37115", "name": "GEOSS" }
Returns a list of data objects available to this repository and documentation representation.
| Parameter | Description | Type | Options |
|---|---|---|---|
| app | Application alias | string | rgis, epscor, elseweb |
| uuid | Repository identifier | uuid | |
| doctypes | Data object types | string | datasets, collections, tileindexes (as comma-delimited list) |
| standard | Documentation standard | string | |
| ext | Format | string | json |
| Parameter | Description | Type | Options | Required |
|---|---|---|---|---|
| limit | integer | F (defaults to 20) | ||
| offset | integer | F (defaults to 0) | ||
| changed | Filter by the date the documentation was changed for a data object | string | {before|after}:yyyyMMdd | F |
| added | Filter by the date the documentation was added for a data object | string | {before|after}:yyyyMMdd | F |
| changedOrAdded | Filter by the date the documentation was changed or added for a data object | string | {before|after}:yyyyMMdd | F |
| changedAndAdded | Filter by the date the documentation was changed for a data object or the date a documentation record was added for a data object | string | {before|after}:yyyyMMdd | F |
Note: including both the changed and added query parameters is effectively an AND filter. Use the combined changedAndAdded to filter based on the same datetime and order.
Return the most recently added or modified documentation records for datasets in the ELSEWeb GEOSS repository:
/apps/elseweb/repository/GEOSS/datasets/ISO-19119.json
Return the last 10 documentation records that were added or modified after March 1, 2014, for datasets in the ELSEWeb GEOSS repository:
/apps/elseweb/repository/GEOSS/datasets/ISO-19119.json?changedOrAdded=after:20140301&limit=10
{ "total": 6656, "results": [ { "url": "http://----------------/apps/elseweb/datasets/a14f6223-a394-47dd-9b0f-8a32dbc41364/metadata/ISO-19119.xml", "date_added": "20130419", "date_modified": "20130419", "dataset": "a14f6223-a394-47dd-9b0f-8a32dbc41364" }, { "url": "http://----------------/apps/elseweb/datasets/93aefd99-cab9-4ee3-a87f-a37036a0064b/metadata/ISO-19119.xml", "date_added": "20130419", "date_modified": "20130419", "dataset": "93aefd99-cab9-4ee3-a87f-a37036a0064b" } ] }


Discover Ezyfit: A free curve fitting toolbox for Matlab
F. Moisy, 19 nov 2008.
Laboratory FAST, University Paris Sud.
Contents
About the Ezyfit Toolbox
The EzyFit toolbox for Matlab enables you to perform simple curve fitting of one-dimensional data using arbitrary fitting functions. It provides command-line functions and a basic graphical user interface for interactive selection of the data.
 Let's fit this data with the function f(t)=a*exp(-t/tau), and show the fit with a bold red line:
undofit % deletes the previous fit showfit('f(t)=a*exp(-t/tau)','fitlinewidth',2,'fitcolor','red');
Equation: f(t) = a*exp(-t/tau) a = 4.3409 tau = 4.397 R = 0.99697 (lin)
Note that showfit recognizes that t is the variable, and the coefficients of the fit are named a and tau.
If you want to use the values of the coefficients t and tau into Matlab, you need to creates these variables into the base workspace:
makevarfit a tau
a = 4.3409 tau = 4.3970
Initial guesses
Now suppose you want to fit more complex data, like a distribution showing two peaks. Let's try to fit these peaks with two gaussians, each of height a, mean m and width s.
plotsample hist2 nodisp showfit('a_1*exp(-(x-x_1)^2/(2*s_1^2)) + a_2*exp(-(x-x_2)^2/(2*s_2^2))');
Exiting: Maximum number of function evaluations has been exceeded - increase MaxFunEvals option. Current function value:<PHONE_NUMBER>53 Equation: y(x) = a_1*exp(-(x-x_1)^2/(2*s_1^2))+a_2*exp(-(x-x_2)^2/(2*s_2^2)) a_1 = 41.052 a_2 = -2492.7 s_1 = 1269.4 s_2 = 13.262 x_1 = 1062.3 x_2 = -38.289 R = 0.32602 (lin)
The solver obviously get lost in our 6-dimensional space. Let's help it, by providing initial guesses
undofit showfit('a_1*exp(-(x-m_1)^2/(2*s_1^2)) + a_2*exp(-(x-m_2)^2/(2*s_2^2)); a_1=120; m_1=7; a_2 = 100; m_2=15', 'fitcolor','blue','fitlinewidth',2);
Equation: y(x) = a_1*exp(-(x-m_1)^2/(2*s_1^2))+a_2*exp(-(x-m_2)^2/(2*s_2^2)) a_1 = 128.41 a_2 = 77.126 m_1 = 6.9929 m_2 = 14.783 s_1 = 0.42396 s_2 = 1.4307 R = 0.98977 (lin)
The result seems to be correct now. Note that only 4 initial guesses are given here; the two other ones, s_1 and s_2, are taken as 1 -- which is close to the expected solution.
Fitting in linear or in log scale
Suppose you want to fit a power law in logarithmic scale:
plotsample power nodisp showfit power
Equation: y(x) = a*x^n a = 0.4784 n = 2.494 R = 0.99934 (log)
would you have obtained the same result in linear scale? No:
swy % this shortcut turns the Y-axis to linear scale showfit('power','fitcolor','red');
Equation: y(x) = a*x^n a = 2.9016 n = 2.2564 R = 0.99608 (lin)
The value of the coefficients have changed. In the first case, LOG(Y) was fitted, whereas in the second case Y was fitted, because the Y-axis has been changed.
You may however force showfit to fit LOG(Y) or Y whatever the Y axis, by specifying 'lin' or 'log' in the first input argument:
rmfit % this removes all the fits showfit('power; lin','fitcolor','red'); showfit('power; log','fitcolor','blue');
Equation: y(x) = a*x^n a = 2.9016 n = 2.2564 R = 0.99608 (lin) Equation: y(x) = a*x^n a = 0.4784 n = 2.494 R = 0.99934 (log)
In the equation information, it is specified (lin) or (log) after the R coefficient.
Using the fit structure f
You can fit your the data without displaying it:
x=1:10;
y=[15 14.2 13.6 13.2 12.9 12.7 12.5 12.4 12.4 12.2];
f = ezfit(x,y,'beta(rho) = beta_0 + Delta * exp(-rho * mu); beta_0 = 12');
f is a structure that contains all the informations about the fit:
f
f = name: 'beta(rho)=beta_0+Delta*exp(-rho*mu)' yvar: 'beta' xvar: 'rho' fitmode: 'lin' eq: 'beta_0+Delta*exp(-rho*mu)' r: 0.9992 param: {'Delta' 'beta_0' 'mu'} m: [3.9949 12.1058 0.3237] m0: [1 12 1] x: [1 2 3 4 5 6 7 8 9 10] y: [1x10 double]
From this structure, you can plot the data and the fit:
clf
plot(x,y,'r*');
showfit(f)
Equation: beta(rho) = beta_0+Delta*exp(-rho*mu) Delta = 3.9949 beta_0 = 12.106 mu = 0.32368 R = 0.99925 (lin)
you can also display the result of the fit
dispeqfit(f)
Equation: beta(rho) = beta_0+Delta*exp(-rho*mu) Delta = 3.9949 beta_0 = 12.106 mu = 0.32368 R = 0.99925 (lin)
or create the variables in the base workspace
makevarfit(f) beta_0 mu Delta
beta_0 = 12.1058 mu = 0.3237 Delta = 3.9949
Weigthed fit
Suppose now we want to fit data with unequal weights, shown here as error bars of different lengths:
x = 1:10;
y = [1.56 1.20 1.10 0.74 0.57 0.55 0.31 0.27 0.28 0.11];
dy = [0.02 0.02 0.20 0.03 0.03 0.10 0.05 0.02 0.10 0.05];
clf, errorbar(x,y,dy,'o');
In order to perform a weighted fit on this data, the vectors y and dy have to be merged into a 2-by-N matrix and given as the second input argument to ezfit. Compare the results for the usual and weighted fits:
fw = ezfit(x, [y;dy], 'exp'); showfit(fw,'fitcolor','red'); f = ezfit(x, y, 'exp'); showfit(f,'fitcolor','blue');
Equation: y(x) = a*exp(b*x) a = 2.0017 b = -0.2519 R = 0.98832 (lin) Equation: y(x) = a*exp(b*x) a = 2.0071 b = -0.24013 R = 0.99067 (lin)
The red curve (weighted fit) tends to go through the data with smaller error bars.


Senior Analyst - Strategy and Analytics - San Francisco, CA
Branch Overview
Branch delivers world-class financial services to the mobile generation. With offices in San Francisco, Lagos, Mexico City, Mumbai and Nairobi, Branch is a for-profit socially conscious company that uses the power of data science to reduce the cost of delivering financial services in emerging markets. We believe that everyone, everywhere deserves fair financial access. The rapid spread of smartphones presents an opportunity for the world’s emerging middle class to access banking options and achieve financial flexibility.
Branch’s mission-driven team is led by founder and former CEO of Kiva.org. The company presents a rich opportunity for our team members to drive meaningful growth in rapidly evolving and changing markets. Most recently, Branch announced our Series C and has garnered more than $100M in funding with investments from leading Silicon Valley firms.
Job Overview
You will help to solve analytical problems across the organization and grow profitability by proposing product and strategy changes. You will make data driven decisions to optimize performance in various areas across the product, growth, and operations strategy
Responsibilities
Collaborate with data science, product, marketing, collections, and engineering to propose hypothesis testing to improve risk and profitability
Conduct ad-hoc analysis to identify underlying explanations for changes in portfolio performance, develop data-driven solutions, and evaluate expected portfolio impacts
Propose data driven product changes to improve customer experience and company profitability. Partner with product and engineering teams to implement your solution into production
Building a user level valuations model to inform future product and marketing decisions
Track and update credit policy to optimize for company risk, profitability, and growth targets
Develop statistical models to assist in pricing and user segmentation for capital markets transactions and financial data analysis
Qualifications
Fluent in SQL, R/Python or (similar statistical analysis tool), excel
Previous experience in analytics and/or quantitative modeling, using large datasets
Experience analyzing, visualizing and communicating impactful insights to management, investors and/or auditors
Strong strategic thinking and problem-solving skills
3-5+ years relevant experience
Enthusiasm for working across cultures, functions and time zones
Benefits of Joining
Mission-driven, fast-paced and entrepreneurial environment
Competitive salary and equity package
99% coverage of insurance costs (health, dental, vision)
Unlimited PTO
Discretionary trips to our offices across the globe
Pre-tax commuter and 401(k) programs
Weekly team meals
Flexible working hours
Branch International is an Equal Opportunity Employer. The company does not and will not discriminate in employment on any basis prohibited by applicable law.


Python API Guide
Overview#
LGSVL Simulator exposes runtime functionality to a Python API which you can use to manipulate object placement and vehicle movement in a loaded scene, retrieve sensor configuration and data, control weather, time state, and more.
The interface to listen for incoming API calls is defined in config.yml
. See
Configuration File and Command Line Parameters
for more information.
Table of Contents
Requirements top#
Using Python API requires Python version 3.5 or later.
Quickstart top#
Python API is available in separate repository: https://github.com/lgsvl/PythonAPI
After cloning or downloading it from the git repository follow these steps:
-
Run the following command to install Python files and necessary dependencies:
pip3 install --user -e .
-
Now launch the simulator (either binary .exe file or from Unity Editor). Simulator by default listens for connections on port 8181 on localhost.
-
Click the
Open Browser
button to open the Simulator UI. -
After the default maps and vehicles have been downloaded, navigate to the
Simulations
tab. -
Create a new Simulation. Give it a name and check the
API Only
option. ClickSubmit
. -
Select the newly created Simulation and click the "Play" button in the bottom right.
-
Run the following example to see the API in action:
./quickstart/05-ego-drive-in-circle.py
This will load the
BorregasAve.unity
scene, instantiate one EGO vehicle, then ask you to pressEnter
to start driving EGO vehicle in a circle.
When the script is running, it will apply throttle and steering commands to make the car move.
Core concepts top#
The Simulator and API communicate by sending json over a websocket server running on 8181 port. The API client can be either on the same machine or any other machine on the same network.
API exposes the following main types:
- Simulator - main object for connecting to simulator and creating other objects
- Agent - superclass of vehicles and pedestrian
- EgoVehicle - EGO vehicle with accurate physics simulation and sensors
- NpcVehicle - NPC vehicle with simplified physics, useful for creating many background vehicles
- Pedestrian - pedestrian walking on sidewalks
Vehicles and Pedestrian are a subclasses of Agent which has common properties like transform, position, and velocity.
All coordinates in the API return values in the Unity coordinate system. This coordinate system uses meters as a unit of distance and is a left-handed coordinate system - x points left, z points forward, and y points up.
The Simulator class provides helper methods to convert coordinates to and from latitude/longitude and northing/easting values.
Simulation top#
To connect to the simulator you need to an instance of the Simulator
class:
import lgsvl
sim = lgsvl.Simulator(address = "localhost", port = 8181)
You can specify a different address as hostname or IP address. By default only port 8181 is used for API connection. Only one client can be connected to simulator at a time.
Next, load the scene ("map"). This is done by load
method:
sim.load(scene = "BorregasAve", seed = 650387)
Scene is a string representing the name of the Map
in the Web UI. Currently available scenes:
- BorregasAve - small suburban map
- AutonomouStuff - small office park
Seed (optional) is an Integer (-2,147,483,648 - 2,147,483,647) that determines the "random" behavior of the NPC vehicles and rain effects.
Check the Web UI Maps tab for a full list of available scenes.
Once a scene is loaded you can instantiate agents and run simulations. See the Agents section on how to create vehicles and pedestrians.
Loading scenes takes a while, to reset a scene to the initial state without reloading it call the reset
method:
sim.reset()
This will remove any vehicles or callbacks currently registered.
After setting up the scene in a desired state you can start advancing time.
During python code execution time is stopped in the simulator. To run the simulator in realtime, call the run
method:
sim.run(time_limit = 5.0)
run
accepts an optional argument for a time limit specifying how long to run. The default
value of 0 will run infinitely.
Diagram illustrating API execution:
Non-realtime Simulation top#
The simulator can be run at faster-than-realtime speeds depending on the performance of the computer running the simulator.
This is done by calling the run
method with the time_scale
argument:
sim.run(time_limit = 6, time_scale = 2)
run
takes a 2nd optional argument specifying how much faster to run.
In the above example, if the computer is fast enough the run call will finish in 3 seconds (6 divided by 2),
but 6 virtual seconds of data would be generated. If only time_scale
is specified or time_limit
= 0,
then simulation will run continuously at non-realtime speed.
The value of time_scale can be lower than 1 which gives ability to run simulation in slower than real time.
Agents top#
You can create vehicles and pedestrians by calling the add_agent
method of the Simulator
object. Example:
ego = sim.add_agent(name = "Lincoln2017MKZ (Apollo 5.0)", \
agent_type = lgsvl.AgentType.EGO, state = None)
This will create the Lincoln2017MKZ (Apollo 5.0)
vehicle from the Web UI Vehicles tab. Other AgentTypes
available are:
- AgentType.EGO - EGO vehicle
- AgentType.NPC - NPC vehicle
- AgentType.PEDESTRIAN - pedestrian
Each agent type has predefined names you can use. Currently availble EGO vehicles:
- Jaguar2015XE (Apollo 3.0) - Apollo 3.0 vehicle
- Jaguar2015XE (Apollo 5.0) - Apollo 5.0 vehicle
- Jaguar2015XE (Autoware) - Autoware vehicle
- Lexus2016RXHybrid (Autoware) - Autoware vehicle
- Lincoln2017MKZ (Apollo 5.0) - Apollo 5.0 vehicle
Available NPC vehicles:
- Sedan
- SUV
- Jeep
- Hatchback
- SchoolBus
- BoxTruck
Available pedestrian types:
- Bob
- EntrepreneurFemale
- Howard
- Johny
- Pamela
- Presley
- Red
- Robin
- Stephen
- Zoe
If an incorrect name is entered, a Python exception will be thrown.
Optionally you can create agents in specific positions and orientations in the scene.
For this you need to use the AgentState
class. For example:
state = lgsvl.AgentState()
state.transform.position = lgsvl.Vector(10, 0, 30)
state.transform.rotation.y = 90
ego = sim.add_agent("Lincoln2017MKZ (Apollo 5.0)", lgsvl.AgentType.EGO, state)
This will create a vehicle at position x=10, z=30 which is rotated 90 degrees around the vertical axis. The position and rotation are set in the world coordinates space.
You can always adjust the position, rotation, velocity and angular velocity of the agent at any later time:
s = ego.state
s.velocity.x = -50
ego.state = s
This will set x component of velocity (in world coordinate space) to -50 meters per second and leave y and z components of velocity unmodified.
All agents have the following common functionality:
state
- property to get or set agent state (position, velocity, ...)transform
- property to gettransform
member of the state (shortcut forstate.transform
)bounding_box
- property to get bounding box in local coordinate space. Note that bounding box is not centered around (0,0,0) - it depends on the actual geometry of the agent.on_collision
- method to set a callback function to be called when the agent collides with something (other agent or static obstacle), see callbacks section for more information.
EGO vehicle top#
EGO vehicle has following additional functionality:
apply_control
- method to apply specified throttle, break, steering or other actions to vehicle. Passsticky=True
to apply these values on every simulation update iteration.get_sensors
- method to return list of sensorsconnect_bridge
- method to connect to ROS or Cyber RT bridgebridge_connected
- bool property,True
if bridge is connected
You can control the movement of the EGO vehicle either by manually specifying state, applying manual control, or connecting through the bridge.
Example to apply constant 20% throttle to EGO vehicle:
ego = sim.add_agent("Lincoln2017MKZ (Apollo 5.0)", lgsvl.AgentType.EGO)
c = lgsvl.VehicleControl()
c.throttle = 0.2
ego.apply_control(c, True)
NPC vehicles top#
You can create multiple NPC vehicles on the map to drive along the lanes or follow specific waypoints on the map.
NPC vehicle has the following additional functionality:
change_lane
- method to make the vehicle change lanesfollow
- method to make vehicle follow specific waypointsfollow_closest_lane
- method to make vehicle follow laneson_waypoint_reached
- method to set callback function which is called for every waypoint the vehicle reacheson_stop_line
- method to set callback function which is called when vehicle reaches a stop line at interesectionon_lane_change
- method to set callback function which is called when vehicle decides to change lanes
You can control the movement of an NPC vehicle either by manually specifying state, or instructing it to follow waypoints or lanes.
To make an NPC follow waypoints prepare a list of DriveWaypoint
objects and call
the follow
method for the npc vehicle:
npc = sim.add_agent("Sedan", lgsvl.AgentType.NPC)
waypoints = [
lgsvl.DriveWaypoint(lgsvl.Vector(1,0,3), 5, lgsvl.Vector(0, 0, 0), 0, False, 0),
lgsvl.DriveWaypoint(lgsvl.Vector(5,0,3), 10, lgsvl.Vector(0, 0, 0), 0, False, 0),
lgsvl.DriveWaypoint(lgsvl.Vector(1,0,5), 5, lgsvl.Vector(0, 0, 0), 0, False, 0),
]
npc.follow(waypoints, loop=True)
Each waypoint has a position in world coordinates, a desired velocity in m/s, a desired angular orientation as a vector of Euler angles, an optional wait-time for the vehicle to stay idle, an bool on whether the NPC should be active while idling, and an optional trigger distance. The NPC
will ignore all traffic rules and will not avoid collisions to try to get to the next
waypoint. The angular orientation of the NPC will be interpolated in such a manner that it will pass through the waypoint at the angle specified in the DriveWaypoint
. The trigger distance, if used, provides a method to pause the NPC until an ego vehicle approaches. The NPC will begin to drive as soon as its distance to an ego vehicle drops below the value specified as trigger distance in the DriveWaypoint
.
You can receive information on progress by setting the on_waypoint_reached
callback. Example (see callbacks for more details):
npc = sim.add_agent("Sedan", lgsvl.AgentType.NPC)
def on_waypoint(agent, index):
print("waypoint {} reached".format(index))
npc.follow(waypoints, loop=True)
npc.on_waypoint_reached(on_waypoint)
sim.run()
follow_closest_lane
will make the NPC vehicle follow whatever lane is the closest.
Upon reaching intersections it will randomly decide to either drive straight or turn.
You can also spawn a pool of NPC vehicles with the same behavior as NPCs added to a non-API simulation. They will follow the map annotations, obey speed limits, obey traffic signals, and attempt to avoid accidents. These NPCs cannot be directly controlled.
sim.add_random_agents(lgsvl.AgentType.NPC)
Pedestrians top#
You can create Pedestrian
agents that will allow you to create pedestrians on sidewalks
and make them walk.
Pedestrians have the following additional functionality:
walk_randomly
- method to make pedestrian walk randomly on the sidewalkfollow
- method to make pedestrian follow specific waypointson_waypoint_reached
- method to set callback function which is called for every waypoint reached
You can control the movement of pedestrians either by manually specifying state, or instructing them to follow waypoints or walk randomly.
To make pedestrians follow waypoints prepare a list of WalkWaypoint
objects and call
the follow
method for pedestrians:
npc = sim.add_agent("Bob", lgsvl.AgentType.PEDESTRIAN)
waypoints = [
lgsvl.WalkWaypoint(lgsvl.Vector(1,0,3), 5, 0),
lgsvl.WalkWaypoint(lgsvl.Vector(5,0,3), 10, 0),
lgsvl.WalkWaypoint(lgsvl.Vector(1,0,5), 5, 0),
]
npc.follow(waypoints, loop=True)
Each waypoint has a position in world coordinates, an optional idle time that the pedestrian will
spend standing in-place when it reaches the waypoint, and an optional trigger distance. You can receive information on progress by
setting the on_waypoint_reached
callback.
You can also spawn a pool of pedestrians with the same behavior as pedestrians added to a non-API simulation. They will follow the map annotations and path find. These pedestrians cannot be directly controlled.
sim.add_random_agents(lgsvl.AgentType.PEDESTRIAN)
Callbacks top#
The Python API can invoke callbacks to inform you of specific events that occur during
simulator runtime. Callbacks are invoked from inside the Simulator.run
method and
while a callback is running the simulation time is paused. Once the callback finishes time is resumed and the simulation resumes execution. You can call Simulator.stop
to stop further execution and return immediately from the callback.
The internals of this process are illustrated in the following sequence diagram:
Here the code resumes simulation after the first callback, but stops execution when the second callback is handled.
You set callback functions by calling on_NAME
method of object, see information below.
Agent Callbacks top#
collision
- called when agent collides with something (other agent or stationary
obstacle).
Example usage:
def on_collision(agent1, agent2, contact):
name1 = "STATIC OBSTACLE" if agent1 is None else agent1.name
name2 = "STATIC OBSTACLE" if agent2 is None else agent2.name
print("{} collided with {} at {}".format(name1, name2, contact))
ego.on_collision(on_collision)
Callback receives three arguments: (agent1, agent2, contact)
- the first two are the agents that collide,
one of them can be None if it is a stationary obstacle like a building or a traffic light pole,
and the third is the world position of the contact point.
EgoVehicle Callbacks top#
In addition to Agent callbacks, EgoVehicle has one extra callback.
on_custom
- called when a Sensor Plugin sends a callback; accepts three arguments:
(agent, kind, context)
- agent instance, kind of sensor plugin as string, JSON context
See Sensor Plugins for more information.
NpcVehicle Callbacks top#
In addition to Agent callbacks, NpcVehicle has three extra callbacks:
waypoint_reached
- called when vehicle reaches a waypoint; accepts two
arguments: (agent, index)
- agent instance and waypoint index as integer
stop_line
- called when vehicle stops at a stop line for a traffic light or stop sign; accepts one argument: (agent)
- agent instance
lane_change
- called when vehicle starts changing lane; accepts one
argument: (agent)
- agent instance
Pedestrian Callbacks top#
In addition to Agent callbacks, Pedestrian has one extra callback.
waypoint_reached
- called when pedestrian reaches waypoint; accepts two
arguments: (agent, index)
- agent instance and waypoint index as integer.
Sensors top#
EGO vehicles have sensors attached. You can get a list of them by
calling EgoVehicle.get_sensors()
which returns a Python list with instances of the following
classes:
- CameraSensor - see Camera sensor
- LidarSensor - see Lidar sensor
- ImuSensor - see IMU sensor
- GpsSensor - see GPS sensor
- RadarSensor - see Radar sensor
- CanBusSensor - see CAN bus sensor
Each sensor has the following common members:
name
- name of sensor, to differentiate sensors of the same type, for example, to choose one out of multiple cameras attached to EgoVehicletransform
- property that contains position and rotation of a sensor relative to the agent transformenabled
- bool property, set toTrue
if sensor is enabled for capturing and sending data to ROS or Cyber bridge
Camera Sensor top#
The Camera sensor has the following read only properties:
frequency
- rate at which images are captured & sent to ROS or Cyber bridgewidth
- image widthheight
- image heightfov
- vertical field of view in degreesnear_plane
- distance of near planefar_plane
- distance of far planeformat
- format of image ("RGB" for 24-bit color image, "DEPTH" - 8-bit grayscale depth buffer, "SEGMENTATION" - 24-bit color image with semantic/instance segmentation)
Camera image can be saved to disk by calling save
:
ego = sim.add_agent("Lincoln2017MKZ (Apollo 5.0)", lgsvl.AgentType.EGO)
for sensor in ego.get_sensors():
if sensor.name = "Main Camera":
sensor.save("main-camera.png", compression=0)
save
method accepts a path relative to the running simulator, and an optional compression
for png files (0...9)
or quality
(0..100) for jpeg files.
Lidar Sensor top#
Lidar sensor has following read only properties:
min_distance
- minimal distance for capturing pointsmax_distance
- maximum distance for capturing pointsrays
- how many laser rays (vertically) to userotations
- frequency of rotation, typically 10Hzmeasurements
- how many measurmenets per rotation each ray is takingfov
- vertical field of view (bottom to top ray) in degreesangle
- angle lidar is tilted (middle of fov view)compensated
- bool, whether lidar point cloud is compensated
Lidar point cloud can be saved to disk as a .pcd file by calling save
:
ego = sim.add_agent("Lincoln2017MKZ (Apollo 5.0)", lgsvl.AgentType.EGO)
for sensor in ego.get_sensors():
if sensor.name = "Lidar":
sensor.save("lidar.pcd")
A .pcd
file is in the binary Point Cloud Data format where each point has x/y/z coordinates as 4-byte floats and a 1-byte unsigned int as intensity (0...255).
IMU Sensor top#
You can use the IMU sensor to get its position in the vehicle. All measurements an IMU would provide can be obtained by using the transform
property of the agent.
GPS Sensor top#
You can retrieve the current GPS location from the GPS sensor by calling data
:
data = gps_sensor.data()
print("Latitude:", data.latitude)
Returned data will contain following fields:
latitude
longitude
northing
easting
altitude
orientation
- rotation around up-axis in degrees
Radar Sensor top#
Currently the Radar sensor can be used only to get its position and rotation in the vehicle. Radar measurements can be received in ROS or Cyber by setting the enabled
property of the sensor.
CAN bus top#
Currently CAN bus can be used only to get its position and rotation in the vehicle. CAN bus messages can be received in ROS or Cyber by setting the enabled
property of the sensor.
Weather and Time of Day Control top#
You can control the weather properties of the simulation by reading or writing to the weather
property. You can
set rain
, fog
or wetness
(float 0...1). Example:
w = sim.weather
w.rain = 0.5 # set rain to 50%
sim.weather = w
Changing time of day allows to control whether the loaded scene appears as day or night.
To get the current time read the time_of_day
property:
print("Current time of day:", sim.time_of_day)
It will return a float between 0 and 24. To set time of day call set_time_of_day
:
sim.set_time_of_day(10, fixed=True)
This will set current time of day to 10am. The optional bool argument fixed
indicates whether the simulation
should advance this time automatically or freeze it and not change it (fixed=True
).
Controllable Objects top#
A controllable object is an object that you can control by performing an action using Python APIs. Each controllable object has its own valid actions
(e.g., green, yellow, red, trigger, wait, loop) that it can take and is controlled based on control policy
, which defines rules for control actions.
For example, a traffic light is a controllable object, and you can change its behavior by updating control policy: "trigger=50;green=1;yellow=1.5;red=2;loop"
trigger=50
- Wait until an ego vehicle approaches this controllable object within 50 metersgreen=1
- Change current state togreen
and wait for 1 secondyellow=1.5
- Change current state toyellow
and wait for 1.5 secondred=2
- Change current state tored
and wait for 2 secondloop
- Loop over this control policy from the beginning
Available controllable object types:
- signal
- cone
All Controllable objects can be added or removed dynamically. When reset() is called, all Controllables are removed and the ones in the map (if any) are added back. Controllable objects can be loaded plugins at runtime. Plugin must include IControllable and be built using the Simulator build process from Assets/External/Controllables folder.
To get a list of controllable objects in a scene:
controllables = sim.get_controllables()
For a controllable object of interest, you can get following information:
signal = controllables[0]
print("Type:", signal.type)
print("Transform:", signal.transform)
print("Current state:", signal.current_state)
print("Valid actions:", signal.valid_actions)
For control policy, each controllable object always has default control policy (read-only). When you load a scene for the first time or reset a scene to the initial state, a controllable object resets current control policy to default one follows it.
You can get default control policy and current control policy as follows:
print("Default control policy:", signal.default_control_policy)
print("Current control policy:", signal.control_policy)
To change a current control policy, you can create a new control policy and call control
function as below:
control_policy = "trigger=50;green=1;yellow=1.5;red=2;loop"
signal.control(control_policy)
To add a plugin controllable and set object state
state = lgsvl.ObjectState()
state.transform.position = lgsvl.Vector(0,0,0)
state.transform.rotation = lgsvl.Vector(0,0,0)
state.velocity = lgsvl.Vector(0,10,0)
state.angular_velocity = lgsvl.Vector(6.5,0,0)
cone = sim.controllable_add("TrafficCone", state)
To get plugin controllable object state
cone.object_state
To set plugin controllable object state
state = lgsvl.ObjectState()
state.transform.position = lgsvl.Vector(0, 0, -10)
cone.object_state = state
Helper Functions top#
Simulator class offers following helper functions:
version
- property that returns current version of simulator as stringcurrent_scene
- property that returns currently loaded scene as string, None if none is loadedcurrent_frame
- property that returns currently simulated frame number as integercurrent_time
- property that returns currentl simulation time in seconds as floatget_spawn
- method that returns list of transforms representing good positions where to place vehicles in the map. This list can be empty, it depends on how the map is prepared in Unity. Returned transforms containposition
androtation
members as aVector
get_agents
- method that returns a list of currently available agent objects added withadd_agent
To map points in Unity coordinates to GPS coordinates the Simulator class offers the following two functions:
map_to_gps
- maps transform (position & rotation) to GPS location, returns same type as GPS Sensordata
methodmap_from_gps
- maps GPS location (latitude/longitude or northing/easting) to transformraycast
- shoots a ray from specific location and returns closest object it hits
map_from_gps
accepts two different inputs - latitude/longitude or northing/easting. Examples:
tr1 = sim.map_from_gps(latitude=10, longitude=-30)
tr2 = sim.map_from_gps(northing=123455, easting=552341)
Optionally you can pass altitude and orientation.
raycast
method can be used in following way:
origin = lgsvl.Vector(10, 0, 20)
direction = lgsvl.Vector(1, 0, 0)
hit = sim.raycast(origin, direction, layer_mask=1)
if hit:
print("Distance right:", hit.distance)
This will shoot a ray in the positive x-axis direction from the (10,0,20) coordinates.
A RaycastHit
object with distance
, point
and normal
fields is returned if something is hit, otherwise None
is returned.
When raycasting you should specify a layer_mask
argument that specifies which objects to check
collision with. It corressponds to layers in the Unity project - check the project for actual values.
Changelog top#
- 2020-08-28
- Added support for time-to-collision and distance-to-collision triggers for NPCs and pedestrians
- 2020-05-22
- Added suport for setting pedestrian travel speed
-
2020-01-30
- Extended controllable objects to support plugins - see controllable plugins
-
2019-09-05
- Extended
DriveWaypoint
to support angle, idle time and trigger distance - Added controllable objects - use
Simulator.get_controllables
- Extended
-
2019-08-12
- Added
time_scale
argument to run function for running simulation in non-realtime - Added
seed
argument toSimulator.load
for deterministic NPCs
- Added
-
2019-04-19
- initial release


normalizedSync.php - Single file demo
Are you trying to sync de-normalized data from a remote source (e.g. webservice) and struggle importing it into your nicely normalized database? Maybe this little demo might give you an idea!
Part 1: ( Normalize existing DB-Data )
Part 2: Keepin’ it all in sync
-
run this from your CLI:
curl -Ls http://git.io/6VTovw | php
-
or download the normalizedSync.php file and run it locally
So… just what exactly is going on here?
Picture this:
- You’re facing yourself with the task to frequently pull data from theSERVICE via their API and keep a synchronized copy on your DB cluster.
- You skim the docs, run some little test scripts and have soon found just the right combination of URL and request data to get exactly the data you need to have.
- You head happily and motivated into implementing and testing your little cron jobby.
And then you realize…
Yeah, but what happened???
Well… Someone over at theSERVICE thought:
“Nah, our users surely won’t need the relational data from our systems… Let’s give ‘em the human friendly, easy readable, flat version.”
Or maybe someone though:
“3NF - WHAT? Ain’t nobody got tyme fo’ dat!”
So basically, you’re facing this situation:

+----------------------+---------------------------+--------------------+-------------+
| vendor | category | name | .... |
+----------------------|---------------------------|--------------------|-------------+
| | | | |
| Vendor 1 | Category 2 | Product 1 | |
+-------------------------------------------------------------------------------------+
| | | | |
| Vendor 1 | Category 2 | Product 2 | |
+-------------------------------------------------------------------------------------+
| | | | |
| Vendor 2 | Category 1 | Product 3 | |
+-------------------------------------------------------------------------------------+
| | | | |
| Vendor 3 | Catefory 3 | Product 4 | |
+----------------------+---------------------------+--------------------+-------------+
\\===> This is the structure of the data you received...

But:
Your system looks like this:

+-----+-----------------------+ +-----+--------------------------+
| id | name | | id | name |
|-----|-----------------------| |-----|--------------------------|
| | | | | |
| 1 | Vendor 1 | | 1 | Category 43 |
+-----------------------------+ +--------------------------------+
| | | | | |
| 2 | Vendor 2 | | 2 | Category 1 |
+-----------------------------+ +--------------------------------+
| | | | | |
+-----+-----------------------+ +-----+--------------------------+
\\==============> vendors table \\==============> categories table

+-----+--------------+-----------------+----------------------+-----------+
| id | vendor_id | category_id | name | ... |
|-----|--------------|-----------------|----------------------|-----------|
| | | | | |
| 1 | 1 | 2 | Product 1 | |
+-------------------------------------------------------------------------+
| | | | | |
| 2 | 1 | 3 | Product 2 | |
+-------------------------------------------------------------------------+
| | | | | |
| 3 | 2 | 12 | Product OVER 9000 | |
+-------------------------------------------------------------------------+
\\=========================================================> products table

And:
Your cron-script takes an hour to complete…
Dis no good.
Enter: This Demo Script! Again: just run “curl -Ls http://git.io/6VTovw | php” from your CLI and see the data flowing in.
Let me quickly describe what’s going on there:
- PHP parses the source file for any class declarations
- The script grabs Jeremy Dorn’s (@jdorn) SqlFormatter to get some juice ;)
- The main loop is called. Just 3 iterations of a formloop, with constantly growing result sets
- Within the loop:
- Related data (vendors, categories) get extracted from the flat dataset
- Then 2 batch insert queries are fired (ON DUPLICATE KEY UPDATE) and the results are instantly retrieved
- And a lookup transformation is applied: Before: vendors[] = {“id”: 1, “name”: “Vendor 1”} After: vendors[“Vendor 1”] = {“id”: 1, “name”: “Vendor 1”} * So with that easy accessible array of meta-infos, for every row of the received data, the columns vendor and category will be replaced by vendor_id, respectively category_id * Out of this normalized result set, we can quickly create another batch insert
- And be done.
But seriously, read the source, get a hang of what’s happening. This was more or less hastily done, and probably has loads of things to optimize.
But you get the idea ;)
One more thing…
There are a few things I’d like to point out and/or explain:
Why do you use array_map() that much? Why no loops?
- I easily could’ve used loops, but I wanted to keep it relatively short.

- Well, I started answering a question about how that particular person could implement an efficient way to solve exactly this problem.
- The thing got out of hand…
So, is it efficient?
- To be fair, I just lab-tested it. I have no real-life benchmarks or anything.
- This particular thing uses 15 db queries in total, and the queries aren’t super complex either. But again, I have not analyzed in regards of performance
Okay, Lab-tested? You sure have run it against a DB, haven’t ya?
OK! Here’s the interesting bit:
We’ve got 3 classes (Sorry @jdorn ):
- Helper
- Extractor
- DB
It is Helper’s job to simulate the API-call, perform the lookup transformations, generate the query string, and so on. Just a little collection of sort of generic methods.
When you run the script you will see some output like

*** SysStats: *******************************************************
$> Received 918 products!
$> DB Stats:
$> COUNT(vendors.*) : 100 rows
$> COUNT(categories.*) : 100 rows
$> COUNT(products.*) : 1867 rows
$> Current query count: 15
*** End of SysStats *************************************************

When you take a look at Helper::get_products() you will find that I’ve limited the number of unique vendors and categories to a hundred results each. That’s just for the sake of creating key-collision so the update part of the query is fired to, demonstrating the desired behaviour. (Albeit only accumulating data at this point)
Then we’ve got the Extractor (cue dramatic music) It’s whole purpose is just to extract the meta-info from the API’s data, induce the assembly of the query string, and initiate the lookup optimization.
…sigh.
Yeah, and then there’s the weird uncle at the family reunion, that no one is sure of his actual relation to your family.
Ladies and gentlemen, please welcome: the Database-Emulator!
I can’t quite explain what led my to produce this piece of… this thing. But hey! It does it’s job!
It emulates an extremely reduced subset of a DBMS, taking an actual SQL-Query, extracting the wanted data from it, and storing it in a projection of what should’ve been some sort of Relational DBMS scheme.
Also, not wanting to overcomplicate it too much, I just gave it a few quick’n’dirty shorthand methods, to make it obey. :)
As I said, check the source! It’s always fun to see, what the human brain comes up with, when you’re actually drifting into insanity. :D
Drop me a note, if I haven’t scared you already :)
And just btw: Here’s a call graph. And here’s the Gist
Have Fun! druu
P.S.: Thanks to Jeremy Dorn (@jdorn) for that supreme SQL Formatter and to Marco Monteiro for editing and publishing this bit :) You rock! \o/


Download
News
Forum
Github
Wiki
SDK
Windows 7, 8.1 or 10 is required.
Latest version
6.1
, released 22/11/2019.
Changelog
Download Installer
Download Portable


--- layout: post sitemap: priority: 1 changefreq: monthly lastmod: 2013-10-17T12:00:00-05:00 --- {% include head.html %} Blueverve Home Our Approach Process Portfolio Team Blog Contact Us


This is Jack. He is an odd little boy that just got an empty box for his birthday.
He may look happy, but he is a little disappointed. Now he'll have to put a few
things in the box.
Jack would really likes...
You can get all this (and more) at an online toy store; Two very popular ones are toysstore.com and eToys.


Hey dude, I'd taken these pictures during my San Francisco trip, while I was there for the BUILD 2013 conference!
Can you see the signs of global climate change?
I really liked the style of this building.


ACP Brevet Times
This worksheet is for ACP-sanctioned brevets between 200 and 1000 kilometers
Distance
200km
300km
400km
600km
1000km
Begins at
Miles
Km
Location
Open
Close
Notes
{% for row in range(20) %}
{% endfor %}


{% blocktrans trimmed %}
In 2014-15, only about 0.24% of front page news
came out of rural India. We want to change that. We can do this without governments – and will. We can’t do it without you.
{% endblocktrans %}
{% trans "Frequently Asked Questions" %}
{% blocktrans trimmed %}Please make sure you include your email address in the donation
form when you make a contribution to PARI. A receipt will be sent to you in 4 to 8 weeks by email.
You may download the 80G certificate here.
{% endblocktrans %}
{% blocktrans trimmed %}
You can send PARI a donation only from an Indian bank account, in Indian rupees. We are
currently not registered with FCRA for accepting foreign funds.
{% endblocktrans %}
{% blocktrans trimmed %}Apart from donating money and equipment, you can provide PARI
copies of photo collections (new and old), pertaining to rural India. We are also always on the look
out for people who can write/photograph for us. Learn more about how you can contribute
here.
{% endblocktrans %}


{# only admins can edit project descriptions, so it's okay to use safe here. #}
{{ project.long_description|safe }}
{% if waffle.switch('labmates') %}
{% if project.allow_sub_projects %}
Add a {{ project.sub_project_label }}
Mozilla is looking for help on making this project ever more awesome.


Connect students to
any academic schools and provide a single point of entry to find aggregated courses and instructors.
Promote extra-curricular school’s programs and capabilities.
Fill-up private classes or group activity sessions through our complete registration process.
Provide management tools for schools, instructors and students.


{% load hq_shared_tags %} {% load i18n %}
{% trans "This is a deprecated property" %}
{% blocktrans with ', ' as suggestion %} Did you mean "{{ suggestion }}" instead? {% endblocktrans %}


Thymeleaf 3 five-minute migration guide
Are you a Thymeleaf 2 user wishing to try the new Thymeleaf 3?
First, the good news. Your existing Thymeleaf templates are almost 100% compatible with Thymeleaf 3 so you will only have to do a few modifications in your configuration.
Thymeleaf 3.0 BETA versions are stable and do everything 2.1 did, so we encourage you to migrate to Thymeleaf 3 as soon as possible in order to take advantage of its performance improvements and new features.
The only downside is that not all Thymeleaf dialects have been migrated to Thymeleaf 3 at this stage, so if you are using some external dialects they may not work with Thymeleaf 3. Please check if the required dialects have a Thymeleaf 3 compatible version.
Template changes
The only change we recommend doing to your templates is removing any th:inline="text"
attributes you might have, because they are not needed anymore in order to have output inlined expressions in HTML or XML templates. And it’s just a recommendation — templates will work anyway. But you will benefit from some extra processing performance if you remove those.
See more information about this below in the Improved inlining mechanism section.
Configuration changes
Let’s show an example of the Thymeleaf 3 configuration using the thymeleaf-spring4 integration package and Java config, as it is the most common choice among Thymeleaf users.
First, the updated Maven dependencies to get Thymeleaf 3 and the Spring 4 integration package:
<dependency>
<groupId>org.thymeleaf</groupId>
<artifactId>thymeleaf</artifactId>
<version>3.0.0.BETA01</version>
</dependency>
<dependency>
<groupId>org.thymeleaf</groupId>
<artifactId>thymeleaf-spring4</artifactId>
<version>3.0.0.BETA01</version>
</dependency>
Second, the Spring configuration:
@Configuration
@EnableWebMvc
@ComponentScan("com.thymeleafexamples")
public class ThymeleafConfig extends WebMvcConfigurerAdapter implements ApplicationContextAware {
private ApplicationContext applicationContext;
public void setApplicationContext(ApplicationContext applicationContext) {
this.applicationContext = applicationContext;
}
@Bean
public ViewResolver viewResolver() {
ThymeleafViewResolver resolver = new ThymeleafViewResolver();
resolver.setTemplateEngine(templateEngine());
resolver.setCharacterEncoding("UTF-8");
return resolver;
}
private TemplateEngine templateEngine() {
SpringTemplateEngine engine = new SpringTemplateEngine();
engine.setTemplateResolver(templateResolver());
return engine;
}
private ITemplateResolver templateResolver() {
SpringResourceTemplateResolver resolver = new SpringResourceTemplateResolver();
resolver.setApplicationContext(applicationContext);
resolver.setPrefix("/WEB-INF/templates/");
resolver.setTemplateMode(TemplateMode.HTML);
return resolver;
}
}
The first difference with the Thymeleaf 2 configuration is that now the recommended template resolver for Spring applications is SpringResourceTemplateResolver
. It needs a reference to the Spring ApplicationContext
so the configuration bean has to implement the ApplicationContextAware
interface.
The second difference is that the template mode has a value of TemplateMode.HTML
. Template modes are not strings anymore and the possible values are a bit different from Thymeleaf 2. We will discuss it in a minute.
If you need to add any extra dialect, you can use the engine.addDialect(...)
method, but first make sure that it has a Thymeleaf 3 compatible version.
You can browse and download the source code for simple “Hello World!” examples at Thymeleaf 3 + Spring 4 + Java config example, Thymeleaf 3 + Spring 4 + XML config example and Thymeleaf 3 + Servlet 3 example
You can also find some additional information (links to binaries and javadocs) at the Thymeleaf BETA 1 announcement.
Full HTML5 markup support
Thymeleaf 3.0 is no longer XML-based, thanks to its new parsing system, so there is no need to write XML-valid HTML code anymore (even if we still recommend you to do so for legibility reasons). When in HTML
mode, Thymeleaf is now much more lenient in terms of closed tags, quoted attributes, etc.
So this is now a perfectly processable (yet a bit ugly) Thymeleaf template:

Whatever
For an explanation of the new parsing system, see Full HTML5 support, new parsing infrastructure
Template modes
Thymeleaf 3 replaces the set of template modes from previous versions. The new template modes are:
HTML
XML
TEXT
JAVASCRIPT
CSS
RAW
There are two markup template modes (HTML
and XML
), three textual template modes (TEXT
, JAVASCRIPT
and CSS
) and a no-op template mode (RAW
).
The HTML
template mode will admit any kind of HTML markup input, including HTML5, HTML 4 and XHTML. No markup validation of well-formedness check will be performed, and template markup code structure will be respected to the biggest possible extent in output.
For a detailed explanation of the different template modes, please take a look at Thymeleaf 3.0 Template Mode set.
You can see a simple example exercising the new template modes at https://github.com/jmiguelsamper/thymeleaf3-template-modes-example
Textual template modes
The new textual template modes bring to Thymeleaf the ability to output CSS, Javascript and plain text. This is handy if you want to use the values of server-side variables in your CSS and Javascript files, or to generate plain text content as, for example, in e-mail composing.
In order to have all Thymeleaf features avaible for the textual modes, a new syntax has been introduced. For example, you can iterate like:
[# th:each="item : ${items}"]
- [# th:utext="${item}" /]
[/]
For a full explanation of this new syntax, take a look at New syntax for textual template modes
Improved inlining mechanism
Sometimes it is handy to be able to output data without using extra tags or attributes, as in:

This product is called [[${product.name}]] and it's great!

This capability, called inlining has been greatly improved and is now much better supported in Thymeleaf 3. See Inlined output expressions for details.
The existing inlining mechanism also matches the new template modes and, indeed, makes the th:inline="text"
attribute unnecessary, because inlining now exists in HTML
mode itself. Take a look at the discussion on Refactoring of the inlining mechanism
Performance improvements
The main achievement of Thymeleaf’s version 3.0 is an improvement in performance, a somewhat common discussion topic with previous versions. Being Thymeleaf an XML-based template engine up to v2.1 brought the power of implementing many great features, but sometimes at a performance cost. And while Thymeleaf rendering time was negligible for the vast majority of projects, this caveat was noticeable in projects with special characteristics (for example, high-load websites dealing with tables with dozens of thousands of rows).
Thymeleaf 3’s engine has been rewritten from scratch with the main focus put on performance. Thymeleaf 3 performs much better than the previous versions so we hope it covers the needs of more and more projects. But Thymeleaf 3’s performance is not only about rendering time: it has also been specifically designed to have a low memory footprint and help reduce latency in high-concurrency scenarios.
For a technical discussion in the new Thymeleaf 3 architecture, see New event-based template processing engine
New Dialect system
Thymeleaf 3 features a brand new dialect system. If you developed a Thymeleaf Dialect for a previous version of Thymeleaf, you will have to adapt it to make it Thymeleaf 3-compatible.
The new dialect interface is really simple…
public interface IDialect {
public String getName();
}
…but you can add many different features on top of it depending on the specific subinterfaces of IDialect
that you implement.
Let’s highlight a few enhancements of the new Dialect system:
- There are not only processors but pre-processors and post-processors, so the template content can be modified before and after being processed. We could, for example, use a pre-processor to serve cached content or a post-processor to minimize and compress the output.
- Dialect precedence is a new concept which allows the sorting of processors accross dialects. Processor precedences are now considered relative to dialect precedence, so every processor in a specific dialect can be configured to be executed before any processors from a different dialect just by setting the correct values for this dialect precedence.
- Expression object dialects provide new expression objects or expression utility objects that can be used in expressions anywhere in templates, such as the
#strings
,#numbers
,#dates
, etc. provided by the Standard Dialect.
For further explanation of these features, take a look at:
Refactoring of the core APIs
The core APIs have been refactored heavily, browse the following issues for details:
Final thoughts
Thymeleaf 3 is a major achievement on the Thymeleaf Template Engine project after four years of existence and many, many, many hours of very hard work. It comes with terrific new features and many under-the-hood improvements.
We hope it fits better the needs of your projects. So please don’t hesitate giving it a try and sending us your feedback!


User
class User: EHSynchronizable
A user.
-
(For efficiency) True if the user is near the App User at the current time, given the currentBSSID values.
Declaration
Swift
private(set) var isNearby = false
-
Time until currentBSSID is set back to nil
Declaration
Swift
let currentBSSIDTimeToLive: NSTimeInterval = 60*5 //5 minutes
-
Last time we notified the app user that this user was nearby
Declaration
Swift
var lastNotifiedNearbyStatusDate: NSDate?
-
User visibility state
Declaration
Swift
var invisible = false
-
Returns user current free time period, or nil if user is not free.
Declaration
Swift
func currentFreeTimePeriod() -> Event?
-
For Performance
Declaration
Swift
func currentAndNextFreeTimePeriods() -> (currentFreeTimePeriod: Event?, nextFreeTimePeriod: Event?)
-
Returns user’s next event
Declaration
Swift
func nextEvent () -> Event?
-
When current BSSID is set, checks if user is near the App User and updates the value of the isNearby property.
Declaration
Swift
func refreshIsNearby()


Home
Donor Registration
Send Request
View Request
Camps
Log In
Search
Contact Us
About
Select Blood Group
Select
o+
o-
AB+
AB-
A+
A-
B+
B-


Class DiscreteConverter<T>
Wraps a continuous distribution and allows it to be used as discrete, by rounding double values produced by NextDouble to nearest int. Its minimum, maximum, mean, median, variance, and mode(s) are exactly the same as its underlying IContinuousDistribution.
Inheritance
Implements
Inherited Members
Namespace: GoRogue.Random
Assembly: GoRogue.dll
Syntax
public class DiscreteConverter<T> : IDiscreteDistribution, IDistribution where T : IContinuousDistribution
Type Parameters
| Name | Description |
|---|---|
| T | The type of continuous distribution being wrapped. Must implement IContinuousDistribution. |
Remarks
Takes a value of type T so that its ContinuousDistribution field can return a value of the exact wrapped type, which still enables access to any distribution-specified fields, etc.
Constructors
| Improve this Doc View SourceDiscreteConverter(T)
Constructor. Takes the continuous distribution to wrap.
Declaration
public DiscreteConverter(T continuousDistribution)
Parameters
| Type | Name | Description |
|---|---|---|
| T | continuousDistribution | Continuous distribution instance to wrap around. |
Properties
| Improve this Doc View SourceCanReset
Gets a value indicating whether the underlying random number distribution can be reset, so that it produces the same random number sequence again.
Declaration
public bool CanReset { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
ContinuousDistribution
The continuous distribution being wrapped.
Declaration
public T ContinuousDistribution { get; }
Property Value
| Type | Description |
|---|---|
| T |
Generator
Gets the IGenerator object that is used as underlying random number generator.
Declaration
public IGenerator Generator { get; }
Property Value
| Type | Description |
|---|---|
| Troschuetz.Random.IGenerator |
Maximum
Gets the maximum possible value of distributed random numbers for the underlying distribution.
Declaration
public double Maximum { get; }
Property Value
| Type | Description |
|---|---|
| System.Double |
Mean
Gets the mean of distributed random numbers for the underlying distribution.
Declaration
public double Mean { get; }
Property Value
| Type | Description |
|---|---|
| System.Double |
Median
Gets the median of distributed random numbers for the underlying distribution.
Declaration
public double Median { get; }
Property Value
| Type | Description |
|---|---|
| System.Double |
Minimum
Gets the minimum possible value of distributed random numbers for the underlying distribution.
Declaration
public double Minimum { get; }
Property Value
| Type | Description |
|---|---|
| System.Double |
Mode
Gets the mode of distributed random numbers.
Declaration
public double[] Mode { get; }
Property Value
| Type | Description |
|---|---|
| System.Double[] |
Variance
Gets the variance of distributed random numbers for the underlying distribution.
Declaration
public double Variance { get; }
Property Value
| Type | Description |
|---|---|
| System.Double |
Methods
| Improve this Doc View SourceNext()
Returns the result of the underlying continuous distribution's NextDouble function, but rounded to the nearest integer.
Declaration
public int Next()
Returns
| Type | Description |
|---|---|
| System.Int32 | The result of the underlying continuous distribution's NextDouble function, rounded to the nearest integer. |
NextDouble()
Returns a distributed floating point random number from the underlying continuous generator.
Declaration
public double NextDouble()
Returns
| Type | Description |
|---|---|
| System.Double | A distributed double-precision floating point number. |
Reset()
Resets the random number distribution, so that it produces the same random number sequence again.
Declaration
public bool Reset()
Returns
| Type | Description |
|---|---|
| System.Boolean | true if the random number distribution was reset; otherwise, false. |