◆ GetBounds()
| GRect Pebble::GBitmapBase::GetBounds |
( |
| ) |
const |
|
inline |
Gets the bounds of the content for the GBitmap. This is set when loading the image or if changed by gbitmap_set_bounds.
- Returns
- The bounding box for the GBitmap.
- See also
- SetBounds
◆ GetBytesPerRow()
| uint16_t Pebble::GBitmapBase::GetBytesPerRow |
( |
| ) |
const |
|
inline |
Get the number of bytes per row in the bitmap data for the given GBitmap. On rectangular displays, this can be used as a safe way of iterating over the rows in the bitmap, since bytes per row should be set according to format. On circular displays with pixel format of GBitmapFormat8BitCircular this will return 0, and should not be used for iteration over frame buffer pixels. Instead, use GBitmapDataRowInfo, which provides safe minimum and maximum x values for a given row's y value.
- Returns
- The number of bytes per row of the GBitmap
- See also
- GetData
◆ GetData()
| uint8_t* Pebble::GBitmapBase::GetData |
( |
| ) |
const |
|
inline |
Get a pointer to the raw image data section of the given GBitmap as specified by the format of the bitmap.
- Returns
- pointer to the raw image data for the GBitmap
- See also
- GetBytesPerRow
-
GBitmap
◆ GetFormat()
◆ GetPalette()
| GColor* Pebble::GBitmapBase::GetPalette |
( |
| ) |
const |
|
inline |
Get the palette for the given GBitmap.
- Returns
- Pointer to a GColor array containing the palette colors.
- See also
- gbitmap_set_palette
The documentation for this class was generated from the following file:


For any questions, comments, or issues, feel free to submit a new issue on Github. If you don't have a Github account, support can be reached at dicebot.email@gmail.com.


ActiveMQ Config Reference for MCollective Users
Summary
Apache ActiveMQ is the primary middleware we recommend with MCollective. It’s good software, but its XML config file is large and unwieldy, and you may need to edit many sections of it in a complex MCollective deployment. This reference guide attempts to describe every major ActiveMQ setting that matters to MCollective.
How to Use This Page
- This page doesn’t describe the complete format of the activemq.xml config file, and will sometimes use incomplete shorthand to describe elements of it.
- You should definitely refer to an example config file while reading, so you can see each element’s full syntax in context.
- You don’t need to read this entire page when setting up a new deployment. We recommend that you:
- Start with an example config file (see directly below).
- Make heavy use of the table of contents above.

- Refer back to this page later when you need to expand your broker infrastructure.
- If you are a new user, we recommend that you:
- Start with the single-broker example config.
- Change the user account passwords.
- Set up TLS.
Example Config Files
We have several.
- Minimal config example — single broker
- Maximal config example — multi-broker
Note: Some config data needs to be set in both MCollective and ActiveMQ; your configuration of one will affect the other. In this page, we call out that information with headers labeled “Shared Configuration.”
Version Limits
This document is about the “new” MCollective/ActiveMQ interface, which means it requires the following:
- MCollective 2.0.0 or newer
- ActiveMQ 5.5.0 or newer
- Stomp gem 1.2.2 or newer
- The activemq connector plugin (included with MCollective 2.0.0 and newer)
How MCollective Uses ActiveMQ
MCollective connects to ActiveMQ over the Stomp protocol, and presents certain credentials:
- It provides a username and password, with which ActiveMQ can do what it pleases.
- If TLS is in use, it will also present a certificate (and verify the ActiveMQ server’s certificate).
Once allowed to connect, MCollective will use the Stomp protocol to create subscriptions. It will then produce and consume a lot of traffic on queues and topics whose names begin with mcollective
. (See “Topic and Queue Names” directly below.)
Absolute Minimum Requirements
ActiveMQ defaults to believing that it is routing traffic between processes in a single JVM instance: it doesn’t assume it is connected to the network, and it uses a loose-to-nonexistent security model.
This means that if you do nothing but enable Stomp traffic, MCollective will work fine. (Albeit with terrible security and eventual out-of-control memory usage.)
Topic and Queue Names
MCollective uses the following destination names. This list uses standard ActiveMQ destination wildcards. “COLLECTIVE” is the name of the collective being used; by default, this is mcollective
, but if you are using subcollectives, each one is implemented as an equal peer of the default collective.
Topics:
ActiveMQ.Advisory.>
(built-in topics that all ActiveMQ producers and consumers need all permissions on)COLLECTIVE.*.agent
(for each agent plugin, where the*
is the name of the plugin)
Queues:
COLLECTIVE.nodes
(used for direct addressing; this is a single destination that uses JMS selectors, rather than a group of destinations)COLLECTIVE.reply.>
(where the continued portion is a request ID)
Shared Configuration
Subcollectives must also be configured in the MCollective client and server config files. ActiveMQ must allow traffic on any subcollective that MCollective servers and clients expect to use.
Config File Location and Format
ActiveMQ’s config is usually called activemq.xml, and is kept in ActiveMQ’s configuration directory (/etc/activemq
with Puppet Labs’s Red Hat-like packages, or a subdirectory of /etc/activemq/instances-enabled
with the standard Debian or Ubuntu packages). Any other files referenced in activemq.xml will be looked for in the same directory.
The config file is in Java’s Beans XML format. Note that all of the settings relevant to MCollective are located inside activemq.xml’s <broker>
element.
This document won’t describe the complete format of the activemq.xml config file, and will sometimes use incomplete shorthand to describe elements of it. You should definitely refer to an example config file while reading, so you can see each element’s full syntax in context.
You can also read external documentation for a more complete understanding.
Bug Warning: In ActiveMQ 5.5, the first-level children of the
<broker>
element must be arranged in alphabetical order. There is no good reason for this behavior, and it was fixed in ActiveMQ 5.6.
External ActiveMQ Documentation
The Apache ActiveMQ documentation contains important information, but it is often incomplete, badly organized, and confusing. The Fuse documentation (a commercially supported release of ActiveMQ) is significantly better written and better organized, although it requires signing up for an email newsletter, but it may be out of sync with the most recent ActiveMQ releases.
Wildcards
You’ll see a lot of ActiveMQ destination wildcards below. In short:
- Segments in a destination name are separated with dots (
.
) - A
*
represents one segment (i.e. any sequence of non-dot characters) - A
>
represents the whole rest of the name after a prefix
Required Settings
One way or another, you must set all of the following.
Transport Connector(s)
It’s generally best to only enable the transport connectors you need. For example, if you’re using Stomp over TLS, don’t leave a bare Stomp transport open. If you’re not using a network of brokers, close the OpenWire transport.
The name
attribute of a transport connector doesn’t seem to matter as long as it’s locally unique.
Stomp
ActiveMQ must listen over the network for Stomp connections; otherwise, MCollective can’t reach it. Enable this with a <transportConnector>
element inside the <transportConnectors>
element. We generally recommend using TLS.
<transportConnectors>
<transportConnector name="stomp+nio" uri="stomp+nio://<IP_ADDRESS>:61613"/>
</transportConnectors>
- Note that the protocol/port/arguments for Stomp URIs can differ:
- Unencrypted:
stomp+nio://<IP_ADDRESS>:61613
- CA-verified TLS:
stomp+ssl://<IP_ADDRESS>:61614?needClientAuth=true
- Anonymous TLS:
stomp+ssl://<IP_ADDRESS>:61614
- Unencrypted:
- You can choose to restrict the interface/hostname to use instead of listening on
<IP_ADDRESS>
.
If you are using TLS, note that you must also:
OpenWire
If you are using a network of brokers instead of just one ActiveMQ server, they talk to each other over OpenWire, and will all need a transport connector for that protocol too:
<transportConnector name="openwire+ssl" uri="ssl://<IP_ADDRESS>:61617?needClientAuth=true"/>
- Note that the protocol/port/arguments for OpenWire URIs can differ:
- Unencrypted:
tcp://<IP_ADDRESS>:61616
- CA-verified TLS:
ssl://<IP_ADDRESS>:61617?needClientAuth=true
- Anonymous TLS:
ssl://<IP_ADDRESS>:61617
- Unencrypted:
- You can choose to restrict the interface/hostname to use instead of listening on
<IP_ADDRESS>
.
Standard Ports for Stomp and OpenWire
Alas, there aren’t any; just a rough consensus.
- 61613 for unencrypted Stomp
- 61614 for Stomp with TLS
- 61616 for unencrypted OpenWire
- 61617 for OpenWire with TLS
All of our documentation assumes these ports.
Shared Configuration
MCollective needs to know the following:
- The port to use for Stomp traffic
- The hostname or IP address to reach ActiveMQ at
- Whether to use TLS
In a network of brokers, the other ActiveMQ servers need to know the following:
- The port to use for OpenWire traffic
- The hostname or IP address to reach peer ActiveMQ servers at
- Whether to use TLS
Reply Queue Pruning
MCollective sends replies on uniquely-named, single-use queues with names like mcollective.reply.<UNIQUE ID>
. These have to be deleted after about five minutes, lest they clog up ActiveMQ’s available memory. By default, queues live forever, so you have to configure this.
Use a <policyEntry>
element for *.reply.>
queues, with gcInactiveDestinations
set to true and inactiveTimoutBeforeGC
set to 300000 ms (five minutes).
<destinationPolicy>
<policyMap>
<policyEntries>
<policyEntry queue="*.reply.>" gcInactiveDestinations="true" inactiveTimoutBeforeGC="300000" />
<policyEntry topic=">" producerFlowControl="false"/>
</policyEntries>
</policyMap>
</destinationPolicy>
Disable Producer Flow Control on Topics
In the example above, you can also see that producerFlowControl
is set to false for all topics. This is highly recommended; setting it to true can cause MCollective servers to appear blocked when there’s heavy traffic.
Recommended Settings
TLS Credentials
If you are using TLS in either your Stomp or OpenWire transport connectors, ActiveMQ needs a keystore file, a truststore file, and a password for each:
<sslContext>
<sslContext
keyStore="keystore.jks" keyStorePassword="secret"
trustStore="truststore.jks" trustStorePassword="secret"
/>
</sslContext>
Note: This example is for CA-verified TLS. If you are using anonymous TLS, you may optionally skip the truststore attributes.
The redundant nested <sslContext>
elements are not a typo; for some reason ActiveMQ actually needs this.
ActiveMQ will expect to find these files in the same directory as activemq.xml.
Creating a Keystore and Truststore
There is a separate guide that covers how to create keystores.
Authentication (Users and Groups)
When they connect, MCollective clients and servers provide a username, password, and optionally an SSL certificate. ActiveMQ can use any of these to authenticate them.
By default, ActiveMQ ignores all of these and has no particular concept of “users.” Enabling authentication means ActiveMQ will only allow users with proper credentials to connect. It also gives you the option of setting up per-destination authorization (see below).
You set up authentication by adding the appropriate element to the <plugins>
element. The Fuse documentation has a more complete description of ActiveMQ’s authentication capabilities; the ActiveMQ docs version is less organized and less complete. In summary:
simpleAuthenticationPlugin
defines users directly in activemq.xml. It’s well-tested and easy. It also requires you to edit activemq.xml and restart the broker every time you add a new user. The activemq.xml file will contain sensitive passwords and must be protected.jaasAuthenticationPlugin
lets you use external text files (or even an LDAP database) to define users and groups. You need to make alogin.config
file in the ActiveMQ config directory, and possibly two more files. You can add users and groups without restarting the broker. The external users file will contain sensitive passwords and must be protected.jaasCertificateAuthenticationPlugin
ignores the username and password that MCollective presents; instead, it reads the distinguished name of the certificate and maps that to a username. It requires TLS, alogin.config
file, and two other external files. It is also impractical unless your servers are all using the same SSL certificate to connect to ActiveMQ; the currently recommended approach of re-using Puppet certificates makes this problematic, but you can probably ship credentials around and figure out a way to make it work. This is not currently well-tested with MCollective.
The example below uses simpleAuthenticationPlugin
.
<plugins>
<simpleAuthenticationPlugin>
<users>
<authenticationUser username="mcollective" password="marionette" groups="mcollective,everyone"/>
<authenticationUser username="admin" password="secret" groups="mcollective,admins,everyone"/>
</users>
</simpleAuthenticationPlugin>
<!-- ... authorization goes below... -->
</plugins>
This creates two users: mcollective
and admin
. Note that unless you set up authorization (see below), these users have the exact same capabilities.
Shared Configuration
MCollective servers and clients both need a username and password to use when connecting. That user must have appropriate permissions (see “Authorization,” directly below) for that server or client’s role.
Authorization (Group Permissions)
By default, ActiveMQ allows everyone to read from any topic or queue, write to any topic or queue, and create (admin) any topic or queue.
By setting rules in an <authorizationPlugin>
element, you can regulate things a bit. Some notes:
- Authorization is done by group.
- The exact behavior of authorization doesn’t seem to be documented anywhere. Going by observation, it appears that ActiveMQ first tries the most specific rule available, then retreats to less specific rules. This means if a given group isn’t allowed an action by a more specific rule but is allowed it by a more general rule, it still gets authorized to take that action. If you have any solid information about how this works, please email us at<EMAIL_ADDRESS>- MCollective creates subscriptions before it knows whether there will be any content coming. That means any role able to read from or write to a destination must also be able to admin that destination. Think of “admin” as a superset of both read and write.
Simple Restrictions
The following example grants all permissions on destinations beginning with mcollective
to everyone in group mcollective
:
<plugins>
<!-- ...authentication stuff... -->
<authorizationPlugin>
<map>
<authorizationMap>
<authorizationEntries>
<authorizationEntry queue=">" write="admins" read="admins" admin="admins" />
<authorizationEntry topic=">" write="admins" read="admins" admin="admins" />
<authorizationEntry topic="mcollective.>" write="mcollective" read="mcollective" admin="mcollective" />
<authorizationEntry queue="mcollective.>" write="mcollective" read="mcollective" admin="mcollective" />
<authorizationEntry topic="ActiveMQ.Advisory.>" read="everyone" write="everyone" admin="everyone"/>
</authorizationEntries>
</authorizationMap>
</map>
</authorizationPlugin>
</plugins>
This means admins can issue commands and MCollective servers can read those commands and reply. However, it also means that servers can issue commands. If you’re using MCollective’s SSL security plugin (or another security provider with strong client authentication), this is generally fine: servers could potentially receive bogus commands, but will reject any commands that don’t come from an authorized client user.
Note that the everyone
group (as seen in the ActiveMQ.Advisory.>
topics) isn’t special. You need to manually make sure all users are members of it. ActiveMQ does not appear to have any kind of real wildcard “everyone” group, unfortunately.
Detailed Restrictions
The following example splits permissions along a simple user/server model:
<plugins>
<!-- ...authentication stuff... -->
<authorizationPlugin>
<map>
<authorizationMap>
<authorizationEntries>
<authorizationEntry queue=">" write="admins" read="admins" admin="admins" />
<authorizationEntry topic=">" write="admins" read="admins" admin="admins" />
<authorizationEntry queue="mcollective.>" write="admins" read="admins" admin="admins" />
<authorizationEntry topic="mcollective.>" write="admins" read="admins" admin="admins" />
<authorizationEntry queue="mcollective.nodes" read="mcollective" admin="mcollective" />
<authorizationEntry queue="mcollective.reply.>" write="mcollective" admin="mcollective" />
<authorizationEntry topic="mcollective.*.agent" read="mcollective" admin="mcollective" />
<authorizationEntry topic="mcollective.registration.agent" write="mcollective" read="mcollective" admin="mcollective" />
<authorizationEntry topic="ActiveMQ.Advisory.>" read="everyone" write="everyone" admin="everyone"/>
</authorizationEntries>
</authorizationMap>
</map>
</authorizationPlugin>
</plugins>
This means admins can issue commands and MCollective servers can read those commands and reply. This time, though, servers can’t issue commands. The exception is the mcollective.registration.agent
destination, which servers DO need the ability to write to if you’ve turned on registration.
Admins, of course, can also read commands and reply as though they were servers, since they have power over the entire mcollective.>
destination set. This isn’t considered much of an additional security risk, considering that admins can already control your entire infrastructure.
Detailed Restrictions with Multiple Subcollectives
Both of the above examples assume only a single mcollective
collective. If you are using additional subcollectives (e.g. uk_collective
, us_collective
, etc.), their destinations will start with their name instead of mcollective
.  (Since all servers are probably members of the defaultmcollective
collective, themcollective-admins
group are sort of the “almost-super-admins.”)COLLECTIVE-servers
can only receive and respond to commands on their specific collective.
Thus, when you define your users in the authentication setup, you could allow a certain user to command both the EU and UK collectives (but not the US collective) with groups="eu_collective-admins,uk_collective-admins"
. You would probably want most servers to be “super-servers,” since each server already gets to choose which collectives to ignore.
MCollective’s Exact Authorization Requirements
As described above, any user able to read OR write on a destination must also be able to admin that destination.
Topics:
ActiveMQ.Advisory.>
— Everyone must be able to read and write.COLLECTIVE.*.agent
— Admin users must be able to write. Servers must be able to read.COLLECTIVE.registration.agent
— If you’re using registration, servers must be able to read and write. Otherwise, it can be ignored.
Queues:
COLLECTIVE.nodes
— Admin users must be able to write. Servers must be able to read.COLLECTIVE.reply.>
— Servers must be able to write. Admin users must be able to read.
Shared Configuration
Subcollectives must also be configured in the MCollective client and server config files. If you’re setting up authorization per-subcollective, ActiveMQ must allow traffic on any subcollective that MCollective servers and clients expect to use.
Settings for Networks of Brokers
You can group multiple ActiveMQ servers into networks of brokers, and they can route local MCollective traffic amongst themselves. There are a lot of reasons to do this:
- Scale — we recommend a maximum of about 800 MCollective servers per ActiveMQ broker, and multiple brokers let you expand past this.
- High availability — MCollective servers and clients can attempt to connect to mupltiple brokers in a failover pool.
- Partition resilience — if an inter-datacenter link goes down, each half’s local MCollective system will still work fine.
- Network isolation and traffic limiting — if your clients default to only sending messages to local machines, you can get better performance in the most common case while still being able to command a global collective when you need to.
- Security — destination filtering can prevent certain users from sending requests to certain datacenters.
This is naturally more complicated than configuring a single broker.
Designing your broker network’s topology is beyond the scope of this reference. The ActiveMQ Clusters guide has a brief description of an example network; see the ActiveMQ docs or the Fuse docs for more detailed info. For our purposes, we assume you have already decided:
- Which ActiveMQ brokers can communicate with each other.
- What kinds of traffic should be excluded from other brokers.
Broker Name
Required.
The main <broker>
element has a brokerName
attribute. In single-broker deployments, this can be anything and defaults to localhost
. In a network of brokers, each broker’s name must be globally unique across the deployment; duplicates can cause message loops.
<broker xmlns="http://activemq.apache.org/schema/core" brokerName="uk-datacenter-broker" dataDirectory="${activemq.base}/data" destroyApplicationContextOnStop="true">
OpenWire Transports
Required.
All participants in a network of brokers need OpenWire network transports enabled. See “Transport Connectors” above for details.
Network Connectors
Required.
If you are using a network of brokers, you need to configure which brokers can talk to each other.
On one broker in each linked pair, set up two bi-directional network connectors: one for topics, and one for queues. (The only difference between them is the conduitSubscriptions
attribute, which must be false for the queue connector.)
This is done with a pair of <networkConnector>
elements inside the <networkConnectors>
element. Note that the queues connector excludes topics and vice-versa.
<networkConnectors>
<networkConnector
name="stomp1-stomp2-topics"
uri="static:(tcp://stomp2.example.com:61616)"
userName="amq"
password="secret"
duplex="true"
decreaseNetworkConsumerPriority="true"
networkTTL="2"
dynamicOnly="true">
<excludedDestinations>
<queue physicalName=">" />
</excludedDestinations>
</networkConnector>
<networkConnector
name="stomp1-stomp2-queues"
uri="static:(tcp://stomp2.example.com:61616)"
userName="amq"
password="secret"
duplex="true"
decreaseNetworkConsumerPriority="true"
networkTTL="2"
dynamicOnly="true"
conduitSubscriptions="false">
<excludedDestinations>
<topic physicalName=">" />
</excludedDestinations>
</networkConnector>
</networkConnectors>
Notes:
- If you’re using TLS for OpenWire, you’ll need to change the URIs to something like
static:(ssl://stomp2.example.com:61617)
— note the change of both protocol and port. - You will need to adjust the TTL for your network’s conditions.
- A username and password are required. The broker with the
<networkConnector>
connects to the other broker as this user. This user should have full rights on all queues and topics, unless you really know what you’re doing. (See authentication and authorization above.) - The
name
attribute on each connector must be globally unique. Easiest way to do that is to combine the pair of hostnames involved with the word “queues” or “topics.” - Alternately, you can set up two uni-directional connectors on both brokers; see the Fuse or ActiveMQ documentation linked above for more details.
Destination Filtering
Optional.
Relevant external docs:
If you want to prevent certain traffic from leaving a given datacenter, you can do so with <excludedDestinations>
or <dynamicallyIncludedDestinations>
elements inside each <networkConnector>
element. This is mostly useful for reducing noise (which can potentially save you money, depending on network topology and datacenter locations), but it can also serve security purposes. Generally, you’ll be filtering on subcollectives, which, as described above, begin their destination names with the name of the collective.
Both types of filter element can contain <queue>
and <topic>
elements, with their physicalName
attributes defining a destination name with the normal wildcards. Since MCollective uses both queues and topics, you’ll usually write a pair of rules for any exclusion or inclusion.
Remember to retain the all-queues/all-topics exclusions as shown above.
Examples
Assume a star network topology.
This topology can be achieved by either having each edge broker connect to the central broker, or having the central broker connect to each edge broker. You can achieve the same filtering in both situations, but with slightly different configuration. The two examples below have similar but not identical effects; the ramifications are subtle, and we really recommend reading the external ActiveMQ and Fuse documentation if you’ve come this far in your deployment scale.
If your central broker is connecting to the UK broker, and you want it to only pass on traffic for the global mcollective
collective and the UK-specific uk_collective
collective:
<dynamicallyIncludedDestinations>
<topic physicalName="mcollective.>" />
<queue physicalName="mcollective.>" />
<topic physicalName="uk_collective.>" />
<queue physicalName="uk_collective.>" />
</dynamicallyIncludedDestinations>
In this case, admin users connected to the central broker can command nodes on the uk_collective
, but admin users connected to the UK broker can’t command nodes on the us_collective
, etc.
Alternately, if your UK broker is connecting to your central broker and you want it to refrain from passing on UK-specific traffic that no one outside that datacenter cares about:
<excludedDestinations>
<topic physicalName="uk_collective.>" />
<queue physicalName="uk_collective.>" />
</excludedDestinations>
In this case, admin users connected to the central broker cannot command nodes on the uk_collective
; it’s expected that they’ll be issuing commands to the main mcollective
collective if they need to (and are authorized to) cross outside their borders.
Tuning
The minor adjustments listed below (turn off dedicated task runner, increase heap, and increase memory and temp usage in activemq.xml) will generally let you reach about 800 MCollective nodes connected to a single ActiveMQ server, depending on traffic and usage patterns, number of topics and queues, etc. Any more detailed tuning is beyond the scope of this reference, and is likely to be unnecessary for your deployment.
Don’t Use Dedicated Task Runner
Set -Dorg.apache.activemq.UseDedicatedTaskRunner=false
when starting ActiveMQ. MCollective creates a lot of queues and topics, so not using a thread per destination will save you a lot of memory usage.
This setting is not configured in activemq.xml; it’s an extra argument to the JVM, which should be provided when ActiveMQ starts up. The place to put this varies, depending on the package you installed ActiveMQ with; it usually goes in the wrapper config file. Check your init script for clues about this file’s location. With the common TanukiWrapper scripts, it would look something like this:
wrapper.java.additional.4=-Dorg.apache.activemq.UseDedicatedTaskRunner=false
Increase JVM Heap if Necessary
Likewise, the max heap is usually configured in the wrapper config file (wrapper.java.maxmemory=512
) or on the command line (-Xmx512m
).
Memory and Temp Usage for Messages (systemUsage
)
Since ActiveMQ expects to be embedded in another JVM application, it won’t automatically fill up the heap with messages; it has extra limitations on how much space to take up with message contents.
As your deployment gets bigger, you may need to increase the <memaryUsage>
and <tempUsage>
elements in the <systemUsage>
element. Unfortunately, we lack a lot of solid data for what to actually set these to. Most users leave the defaults for memory and temp until they have problems, then double the defaults and see whether their problems go away. This isn’t perfectly effecient, but anecdotally it appears to work.
The many redundant nested elements are not a typo; for some reason, ActiveMQ seems to require this.
<!--
The systemUsage controls the maximum amount of space the broker will
use for messages.
- memoryUsage is the amount of memory ActiveMQ will take up with
*actual messages;* it doesn't include things like thread management.
- tempUsage is the amount of disk space it will use for stashing
non-persisted messages if the memoryUsage is exceeded (e.g. in the
event of a sudden flood of messages).
- storeUsage is the amount of disk space dedicated to persistent
messages (which MCollective doesn't use directly, but which may be
used in networks of brokers to avoid duplicates).
If producer flow control is on, ActiveMQ will slow down producers
when any limits are reached; otherwise, it will use up the
memoryUsage, overflow into tempUsage (assuming the default cursor
settings aren't changed), and start failing message deliveries after
tempUsage is spent. In MCollective, the latter behavior is generally
preferable. For more information, see:
http://activemq.apache.org/producer-flow-control.html
http://activemq.apache.org/javalangoutofmemory.html
-->
<systemUsage>
<systemUsage>
<memoryUsage>
<memoryUsage limit="20 mb"/>
</memoryUsage>
<storeUsage>
<storeUsage limit="1 gb"/>
</storeUsage>
<tempUsage>
<tempUsage limit="100 mb"/>
</tempUsage>
</systemUsage>
</systemUsage>
Boilerplate
There’s little reason to care about these settings in most conditions, but they’re in the example config files anyway.
Persistence
MCollective rarely uses this. It’s only necessary in networks of brokers, where it is used to prevent routing loops. Leave it enabled; it has no notable performance penalty and its disk usage is limited by the <storeUsage>
element described above.
<persistenceAdapter>
<kahaDB directory="${activemq.base}/data/kahadb"/>
</persistenceAdapter>
Management Context
This is for monitoring. MCollective doesn’t use this and the examples have it turned off, but you may want it for your own purposes.
<!--
The managementContext is used to configure how ActiveMQ is exposed in
JMX. By default, ActiveMQ uses the MBean server that is started by
the JVM. For more information, see:
http://activemq.apache.org/jmx.html
-->
<managementContext>
<managementContext createConnector="false"/>
</managementContext>
Statistics Broker
MCollective doesn’t use this.
<plugins>
<!--
Enable the statisticsBrokerPlugin to allow ActiveMQ to collect
statistics.
-->
<statisticsBrokerPlugin/>
<!-- ...auth, etc... -->
</plugins>
Jetty (Web Consoles, APIs, etc.)
The activemq.xml file will often either contain Jetty settings or import them from another file. MCollective doesn’t use this. If you’re not using it to manage ActiveMQ, leaving it enabled may be a security risk. Note that this configuration is outside the <broker>
element.
<!--
Enable web consoles, REST and Ajax APIs and demos
It also includes Camel (with its web console), see ${ACTIVEMQ_HOME}/conf/camel.xml for more info
Take a look at ${ACTIVEMQ_HOME}/conf/jetty.xml for more details
-->
<import resource="jetty.xml"/>


Currently our blog is located at blog.durandal.io
. That's a bit odd considering all the content here is directly related to Aurelia. So, we'll be moving the blog to blog.aurelia.io
this coming week. We apologize for any inconvenience this may cause you. Thanks!


The the grid based design is how websites presenting information. Grids offer an effective design approach for the site layouts and assist in communicating the site's main messages clearly to the end user. They created ordered hierarchies, proportional relationships, and clear visual paths for the eye to travel.
With a range of devices viewing webpages it is important to note that each of these devices have a different range of pixels, so webpages must be able to adapt to these different sizes. The hype surrounding Responsive Webpages are about how the webpage adapts it's size, rather than remaining fixed.
The Semantic Structure is all about the layout of HTML tags and making sure that it structured smoothly. So that it is easy to follow and easy to make changes if necessary.
More of an observation but I can see how the Code Test Refine process is going to use a lot of time.


5 sequences are predicted as CDS (see Table predicted_cds).
From these 5 prediced CDS, 2 are ending with a TAG STOP codon (see Table tag_ending_cds). 2 are predicted as potential PYL sequences (see Table potential_pyl_cds).
After similarity search, 1 sequences (of 2 predicted PYL sequences) are conserved (1 rejected) as potential PYL proteins (see Table final_cds).
- final_cds:
- final_info.csv
- potential_pyl_cds:
- pot_pyl_cds
- predicted_cds:
- cds.csv
- tag_ending_cds:
- tag_ending_cds.csv


{% extends "global/Page.html" %} {% load staticfiles otree_tags %} {% block title %} End of negotiation {% if incentives == True %} - Bonus {% endif %} {% endblock %} {% block styles %} {% endblock %} {% block content %} {% if subsession.round_number == Constants.num_rounds %}
The maximum number of rounds has been reached. It has taken the three of you too long to form a coalition.
This means that, in addition to your base fee, you have not been able to obtain a bonus payment.
{% else %}A {{ group.formed_coalition_name }}-coalition has been formed: {% if group.formed_coalition_name == 'AB' and group.payoff_A > 0 or group.formed_coalition_name == 'AC' and group.payoff_A > 0 or group.formed_coalition_name == 'ABC' and group.payoff_A > 0 %} Party A{% if player.position == 'A' %} (you) {% endif %} has received ${{ group.payoff_A }} million.{% endif %} {% if group.formed_coalition_name == 'AB' and group.payoff_B > 0 or group.formed_coalition_name == 'BC' and group.payoff_B > 0 or group.formed_coalition_name == 'ABC' and group.payoff_B > 0 %} Party B{% if player.position == 'B' %} (you) {% endif %} has received ${{ group.payoff_B }} million.{% endif %} {% if group.formed_coalition_name == 'BC' and group.payoff_C > 0 or group.formed_coalition_name == 'AC' and group.payoff_C > 0 or group.formed_coalition_name == 'ABC' and group.payoff_C > 0 %} Party C{% if player.position == 'C' %} (you) {% endif %} has received ${{ group.payoff_C }} million.{% endif %}
{% if incentives == True %}For you, this has the following consequences:
{% if player.payoff > 0 %} In the negotiation, you have received, ${{player.money}} million. For every $1 million, you will obtain a bonus of ${{ payoff_conversion }}. This means that, in addition to the base fee of ${{ base_fee }}, you will receive a bonus of: {{player.payoff}}. {% endif %} {% if player.participant.payoff == 0 %} In the negotiation, you did not obtain a share of the budget. This means that you will receive no bonus payment in addition to the base fee of ${{ base_fee }}. {% endif %}
{% endif %}Please go to the next page to answer some final questions before claiming your payment.
{% endif %}Note: The interaction phase of the study has ended. This means you will have no time limit for the last few pages.


StoreKit Module In-App Purchase Testing
Chapters
Summary
If you are looking to implement in-app purchases into your iOS application, you will need to download and implement the StoreKit module. The following is a step-by-step guide to walk you through that process.
Version Information
Ti.Storekit Version 1.1
Install the StoreKit
-
Download the StoreKit Module from the marketplace
-
Unzip the ti.storekit-iphone-1.1.zip
-
Drop the ti.storekit directory in /Library/Application Support/Titanium/modules/iphone
-
Create a Mobile Titanium Project
-
Modify the tiapp.xml file to include:
<modules> <module version="1.1">ti.storekit</module> </modules>
-
Replace the app.js file in the resources directory with the one located at /Library/Application Support/Titanium/modules/iphone/ti.storekit/0.1/example/app.js
Create a Test Application
-
Create an App ID in the Apple Provisioning Portal
-
Create a Development Provisioning Profile for that App ID
-
Download the Provisoning File, Drag and Drop onto Xcode
-
In iTunes Connect click on 'Manage your Apps'
-
Click on 'Add New App'
-
Be sure to select the proper Bundle ID for your App.
-
Fill out all necessary information and upload necessary icon and screen shots.
Create Test Products
-
In iTunes Connect click on 'Manage your In-App Purchases'
-
Click 'Create New' and select appropriate application.
-
Fill out product information.
-
Be sure product ID is AppID.productID (com.appcelerator.StoreKit.product1)
-
Cleared for Sale does not need to be checked.
-
You do not need a screen shot.
Create Test User
-
In iTunes Connect click on 'Manage Users'
-
Create a Test User
Add Products and Test App
-
In the app.js file add your products to:
Ti.Storekit.requestProducts(['com.appcelerator.StoreKit.product1','com.appcelerator.StoreKit.product2'])
-
Install your provisioning file and install your app to device. (Simulator will not work)
-
You should be able to make an In-App Purchase using your Test User.


A series of shortcuts for routine tasks originally developed by Rafael A. Irizarry to facilitate data exploration.
| Version: | 1.0.0 |
| Imports: | RColorBrewer |
| Published: | 2015-08-09 |
| Author: | Rafael A. Irizarry and Michael I. Love |
| Maintainer: | Rafael A. Irizarry <rafa at jimmy.harvard.edu> |
| License: | Artistic-2.0 |
| NeedsCompilation: | no |
| Materials: | README |
| CRAN checks: | rafalib results |
| Reference manual: | rafalib.pdf |
| Package source: | rafalib_1.0.0.tar.gz |
| Windows binaries: | r-devel: rafalib_1.0.0.zip, r-release: rafalib_1.0.0.zip, r-oldrel: rafalib_1.0.0.zip |
| OS X binaries: | r-release: rafalib_1.0.0.tgz, r-oldrel: rafalib_1.0.0.tgz |
Please use the canonical form https://CRAN.R-project.org/package=rafalib to link to this page.


To the Editor: Zika virus (ZIKV) has been recognized as an emerging mosquito-borne flavivirus since outbreaks were reported from Yap Island in 2007 ( 1 ), French Polynesia in 2013 ( 2 ), and Cook Island and New Caledonia in 2014 ( 3 ). It has joined dengue virus (DENV) and chikungunya virus (CHIKV) as global public health threats ( 4 ). ZIKV infection typically causes a self-limited dengue-like illness characterized by exanthema, low-grade fever, conjunctivitis, and arthralgia, and an increase in rates of Guillain-Barré syndrome have been observed during ZIKV outbreaks ( 5 ).
In Brazil, clusters of cases of acute exanthematous illness have been reported from various regions since late 2014, and in April 2015, ZIKV was identified as the etiologic agent ( 6 ). In May 2015, the Brazilian Ministry of Health recognized circulation of ZIKV in Brazil. We report epidemiologic findings for an ongoing outbreak of acute exanthematous illness in the population of Salvador, the third largest city in Brazil.
The Salvador Epidemiologic Surveillance Office (ESO) was first alerted to cases of an acute exanthematous illness early in 2015. Reporting of cases increased during March, and in April the ESO established 10 public emergency health centers in Salvador as sentinel units for systematic surveillance of patients with acute exanthematous illness of unknown cause. The units searched retrospectively for suspected cases by review of medical charts of patients treated since February 15, continued with prospective case detection, and submitted weekly reports of identified cases to the ESO.
During February 15−June 25, a total of 14,835 cases of an indeterminate acute exanthematous illness were reported from the 12 sanitary districts in Salvador.
The epidemic curve peaked in the first week of May, which was 1 week after molecular diagnosis of ZIKV in 8 patients residing ≈50 km from Salvador and during a period of intense media coverage of the outbreak ( Figure) ( 6 ). Reporting of suspected dengue cases in Salvador did not vary substantially from that in other years and was >5 times lower: 2,630 cases, of which 165/366 (45.1%) were positive for dengue IgM, 20/590 (3.4%) positive for dengue virus nonstructural protein 1, and 1/11 (9.1%) positive for dengue virus by reverse transcription PCR ( Figure). During the same period, 58 cases of suspected chikungunya were reported and 24 patients with suspected Guillain-Barré syndrome were hospitalized.
Reported cases of indeterminate acute exanthematous illness and suspected dengue fever in Salvador, Brazil, by date of medical care, February 15−June 25, 2015. Letters indicate specific events. A) February 15: systematic reporting of cases of acute exanthematous illness of unknown cause begins in Salvador. B) April 13: Salvador Epidemiologic Surveillance Office releases its first epidemiologic alert about the outbreak in Salvador. C) April 29: Zika virus is confirmed in 8 samples from patients residing ≈50 km from Salvador (
The median age of case-patients was 26 years (interquartile range 11–39 years), but all age groups were affected, which is a pattern typical of spread of new microorganisms (or subtypes) in a susceptible population. Median duration of symptoms at time of medical attention was 1 day (interquartile range 0–3 days). All patients had exanthema and most (12,711/14,093 [90.2%]) had pruritus. Fever (4,841/13,786, 35.1%), arthralgia (278/1,048 [26.5%]), headache (3,446/13,503 [25.6%]), and myalgia (223/1,033 [21.6%]) were less common.
Serum samples from some patients were examined for rubella IgM (2/200, 1.0% positive), rubella IgG (15/18, 83.3% positive), measles IgM (0/11, 0% positive), dengue nonstructural protein 1 (3/185, 1.6% positive), dengue IgM (17/80, 21.3% positive), parvovirus B19 IgM (0/1, 0% positive), and parvovirus B19 IgG (1/1, 100% positive). Reverse transcription PCR was performed on 58 serum samples stored at −20°C and confirmed ZIKV in 3 (5.2%) samples, CHIKV in 3 (5.2%) samples, DENV type 3 in 1 (1.7%) sample, and DENV type 4 in 1 (1.7%) sample.
Identification of ZIKV, CHIKV and DENV as etiologic agents of acute exanthematous illness suggests that these 3 Aedes spp. mosquito−transmitted viruses were co-circulating in Salvador and highlights the challenge in clinically differentiating these infections during outbreaks. Although we were not able to determine the specific incidence of each virus, the low frequency of fever and arthralgia, which are indicators of dengue and chikungunya, point to ZIKV as the probable cause of several of the reported cases. Furthermore, laboratory-confirmed cases of infection with ZIKV were simultaneously identified in other cities within metropolitan Salvador ( 6 , 7 ) and in other states in Brazil ( 8 ). Low diagnosis of ZIKV infection is likely because viremia levels among infected patients appear to be low ( 9 ).
The spread of ZIKV represents an additional challenge for public health systems, particularly because of the risk for concurrent transmission of DENV and CHIKV by the same vectors, Ae. aegypti and Ae. albopictus mosquitoes, which are abundant throughout tropical and subtropical regions. To date, the largest outbreak of chikungunya in Brazil occurred in 2014 in Feira de Santana, Bahia, ≈100 km from Salvador, where dengue is also prevalent ( 10 ).
This report illustrates the potential for explosive simultaneous outbreaks of ZIKV, CHIKV, and DENV in the Western Hemisphere and the increasing public health effects of Aedes spp. mosquitoes as vectors. The apparent increase in reports of Guillain-Barré syndrome during the outbreak deserves further investigation to elucidate whether this syndrome is associated with ZIKV infection. Public health authorities in Brazil and neighboring countries should plan accordingly.
Suggested citation for this article: Cardoso CW, Paploski IAD, Kikuti M, Rodrigues MS, Silva MMO, Campos GE, et al. Outbreak of acute exanthematous illness associated with Zika, chikungunya, and dengue viruses, Salvador, Brazil [letter]. Emerg Infect Dis. 2015 Dec [ date cited].
These authors contributed equally to this article.
We thank the health professionals of the Municipal Health Secretariat of Salvador, particularly those working in surveillance activities, for invaluable assistance in case reporting and outbreak investigation; and the municipal laboratory staff for assistance.
This study was supported by the Brazilian National Council for Scientific and Technological Development (CNPq grant 400830/2013-2 and CNPq scholarships to I.A.D.P., M.S.R., U.K., M.G.R., and G.S.R.), the Bahia Foundation for Research Support (grant PNX0010/2011), and the Coordination for the Improvement of Higher Education Personnel, Brazilian Ministry of Education (CAPES scholarship to M.K.).


And then, of course, I've got this terrible pain in all the diodes down my left side.
Yeah, you are successfully unsubscribe.


A quirky little blog made
by Sangwook
Documentation
Features: Hagura is a theme made for blogs with long text paragraphs. Made to be easy on eyes as well.
Features: Hagura is a theme made for blogs with long text paragraphs. Made to be easy on eyes as well.


Ruth Bader Ginsburg released from hospital after experiencing fever, chills
by Vandana RambaranSupreme Court Justice Ruth Bader Ginsburg was released from the hospital and is "doing well" after she underwent treatment for a possible infection, court spokeswoman Kathy Arberg said Sunday.
Ginsburg, 86, was admitted to Johns Hopkins Hospital in Baltimore on Friday night after suffering from fever and chills earlier in the day and received intravenous antibiotics and fluids, the Supreme Court announced in a news release.
Doctors initially evaluated her at Sibley Memorial Hospital in Washington, D.C., before transferred her to Johns Hopkins for further evaluation and treatment of any possible infection.
RUTH BADER GINSBURG HOSPITALIZED FOR CHILLS AND FEVER, SUPREME COURT SAYS
Ginsburg has faced a slew of hurdles concerning her health, fueling speculation that her possible exit from the court could provide an opportunity for President Trump to appoint a third justice to the bench. However, she consistently has slapped down any notion that her departure from the nation's highest court was imminent, insisting that she'd like to remain on the bench until she's 90 years old.
Her ailments, however, caused her to miss oral arguments before the high court on Nov. 13 -- a rarity for her -- due to a stomach bug.
In August, Ginsburg underwent three weeks of radiation therapy for a malignant tumor on her pancreas, just months after she had lung cancer surgery the previous December.
While recovering from surgery, she missed arguments at the court in January, her first illness-related absence in over 25 years as a justice.
CLICK HERE FOR THE FOX NEWS APP
Ginsburg has also had two previous bouts with cancer. She had colorectal cancer in 1999 and pancreatic cancer in 2009.
The Associated Press contributed to this report.


BOSTON — A Nerf dart gun, ice cream-scented Nickelodeon slime and a plastic Power Rangers claw are among the toys topping a consumer safety group’s list of worst toys for the holidays.
World Against Toys Causing Harm unveiled its annual list Tuesday at a Boston children’s hospital.
A realistic toy machine gun, a “pogo trick board,” a yeti teddy bear and a pull-along caterpillar toy for infants also made the list.
The Massachusetts nonprofit has been releasing the list for more than 40 years.
It says many of the products present choking, eye and other safety hazards frequently found in poorly designed toys. It also cites the products for having inconsistent and inadequate warnings labels.
The organization says the Nerf Ultra One gun, which is billed as firing soft darts up to 120 feet, shoots the projectiles with enough force to potentially cause eye injuries.
It also says the warning label on Flybar’s Pogo Trick Board tells children to wear protection, but the product’s packaging features a child using the device without a wearing a helmet or other protection.
And the association notes that Nickelodeon’s Frozen Treats Slime includes mint chocolate chip, berry smoothie, and snow cone-scented versions of the goo even as it warns the products are made of harmful chemicals and shouldn’t be eaten.
The Toy Association, a toy industry trade group that represents most of the toy makers named on the list, dismissed the annual list as misleading. It suggests parents always purchase toys from reputable stores and online sellers.


Select a tab by setting active binding to true:
Static content
{{tabz['content']}}
Alert!
I've got an HTML heading, and a select callback. Pretty cool!
Vertical content 1
Vertical content 2
Bootstrap 4 doesn't have justified classes
Justified content
Short Labeled Justified content
Long Labeled Justified content


Shown are the {{ext.total}} articles where target and disease are found in the same sentence.
No data available


new 9.x feature that size the items to fit their content height as to not have scroll bars (unless `fitToContent:false` in C: case)


How to set the Primary Administrator who will receive email notification of member activities such as new registrations, unregistered accounts and feedback submitted using the Feedback module (unless this is overridden on the Feedback module). In new DNN installations, the Host user account that is created is selected by default for the first site that is created.
Tip: To create new Administrators, add a new user account (


HEAD
Login Form
Sign In
EmailAddress
Password
Forgot Password ?
Sign In
Welcome
Don't have an account ?
Sign Up


I wrote this in English because it is a habbit I have: when I’m frustrated, I wrote in English.
It feels safer and warmer because it seems no one will take time to read it carefully when the language is switched.
Today one of our freind told me she decides to resign to brew her drawing skill dedicatedly. She is working with us since Myriad, then Palm4fun, then Testbird. And she is not just a colleague for us, but a talent, honest freind. So I feel kinda upset.
But I know it will happen sooner or later since we join Testbird.
It doesn’t have to be her, but it will happen.
It doesn’t have to be Testbird, but it will happen.
I know it because everytime when you join a new team you will have the disappointment and confidence problem.
On the very first day of the new job. When you walk in the building knowing practically no one. Everyone is pleasant and nice… almost too nice. Everyone (including you) is not quite themselves because everyone understands the power of the first impression. They’re watching every single move and attempting to interpret how these moves might be perceived. It’s exhausting and it doesn’t reflect the natural steady state of the team.
You listen. You talk to every single person who is willing and you slowly form the impression of the tangible and intangible aspects of this group of people.  As quickly as possible, your brain wants a framework that efficiently predicts what is going to happen next. Your initial framework is a calming hodgepodge of past experience combined with your three most recent epiphanies, and you call this weak sauce, “The way they work.”
And this poor assessment goes both ways. It’s the beginning of the disappointment. You discover your model for them is incorrect. They discover that you are not who they expected. It’s the end of the honeymoon and the fact the end has begun is progress, but it mostly feels like disappointment. You’re in an unfortunate hole. It’s buyer’s remorse. It’s understanding the world is never, ever that simple.
You sense their disappointment, so you listen harder. You push yourself to talk with a wider variety of unfamiliar humans, because you continue to erroneously believe that one of them could tell you that elusive one rule that would explain this particular clan’s culture in a immediately useful and revealing way. You read every decrepit wiki page. You attend every meeting. You’re attempting to rebuild yourself in a new culture and it’s exhausting because you took all of this for granted in your prior gig. You had built blazing fast intuition, but it took months…perhaps years.
Or maybe never.
How can you start climbing out of the disappointment? The only way I know is through small, unexpected wins.
Find something small enough that you can fix it without breaking other things.
No one expected you to fix that; no one even knew it was broken; and no one thought it was that important. When you fixed it, no one really noticed. When the consequences of the fix became obvious, they thought, “She/He can do that? Hmmm….interesting.”

Disappointment vanishes slowly and quietly each of these small wins. The wins don’t feel substantive or impactful, but they continue to incrementally define who you are to the rest of the team. They start to build a realistic model of you in their minds. You’re not who they expected, it’s not what you expected, but after three months you start to think of this strange place as home.
I wish all the best for her and hope she take the time to relax and learn, and come back not just with her enhanced UX expertise, but also with the knowledge that everybody boarding on a new ship will have the same disappointment problem and you can always conquer it with small wins.
Good Luck!


{% capture title%}{{page.title}}{%endcapture%} {% comment %} Enforce string as integer is not supported by 'escape' {% endcomment %}


{
general: {
title: 'General',
type: 'object',
collapsed: true,
order: -1,
description: 'General options for Atom Beautify',
properties: {
analytics: {
title: 'Anonymous Analytics',
type: 'boolean',
"default": true,
description: "[Google Analytics](http://www.google.com/analytics/) is used to track what languages are being used the most and causing the most errors, as well as other stats such as performance. Everything is anonymized and no personal information, such as source code, is sent. See https://github.com/Glavin001/atom-beautify/issues/47 for more details."
},
_analyticsUserId: {
title: 'Analytics User Id',
type: 'string',
"default": "",
description: "Unique identifier for this user for tracking usage analytics"
},
loggerLevel: {
title: "Logger Level",
type: 'string',
"default": 'warn',
description: 'Set the level for the logger',
"enum": ['verbose', 'debug', 'info', 'warn', 'error']
},
beautifyEntireFileOnSave: {
title: "Beautify Entire File On Save",
type: 'boolean',
"default": true,
description: "When beautifying on save, use the entire file, even if there is selected text in the editor. Important: The `beautify on save` option for the specific language must be enabled for this to be applicable. This option is not `beautify on save`."
},
muteUnsupportedLanguageErrors: {
title: "Mute Unsupported Language Errors",
type: 'boolean',
"default": false,
description: "Do not show \"Unsupported Language\" errors when they occur"
},
muteAllErrors: {
title: "Mute All Errors",
type: 'boolean',
"default": false,
description: "Do not show any/all errors when they occur"
}
}
}
}


Portfolio Weather Dashboard Turn the Tables Online Quiz Workday Scheduler NEBHE American Vegetable Oil CSU Chico Today John Livesay My Rehab Exercise Burger Logger


I always thought my dream was to be an academic. I imagined composing beautiful,
tight-knit theories that described the world - or should describe the world,
anyway. Then I opened R and caught fire.
The spark in me for coding ignited the second a teacher taught me how to use my knowledge of
matrix algebra to populate a vector and run a loop. It was stoked everytime I picked
up a new language (C++, Python, SQL, HTML, CSS, JavaScript, MATLAB) and molded the code
to do my bidding for projects in physics, UX/UI design, machine-learning, or geospatial
data visualization, to name a few. Everytime I jumped from my seat, ecstatic that my
hypothesis was correct or my thesis had found statistically significant results, I added
more coals to this fire.
I am now a masters candidate at the University of Virginia School of Data
Science, compounding on an economic policy / mathematics / statistics focus as an undergraduate.
I am just as enthusiastic about improving the world, but now I look to garner the skills
that will help me explain it through the data and creative analysis. My passions include
learning new programming languages, creative problem-solving, writing,
and a desire to make things function better and more effectively for businesses. In my free
time, I publish articles to Medium's Towards Data Science and The Startup.


hi
I have a old ferraris type energy meter. Every turn in a non fixed interval is corresponding to 0.75 kWh energy. Every turn I send the value of 0.75 to emoncms. The value is logged and I can add it to a feed. So far everything is ok. But I don't get it how to configure emoncms to display the actual power (kW) in a diagramm. If I would have to code something to do this, I would count the time between 2 impulses and calculate so the power. Is there a feature in emoncms to do this and showing me the kW power in a diagramm just by analyzing fixed kWh impulses in a non fixed interval?
Re: how to convert kWh to W
if no one can help me, I have to count the impulses in a fixed interval and send this value to the server. That would work but I wonder if there is are other way.
Re: how to convert kWh to W
In the emonTx sketches, the timing to convert pulses to watts is done there. But there's an inherent problem: no matter where you do the calculation, you can only estimate the average power historically - over the interval from the preceding pulse to the present one. I think that's why many people use both CT and pulse inputs - the pulse feed gives an accurate measure of energy (especially in the long term) and the CT gives an instantaneous reading of power.


"25 terrorist would still be alive"
Bennett warns against a minority government supported by the Arab parties
by Arutz Sheva StaffDefense Minister, Naftali Bennett warned this morning (Sunday) against minority government supported by the Arab parties. "If this government would have been supported by the Joint List then the 25 terrorists killed this week would still be alive."
"Those MKs (members of Knesset) would say it would be murder. I call to Gantz not to allow this to happen, a unity government must be formed."
Benny Gantz's mandate to create a coalition will end on Wednesday, yesterday he met the President for half an hour to update him on the negotiation progress.


Drag 'n Drop a
Log File in JSON format
or
Use the File Upload Element
Drag 'n Drop a
UI Video File,
or
Use the File Upload Element


This summary was extracted from the C++ standard ISO/IEC 14882:1998, working documents leading to the standard and various textbooks. It is not intended to be 100% complete. Hopefully it will be useful as a memory aid in writing C++ programs.
Notation is kept as simple as possible. local_declarations means C++ declaration(s) can be inserted sequence_of_statements means C++ executable statement(s) can be inserted \_ optional means this part or section is optional / ( all optional cases not necessarily shown) ... means more of the same allowed, use common sense occasionally a statement will be shown in a structure, this is just a reminder of something useful or required. Comments in the language and this summary start with // , two consecutive divide signs. The rest of the line is a comment. The end of a line is interpreted as a white space just like a space or tab. The language is free form but is typically entered using indentation. Key words, reserved words, must always be lower case. Names that can be chosen by the programmer usually have a leading uppercase letter or may be all lower case letters. Underscore "_" or an embedded capital letter are used to make names readable. All names are case sensitive and no embedded white space is allowed.
The "main" function and one or more other functions may be in a file. A function may be used like a procedure or subroutine by having no return value. Files are compiled with the some C++ compiler such as g++, CC, Borland, Microsoft, etc. Include file are usually not compiled separately. Some typical file structures: int main(int argc, char *argv[]) // This could be a complete program { local_declarations sequence_of_statements return 0; // a zero return usually means good } #include <something> void main(void) // main function and other functions { // in same file local_declarations sequence_of_statements } void procedure_1( formal_parameters ) // functions, procedures, subroutines { // may not be nested local_declarations sequence_of_statements // no return statement needed } some_type function_1(void) // no formal parameters { local_declarations sequence_of_statements } // as many functions as desired #include <something> // a main function that can get command line // this area is known as "file scope" because it is outside of a function // global variables (use as few as possible) // function prototypes (for locally defined functions, others should come // in via included files) // template definitions // external declarations int main(int argc, // argc, the number of command line items char *argv[]) // argv, command line items including calling // program name as argv[0] { local_declarations sequence_of_statements return good_or_bad; }
Any of the following may be used for sequence_of_statements either singly or in groups. Statements end with a semicolon or brace. A compound statement may be made from a sequence of statements by enclosing them in braces. { statement ; statement ; statement ; } is a statement Usually, one statement is written per line. Assignment statements (with some short hand notation) x = 10; x = x+1; ++x; // same as x = x+1; x++; // same as x = x+1; sets a false flag to true --x; // same as x = x-1; x--; // same as x = x-1; x = x+20; x += 20; // same as x = x+20; x -= 20; // same as x = x-20; x *= 20; // same as x = x*20; x /= 20; // same as x = x/20; x %= 20; // same as x = x%20; modulo x <<= 2; // same as x = x<<2; shift left x >>= 2; // same as x = x>>2; shift right x &= 20; // same as x = x&20; and bits x ^= 20; // same as x = x^20; exclusive or bits x |= 20; // same as x = x|20; or bits x = (y=3,y++) // same as y=3; x=y; y=y+1; x = who ? 3 : y; // same as if(who)x=3; else x=y; x = sin(x) ; // function call x = mat[i][j] ; // subscripting Function call with no return: (a procedure or subroutine in other languages) go_do_it(); // no actual parameters, do NOT use "void" here exit(0); // special function that terminates execution Unconditional branches: break; // immediate exit from loop or switch continue; // immediate jump to end of loop ( not exit ) also used to exit a switch in a loop return; // immediate exit from function, no value returned return exp; // exit from function returning value of exp goto label; // unconditional jump ( should not be needed. ) label: statement; // label definition ( should not be needed. ) Conditional branching: if ( expression ) // condition may be any expression, != 0 is true { sequence_of_statements // executed if expression is true or not equal 0 } else { sequence_of_statements // executed if expression is false or equal zero } if-else-if ladder structure if(exp_1) // the first expression that is true, e.g. exp_i statement_1; // causes statement_i to be executed else if(exp_2) // then jump to end after statement_n statement_2; // use { } even if only one statement for safety else if(exp_3) // when doing changes or maintenance statement_3; ... else statement_n; Switch statement: switch ( expression ) // constants must be unique { case constant_1: // do nothing for this case break; case constant_2: // drop through and do same as constant_3 case constant_3: sequence_of_statements // can have but does not need { } break; case constant_4: sequence_of_statements // does this and next statements also case constant_5: sequence_of_statements break; default: // default executes if no constant equals statement_sequence // the expression. This is optional } An expression can be almost anything. e.g. (Pi - 37.026E5 < x) && (a > b) Iteration statements: for ( initialization ; condition ; increment ) { sequence_of_statements } // The flow sequence is : // initialization // test condition and exit if false // sequence_of_statements // increment // loop back to test condition examples: infinite loop: for(;;){ statements ... if(stuff)break; ... } self initialized: for(int i=0; i<n; i++){ statements } while ( condition ) { sequence_of_statements // keep repeating while condition is true } examples: infinite loop: while(1){ statements ... if(stuff)break; ... } non null pointers: while(!P){ P=P.next; statements to work on list } do { statement_sequence } while ( condition ) ; // test for finished at the end, all // other loops test first example: repeat if changes: do{ statements; if(what)changes=1; ..} while(changes); in all iteration statements, break; causes an immediate exit from loop continue; causes an immediate increment
Function Prototype: type function_name(type_1 v1, type_2 *v2, type_3 &v3, const type_4 v4); // e.g. char * strcpy(char * s1, const char * s2); // *v2 says pass a pointer to v2 // &v3 says pass by reference // const type_4 v4 says v4 is an 'in' parameter a prefix of static makes the function visible only in this file Function Definition: type function_name(int a, float b, const char * ch,...){ function_body } // only parameters passed by pointer or reference can // be modified in the calling function, // a local copy will be made and can be modified, // unsafely, unless const is used char * strcpy( char * s1, const char * s2 ) { statements } Obsolete example of a function and call passing the address of a scalar void func(int *num) { *num *= *num; // square num back in its place } ... func(&i); // call, passing address of i, the lvalue of i ( yuk!) C++ example of a function and call passing a reference of a scalar void func(int &num) // says do type checking and pass by reference { num = num*num; // square num back in its place } func(i); // just a normal call, the compiler knows to pass a reference
Reserved words as the name implies are reserved for the language. Reserved words must not be used as names of objects, types, functions or anything else. Technically these are key words because a few can be redefined by the user (without command line or preprocessor directives) but resist the temptation! There are relatively few "reserved words" . But don't be complacent. The next pages cover a lot of types, objects and other names that are not technically reserved words but can create havoc if used in the wrong place! Some common sequences of reserved words are shown. Spaces are important. asm assembly language, destroys portability auto optional local declaration bool basic declaration of type Boolean break used to exit loop and used to exit switch case choice in a switch catch catch block that handles a thrown exception char basic declaration of a type character class start a class definition const prefix declaration meaning variable can not be changed const_cast remove 'const' property continue go to bottom of loop in for, while and do loops default optional last case of a switch delete free space created by 'new' ( do not use 'free' ) do executable statement, do-while loop double basic declaration double precision floating point dynamic_cast cast a pointer type if legal, else return null else executable statement, part of "if" structure enum basic declaration of enumeration type explicit restricts constructors to not allow myclass a = 7; export precedes a template that can be used by other files extern prefix declaration meaning variable is defined externally false value of type bool float basic declaration of floating point for executable statement, for loop friend a function that can see internal stuff in a class goto jump within function to a label if executable statement inline expand the code rather than call it int basic declaration of integer long prefix declaration applying to many types long int example of a type that is a long integer long unsigned int example of sequence of reserved words mutable override const member functions in classes namespace a scope for declarations and function prototypes new get storage, free storage later with 'delete' ( do not use malloc) operator followed by an operator symbol, can define overloaded functions private the stuff after this is not visible outside the class protected the stuff after this is for classes that inherit this class public the stuff after this is visible outside the class register prefix declaration meaning keep variable in register reinterpret_cast converts a type into any different type (e.g. int to pointer) return executable statement with or without a value short prefix declaration applying to many types signed prefix declaration applying to some types sizeof operator applying to variables and types, gives size in bytes static prefix declaration to make local variable static static_cast a normal cast with no run time checking struct declaration of a structure, like a record switch executable statement for cases template defines template class or function this the class object, used in 'return' statements and others throw throw an exception true value of type bool try try block that precedes a catch block typedef creates a new type name for an existing type typeid function for getting the type of a typename, == and != comparison typename specifies the following name is a type union declaration of variables that are in the same memory locations unsigned prefix declaration applying to some types using makes an entity in a namespace directly visible using namespace make the namespace visible (in scope) virtual this type of function is hidden if defined by an inheritor void declaration of a typeless variable or no formal parameters volatile prefix declaration meaning the variable can be changed at any time wchar_t basic declaration for type wide character (internationalization) while executable statement, while loop or do-while loop also reserved are names that start with __ ( double underscore ) avoid names that start with _ ( single underscore ) except for special use
Remember! Operators can be redefined and overloaded. The "<<" in a = 2 << 3; is very different from cout << a; operator definitions ( in executable code, highest precedence first ) : :: scope resolution for class, namespace, etc. ( ) grouping parenthesis, function call [ ] array indexing, also [ ][ ] etc. -> selector, structure pointer employee->wage = 7.50 ; . select structure element employee.wage = 7.50 ; sizeof size in bytes, sizeof a or sizeof (int) typedef defining a type ++ increment, pre or post to a variable -- decrement, pre or post to a variable ! relational not, complement, ! a yields true or false ~ bitwise not, ones complement, ~ a + unary plus, + a - unary minus, - a (type) a cast, explicit type conversion, (float) i, (*fun)(a,b), (int *)x new allocate storage ( replaces malloc ) delete deallocate storage ( replaces free ) * indirect, the value of a pointer, * p is value at pointer p address & the memory address, & b is the memory address of variable b .* pointer to member operator, to class ->* pointer to member operator, to class pointer * multiply, a * b / divide, a / b % modulo, a % b + add, a + b - subtract, a - b << shift left or insert, left operand is shifted left by right operand bits >> shift right or extract, left operand is shifted right by right operand bits < less than, result is true or false, a < b <= less than or equal, result is true or false, a <= b > greater than, result is true or false, a > b >= greater than or equal, result is true or false, a >= b == equal, result is true or false, a == b != not equal, result is true or false, a != b & bitwise and, a & b ^ bitwise exclusive or, a ^ b | bitwise or, a | b && relational and, result is true or false, a < b && c >= d || relational or, result is true or false, a < b || c >= d ? exp1 ? exp2 : exp3 result is exp2 if exp1 != 0, else result is exp3 : see above = store += add and store -= subtract and store *= multiply and store /= divide and store %= modulo and store <<= shift left and store >>= shift right and store &= bitwise and and store ^= bitwise exclusive or and store |= bitwise or and store , separator as in ( y=x,z=++x ) zero evaluates to false ( a null pointer has an equivalent zero value ) non zero evaluates to true ( !null_pointer is true ) * is heavily overloaded, so is &
operator precedence and associativity is: Assoc highest : :: LR ( ) [ ] -> . x++ x-- LR ! ~ +<unary> -<unary> ++x --x *<dereference> &<address of> sizeof (type)<cast> new delete RL .* ->* LR * / % LR + - LR << >> LR < <= > >= LR == != LR & LR ^ LR | LR && LR || LR ? : RL = += -= *= /= %= >>= <<= &= ^= |= RL lowest : , LR LR means associate left to right, RL means associate right to left
Expressions: variable names start with alphabetic or underscore, followed by alphabetic, numeric or underscore I some_name ELSE Else z999 __do_not_use numbers decimal integer ( no U or L yields shortest type ) (int) 1 12349 (unsigned int) 1U 12349U (long int) 1L 1234569L (unsigned long int) 1UL 1234569UL floating point ( default is double ) (double) .1 1. 1.5E-20 (float) .1F 1.F 1.5E-20F (long double) .1L 1.L 1.5E-20L octal ( 0 prefix ) and hexadecimal ( 0x prefix ) integers ( no U or L yields shortest type ) (int) 01777 0x248F (unsigned int) 01777U 0x248FU (long int) 01777L 0x248FL (unsigned long int) 01777UL 0x248FUL character single character between apostrophes plus special backslash codes 'a' 'Z' '\n' string characters between quotes plus special backslash codes a null is automatically placed at end of every string "Hello" "good by \n" let exp, exp1, exp2, exp3 etc. stand for expressions expressions are: variables numbers characters strings unary_operator expression expression binary_operator expression ( expression ) variable post_operator ( ++ and -- )
Basic types: char character type, usually one byte ( a string is array of char ) bool boolean type has values true and false, usually one byte int integer type, usually 2 or 4 bytes ( default ) may be 8 bytes float floating point type, usually 4 bytes IEEE 32 bit double floating point type, usually 8 bytes IEEE 64 bit void no type, typeless enum enumeration type ( user defines the type name ) Type modifiers, prefix for basic types: signed has a sign ( default ) unsigned no sign bit in variable long longer version of type (short or long alone means short int or short shorter version of type long int because int is the default ) const variable can not be stored into Storage class, prefix for types: auto local variable ( default, not really needed ) static persistent when function exits, not auto volatile can change from outside influence extern variables are defined elsewhere, externally register assign variable to register, usually ignored by modern compilers Other stuff: inline expand code inline rather than call the function(only a hint) virtual use unless over ridden by later definition, functions only friend can access internals of other classes class a basic data structure type struct a basic data structure type union overlay previously defined data types Modifier type: * makes a pointer to what follows & makes a reference to what follows int i = 1000; // allocate storage and initialize value to 1000 int *ptr; // allocate storage for a pointer, garbage initially ptr = &i; // ptr now points to i *ptr = 100; // change value of i to 100
Declarations have the forms: basic_type variable ; basic_type variable_1, variable_2=value; // only initializes variable_2 prefix_type(s) basic_type modifier_type variable , variable ,... ; Atype variable[val][val]...[val]={data,data,...}; struct struct_name { // struct_name is now a type name Atype variableA; // any declaration Atype variableB; ... Atype variable; } variable1, variable2, ... ; // variables are optional struct struct_name { // struct_name is now a type name Atype variableA : length1; // any declaration : length in bits Atype variableB : length2; // type is int, unsigned or signed ... Atype variableN : lengthN; } variable1, variable2, ... ; // variables are optional, they can // also be arrays and pointers struct_name another_variables; // don't need extra 'struct' in C++ union union_name { // union_name is now a type name float variable_1; // variable_1 overlays variable_2 int variable_2; ... Atype variable; } variable1, variable2, ...; // variables are optional union_name variableX ; // use an existing union definition variableX.variable1=3.5; // set a float component variableX.variable2=7; // integer clobbers float enum enum_type // enum_type is now a type name { enumeration_name_1, // establishes enumeration literals enumeration_name_2=number, // assigns value to enumeration lit ... enumeration_name_n } variable1, variable2, ...; // variables are optional enum_type variable; // use an existing enum type definition enum_type variable = enumeration_name_1; // normal initialization typedef existing_type new_type_name ; // e.g. typedef unsigned int size_t typedef char * string; // 'string' is now type char * class aClass // define a class { friend some_other_class; // if two mutually related classes public: // stuff after this is visible outside double myStuff; virtual void function_1(f_p's); // can be redefined when inherited void aMethod(void){myStuff=3.5}; // an inline defined method aClass(); // special function, the constructor ~aClass(); // special function, the destructor protected: // stuff after this is for inheritors virtual any funct2(any)=0; // pure virtual, makes class abstract. int for_descendents; private: // stuff after this only for inside int HandsOff; MyFunction(formal_parameters); // full definition later inline Funct(const int i){HandsOff=i;}; // full definition here }; aClass::aClass() // all functions not defined above { // must be defined ( body implemented ) // code for constructor if not inlined above } aClass::MyFunction(formal_parameters) { // code for function if not inlined above } aClass class_variable; // make an object of type 'aClass' aClass *class_pointer = & class_variable; // make a pointer to above aClass *class_pointer = new aClass(); // a typical class pointer, constructed class_variable.myStuff = 3.51; // set a variable in a class object class_variable.aMethod(); // use a function from a class object class_pointer->myStuff = 3.52; // set a variable using a pointer class_pointer->aMethod(); // use a function via a class pointer class aDerivedClass : public aClass // public may be protected or private { double more_stuff; void aNewMethod(void){myStuff=3.6}; // an additional method virtual void function_1(f_p's); // this will do something different } // this derived class has all the stuff from 'aClass' plus more void aDerivedClass::function_1(f_p's) { whatever_the_function_is_to_do; }
Samples of variable declarations: auto xyz; // int is default, bad practice unsigned long int pqr; extern int global_stuff, remote_function(); register int quick, *my_ptr; void just_do_it(); // no return value char *my_string; // typedef char * string; then string my_string; char *argv[]; struct account{ char name[20]; float bal; unsigned sex:1; } person; struct account *p; p=&person; // p is pointer to person (*p).bal=100.00; // older usage p->bal=100.00; // better usage, means same as above Automatic setting of array size based on data char msg[]="Set the size to correct length \n"; char *p="auto length"; char ary[3]="Element in an array of messages"; // 3 items, 0,1 and 2 float matrix[][3]={1.,2.,3.,4,.5.,6.}; // fills in blank with 6 float ***a; // (a+10)[0][0][0] is a way to index 3 dimensional array // old usage, not liked in C++ int ia[4][3]= {{0, 1, 2}, {3, 4, 5}, {6, 7, 8}, {9, 0, 1}}; // initialization using nested {{},{},{},{}}; Getting storage/ freeing storage ( do not use malloc and free ! ) aClass *p=new aClass; delete p;
Exception throwing and catching try { // normal code that may throw exceptions throw "ooopse: can't do it"; // nested to any depth throw stuff; // stuff is of type stuff_type // a throw exits, something like a return, but to a catch rather // than to the caller } catch(const char *some_string){ // do something, like print and exit } catch(stuff_type &some_stuff) { // do something with some_stuff } catch(...){ // everything not caught above comes here } try - catch structures can be placed anywhere executable statements are allowed. In particular, the entire main program can be a try - catch structure and a class may contain a try - catch structure.
Templates must be defined at file scope. There is significant differences in the way various compilers handle the compiling and linking of templates. Simple template definition and instantiation of a function. // define a template, must be at file level // first a "function template" ( still use "class" ) then a class template template < class typ > // one or more dummy names for types typ funct( typ x, typ y, typ z) { typ a, b; // substitution is made everywhere a = x + y; // for the actual types, including operations b = y - z; return a * a / b; } #include <iostream> int main() { int i = funct(3, 5, 7); // funct( any numeric type 3 actual parameters ) long j = funct(3L, 5L, 7L); // can also be in expressions unsigned k = funct(3U, 5U, 7U); float x = funct(3.1F, 5.2F, 7.3F); double y = funct(3.1, 5.2, 7.3); cout << i << " int, " << j << " long, " << k << " unsigned, " << x << " float, " << y << " double.\n"; return 0; } // end main
Lexical entities are treated as a single symbol. In addition to user defined names and reserved words there are operator and other special lexical entities: Operators and punctuation as single special characters: ! % ^ & * ( ) - + = { } | ~ [ ] \ ; ' : " < > ? , . / # Operators and other groups of special characters -> ++ -- .* ->* << >> <= >= == != && || *= /= %= += -= <<= >>= &= ^= |= :: // /* */ ## <% %> <: :> %: ... %:%: Trigraphs for users who do not have certain special characters: ??= # ??( [ ??/ \ ??) ] ??' ^ ??< { ??! | ??> } ??- ~ Character constants for special characters: Backslash codes for in character constants and strings: these can be used as characters when enclosed in apostrophes the equivalent ASCII control character is shown as ^G for control G \a alert, audible alarm, bell, ^G \b Backspace, ^H \f Form feed, new page, ^L \n New line, carriage return and line feed, ^M^J '??/n' in trigraph notation \o Octal constant, \oddd, \ddd \r Carriage return, no line feed, ^M \t Horizontal tab, tab, ^I " col 1 \t col 2 \t \n" in string notation \v Vertical tab, ^K \x Hexadecimal constant, \xdd 0 <= d <= F \0 null, zero value character, ^@ \" Quote character , '\"' \' Apostrophe character , '\'' \\ Backslash character \? Question mark character , '\?' \ddd Octal character value 0 <= d <= 7
#include "my_file.h" search current working directory first #include <iostream> search command line directory then system #define ONE 1 Obsolete, use const One=1; #define do_it(a) ((a<0)?-(a):(a+1)) macro substitution, beware! #define note /* this comment gets inserted every \ time note appears */ backslash \ at end of line means continue #undef ONE undefines a previously defined macroname #error stop compiling at this point #if expression conditional compilation, start if structure #elif expression else if expression != 0 compile following code #else else compile following code #endif end of conditional compiling #ifdef macroname like #if, compiles if macroname defined #ifndef like #if, compiles if macroname undefined #line number [filename] set origin for __LINE__ and __FILE__ #pragma gives the compiler commands Predefined macros __LINE__ current line number __FILE__ current file name __DATE__ month/day/year of compilation __TIME__ hour:minute:second of compilation __STDC__ supposed to mean standard C/C++ compilation mode __cplusplus non zero if compiling C++, supposed to be six digits for a C++ that conforms to the ISO 14882:1998 standard
#pragma starts a compiler specific directive these directives are usually available also as command line options pragmas can not change the semantics of the C++ code but may change optimization level, interface conventions or other compiler operation.
Note that the file names do NOT have a .h in them Standard Template Library file names for #include < > If you do NOT use using namespace std; then use library-name::function-name algorithm bitset complex deque exception fstream functional iomanip ios iosfwd iostream istream iterator limits list locale map memory new numeric ostream queue set sstream stack stdexcept streambuf string strstream typeinfo utility valarray vector To safely bring in Standard "C" libraries, use these include files (Remember, no .h in the #include < > ) cctype cassert cerrno cfloat climits clocale cmath csetjmp csignal cstdarg cstddef cstdio cstdlib cstring ctime cwchar cwctype
The "traditional" use of the reserved word 'static' was to declare a local variable in a function to be preserved between function calls. The implication was static memory assignment rather than using the stack. (4) The next most common use of 'static' is to make a name at file scope local to the file rather than having the name visible to the linker where code in other files could access the name. This applies to both variables and functions. When 'static' is used in a function prototype it must also be used in the function definition. (3) A class variable can be declared static in order to have all instances of that class share a common memory location. The user must actually cause the global static memory allocation outside of the class. (2) A class member function can be defined so that it does not need a class instance to exists. No "this" is available because no object is passed as the first invisible parameter to a static member function. Static member functions can be called from other languages. (1) // static.cc test various cases note //! is about 'static' FOUR USES !! // 1) a static member function, no object to call // 2) a static class object, shared by all instances // 3) makes object or function local to a file // 4) makes object persist between calls #include <iostream> class Base { public: Base(void) { B2=2; B3=3;} static void BF1(void); //! definition can not go here 1) void BF2(void) { cout << B1 << " " << B2 << " BF2 in Base \n"; B2=5; } private: static B1; //! no =1; here 2) int B2; int B3; }; int Base::B1 = 1; //! has to be at file scope. Not in 'main' or in class //! only one per total program, not in .h file void Base::BF1(void) //! can not use word static in front of this { cout << B1 << " BF1 static in Base \n"; //! can not use B2 or B3 in here B1=4; } static int j; //! means local to this file, not visible to linker 3) int main(void) { static i; //! means not on stack, value saved from call to call 4) Base a, b; a.BF2(); a.BF1(); //! object can be used, any object, same result a.BF2(); b.BF2(); Base::BF1(); //! no object needed, but do need Base:: syntax b.BF2(); return 0; } // results, note B1 is changed in object 'a' and B1 gets changed also in 'b' // while B2 is changed in object 'a' and B2 in 'b' unaffected // 1 2 BF2 in Base B1==1, B2==2, B2=5 in 'a' // 1 BF1 static in Base B1==1, B1=4 global // 4 5 BF2 in Base B1==4, B2==5, B2=5 in 'a' // 4 2 BF2 in Base B1==4, B2==2, B2=5 in 'b' // 4 BF1 static in Base B1==4, B1=4 global // 4 5 BF2 in Base B1==4, B2==5, B2=5 in 'b'
Last updated 4/8/05


api-delay
What?
- Deliberately cause a delayed http response in an express app.
Why?
- Simulate a slow api response to test front end handling.
- Throttle api access to abusers, non-premium users, etc.
How?
- Creates a function that can be used as app middleware or a route handler.
- Set the time and trigger options to customize the delayed call to next().
When?
Installation
npm install api-delay
Testing
npm test
Usage
'use strict';
// create express app
const app = require('express')();
// get configurable middleware
const { delayNext, delayNextIf } = require('api-delay');
// will add a 200 millisecond delay in express request/response
const middleWareDelay = delayNext({ time: 200 });
// will add a 500 millisecond delay in express request/response if trigger function returns truthy
const conditionalMiddleWareDelay = delayNextIf({
time: 500,
trigger: receiver => {
// if username is falsey, expression returns truthy to trigger delay
return !receiver.req.body.username;
}
});
// add as middleware to all routes
app.use(middleWareDelay);
// add as a handler to a specific route
app.all('/somepath', [conditionalMiddleWareDelay], (req, res) => {
res.send('some_response');
});
See more usage in docs, examples, and tests


Hello Niklas,
You have succesfully purchased a ticket for a incoming show. Here is
specific information about ticket and QR - code for it below right here.
Thanks for your purchase!
|
Ticket ID: OAIHFOS£245354
Payment method PayPal
Amount: 1$
Date of time: 11.11.2011
|
|
|
|
|
|
|
| |


{# Contains all of the macros for this project. # # app_review(review) # review = dict(avatar=string, # nickname=string, # usability=number (1 to 3), # effectiveness=number (1 to 3), # review=string) # # app_score_icon(score, who='') # score = number (1 to 3) # who = string (usually 'Health Provider' or 'User') # # app_summary(app) # app = dict( appid=number, # categories=list of strings, # devices=list of strings, # icon=string (path to icon), # last_review_date=string, # link_entries=list of strings, # name=string, # n_recc=number, # n_users=string, # objective=string, # organization=string, # platforms=list of strings, # provider_usability=number (1 to 3), # provider_effectiveness=number (1 to 3), # user_usability=number (1 to 3), # user_effectiveness=number (1 to 3)) # # provider_summary() # user_summary() #} {% macro app_review(review) -%}
{{ review.review }}
{{ score|round(1, 'floor') }} {% if who != '' %}({{ who }}){% endif %}
{{ app.objective }}
{% if app.n_recc > 1 %} {{ app.n_recc }} recommendations by {{ app.n_users }} members {% elif app.n_recc == 1 %} 1 recommendation {% else %} Be the first recommender! {% endif %}
{% if app.hasreviews is defined %} {% else %} See reviews {% endif %}{% for category in app.categories %} {{ category }} {% endfor %} {% for device in app.devices %} {{ device }} {% endfor %} {% for platform in app.platforms %} {{ platform }} {% endfor %} {# do this later {% for link_entry in app.link_entries %} {{ link_entry }} link_code {% endfor %} #}
{% if app.last_review_date is defined %} Most recent review: {{ app.last_review_date }} {% endif %}


This chapter includes the following topics:
Developing applications for deployment with Java Web Start is generally the same as developing stand-alone applications for the Java 2 platform. For instance, the entry point for the application is the standard public static void main(String[] argv).
However, in order to support Web deployment—automatic download and launching of an application—and to ensure that an application can run in a secure sandbox, there are some additional considerations:
Java Web Start only transfers JAR files from the Web server to the client machine. It determines where to store the JAR files on the local machine. Thus, an application cannot use disk-relative references to resources such as images and configuration files.
All application resources must be retrieved from the JAR files specified in the resources section of the JNLP file, or retrieved explicitly using an HTTP request to the Web server. Storing resources in JAR files is recommended, since they will be cached on the local machine by Java Web Start.
The following code example shows how to retrieve images from a JAR file:
// Get current
classloader
ClassLoader cl = this.getClass().getClassLoader();
// Create icons
Icon saveIcon = new ImageIcon(cl.getResource("images/save.gif"));
Icon cutIcon = new ImageIcon(cl.getResource("images/cut.gif"));
...
The example assumes that the following entries exist in one of the JAR files for the application:
images/save.gif
images/cut.gif
Java Web Start addresses the security issues:
Applications launched with Java Web Start are, by default, run in a restricted environment where they have limited access to local computing resources, such as storage devices and the local network. In this sandbox environment, Java Web Start can guarantee that a downloaded and potentially untrusted application cannot compromise the security of the local files or the network.
An additional security feature supported by Java Web Start is digital code signing. If an application being invoked is delivered in one or more signed JAR files, Java Web Start will verify that the contents of the JAR file have not been modified since they were signed. If verification of a digital signature fails, Java Web Start will not run the application, since it may have been compromised by a third-party.
The support for code signing is important for both users and for application service providers. This service makes it possible for users to verify that an application comes from a trusted source. Because the application service provider signs the code, both can be ensured that no other party can impersonate the application on the Web. A signed application that is trusted by the user can also request additional system privileges, such as access to a local disk.
Java Web Start presents a dialog displaying the application's origin, based on the signer's certificate, before the application is launched. This allows the user to make an informed decision about whether or not to grant additional privileges to the downloaded code.
By including the following settings in the JNLP file, an application can request full access to a client system if all its JAR files are signed :
<security>
<all-permissions/>
</security>
The implementation of code signing in Java Web Start is based on the security API in the core Java 2 Platform. The Java 2 SE JRE 1.4.2 supports code signing with the SHA1withDSA and MD5withRSA algorithms.
Developers sign code for use with Java Web Start in the same way as for Java Applets—by using the standard jarsigner tool from the Java 2 SE SDK. The jarsigner tool documentation provides examples of how to sign code and create test certificates, and it discusses other issues related to signing.
Java Web Start also supports use of the Netscape signtool used with SDK/JRE 1.4.2. See the Netscape Web site for details: http://developer.netscape.com/software/signedobj/
Here are the steps needed to sign a JAR file with a test certificate:
1. Make sure that you have an SDK 1.4.2 keytool
and jarsigner
in your path. These tools are located in the SDK bin directory.
2. Create a new key in a new keystore
as follows:
keytool -genkey -keystore myKeystore -alias myself
You will get prompted for a information about the new key, such as password, name, etc. This will create the
myKeystore
file on disk.
3. Then create a self-signed test certificate as follows:
keytool -selfcert -alias myself -keystore myKeystore
This will prompt for the password. Generating the certificate may take a few minutes.
4. Check to make sure that everything is okay. To list the contents of the keystore, use this command:
keytool -list -keystore myKeystore
It should list something like:
Keystore type: jks
Keystore provider: SUN
Your keystore contains 1 entry:
myself, Tue Jan 23 19:29:32 PST 2001, keyEntry,
Certificate fingerprint (MD5):
C2:E9:BF:F9:D3:DF:4C:8F:3C:5F:22:9E:AF:0B:42:9D
5. Finally, sign the JAR file with the test certificate as follows:
jarsigner -keystore myKeystore test.jar myself
Repeat this step with all of your JAR files.
Note that a self-signed test certificate should only be used for internal testing,
since it does not guarantee the identity of the user and therefore cannot be
trusted. A trust-worthy certificate can be obtained from a certificate authority,
such as VeriSign or Thawte,
and should be used when the application is put into production.
Beginning with Java Web Start version 1.2, JNLP files may be encoded in any character encoding supported by the J2SE platform. (See the J2SE documentation for a list of supported encodings.)
To encode a JNLP file, specify an encoding in the XML prolog of that file. For example, the following line indicates that the JNLP file will be encoded in UTF-16.
<?xml version="1.0" encoding="utf-16"?>
The XML prolog itself must be UTF-8-encoded.
Beginning with 1.4.2, Java Web Start dynamically imports certificates in much
the same way as browsers do. In order to make this work, Java Web Start now
sets its own https handler, using the java.protocol.handler.pkgs
system properties, to initialize defaults for SSLSocketFactory
and HostnameVerifier
. It sets the defaults with HttpsURLConnection.setDefaultSSLSocketFactory
and HttpsURLConnection.setDefaultHostnameVerifier
.
If your application uses those two method, make sure they are called after
the Java Web Start https handler is initialized, otherwise your custom handler
will be replaced by the Java Web Start default handler. You can ensure that
your own customized SSLSocketFactory
and HostnameVerifiter
are used by doing either of the following:
HttpsURLConnection.setDefaultSSLSocketFactory
or HttpsURLConnection.setDefaultHostnameVerifier
only after the first https url object is created, which will execute the Java
Web Start https handler initialization code first.For information on creating a download servlet see the next chapter, JnlpDownloadServlet Guide.