text:
---
computation_units: Yes/No
data_non_statistical: false
date_metadata_updated: February, 2018 (Kali Kong)
goal_meta_link: http://unstats.un.org/sdgs/files/metadata-compilation/Metadata-Goal-13.pdf
graph: binary
graph_title: Has the US established national and local disaster risk reduction strategies?
graph_type: line
has_metadata: true
indicator: 13.1.2
indicator_definition: "Death: The number of people who died during the disaster, or\
  \ directly after, as a direct result of the hazardous event Missing: The number\
  \ of people whose whereabouts is unknown since the hazardous event. It includes\
  \ people who are presumed dead although there is no physical evidence. The data\
  \ on number of deaths and number of missing are mutually exclusive. Affected people:\
  \ People who are affected by a hazardous event. Comment: People can be affected\
  \ directly or indirectly. Affected people may experience short-term or long-term\
  \ consequences to their lives, livelihoods or health and in the economic, physical,\
  \ social, cultural and environmental assets. Directly affected: People who have\
  \ suffered injury, illness or other health effects; who were evacuated, displaced,\
  \ relocated; or have suffered direct damage to their livelihoods, economic, physical,\
  \ social, cultural and environmental assets. Indirectly affected: People who have\
  \ suffered consequences, other than or in addition to direct effects, over time\
  \ due to disruption or changes in economy, critical infrastructures, basic services,\
  \ commerce, work or social, health and physiological consequences. In this indicator,\
  \ given the difficulties in assessing the full range of all affected (directly and\
  \ indirectly), UNISDR proposes the use of an indicator that would estimate \"directly\
  \ affected\" as a proxy for the number of affected. This indicator, while not perfect,\
  \ comes from data widely available and could be used consistently across countries\
  \ and over time to measure the achievement of the Target B. From the perspective\
  \ of data availability and measurability, it is proposed to build a composite indicator\
  \ which consists of \"directly affected\", or those who are \tInjured or ill, \t\
  Evacuated, \tRelocated and to measure the number who suffered direct damage to their\
  \ livelihoods or assets, \tPeople whose houses were damaged or destroyed \tPeople\
  \ who received food relief aid. Injured or ill: The number of people suffering from\
  \ physical injuries, trauma or cases of disease requiring immediate medical assistance\
  \ as a direct result of a hazardous event. Evacuated: The number of people who temporarily\
  \ moved from where they were (including their place of residence, work places, schools\
  \ and hospitals) to safer locations in order to ensure their safety. Relocated:\
  \ The number of people who moved permanently from their homes to new sites due to\
  \ hazardous event. Note: This definition excludes preventive relocation before the\
  \ event. People whose houses were damaged or destroyed due to hazardous events:\
  \ The estimated number of inhabitants previously living in the houses (housing units)\
  \ damaged or destroyed. All the inhabitants of these houses (housing units) are\
  \ assumed to be affected being in their dwelling or by direct consequence of the\
  \ destruction/damage to their housings (housing units). An average number of inhabitants\
  \ per house (housing unit) in the country can be used to estimate the value. Houses\
  \ destroyed: Houses (housing units) levelled, buried, collapsed, washed away or\
  \ damaged to the extent that they are no longer habitable. Houses damaged: Houses\
  \ (housing units) with minor damage, not structural or architectural, which may\
  \ continue to be habitable, although they may require some repair or cleaning. People\
  \ who received food relief aid: The number of persons who received food /nutrition,\
  \ by government or as humanitarian aid, during or in the aftermath of a hazardous\
  \ event. Hazardous event: The occurrence of a natural or human-induced phenomenon\
  \ in a particular place during a particular period of time due to the existence\
  \ of a hazard. Hazard: A potentially damaging physical event, phenomenon or human\
  \ activity that may cause the loss of life or injury, property damage, social and\
  \ economic disruption or environmental degradation. UNISDR recommends setting NO\
  \ threshold for recording hazardous event in order to monitor all hazardous events.\
  \ Small-scale but frequent hazardous events that are not registered in international\
  \ disaster loss databases account for an important share of damages and losses when\
  \ they are combined, and often go unnoticed by the national and international community.\
  \ These events, when accumulated, are often a source of poverty in developing countries\
  \ but can be effectively addressed by well-designed policies. The scope of the Sendai\
  \ Framework for Disaster Risk Reduction 2015-2030 is \"the risk of small-scale and\
  \ large-scale, frequent and infrequent, sudden and slow-onset disasters, caused\
  \ by natural or man-made hazards as well as relate environmental, technological\
  \ and biological hazards and risks\". Regarding the inclusion of biological and\
  \ environmental hazards in natural hazards category and whether and how to integrate\
  \ man-made hazards, UNISDR will discuss the issue with WHO and other organizations\
  \ (for example, WHO would be in a better position in terms of data, knowledge and\
  \ relationship with Member States and other stakeholders to monitor biological events\
  \ including epidemics. However, we generally do not expect biological disasters\
  \ will cause physical damages to facilities. ). \tNote: Terminology will be discussed\
  \ and finalized in the Open-ended Intergovernmental Working Group for Sendai Framework\
  \ for Disaster Risk Reductio"
indicator_name: Number of countries that adopt and implement national disaster risk
  reduction strategies in line with the Sendai Framework for Disaster Risk Reduction
  2015-2030
indicator_sort_order: 13-01-02
indicator_variable: disaster_rsk_rdctn
layout: indicator
method_of_computation: 'Summation of data on related indicators from national disaster
  loss databases. Make the sum a relative figure by using global population data (World
  Bank or UN Statistics information). Relativity is important because population growth
  (expected to be 9 billion in 2050) may translate into increased hazard exposure
  of population. The Expert Group recommends not using the indicators related with
  the people whose houses were damaged/destroyed in the computation. UNISDR and IRDR
  groups recommend using them as they can be estimated from widely available and verifiable
  data and reflect vulnerability and livelihood issues. Data on housing damage and
  destroyed is essential for economic loss, so using these indicators would not impose
  additional data collection burden. Double-counting: From practical perspective,
  double counting of affected people is unavoidable (for example, injured and relocated)
  in many countries. Minimum double counting is summing "number of injured" and Number
  of people whose housings were damaged or destroyed. Relocated is sub-set of number
  of people whose housings were destroyed. The data can be disaggregated by hazard
  type. When applied to proposed target 13.1 and 15.3, hydrological, meteorological
  and climatological and indirectly biological disasters are monitored.'
national_geographical_coverage: United States
periodicity: Annual
permalink: /13-1-2/
published: true
rationale_interpretation: "Cities around the world, as well as rural populations,\
  \ witness growing disaster risks. Impacts of climate change on sustainable development\
  \ are observed through both slow-onset events (e.g. sea level rise, increasing temperatures,\
  \ ocean acidification, glacial retreat and related impacts, salinization, land and\
  \ forest degradation, loss of biodiversity and desertification) and extreme weather\
  \ events. Human loss can be measured by the number of deaths, missing, injured or\
  \ ill, evacuated, relocated, people whose houses were damaged/destroyed and people\
  \ who received food relief aid as a direct result of the hazardous events. \nCities\
  \ are some of the most vulnerable areas to natural disasters. Unplanned urban development\
  \ (e.g. informal settlements, overcrowding, inadequate infrastructures) exacerbates\
  \ urban vulnerability to climate change impacts and hydro-meteorological and geological\
  \ hazards. Over half of all coastal areas are urbanized and 21 of the world's 33\
  \ mega cities lie in coastal flood zones. SIDS and coastal regions are particularly\
  \ affected by sea level rise, coastal flooding and erosion, and extreme events (e.g.\
  \ tsunamis and storm surges) due to undermining natural protective barriers, low\
  \ levels of development combined with rapid population growth in low lying coastal\
  \ areas and inadequate capacity to adapt. Poor urban populations must often resort\
  \ to unsustainable coping strategies and mechanisms. \nLarge numbers of people remain\
  \ perilously close to falling into poverty, experiencing shocks that they are unable\
  \ to cope with. For the poor, a shock of even a relatively short duration can have\
  \ long term consequences. Several dimensions of poverty are closely related to environment,\
  \ which is often affected by natural disasters. The poverty reduction agenda could\
  \ include well-designed social protection scheme to help protecting the poor against\
  \ sudden shocks and the development of capacities to better predict and prepare\
  \ for such shocks. Better management of natural resources can themselves strengthen\
  \ the resilience of the poor, by both reducing the likelihood of natural hazardous\
  \ events and offering resources to help cope with them. \nBiodiversity provides\
  \ ecosystem resilience and contributes to the ability to respond to unpredictable\
  \ global changes and natural disasters. Healthy ecosystems act as buffers against\
  \ natural hazards, providing valuable yet underutilized approaches for climate change\
  \ adaptation, enhancing natural resilience and reducing the vulnerability of people,\
  \ for example to floods and the effects of land degradation. These ecosystem services\
  \ improve the sustainability and economic efficiency of built infrastructure, and\
  \ are critical for sustainable and resilient urban areas. \nThis indicator will\
  \ track human-related loss. The disaster loss data (particularly mortality) are\
  \ significantly influenced by large-scale catastrophic event, which represent important\
  \ outliers. UNISDR recommends countries to report the data by event, so complementary\
  \ analysis can be done by both including and excluding such catastrophic events.\
  \ \nThe indicator will build bridge between SDGs and the Sendai Framework for Disaster\
  \ Risk Reduction because the reduction of human related loss is included in the\
  \ Sendai Framework global targets and will also be monitored under the Sendai Framework\
  \ Monitoring Mechanism. (mainly based on TST Issue Brief 2, 5, 20 and 23-26)"
reporting_status: complete
sdg_goal: 13
source_active_1: true
source_agency_staff_email_1<EMAIL_ADDRESS>source_agency_staff_name_1: Elan Strait
source_agency_survey_dataset_1: National Security Council/Executive Office of the
  President
source_notes_1: null
source_organisation_1: National Security Council/Executive Office of the President
source_title_1: null
source_url_1: https://www.dhs.gov/presidential-policy-directive-8-national-preparedness
target: Strengthen resilience and adaptive capacity to climate-related hazards and
  natural disasters in all countries.
target_id: '13.1'
title: Number of countries that adopt and implement national disaster risk reduction
  strategies in line with the Sendai Framework for Disaster Risk Reduction 2015-2030
un_custodial_agency: 'UNISDR (Partnering Agencies: UN Habitat, UNEP)'
un_designated_tier: '1'
us_method_of_computation: 'US Presidential Policy Directive 8: National Preparedness,
  including the National Preparedness Goal and the National Preparedness System'
variable_description: null
variable_notes: null
---

repository: brockfanning/sdg-data-usa

repo_name: brockfanning/sdg-data-usa


text:
# SampleCourierNetCore

This sample is based on the Sample-Courier - https://github.com/MassTransit/Sample-Courier

Adapted the project for ASP.NET core: WebApi, Swagger, MassTransit, RabitMq, Automatonymous, DependencyInjection, EntityFrameworkCore and Serilog

Courier is MassTransit's routing-slip implementation, which makes it possible to orchestrate distributed services into a business transaction.
This sample demonstrates how to create and execute a routing slip, record routing slip events, and track transaction state using Automatonymous.

A postman test collection can be found in the postman folder.

**WebApi console output:**
![](./images/WebApi.jpg "WebApi console")

**TrackingService console output**:
![](./images/TrackingService.jpg "TrackingService")

**ProcessingService console output**:
![](./images/ProcessingService.jpg "ProcessingService")

**Web API help with Swagger**:
![](./images/Swagger.jpg "Swagger")

branch_name: refs/heads/master

extension: md

license_type: permissive


text:
A library for writing web application tests in javascript.

Provides a procedural interface for writing tests, so you don't have to
grok event based programming. Uses PhantomJS to provide a webkit-based
headless browser to run your tests against.

Synopsis
--------

    phantom.injectJs('testlib.js');
    var t = new Test('https://github.com');
    t.open('/');
    t.is(t.text('title'), 'GitHub · Social Coding', 'Homepage loaded');
    t.done();

Installation
------------

1. Clone this repository
2. Either install PhantomJS from the repository (Ubuntu natty, maverick)

sudo add-apt-repository ppa:jerome-etienne/neoip
    sudo apt-get update
    sudo apt-get install phantomjs

    Or build PhantomJS from source

sudo apt-get install libqt4-dev qt4-qmake
    git clone git://github.com/ariya/phantomjs.git && cd phantomjs
    git checkout 1.4
    qmake-qt4 && make
    sudo ln -s  $(pwd)/bin/phantomjs /usr/local/bin/phantomjs

3. Test:

phantomjs github-test.js

    Note: if you don't have an X server, install xvfb, and prepend the above command with xvfb-run

Notes
-----

It's early days for this project, feel free to contribute.

For now (a temporary restriction), the page you are testing must have JQuery
loaded. We'll work around this shortly.

Legal
-----

(C) 2012 Shoptime Software.

This project is licensed under the MIT license.

license: MIT

repository: grantm/phantom-testlib

repo_name: grantm/phantom-testlib


text:
tl;dr
Some DVs for explanatory goodness. Overall, goodness of explanation is closely tied to P(explanandum|explanans). In these experiments, base rates of explanans were neglected by participants.

Some questions they asked:
* How does probabilistic information affect explanatory judgements? Answer: in the way you'd expect...?
* Are explanatory and abductive inference the same kind of inference? Answer: how is this addressed in this paper?

Some variables:
* Explanatory value
* Rational acceptability
* Entailment

Virtues of explanations:
* simplicity
* generalizability
* "sense of understanding"

Statistical relevance but not base rates determined explanatory value.

Two possible explanations (urns, medical treatment, cabs in a city)

* "logical implication" H logically implies D.
* "causal relevance" H specifies the cause of D.
* "confirmation" H is confirmed by D.
* "posterior probability" H is probable given D.
* "explanatory power" H explains that D.
* "increase in understanding" H provides understanding about D.
* "truth" H is true.

Varied factors:
* statistical relevance
* prior probability

Authors ran PCA to get 3 features:
* Explanatory value (causal power)
* Confirmation "rational acceptability" (is the hypothesis likely?)
* Entailment

Some ANOVAs:
* statistical relevance -- causal P(D|H) -- significantly related to "explanatory value" and "rational acceptability" and "entailment"
* prior probability of hypothesis didn't matter to anything, which makes sense in light of other research on "base rate neglect" and inference of causal models

repository: erindb/explanations-reboot

repo_name: erindb/explanations-reboot


text:
---
title: Alerts Best Practices
keywords: alerts
tags: [alerts, best practice]
sidebar: doc_sidebar
permalink: alerts_best_practices.html
summary: Learn about best practices for alert creation, alert settings, and alert troubleshooting.
---

You use alerts in VMware Aria Operations for Applications (formerly known as Tanzu Observability by Wavefront) to get notified when something out of the ordinary happens. Alerts monitor your environment's behavior and send notifications based on how you configure the alert.

This page has some best practices from our Technical Support engineers to help you set up truly useful alerts and avoid common problems with alerts.

## Know Your Data!

If you don't know your data before you create charts and alerts, results can be confusing. It's even possible that your query times out because of system overload. Some extra time spent examining your data can help you avoid a lot of troubleshooting time later.

<!--- For example one Wavefront customer tried to create a ratio that used large amounts of data:

RK>>How can we obfuscate/simplify the queries in https://sunnylabs.zendesk.com/agent/tickets/4237 ?

They are:

...${paas core count} / (${bare metal core count} + ${paas core count})...

...${bare metal core count} / (${bare metal core count} + ${paas core count})--->

Before creating queries and alerts, make sure you understand the following aspects of your data.

### Fixed Interval?

**Question:** Does the metric report regularly, i.e., at a fixed interval?

For metrics that do not report at a fixed interval, alerts are only useful if you select the appropriate aggregation method.

* You can base the query condition on the last value reported, the sum of the values, or the average of the values depending on what nuance you want your query to capture.

* Operations for Applications evaluates alerts once every 5 minutes by default. The **Checking Frequency** in the Alert page's **Advanced Settings** allows you to change the default (minimum is 1 minute).

**Example 1**: Suppose you have a metric that reports the number of failures since server restart. If the metric reports 25 failures at 1:24, and 25 failures at 1:25, that could mean nothing has changed. However, it could also mean that within a minute, 10 failures resolved and 10 new failures appeared. It could even mean that within a minute, total failures dropped to 2, jumped up to 100, and came back down to 25. For this use case, your alert can't just check the number of failures once a minute. Instead, the alert has to look at a metric that captures the total number of failures that happened over time.

<!---RK>>Need some sample queries here...--->
**Example 2**: Suppose your metric returns values that represent new failures several times per minute. You want to generate an alert based on the total number of failures per minute. In this case, you can sum the values into minute buckets rather than relying on the alert behavior--which averages those values by default--. Or you can average those values to see how many seconds it took to get an error response.
<!---RK>>Need some sample queries here...--->
### Only Non-Zero Values?

**Question:** Does the metric report only non-zero values, or does it also report zero values?

If your metric includes zero values, or if blips in the network might result in temporary zero values, our Technical Support team recommends that you use [cumulative counter metrics](delta_counters.html), which represent increasing numerical values.

Your data might already come in as counters, for example, the uptime for a system. Or you can explicitly set up a counter to count tasks completed, errors occurred, etc. For example, `sum(ts(cpu.idle))` is a counter metric. It increases over time, and never reports zero values.

For alerts, follow these guidelines:
* Counters are especially helpful for alerts: Even if there's a break in the data flow, the alert doesn't immediately get triggered because a counter always has a value. You can instead have the alert check whether the value didn't change for a specified amount of time.

* If a counter doesn't make sense, delta counters might work. Delta counters record changes between the last metric and the current metric. Delta metrics that report zero values are more useful for alerting than deltas that don't report zero values.

If you know your data, you can pick a suitable metric to get the best results for your alert. Or you can use functions like `sum` to create your own counter.

### Danger of Becoming Obsolete?

**Question:** Might this metric become [obsolete](metrics_managing.html#obsolete-metrics) because it doesn't report values (e.g., no failures)?

We consider a metric obsolete after it hasn't reported any values for a certain period of time (by default 2 weeks). The [obsolescence period](metrics_managing.html#obsolete-metrics) might vary because it is a configurable setting. You can see your current configuration by looking into the Advanced settings of any [chart](ui_charts.html#include-metrics-that-stopped-reporting) or [dashboard](ui_dashboards.html#set-dashboard-display-preferences-and-settings). To change this configuration, contact [Technical Support](wavefront_support_feedback.html).

For example, if your obsolescence period is 2 weeks and you monitor `http.failures`, the metric becomes obsolete if no failures occurred for 2 weeks. To avoid this, you can monitor `http.failures.count` or wrap `count` around the `http.failures` metric, so that the metric is cumulative and does not become obsolete.

The UI allows you to include or exclude obsolete metrics in several places. For alerts, you can select the **Advanced** check box **Include Obsolete Metrics**.

As discussed above, it's usually better to find a way to report values, for example by using a counter or delta counter, than to include obsolete metrics.

### Simultaneous Metrics?

**Question:** Do some of the metrics report at exactly the same moment?

If an alert uses two metrics in its condition, for example, `ts(metric1)/(metric2)`, you have to find out whether these two metrics report at exactly the same time.

If metrics report at the same time, it might be better to use raw aggregate functions and not interpolating aggregate functions  There is no default in this case:

* With standard aggregation functions, interpolation will occur
* With raw aggregation functions, interpolation does not occur.

Don't use interpolation if metrics show deltas to avoid results like `4.5 processes running`.

### Aligned to Time Interval?

**Question:** Is this metric aligned to the minute (or any other interval)?

By default, alert checking frequency is 5 minutes, and alert condition queries are evaluated with 1 minute granularity. If more than 1 data point comes in per minute, consider explicitly aligning your data to 1 minute using the summarization strategy appropriate for your use case (e.g., `sum`, `max`, `last` etc). If you don't specify a summarization strategy, Operations for Applications uses `avg`, which computes the mean. If your data points are coming in much less frequently than once a minute, consider adjusting the alert's checking frequency advanced option.

### Near Real Time or Back-Filled?

**Question:** Is this metric reporting in near real time or is it back-filled in chunks?

For some data sources, for example AWS, the metric is backfilled in chunks, and your alert has to take that into account. For example, if the metric is backfilled in 10-minute chunks, avoid setting **Minutes to Fire** to less than 10 minutes, or use moving time window functions to make sure all the incoming data is visible to the alert.

### Does the Query Work for the Data Shape?

Data shape refers to the reporting behavior of the alert data. Behavior such as how often data is reported, the intervals associated with reporting, and a lag in real-time data can all result in an alert that doesn't match your expectations.

For example, imagine you want to trigger an alert when the total number of errors reported across 10 VMs exceeds expectation. The data shape can impact how you should construct your alert condition query. For this example, pay attention to the following data shape behavior to ensure that your alert meets expectations:
* **Reporting behavior when no errors occur**: Some environments send a value of 0 if no errors occurred at a reporting interval, while others omit a reported value. If there's no reported value, you might need the [default](ts_default.html) missing data function to correctly handle the omitted value.

* **Reporting intervals**: Even though each VM in this example likely has the same reporting frequency, the reporting interval may be staggered. It usually makes sense to calculate the `total number of errors reported across 10 VMs` with an aggregation function. But staggered reporting in conjunction with an aggregation function introduces interpolated values. Consider whether you want to use a raw or non-raw aggregation function. See [Aggregating Time Series](query_language_aggregate_functions.html) for background and a video.

* **Lag in real-time data**: If the Operations for Applications service receives the error data with a 5-minute lag, then you need to consider that when setting the Alert Firing time window or constructing your query.
  - If the alert is set to evaluate a 3-minute time window of real-time data, then there would be no reported values to evaluate during the check.
  - If you look at the data 20 minutes after the fact, you see that the total number of errors were exceeded.
You can increase the **Trigger Window** or use the lag() function to get the correct behavior (alert fires).

## Plan and Test!

Effective alerts require planning and testing. Here are some things to keep in mind to avoid unexpected problems:

**Compose the query carefully**. You can create alerts directly from the **Alerts Browser** page or by selecting **Create Alert** from the ellipsis icon menu on the right of a query.

![create alert](images/v2_create_alert.png)

In both cases, but especially when you create the query from scratch, it's important that you compose the query carefully. In some cases, the default settings for alerts work well, but in other cases it makes sense to change them. See [Recommendations for Alert Settings](#follow-alert-settings-recommendations)

- **Know your data**. Understanding your data is essential for creating useful and meaningful alerts. See [Know Your Data](alerts_best_practices.html#know-your-data) above.

- **Test your alert**. Make sure the alert fires when you expect it does. With alerts, it's possible to get false positives (alert fires when you didn't expect it) or false negatives (alert does not fire when you expected). False positives are usually easier to debug than false negatives.

- **Watch out for changes to the metrics**. If your data changes and your alert remains the same, the alert might no longer work as expected. For example, if your alert monitored environments tagged with `env=prod` and `env=dev`, and the environment names change, the alert can no longer detect problems. Retest alerts after changes to the data and update as needed.
- **Keep stakeholders informed**. Inform your team if you change the alert to avoid confusion about unexpected behavior.
- **Pick a suitable aggregation strategy**. Make sure the alert works for the type of metrics that you are collecting. The aggregation strategy depends on the data. What the chart shows you and what the alert acts on are different aspects of the data.
  - **Chart**: In a chart, nuances might be hidden, but the alert might expose information that the chart doesn't show.
  - **Alert**: Alerts check only once per minute by default, so the alert might not catch certain changes.

## Select Time Windows Carefully

If your alert doesn't have constant time window that's long enough to account for data delays, alert behavior can become very confusing.

### Use a Constant Time Window in the Query

Use a constant time window in your alert queries -- and don't use 1vw.

If you use 1vw in a chart, the query applies to the time window selected for the chart the user looks at. But if you use 1vw in an alert query,  view window that is used in the alert condition defaults to:

* When the alert is **not firing**, the minutes to fire for the alert.
* When the alert is in **Firing** state, the minutes to fire or minutes to resolve for the alert (whichever is greater)

### Consider Data Delays

Data coming from certain sources, such as cloud applications, are often batched and arrive at your alert at unpredictable times. You can [Limit the Impact of Data Delays](alerts_delayed_data.html) by making sure you understand the issue and by fine-tuning the query and time window.

## Follow Alert Settings Recommendations

Consider carefully which values are best suited for the settings you specify in the **Alerts** UI.

- **Minutes to Fire** - Alerts with very short **Minutes to Fire** time windows can jump over a problem spot and not fire. This might happen in case of delays in the metric pipeline or if **Alert Check Frequency** is higher than **Minutes to Fire**.

  For example, if **Minutes to Fire** is  5m, and the **Checking Frequency** is 10m, data might meet the condition within the 5-minute time interval, but the alert never fires because the checking frequency is too high.

  To trigger an alert with a single value, instead of `ts(critical.event.count) > 0` with 1 minute to fire and 30 minutes to resolve, use `ts(critical.event.count) != 0` with 30 minutes to fire and 30 minutes to resolve. The alert still fires immediately when the first non-zero value is encountered.

  <!---(picture here!)-->
- **Alert Check Frequency** - Decrease alert check frequency, that is, increase the interval, for non-critical alerts. Check when the alert really matters to you and check only as often as you must. In development environments, check less frequently.

  Increase alert checking frequency for conditions that use larger moving time windows, or align to a large interval. An alert that compares a `mavg(6h, ...)` to `mavg(48h, ...)` can be safely checked once an hour or even less.
- **Minutes to Fire and Alert Check Frequency**. Set **Minutes to Fire** to be no less than **Alert Check Frequency** unless you use moving time windows.

repository: wavefrontHQ/docs

gha_language: CSS

repo_name: wavefrontHQ/docs


text:
# Raspberry Pi Model A+, B, B+, and Zero
[![Build Status](https://travis-ci.org/nerves-project/nerves_system_rpi.png?branch=master)](https://travis-ci.org/nerves-project/nerves_system_rpi)

This is the base Nerves System configuration for the Raspberry Pi A+, B,
B+ and Zero. This is not the configuration for the Raspberry Pi 2 or 3.

![Fritzing Raspberry Pi A+ image](assets/images/raspberry-pi-model-a-plus.png)

[Image credit](#fritzing)

| Feature              | Description                     |
| -------------------- | ------------------------------- |
| CPU                  | 700 MHz ARM1176JZF-S for A+, B, and B+, 1 GHz ARM1176JZF-S for the Zero  |
| Memory               | 256 MB for rev 1 boards, 512 MB for rev 2 and the Zero  |
| Storage              | MicroSD                         |
| Linux kernel         | 4.1 w/ Raspberry Pi patches     |
| IEx terminal         | HDMI and USB keyboard (can be changed to UART)   |
| GPIO, I2C, SPI       | Yes - Elixir ALE                |
| ADC                  | No                              |
| PWM                  | Yes, but no Elixir support      |
| UART                 | 1 available - ttyACM0           |
| Camera               | Yes - via rpi-userland          |
| Ethernet             | Yes                             |
| WiFi                 | Requires USB WiFi dongle        |
| Bluetooth            | Not supported                   |

## Supported USB WiFi devices

The base image includes drivers and firmware for Ralink RT53xx
(`rt2800usb` driver) and RealTek RTL8712U (`r8712u` driver) devices.

We are still working out which subset of all possible WiFi dongles to
support in our images. At some point, we may have the option to support
all dongles and selectively install modules at packaging time, but until
then, these drivers and their associated firmware blobs add significantly
to Nerves release images.

If you are unsure what driver your WiFi dongle requires, run Raspbian and configure WiFi
for your device. At a shell prompt, run `lsmod` to see which drivers are loaded.
Running `dmesg` may also give a clue. When using `dmesg`, reinsert the USB
dongle to generate new log messages if you don't see them.

## Accessing IEx terminal via UART / FTDI Cable / `screen`

By default, the raspberry's tty is configured to be available at the HDMI
output. Another option is to have a FTDI Cable connecting `raspberry <-> host`,
so you can see the board's output in your own computer. In order to do this,
you will first have to configure the board's tty to be redirected to the
UART pins:
* make a copy of the `cmdline.txt` file and put it under your project's
`config` folder
* edit it, adding ` -c ttyAMA0` to the end of the _line_
* make a copy of the `fwup.conf` file and put it in the `config` folder
* edit the `file-resource cmdline.txt` directive inside `fwup.conf` to make it
point to your new `cmdline.txt` file. In the end it shall look like this:
```
file-resource cmdline.txt {
    host-path = "${NERVES_APP}/config/cmdline.txt"
}
```
* edit your project's `config.exs` file, indicating that Nerves should look at
your new, modified files. Make it look like this:
```
config :nerves, :firmware,
  fwup_conf: "config/fwup.conf"
```
* after this, on loading the new firmware in the board, you shall be able to
connect to its tty via something like this: `screen /dev/ttyUSB0 115200`.

## Installation

If [available in Hex](https://hex.pm/docs/publish), the package can be installed as:

  1. Add nerves_system_rpi to your list of dependencies in `mix.exs`:

        def deps do
          [{:nerves_system_rpi, "~> 0.6.1"}]
        end

  2. Ensure nerves_system_rpi is started before your application:

        def application do
          [applications: [:nerves_system_rpi]]
        end

[Image credit](#fritzing): This image is from the [Fritzing](http://fritzing.org/home/) parts library.

branch_name: refs/heads/develop


text:
## 0.1.3

- Minimum supported Rust version: 1.32.0.
- Update dependencies:
  - `log`: ^0.4.0 -> ^0.4.8
  - `env_logger`: 0.6.0 -> ^0.7.1
- Gate logging behind an opt-in feature. This improves decoding performance by
  ~25% (https://github.com/gendx/lzma-rs/pull/31).
- Lazily allocate the circular buffer (https://github.com/gendx/lzma-rs/pull/22).
  This improves memory usage (especially for WebAssembly targets) at the expense
  of a ~5%  performance regression (https://github.com/gendx/lzma-rs/issues/27).
- Return an error instead of panicking on unsupported SHA-256 checksum for XZ
  decoding (https://github.com/gendx/lzma-rs/pull/40).
- Add Clippy to CI.
- Document public APIs.
- Deny missing docs, missing Debug implementations and build warnings.
- Forbid unsafe code.
- Remove extern statements that are unnecessary on the 2018 edition.

## 0.1.2

- Fix bug in the range coder (https://github.com/gendx/lzma-rs/issues/15).
- Add support for specifying the unpacked size outside of the header
  (https://github.com/gendx/lzma-rs/pull/17).
- Migrate to Rust 2018 edition.
- Add benchmarks.
- Fix some Clippy warnings.

## 0.1.1

- Upgrade `env_logger` dependency.
- Refactoring to use `std::io::Take`, operator `?`.

## 0.1.0

- Initial release.


text:
# RunSimpleRender

Simple approach to have a more powerful presentation in rails.

The idea behind this gem is to be able to tie models to the appropriate
views for the maximum reusability while **avoiding**:

a. helpers with inline html

b: creation of additional classes (with more html within the methods)

c. bloating the models with presentation methods (bad practice)

d. a learning curve (this is extremely easy to use)

## Latest Update

###May 3 2015
+ Fixing dependencies mess

###May 2 2015
+ Link to GitHub.com

###April 17 2015
+ Updates to documentation
+ Optionally pass arguments to the rendition. This will allow an even better reuse of the renditions

       @usr.render(:card, args:{ background_picture: 'bg_picture.jpg'})

## Installation

Add this line to your application's Gemfile:

    ruby gem 'run_simple_render'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install run_simple_render

## Usage

A. Include RunSimpleRender in the model

       class User < ActiveRecord::Base
         include RunSimpleRender

B. Create your model views under a folder called renditions

    $ /app/views/renditions/[modelname]/

   ex. /app/views/renditions/user/default.html.erb:

    Name: <%=obj.last_name %>, <%obj.first_name%>

   ex. /app/views/renditions/user/email.html.erb:

      Email: <%=obj.email %>

C. Render the appropriate view as needed and were needed

    @usr = User.find(1)

    @usr.render          #Name: Louis, Joe

    @usr.render(:email)  #Email<EMAIL_ADDRESS>

## More

You can also call related models

    @usr = User.find(1)

    @usr.company.render(:short_description)

Or render a collection from the view  ex. /app/views/renditions/company/all_users.html.erb:

    Company: <%= obj.name %>

Users

      <% obj.users.each |u| %>

<%= u.render %> [ <%= u.email %>]

      <% end %>

## GitHub

https://github.com/s1mpl3/run_simple_render


text:
## Latest changes live on https://tyrasd.github.io/overpass-turbo/

- Implement nwr shorthand
- Display Git commit date in help/about
- Use modern build tools: vite, vitest
- Show shortcuts in tooltip
- Wizard: checkbox to include/exclude query comments
- Migrate to @openstreetmap/id-tagging-schema
- Migrate source code to TypeScript (#606)
- Retain query in URL when loading overpass-turbo (#563)
- Store query in URL when running it (#585)
- Trim `w=` URL parameter (#609)
- Support many [MapCSS label properties](https://wiki.openstreetmap.org/wiki/MapCSS/0.2#Label_properties) (#627)
  - `font-family`
  - `font-size`
  - `font-style`
  - `font-variant`
  - `font-weight`
  - `max-width`
  - `shield-color`
  - `shield-frame-color`
  - `shield-frame-width`
  - `text-color`
  - `text-decoration`
  - `text-halo-color`
  - `text-halo-radius`
  - `text-opacity`
  - `text-transform`

## 2022-01-09

- Show request duration in stats tooltip
- Adjust MapCSS without re-running query
- Rewrite UI to Bulma CSS
- Add button to reset settings
- Add confirmation for logout
- Add syntax highlighting for nw/nr/wr

## 2020-01-07

- Saved Queries: clarify which query to be deleted
- Add link to multi values wikidata
- Disable "locate me" button when loaded via http://
- Tag table: link \*:wikipedia tags
- Display Git version in help/about
- Coordinates in popup: add geo URI
- Add cs, gl, lv, zh-CN languages
- Always call JOSM over http
- Show exclamation mark in document title
- Display tag (and relation) count in the popup
- Export query with placeholders

## 2018-02-17

- Remember recently used overpass and background map tile servers in settings dialog
- Add new public overpass instance to list of available servers
- mapcss: allow filtering by meta attributes
- make `{{date}}` shortcut without further parameters return the current date
- bugfixes
- update external dependencies
- update translations

## 2017-06-25

- add possibility to sync (save/load) queries on your account on osm.org 😎
- many export tools now have a possibility to copy the data/content into the clipboard (additionally to saving/downloading as a file), thanks @simon04
- link to mapillary and wikimedia_commons content in popups
- fix regression: exporting map as png image now works again

## 2017-05-28

- update translations
- fix regression: mapcss text labels on polygons are now displayed again
- update osmtogeojson library (bugfixes, added handling for waterway relations)

## 2017-05-11

- activate Hungarian translation

## 2017-05-10

- add two new "export query as text" options: raw overpass turbo query (#292) and as (escaped) osm wiki template (#288)
- make exporting as GeoJSON, GPX, KML and raw OSM data faster by getting rid of the textareas that were used as fallbacks for old browsers without file download support
- bugfix: make eval statements in MapCSS work again
- bugfix: fix exporting of map as png image
- bugfix: load translations before starting to initialize the user interface
- update translations

## 2017-05-07

- bugfix: make exported GeoJSON return valid Feature objects #295

## 2017-05-04

- switch to a webpack-based build system, making further development easier. Thanks @simon04
- make exporting of complex GeoJSON geometries much faster
- update translations, activate Esperanto

## 2017-02-18

- switch to (newish) osmnames geocoder for map location search
- improvements to mapcss (better text label placement, improved eval statements)
- updated translations

## 2016-09-15

- make sure GPX output is well formated
- fix handling of mapcss [eval statements](http://wiki.openstreetmap.org/wiki/MapCSS/0.2/eval), closing XSS vector
- new translation: Portuguese
- update translations, presets, icons

## 2016-06-06

- add visual (warning) indicator if query results are very outdated
- add "build query" button to wizard dialog
- show fancy spinner animation in browser tab title while waiting for Overpass API
- partial mapcss and data statement support in "interactive map" exports
- enable small features rendering in "interactive map" exports
- add api to execute queries of an iframe-embedded map.html page
- activate Greek translation set
- add osmic icon set
- optimize layout also for portrait style monitors
- update translations, presets, icons
- update libraries (leaflet, osmtogeojson, togpx)

## 2015-05-18

- bugfix (htts everywhere issues)
- update translations, presets and icons

## 2015-04-23

- bugfixes
- updates to syntax highlighting, translations and presets

## 2015-02-07

- Wizard works better with non-ASCII strings
- MapCSS support for [line offsets](https://github.com/bbecquet/Leaflet.PolylineOffset)
- URL parameters (for example from short-urls) are dropped after page load
- many bugfixes
- update translations, presets and icon sets

## 2014-11-05

- upgrade osmtogeojson library (bugfixes, improve polygon-feature data)
- minor UI improvements
- update translations, presets and icon sets

## 2014-10-23

- support for Overpass "full" geometry output
- wizard, templates and example queries now produce OverpassQL queries
- new {{geocode*}} shortcuts instead of {{nominatim*}} ones with slightly altered syntax
- prevent error messages or popups from overflowing with too much content
- new languages: Norwegian, Taiwan Chinese, Polish
- bugfixes
- update translations, presets and icon sets

## 2014-09-08

- support for Overpass "center" and "bounds" geometry output
- wizard supports regex key searches via new `~"keyregex"~="valueregex"` syntax
- show currentness of Overpass areas in data stats tooltip (incl. improved date formatting)
- minor improvements to the wizard's query construction algorithm
- bugfixes
- update translations, presets and icon sets

## 2014-07-14

- activate Estonian translation
- bugfixes
- update translations and presets

## 2014-06-22

- bugfixes
- update translations

## 2014-06-06

- MapCSS: implemented text markers
- show additional data stats when hovering object counter box
- some UI improvements (better tooltips, toggle data overlay)
- bugixes in UI translations
- make more stuff configurable for custom installations
- updated some external libraries (leaflet, jQuery)

## 2014-05-25

- add export to [Level0](https://github.com/Zverik/Level0#readme) (OSM editor)
- improved query auto-repair (should less often kick in unnecessarily)
- bugfixes
- updated icon sets, translations, presets
- allow external URL shortening services in configs

## 2014-05-18

- remote control the query wizard via an [URL-parameter](http://wiki.openstreetmap.org/wiki/Overpass_turbo/Development#Wizard).
- wizard works around some Overpass API "specialities"
- better status messages during start-up
- don't load libraries from external CDN's (for faster startup, possibility to enable usage of page via https)

## 2014-05-08

- update translations & presets
- highlight new Overpass QL keywords
- fix exported links to geojson.io

## ~~2014-04-30~~

- activate new translations: Ukrainian, Slovenian, Brazilian
- update presets

## 2014-04-14

- update translations
- fix a bug with multiple overpass-turbo-statements in a single query
- other bugfixes

## 2014-03-19

- add hyperlinks to wikidata entries
- add hyperlinks to OSM user and changeset pages
- update translations
- update presets
- bump some library versions

## 2014-02-10

- activate Catalan translation
- bugfixes
- updated presets and translations

## 2014-01-26

- **intelligent wizard**: using iD's presets to construct queries from simple description of objects
- improved query-abort behaviour
- updated translations
- bugfixes

## 2014-01-02

- better zoom-to-location tool
- wizard: add "key is [not] null" and "key [not] like regex" expressions (aliases)
- wizard: allow colons in keys of key-value searches
- update osmtogeojson library to version 2.0.0 (exported geojson has polygons with proper winding order now)

## 2013-12-12

- **query builder wizard** :) [read more](https://wiki.openstreetmap.org/wiki/Overpass_turbo/Wizard)
- new query shortcuts: `{{date:*}}` and `{{nominatim*:*}}` [read more](https://wiki.openstreetmap.org/wiki/Overpass_turbo/Extended_Overpass_Queries)
- activate map overscaling (+1 more zoomlevel) for easier inspection of very small features
- upgrade libraries (Leaflet 0.7, Maki 0.3, etc.)
- activate Spanish translation
- bugfixes

## 2013-11-05

- update tokml library for better KML export results

## 2013-11-02

- new export format: KML (based on [tokml](https://github.com/mapbox/tokml))
- improved startup with url-parameters: undoabe query loading, clever auto-zooming to data, handle empty values in templates, …
- more verbous GPX export (adds all tags as `<desc>` field)
- update library [osmtogeojson](https://github.com/tyrasd/osmtogeojson) / new spinn-off library [togpx](https://github.com/tyrasd/togpx)
- work around JOSM remote-control deficiencies
- bugfixes

## 2013-10-18

- split-off [osmtogeojson](https://github.com/tyrasd/osmtogeojson) as an external library/tool
- fix loading of templates with newlines in parameters

## 2013-10-06

- activate Italian translation
- usability improvements for autorepair feature

## 2013-09-27

- activated new translations: Russian, Vietnamese, Japanese, Dutch, Croation, French
- updated polygon detection heuristic
- bugfixes

## 2013-09-16

- new export mode: data (geoJSON) as gist including a link to geojson.io
- reworked i18n code (translations are now done via Transifex)
- add Danish translation
- improved multipolygon rendering
- lightened exported geoJSON (drop unnecessary flags)
- support for newest Overpass query features (e.g. global bbox)
- bugfixes, compability improvements, etc.

## 2013-08-07

- cleaned up help dialog
- improvements to compact stylesheet (mobile devices)
- implemented data statement
- upgraded libraries (e.g. leaflet 0.6)
- lots of bugfixes

## 2013-05-11

- implemented downloadable content (save as file) for exports (GeoJSON, GPX, raw data, PNG)
- added new "raw data" export (same as the data-tab, but with easy file save - see above)
- speed up for some export modes
- shiny new "powered by Overpass API" mark
- bugfixes

## 2013-04-29

- reworked export dialog
- export GeoJSON with flattened properties (see #14)
- bugfixes and UI improvements

## 2013-04-15

- MapCSS support :) Read more: http://wiki.openstreetmap.org/wiki/Overpass_turbo/MapCSS
- enabled an url-shortening service on http://overpass-turbo.eu
- new "as GPX" export
- some bugfixes and UI improvements

## 2013-03-24

- implemented a build system - should result in much faster startup :)
- better area-detection. See http://wiki.openstreetmap.org/wiki/Overpass_turbo/Polygon_Features
- improved URL and email formatting/linkification
- removed min-zoom level on the map

## 2013-03-21

- showing hyperlinks for http/https/ftp-URLs, email addresses and wikipedia entries
- added new "welcome" message for first time users
- slightly more robust template code

## 2013-03-02

- showing warning message for queries returning large amounts of data (>~ 1MB).
- better progress indicator: show checkmarks for past events; also: made it a little more responsive during lenghty calculations
- improved bbox-selector: hide if there is no use of {{bbox}} in the query, also: show manually selected bbox in "map view" info dialog
- support for standard lat/lon/zoom parameters (in addition to turbo specific params)
- added type-id template
- updated template descriptions
- fixed several compatibility issues and bugfixes

## 2013-02-10

- multipolygon rendering
- implemented "templates" as an alternative to permalinks for basic queries
- showing stats about number of elements loaded and displayed
- more complete polygon detection
- some internal code restructuring (new OSM4Leaflet and NoVanish classes)
- added map key to help
- bugfixes

## 2013-02-04

- display small features at low zoom like POIs
- i18n support (and translation to German)
- added "fullscreen" (wide) map view
- handle untagged nodes as POIs when they are member of at least 1 relation
- implemented first set of unit tests
- upgraded to CodeMirror 2.38
- bugfixes

## 2013-01-30

- resizable panels (editor/map)
- tooltips for map controls
- auto-repair also for "JOSM" export
- enabled "include current map state in shared link" by default
- upgrade to jquery 1.9.0 and jqueryUI 1.10.0
- bugfixes

## 2013-01-28

- implemented auto-repairing of queries with a possible lack of recurse statements
- upgrade to leaflet 0.5
- disabled "start at current location" by default
- added keyboard shortcuts for saving/loading and help
- added clear data overlay button
- added permalink to osm.org on export->map view
- bugfixes
- some internal code restructuring
- appname (for X-Requested-With headers) set to overpass-turbo

## 2013-01-24

- initial release

repository: tyrasd/overpass-turbo

gha_language: TypeScript

gha_license_id: NOASSERTION

repo_name: tyrasd/overpass-turbo


text:
# Puzzle
Variant Caller GUI and genetic disease analysis tool.

## Overview

Puzzle will look for variant calling resources such as VCF files and [GEMINI](gemini) databases and visualize their content. It lets you inspect, annotate, and analyze variant calls.

Puzzle is not primarily meant to be run as a persistant server but think of it more as an webinterface to quickly spin to visualize your variant calls.

We set out to make `Puzzle` both very simple to install as well as intuitive to use. You can be up and running in minutes with minimal prerequisites.

When puzzle is installed, in its simplest form it will try to visualize the VCF files in the directory you point to with

```
puzzle tests/ view
```

Try it!

### Annotations ###

Puzzle will work best if the variants are annotated with [VEP](http://www.ensembl.org/info/docs/tools/vep/index.html), and some additional annotations such as 1000G frequencies and CADD scores.

### Gemini support ###

If gemini is installed, the user can visualize a gemini database by running

```
puzzle path/to/geminidatabase.db --plugin gemini view
```

Right now it will only work well with databases that includes one family.

## Developing Puzzle
Puzzle is a Python Flask app with a command line interface. It can work with multiple backends using plugins; raw VCFs, GEMINI, MongoDB.

Anyone can help make this project better - read [CONTRIBUTING](about/contributing.md) to get started!

[gemini]: https://github.com/arq5x/gemini


text:
---
layout: default
---

# 1995-11-29 - Re: Directed Hamiltonian Path Problem

## Header Data

From: "E. ALLEN SMITH"<EMAIL_ADDRESS>To<EMAIL_ADDRESS>Message Hash: 6db55676169f77a4dab4ccf4186cbe063ba71fd5660accdcfd416043b21e0bac

Message ID<EMAIL_ADDRESS>Reply To: _N/A_

UTC Datetime: 1995-11-29 00:12:29 UTC

Raw Date: Wed, 29 Nov 1995 08:12:29 +0800

## Raw message

```
{% raw  %}From: "E. ALLEN SMITH"<EMAIL_ADDRESS>Date: Wed, 29 Nov 1995 08:12:29 +0800
To<EMAIL_ADDRESS>Subject: Re: Directed Hamiltonian Path Problem
Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

From<EMAIL_ADDRESS>28-NOV-1995 02:02:17.85

Indeed. Its the problem with innumeracy. People don't understand that
if, say, a problem is O(2^N), and a problem of size 1000 requires a
liter of fluid, a problem of size 2000 requires
---------------------------
	Now that I've looked at it a bit more, I would definitely agree...
exponential growth is quite a function. Incidentally, talking about it in
liters of fluid is probably not the best way to look at it, any more than
computer chips can be best defined in square centimeters. But that doesn't
change the essential conclusion; it just alters how big of a problem you
need to use. The lesson here, I believe, is to use as large of a key/etcetera
as possible... something that should be news to none, even to novices like me.
Never assume that something will require too much computing power, until the
computing power needed is not doable in the universe. Then add some, since
(for some problems) someone might figure out a clever way around them. I
worry that factoring may be one of these.
	-Allen

{% endraw %}
```

## Thread

+ Return to [November 1995](/archive/1995/11)

+ Return to "["E. ALLEN SMITH" <EALLENSMITH@ocelot.Rutgers.EDU>](/authors/e_allen_smith_eallensmith_at_ocelot_rutgers_edu_)"

+ 1995-11-29 (Wed, 29 Nov 1995 08:12:29 +0800) - Re: Directed Hamiltonian Path Problem - _"E. ALLEN SMITH"<EMAIL_ADDRESS>

gha_license_id: MIT


text:
---
title: ShareDBError
layout: default
parent: API
---

# ShareDBError
{: .no_toc }

1. TOC
{:toc}

Representation of an error, with a machine-parsable [code](#error-codes).

## Properties

### `code` -- string

> A machine-parsable [code](#error-codes) representing the type of error

### `message` -- string

> A human-readable message providing more detail about the error

{: .warn }
> Consumer code should never rely on the value of `message`, which may be fragile.

## Error codes

### `ERR_OP_SUBMIT_REJECTED`

> The op submitted by the client has been rejected by the server for a non-critical reason.

> When the client receives this code, it will attempt to roll back the rejected op, leaving the client in a usable state.

> This error might be used as part of standard control flow. For example, consumers may define a middleware that validates document structure, and rejects operations that do not conform to this schema using this error code to reset the client to a valid state.

### `ERR_OP_ALREADY_SUBMITTED`

> The same op has been received by the server twice.

> This is non-critical, and part of normal control flow, and is sent as an error in order to short-circuit the op processing. It is eventually swallowed by the server, and shouldn't need further handling.

### `ERR_SUBMIT_TRANSFORM_OPS_NOT_FOUND`

> The ops needed to transform the submitted op up to the current version of the snapshot could not be found.

> If a client on an old version of a document submits an op, that op needs to be transformed by all the ops that have been applied to the document in the meantime. If the server cannot fetch these ops from the database, then this error is returned.

> The most common case of this would be ops being deleted from the database. For example, let's assume we have a TTL set up on the ops in our database. Let's also say we have a client that is so out-of-date that the op corresponding to its version has been deleted by the TTL policy. If this client then attempts to submit an op, the server will not be able to find the ops required to transform the op to apply to the current version of the snapshot.

> Other causes of this error may be dropping the ops collection all together, or having the database corrupted in some other way.

### `ERR_MAX_SUBMIT_RETRIES_EXCEEDED`

> The number of retries defined by the [`maxSubmitRetries`]({{ site.baseurl }}{% link api/backend.md %}#options) option has been exceeded by a submission.

### `ERR_DOC_ALREADY_CREATED`

> The creation request has failed, because the document was already created by another client.

> This can happen when two clients happen to simultaneously try to create the same document, and is potentially recoverable by simply fetching the already-created document.

### `ERR_DOC_WAS_DELETED`

> The deletion request has failed, because the document was already deleted by another client.

> This can happen when two clients happen to simultaneously try to delete the same document. Given that the end result is the same, this error can potentially just be ignored.

### `ERR_DOC_TYPE_NOT_RECOGNIZED`

> The specified document [type]({{ site.baseurl }}{% link types/index.md %}) has not been registered with ShareDB.

> This error can usually be remedied by remembering to [register]({{ site.baseurl }}{% link types/index.md %}#installing-other-types) any types you need.

### `ERR_DEFAULT_TYPE_MISMATCH`

> The default type being used by the client does not match the default type expected by the server.

> This will typically only happen when using a different default type to the built-in `json0` used by ShareDB by default (e.g. if using a fork). The exact same type must be used by both the client and the server, and should be registered as the default type:

> ```javascript
> var ShareDB = require('sharedb');
> var forkedJson0 = require('forked-json0');
>
> // Make sure to also do this on your client
> ShareDB.types.defaultType = forkedJson0.type;
> ```

### `ERR_OP_NOT_ALLOWED_IN_PROJECTION`

> The submitted op is not valid when applied to the projection.

> This may happen if the op targets some property that is not included in the projection.

### `ERR_TYPE_CANNOT_BE_PROJECTED`

> The document's type cannot be projected. [`json0`]({{ site.baseurl }}{% link types/json0.md %}) is currently the only type that supports projections.

repository: share/sharedb

gha_language: JavaScript

repo_name: share/sharedb


text:
---
layout: post
title: "LeetCode"
description: "Algorithms in Python"
category: Computer Science
tags: [LeetCode]
---
{% include JB/setup %}
Today marks the accomplishment of 152 [LeetCode](https://oj.leetcode.com/problems/) questions in Python. It took about 60 days during my final academic year autumn semester (I guess never too late to catch up, huh?). I attempted 1 to 3 questions every day and had been keeping doing it for 60 days. Strangely, coding gradually becomes a natural part of life as other everyday activity like reading news and blogs. Surprisingly, during these 60 days, I even got my GRE done and TOEFL done. It feels terrific to be productive and do something meaningful.

The LeetCode Python solutions are in github repo [github.com/idf/LeetCode](https://github.com/zhangdanyangg/LeetCode). You are more than welcomed to take a look at it and discuss.


text:
# # SellerCustomPolicy

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**description** | **string** | The seller-defined description of the policy. | [optional]
**label** | **string** | The seller-defined label for an individual custom policy. | [optional]
**type** | **string** | The type of custom policy, such as PRODUCT_COMPLIANCE or TAKE_BACK. For implementation help, refer to eBay API documentation | [optional]

[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md)

gha_language: PHP


text:
# SoundRain
Evented Node.js module for downloading songs from [SoundCloud](http://soundcloud.com). Based on the awesome work by [@dmotz](https://github.com/dmotz/soundscrape).

This Node.js module isn't connected to the [soundrain.org](http://soundrain.org/) website, it was solely created for my personal use - but figured since I'm awesome, I'll share it.

# Installation
`npm install soundrain`

# Usage
SoundRain is really easy to setup. Create a folder in your app directory which will be used to download songs into. In this example, I've used `./mp3`.

```js
SoundRain = require('soundrain');
var Song = new SoundRain("https://soundcloud.com/jbrooksuk/twisted-beat-sample-at", './mp3');
Song.on('error', function(err) {
	if(err) throw err;
}).on('done', function(file) {
	console.log(file);
});
```

# Notice
Use responsibly and respect SoundCloud and the artists which use it.

# License
MIT - [http://jbrooksuk.mit-license.org](http://jbrooksuk.mit-license.org)

repository: adumbidiot/SoundRain

repo_name: adumbidiot/SoundRain


text:
---
title: The Register – Contain(er) your enthusiasm, nerds – Docker-backed OCI runtime spec hits 1.0
author:
  name: Open Container Initiative
  tag: oci
tags: news
date: 2017-07-19
---

The Open Container Initiative, an attempt by Docker and other container tech companies to build standards and consensus for container technology, on Wednesday plans to release the initial version of its runtime and image specifications.

Read more from [The Register](https://www.theregister.co.uk/2017/07/19/dockerbacked_oci_runtime_spec_hits_10/).

branch_name: refs/heads/main

gha_language: HTML


text:
# osx-lock-on-remove-usb
Lock the screen on OS X when some USB device is removed

# Find vendor and product ID

Run `system_profiler SPUSBDataType` in your terminal and look for your USB device.
Copy the `Vendor ID` and the `Product ID` after the `0x` part and paste them in the installation command.

# Installation

`./install.sh <vendor-id> <product-id>`

# First run
After the install detach your usb device to trigger the script.
This will ask for "bash" to have access to "Accessibility", do so to fully enable the script.

# Uninstall

`./uninstall.sh <vendor-id> <product-id>`

repository: nfirvine/osx-lock-on-remove-usb

gha_language: Shell

repo_name: nfirvine/osx-lock-on-remove-usb


text:
# VOQC Interoperability

## Overview

This README contains instructions for using the VOQC optimizer with widely used quantum frameworks.

VOQC is currently compatible with the following frameworks:
* Cirq (Version 0.8.2)
* Qiskit (Version 0.19.6)

## Using VOQC Transpiler Pass in Qiskit

To pass a qiskit circuit to the VOQC optimizer, append `QiskitVOQC([list of optimizations])` to a pass manager. The argument `list of optimizations` is an optional argument that allows custom optimizations to be run. Appending `VOQC()` to a pass manager without a list will run the main optimize function in VOQC. The client file must be run from the `pyvoqc` directory.

*Example*: The following is a transpiler pass to VOQC using a circuit built in qiskit.
```
from qiskit.transpiler import PassManager
from pyvoqc.qiskit.voqc_pass import QiskitVOQC
from qiskit import QuantumCircuit

# build quantum circuit
circ = QuantumCircuit(2)
circ.cx(0, 1)
circ.cx(0, 1)
circ.h(0)
print(circ)

# create PassManager
pm = PassManager()

# call cancel_two_qubit_gates
pm.append(QiskitVOQC(["cancel_two_qubit_gates"]))
new_circ = pm.run(circ)
print(new_circ)
```

## Using VOQC Optimization Pass in Cirq

Passing a Cirq circuit object to the VOQC compiler pass is similar to the built-in optimizations. Just like the built-in Cirq optimizations, VOQC implements the `optimize_circuit(input_circ)` function. To call this non-static method, create an instance of `CqVOQC` with an optional argument `list of optimizations` and call the `optimize_circuit(input_cirq)` function with `input_cirq` being the circuit to be optimized. The `list of optimizations` argument is identical to that of Qiskit as it is a list that allows the execution of customized optimizations. Again, the client file must be run from the pyvoqc directory.

*Example*: The following is a compiler pass to VOQC using a circuit built in Cirq.
```
import cirq
from pyvoqc.cirq.voqc_optimization import CqVOQC

#Build Circuit Object
q_0 = cirq.NamedQubit("q_0")
q_1 = cirq.NamedQubit("q_1")
circ = cirq.Circuit([cirq.CNOT.on(q_0,q_1), cirq.CNOT.on(q_0, q_1), cirq.H.on(q_0)])

#Instantiate CqVOQC compiler pass and pass our sample circuit 'circ' with the "optimize_circuit" function
pass_object = CqVOQC(["cancel_two_qubit_gates"])
new_circ = pass_object.optimize_circuit(circ)

"""
The previous two lines could also be combined:

new_circ = CqVOQC(["cancel_two_qubit_gates"]).optimize_circuit(circ)

"""
```


text:
# Crossplane Composition to create Worker Clusters

This directory contains the Crossplane.io resources to create new Kubernetes Clusters in GGP. This example can be extended to any other Cloud Provider.

For this to work you need to have Crossplane installed in the Cluster and the GCP Provider. Follow the docs here: https://crossplane.io/docs/v1.7/getting-started/install-configure.html
When you install the GCP provider you need to add a couple of extra permissions for the GPC provider to create clusters, networks and nodepools:

```
SERVICE="container.googleapis.com"
gcloud services enable $SERVICE --project $PROJECT_ID
```

```
ROLE="roles/container.admin"
gcloud projects add-iam-policy-binding --role="$ROLE" $PROJECT_ID --member "serviceAccount:$SA"
```

```
SERVICE="compute.googleapis.com"
gcloud services enable $SERVICE --project $PROJECT_ID
```

```
ROLE="roles/compute.admin"
gcloud projects add-iam-policy-binding --role="$ROLE" $PROJECT_ID --member "serviceAccount:$SA"
```

Make sure that you do this before creating the service account secret, meaning before you do this:
```

# create service account keyfile
gcloud iam service-accounts keys create creds.json --project $PROJECT_ID --iam-account $SA

```

and this:

```
kubectl create secret generic gcp-creds -n crossplane-system --from-file=creds=./creds.json
```

## Creating Worker Clusters definitions

This direcotry contains 3 files that define a Crossplane Composition and a new CRD to create worker clusters.

- crossplane.yaml
- composition.yaml
- definition.yaml

You can read more about how composition works here: https://crossplane.io/docs/v1.7/getting-started/create-configuration.html

I've packaged this composition as an OCI image, so you can just install it by running:

```
kubectl crossplane install configuration salaboy/spicy-project-template-gcp:0.1.0
```

You can modify and build the package yourself:
```
kubectl crossplane build configuration
kubectl crossplane push configuration <USER>/spicy-project-template-gcp:0.1.0
```

Then you can create a new Spicy Project Cluster by running:

```
kubectl apply -f spicy-project-template
```

and list the Spicy Clusters by doing:

```
kubectl get spicy
```


text:
# errors
[![Build Status](https://travis-ci.org/joaosoft/errors.svg?branch=master)](https://travis-ci.org/joaosoft/errors) | [![codecov](https://codecov.io/gh/joaosoft/errors/branch/master/graph/badge.svg)](https://codecov.io/gh/joaosoft/errors) | [![Go Report Card](https://goreportcard.com/badge/github.com/joaosoft/errors)](https://goreportcard.com/report/github.com/joaosoft/errors) | [![GoDoc](https://godoc.org/github.com/joaosoft/errors?status.svg)](https://godoc.org/github.com/joaosoft/errors)

Error handling with caused-by and stack.

###### If i miss something or you have something interesting, please be part of this project. Let me know! My contact is at the end.

## Dependecy Management
>### Dependency

Project dependencies are managed using Dep. Read more about [Dep](https://github.com/golang/dep).
* Get dependency manager: `go get github.com/joaosoft/dependency`
* Install dependencies: `dependency get`

>### Go
```
go get github.com/joaosoft/errors
```

## Usage
This examples are available in the project at [examples/main.go](https://github.com/joaosoft/errors/tree/master/example_test.go)
```go
var (
	ErrorOne = errors.New(errors.LevelError, 1, "Error one")
	ErrorTwo = errors.New(errors.LevelError, 2, "Error two")
)

func main() {
	fmt.Println("\nADDING ERRORS!\n")

	errs := errors.Add(ErrorOne).
		Add(ErrorTwo)

	fmt.Println(errs.Cause())

	fmt.Println(errs.Stack)
	fmt.Println(errs.Previous.Stack)

	fmt.Println("\nDONE!")
}
```

## Known issues

## Follow me at
Facebook: https://www.facebook.com/joaosoft

LinkedIn: https://www.linkedin.com/in/jo%C3%A3o-ribeiro-b2775438/

##### If you have something to add, please let me know<EMAIL_ADDRESS>

repository: joaosoft/validator

gha_language: Go

repo_name: joaosoft/validator


text:
# nginx

Windows Server Core image with Nginx installed.

# Notes

Nginx isn't tweaked for Windows in the way it is for Linux. It is functional but doesn't have the performance and scale - it's considered a [beta version](http://nginx.org/en/docs/windows.html).

# Run Nginx

Run as-is:

```PowerShell
docker run -d -p 80:80 --name nginx sixeyed/nginx:windowsservercore
```

And get the IP address of the container to view the welcome screen:

```PowerShell
$ip = docker inspect --format '{{ .NetworkSettings.Networks.nat.IPAddress }}' nginx
start "http://$($ip)"
```

# Use as a Base

Add your own content into `C:\nginx\html`:

```Dockerfile
FROM sixeyed/nginx:windowsservercore

COPY index.html C:/nginx/html
```

> Note. You can't mount a host directory to `C:\nginx\html` in the container, because the container directory isn't empty. That's one difference between Windows and Linux containers.

repository: devcfgc/dockerfiles-windows

repo_name: devcfgc/dockerfiles-windows


text:
# Contributing

 We welcome community contribution to this repository. To help add
 functionality or address issued please take the following steps:

- Fork the repository from the master branch.
- Create a new branch for your features / fixes.
- Make the changes you wish to see.
- Add tests for all changes.
- Create a pull request with details of what changes have been made.
  Explanation of new behaviour. Link to issue that is addressed. Ensure
  documentation contains the correct information.
- Pull requests will be reviewed and hopefully merged into a release.


text:
---
layout: default
---

# 1993-10-08 - distributed autonomous networks

## Header Data

From<EMAIL_ADDRESS>(Dwayne)

To<EMAIL_ADDRESS>Message Hash: 46ce023461453fd07dad9b6f07f47f3f82a122dc822ef0aa50b6f909878f93de

Message ID<EMAIL_ADDRESS>Reply To: _N/A_

UTC Datetime: 1993-10-08 17:19:23 UTC

Raw Date: Fri, 8 Oct 93 10:19:23 PDT

## Raw message

```
{% raw  %}From<EMAIL_ADDRESS>(Dwayne)
Date: Fri, 8 Oct 93 10:19:23 PDT
To<EMAIL_ADDRESS>Subject: distributed autonomous networks
Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

Hi guys,
   well, after reading through the backlog of spread spectrum stuff, I was
surprised to read about the radio-network-on-a-board (Julieboard) article
that someone posted. A couple of us here in Australia have been kicking
around the idea of a cheap network, running via repeaters in _very_
small boxes tossed all around a city, which would be indestructible through
sheer numbers (a la the arpanet).
   So: anyone got any ideas, schematics, information?

The main idea is a huge number of small, low-power and CHEAP nodes which
would handle through traffic which anyone with a radio modem could tap into,
with the nodes disguised and placed in extremely hard to get to places (tops
of telephone poles, buildings, on bridges and overpasses, etc).
   This would mean that it would cost an awful lot of money to remove each of
these things, IF they could be found.

Possible power sources: batteries (but they need to be changed)
                        solar power (Australia leads the world in solar power
                                     technology, and I know people who know
                                     people).
                         Near Field Interaction and EMF pickups (stick 'em
                            near high-frequency power transmission lines).
                         Something that convert heat to electrical energy
       or combinations of all of the above.

The idea being that we would have an untraceable, unbreakable network. Sure,
you may have an address (perhaps we could set it up as a FQDN domain?), but
that address would not correspond to any actual physical location. And, it
would be free, aside from the cost of the equipment. No more phone calls
to pay for!

I have no idea how this could be done across interstate or international
distances, but I'm sure people might have ideas. Bounce signals off
satellites (are those big shiny things from the 50's still about?); send
stuff encrypted via the internet, etc etc.

This could well mean that we would have a truly private network, with
strong encryption and no centralised source of transmission (I mean, most
of the internet traffic into and from Australia goes via a single link,
so far as I know).

Comments?

Dwayne

{% endraw %}
```

## Thread

+ Return to [October 1993](/archive/1993/10)

+ Return to<EMAIL_ADDRESS>(T. William Wells)](/authors/bill_at_twwells_com_t_william_wells_)"
+ Return to<EMAIL_ADDRESS>(Dwayne)](/authors/hiscdcj_at_lux_latrobe_edu_au_dwayne_)"
+ Return to "[Jason Asbahr <Asbahr@UH.EDU>](/authors/jason_asbahr_asbahr_at_uh_edu_)"
+ Return to "[Matthew J Ghio <mg5n+@andrew.cmu.edu>](/authors/matthew_j_ghio_mg5n_at_andrew_cmu_edu_)"

+ 1993-10-08 (Fri, 8 Oct 93 10:19:23 PDT) - distributed autonomous networks -<EMAIL_ADDRESS>(Dwayne)_
  + 1993-10-08 (Fri, 8 Oct 93 12:20:45 PDT) - [Re: distributed autonomous networks](/archive/1993/10/5a571165506d2b1a9f743c1f88ffde776a59ef57075c840f2b089cd9e9308981) - _Jason Asbahr<EMAIL_ADDRESS>    + 1993-10-08 (Fri, 8 Oct 93 15:25:47 PDT) - [Re: distributed autonomous networks](/archive/1993/10/2a3a47b72dcab569e9a6a32da9ba22e29d94ac83574058172c546d3929440c3f) - _Matthew J Ghio<EMAIL_ADDRESS>      + 1993-10-09 (Sat, 9 Oct 93 01:09:29 PDT) - [Re: distributed autonomous networks](/archive/1993/10/92ac67b2d56a2d38cea408a0423def3c5bad7d65f501a57441b524a4afc0b4ff) -<EMAIL_ADDRESS>(T. William Wells)_
    + 1993-10-12 (Tue, 12 Oct 93 07:27:03 PDT) - [Re: distributed autonomous networks](/archive/1993/10/86da0976561241d61c78d232023fb1a0c42e61a7c7899253a5a5db5bae655d09) -<EMAIL_ADDRESS>(Dwayne)_
  + 1993-10-08 (Fri, 8 Oct 93 16:15:59 PDT) - [Re: distributed autonomous networks](/archive/1993/10/b0b08c73208f8a89ef6f9118847da459db7ac053a7dfa0d67d8a899057ab2825) - _Matthew J Ghio<EMAIL_ADDRESS>  + 1993-10-12 (Tue, 12 Oct 93 07:24:54 PDT) - [Re: distributed autonomous networks](/archive/1993/10/8490ed6c04c9b9a37a594c7c22a9969239681af25c857ddab4764061f1d79a48) -<EMAIL_ADDRESS>(Dwayne)_