text:
## Order Return Discount

Represents a discount being returned that applies to one or more return line items in an
order.

Fixed-amount, order-scoped discounts are distributed across all non-zero return line item totals.
The amount distributed to each return line item is relative to that item’s contribution to the
order subtotal.

### Structure

`OrderReturnDiscount`

### Fields

| Name | Type | Tags | Description |
|  --- | --- | --- | --- |
| `uid` | `String` | Optional | Unique ID that identifies the return discount only within this order. |
| `source_discount_uid` | `String` | Optional | `uid` of the Discount from the Order which contains the original application of this discount. |
| `catalog_object_id` | `String` | Optional | The catalog object id referencing [CatalogDiscount](./models/catalog-discount.md). |
| `name` | `String` | Optional | The discount's name. |
| `type` | [`String (Order Line Item Discount Type)`](/doc/models/order-line-item-discount-type.md) | Optional | Indicates how the discount is applied to the associated line item or order. |
| `percentage` | `String` | Optional | The percentage of the tax, as a string representation of a decimal number.
A value of `7.25` corresponds to a percentage of 7.25%.

The percentage won't be set for an amount-based discount. |
| `amount_money` | [`Money Hash`](/doc/models/money.md) | Optional | Represents an amount of money.

__Important:__ Unlike version 1 of the Connect API, __all monetary amounts
returned by v2 endpoints are positive.__ (In v1, monetary amounts are negative
if they represent money being paid _by_ a merchant, instead of money being
paid _to_ a merchant.) |
| `applied_money` | [`Money Hash`](/doc/models/money.md) | Optional | Represents an amount of money.

__Important:__ Unlike version 1 of the Connect API, __all monetary amounts
returned by v2 endpoints are positive.__ (In v1, monetary amounts are negative
if they represent money being paid _by_ a merchant, instead of money being
paid _to_ a merchant.) |
| `scope` | [`String (Order Line Item Discount Scope)`](/doc/models/order-line-item-discount-scope.md) | Optional | Indicates whether this is a line item or order level discount. |

### Example (as JSON)

```json
{
  "uid": null,
  "source_discount_uid": null,
  "catalog_object_id": null,
  "name": null,
  "type": null,
  "percentage": null,
  "amount_money": null,
  "applied_money": null,
  "scope": null
}
```

repository: baweaver/square-ruby-sdk

repo_name: baweaver/square-ruby-sdk


text:
---
layout: post
title: The History of Speech Recognition to the Year 2030
katex: True
---

Given the remarkable changes in the state of speech recognition over the
previous decade, what can we expect over the coming decade? I attempt to
forecast the state of speech recognition research and applications by the year
2030.

---

A longer version of this article with more technical details on the research
and more comprehensive references is available on
[arXiv](https://arxiv.org/abs/2108.00084).

---

## Recap

The decade from 2010 to 2020 saw remarkable progress in speech recognition and
related technology. The figure below shows a timeline of some of the
major developments in the research, software, and application of speech
recognition over the previous decade. The decade saw the launch and spread of
phone-based voice assistants like Apple Siri. Far-field devices like Amazon
Alexa and Google Home were also released and proliferated.

A timeline of some of the major developments in speech recognition from the
years 2010 to 2020. The decade saw the launch of voice-based devices and voice
assistants, open-source and widely used speech recognition software like Kaldi,
and larger benchmarks like LibriSpeech. We also saw speech recognition models
improve starting from hybrid neural network architectures to more end-to-end
models including Deep Speech, Deep Speech 2, encoder-decoder models with
attention, and transducer-based speech recognition.

These technologies were enabled in-part by the remarkable improvement in the
word error rates of automatic speech recognition as a result of the rise of
deep learning. The key drivers of the success of deep learning in speech
recognition have been 1) the curation of massive transcribed data sets, 2) the
rapid rate of progress in graphics processing units, and 3) the improvement in
the learning algorithms and model architectures.

Thanks to these ingredients, the word error rate of speech recognizers improved
consistently and substantially throughout the decade. On two of the most
commonly studied benchmarks, automatic speech recognition word error rates have
surpassed those of professional transcribers.

This remarkable progress invites the question: what is left for the coming
decade to the year 2030? In the following, I attempt to answer this question.
But, before I begin, I'd first like to share some observations on the general
problem of predicting the future. These findings are inspired by the
mathematician (as well as computer scientist and electrical engineer) Richard
Hamming, who also happened to be particularly adept at forecasting the future
of computing.

## Predicting the Future

Richard Hamming in *The Art of Doing Science and Engineering* makes many
predictions, many of which have come to pass. Here are a few
examples:[^hamming]

- He stated that by "the year 2020 it would be fairly universal practice for
  the expert in the field of application to do the actual program preparation
  rather than have experts in computers (and ignorant of the field of
  application) do the program preparation."

- He predicted that neural networks "represent a solution to the
  programming problem," and that "they will probably play a large part in
  the future of computers."

- He predicted the prevalence of general-purpose rather than special-purpose
  hardware, digital over analog, and high-level programming languages all long
  before the field had decided one way or another.

- He anticipated the use of fiber-optic cables in place of copper wire for
  communication well before the switch actually took place.

These are just a few examples of Hamming's extraordinary prescience. Why was he
so good at predicting the future? Here are a few observations which I think
were key to his ability:

**Practice:** One doesn't get good at predicting the future without actually
practicing at it. Hamming practiced. He reserved every Friday afternoon for
"great thoughts" in which he mused on the future. But he didn't just predict in
isolation. He made his predictions public, which forced him to put them in a
communicable form and held him accountable. For example, in 1960 Hamming gave a
talk titled "The History of Computing to the Year 2000" (you may recognize the
title) in which he predicted how computing would evolve over the next several
decades.

**Focus on fundamentals:** In some ways, forecasting the future development
of technology is just about understanding the present state of technology more
than those around you. This requires both depth in one field as well as
non-trivial breadth. This also requires the ability to rapidly assimilate new
knowledge. Mastering the fundamentals builds a strong foundation for both.

**Open mind:** Probably the most important trait Hamming exhibited, and in my
opinion the most difficult to learn, was his ability to keep an open mind.
Keeping an open mind requires constant self-vigilance. Having an open mind one
day does not guarantee having it the next. Having an open mind with respect to
one scientific field does not guarantee having it with respect to another.
Hamming recognized for example that one may be more productive in an office
with the door closed, but he kept his office door open as he believed an "open
mind leads to the open door, and the open door tends to lead to the open
mind."

I'll add to these a few more thoughts. First, the rate of change of progress in
computing and machine learning is increasing. This makes it harder to predict
the distant future today than it was 50 or 100 years ago. These days predicting
the evolution of speech recognition even ten years out strikes me as a
challenge. Hence my choosing to work with that time frame.

A common saying about technology forecasting is that short-term predictions
tend to be overly optimistic and long-term predictions tend to be overly
pessimistic. This is often attributed to the fact that progress in technology
has been exponential. The graph below shows how this can happen if we
optimistically extrapolate from the present assuming progress is linear with
time. Progress in speech recognition over the previous decade (2010-2020) was
driven by exponential growth along two key axes. These were compute (e.g.
floating-point operations per second) and data set sizes. Whether or not such
exponential growth will continue to apply to speech recognition for the coming
decade remains to be seen.

The graph depicts progress as a function of time. The linear extrapolation from
the present (dashed line) initially results in overly optimistic predictions.
However, eventually the predictions become pessimistic as they are outstripped
by the exponential growth (solid line).

I'm sure a lot of the following predictions will prove wrong. In some ways,
particularly when it comes to the more controversial predictions, these are
really more of an optimistic wishlist for the future. On that note, let me
close this section with the famous words of the computer scientist Alan
Kay:[^kay]

> The best way to predict the future is to invent it.

## Research Predictions

### Semi-supervised Learning

**Prediction:** Semi-supervised learning is here to stay. In particular,
self-supervised pretrained models will be a part of many machine-learning
applications, including speech recognition.

Part of my job as a research scientist is hiring, which means a lot of
interviews. I've interviewed more than a hundred candidates working on a
diverse array of machine-learning applications. Some large fraction,
particularly of the natural language applications, rely on a pretrained model
as the basis for their machine-learning enabled product or feature.
Self-supervised pretraining is already pervasive in language applications in
industry. I predict that by 2030 self-supervised pretraining will be just as
pervasive in speech recognition.

The main challenges with self-supervision are those of scale, and hence
accessibility. Right now only the most highly endowed industry research labs
*e.g.* Google Brain, Google DeepMind, Facebook AI Research, OpenAI, *etc.*)
have the funds to burn on the compute required to research self-supervision at
scale. As a research direction, self-supervision is only becoming less
accessible to academia and smaller industry labs.

**Research implications:** Self-supervised learning would be more accessible
given lighter-weight models which could be trained efficiently on less data.
Research directions which could lead to this include sparsity for
lighter-weight models, optimization for faster training, and effective ways of
incorporating prior knowledge for sample efficiency.

### On Device

**Prediction:** Most speech recognition will happen on the device or at the
edge.

There are a few reasons I predict this will happen. First, keeping your data on
your device rather than sending it to a central server is more private. The
trend towards data privacy will encourage on-device inference whenever
possible. If the model needs to learn from a user's data, then the training
should happen on the device.

The second reason to prefer on-device inference is latency. In absolute terms,
the difference between 10 milliseconds and 100 milliseconds is not much. But
the former is well below the perceptual latency of a human, and the latter well
above. Google has already demonstrated an on-device speech recognition system
with accuracy nearly as good as a server-side system. The latency differences
are easily noticeable.[^google_on_device] From a pragmatic standpoint, the
latency of the server-side recognizer is probably sufficient. However, the
imperceptible latency of the on-device system makes the interaction with the
device feel much more responsive and hence more engaging.

A final reason to prefer on-device inference is 100% availability. Having the
recognizer work even without an internet connection or in spotty service means
it will work all the time. From a user interaction standpoint there is a big
difference between a product which works most of the time and a product which
works every time.

**Research implications:** On-device recognition requires models with smaller
compute and memory requirements and which use less energy in order to preserve
battery life. Model quantization and knowledge distillation (training a smaller
model to mimic the predictions of a more accurate larger model) are two
commonly used techniques. Sparsity, which is less commonly used, is another
approach to generate lighter-weight models. In sparse models, most of the
parameters (*i.e.* connections between hidden states) are zero and can be
effectively ignored. Of these three techniques, I think sparsity is the
most promising research direction.

Weak supervision will be an important research direction for on-device training
for applications which typically require labeled data. For example, a users
interaction with the output of a speech recognizer or the actions they take
immediately afterward could be useful signal from which the model can learn in
a weakly-supervised manner.

### Word Error Rate

**Prediction:** By the end of the decade, possibly much sooner, researchers
will no longer be publishing papers which amount to "improved word error rate
on benchmark X with model architecture Y."

As you can see in graphs below, word error rates on the two most commonly
studied speech recognition benchmarks have saturated. Part of the problem is
that we need harder benchmarks for researchers to study.

The improvement in word error rate over time on the LibriSpeech (left) and
Switchboard Hub5'00 (right) benchmarks.[^wer_are_we] The dashed lines indicate
human-level performance.

Another part of the problem is that we have reached a regime where word error
rate improvements on academic benchmarks no longer correlate with practical
value. Speech recognition word error rates on both benchmarks surpassed human
word error rates several years ago. However, in most settings humans understand
speech better than machines do. This implies that word error rate as a measure
of the quality our speech recognition systems does not correlate well with an
ability to understand human speech.

A final issue is research in state-of-the-art speech recognition is becoming
less accessible as models and data sets are getting larger, and as computing
costs are increasing. A few well-funded industry labs are rapidly becoming the
only places that can afford this type of research. As the advances become more
incremental and further from academia, this part of the field will continue to
shift from research labs to engineering organizations.

### Richer Representations

An example lattice used to encode mutliple hypotheses output from a speech
recognizer with differing weights.

**Prediction:** Transcriptions will be replaced by richer representations for
downstream tasks which rely on the output of a speech recognizer. Examples of
such downstream applications include conversational agents, voice-based search
queries, and digital assistants.

Downstream applications often don't care about a verbatim transcription; they
care about semantic correctness. Hence, improving the word error rate of a
speech recognizer often does not improve the objective of the downstream task.
One possibility is to develop a *semantic error rate* and use it to measure the
quality of the speech recognizer. This is a challenging albeit interesting
research problem.

I think a more likely outcome is to give downstream applications richer
representations from the speech recognizer. For example, instead of passing a
single transcription, passing a lattice of possibilities (as in graph below)
which captures the uncertainty for each could be much more useful.

**Research implications:** The exact structure used to encode the
representation is an open question. One possibility could be some sort of
weighted transducer which if differentiable could allow for fine-tuning the
recognizer to specific applications. This type of representation also requires
models which are able to ingest variable-sized graphs as input.

### Personalization

**Prediction:** By the end of the decade, speech recognition models will be
deeply personalized to individual users.

One of the main distinctions between the automatic recognition of speech and
the human interpretation of speech is in the use of context. Humans rely on a
lot of context when speaking to one another. This context includes the topic
of conversation, what was said in the past, the noise background, and visual
cues like lip movement and facial expressions. We have, or will soon
reach, the Bayes error rate for speech recognition on short (*i.e.* less
than ten second long) utterances taken out of context. Our models are using the
signal available in the data to the best of their ability. To continue to
improve the machine understanding of human speech will require leveraging
context as a deeper part of the recognition process.

One way to do this is with personalization. Personalization is already used to
improve the recognition of utterances of the form "call `<NAME>`".  As another
example, personalizing models to individual users with speech disorders
improves word error rates by 64% relative.[^sim2019] Personalization can make
a huge difference in the quality of the recognition, particularly for groups or
domains that are underrepresented in the training data. I predict we will see
much more pervasive personalization by the end of the decade.

**Research implications:** On-device personalization requires on-device
training which in itself requires lighter-weight models and some form of weak
supervision. Personalization requires models which can be easily customized to
a given user or context. The best way to incorporate such context into a model
is still a research question.

## Application Predictions

### Transcription Services

**Prediction:** By the end of the decade, 99% of transcribed speech services
will be done by automatic speech recognition. Human transcribers will perform
quality control and correct or transcribe the more difficult utterances.
Transcription services include, for example, captioning video, transcribing
interviews, and transcribing lectures or speeches.

### Voice Assistants

**Prediction:** Voice assistants will get better, but incrementally, not
fundamentally. Speech recognition is no longer the bottleneck to better voice
assistants. The bottlenecks are now fully in the language understanding domain
including the ability to maintain conversations, multi-ply contextual
responses, and much wider domain question and answering. We will continue to
make incremental progress on these so-called AI-complete
problems,[^shapiro]
but I don't expect them to be solved by 2030.

Will we live in smart homes that are always listening and can respond to our
every vocal beck and call? No. Will we wear augmented reality glasses on our
faces and control them with our voice? Not by 2030.

## Summary

Here is a summary of some of my predictions for the progress in speech
recognition research and applications by the year 2030:

- Self-supervised learning and pretrained models are here to stay.
- Most speech recognition (inference) will happen at the edge.
- On-device model training will be much more common.
- Sparsity will be a key research direction to enable on-device inference and training.
- Improving word error rate on common benchmarks will fizzle out as a research goal.
- Speech recognizers will output richer representations (graphs) for use by downstream tasks.
- Personalized models will be commonplace.
- Most transcription services will be automated.
- Voice assistants will continue to improve, but incrementally.

The predictions show that the coming decade could be just as exciting and
important to the development of speech recognition and spoken language
understanding as the previous one. We still have many research problems to
solve before speech recognition will reach the point where it works all the
time, for everyone. However, this is a goal worth working toward, as speech
recognition is a key component to more fluid, natural, and accessible
interactions with technology.

### Acknowledgements

Thanks to Chris Lengerich,
Marya Hannun,
Sam Cooper,
and Yusuf Hannun for their
feedback.

### Footnotes

[^hamming]:
    Quotes and predictions are from chapters 2, 4, and 21 of Richard Hamming's
    *The Art of Doing Science and Engineering: Learning to Learn*.

[^kay]:
    Alan Kay is best known for developing the modern graphical user interface
    and also object-oriented programming in the Smalltalk programming langauge.

[^google_on_device]:
    For an example of the perceptual difference in latencies see the blog post
    on [Google's on-device speech recognizer](https://ai.googleblog.com/2019/03/an-all-neural-on-device-speech.html).

[^wer_are_we]:
    The data for these figures is from [wer_are_we](https://github.com/syhw/wer_are_we).

[^sim2019]:
    Khe Chai Sim, *et al.* *Personalization of end-to-end speech recognition on
    mobile devices for named entities.* 2019. [(link)](https://arxiv.org/abs/1912.09251)

[^shapiro]:
    Shapiro in the *Encyclopedia of Artificial Intelligence* defines an AI task as
    AI-complete if solving it is equivalent to "solving the general AI problem",
    which he defines as "producing a generally intelligent computer program".

license: MIT

branch_name: refs/heads/main

extension: md

license_type: permissive


text:
The sample application uses two Watson services:
- **Visual Recognition** : It detects the human faces in the image and determines their name, gender, maximum and minimum age.
- **Text to Speech**: It converts the given text to audio. You also have the option to download the audio file.

We need to first create instances of these services so that the application can use it. Following are the steps to create instances of these services.

1. Login to your bluemix account
`bx login`.
2. Create a instance of the **Visual Recognition** service
 `bx service create watson_vision_combined free <instance_name>`.
3. Create credential key for the **Visual Recognition** service
`bx service key-create <instance_name> <credential_name>`.
4. Run the following command to view the credential for the **Visual Recognition** service
` bx service key-show <instance_name> <credential_name>`
and look for an "api_key" in the returned JSON and note down its value (we will require it later).
5. Similary follow the commands to create a instance of **Text to Speech** service

`bx service create text_to_speech standard <instance_name>`

`bx service key-create <instance_name> <credential_name>`.

`bx service key-show <instance_name> <credential_name>`

In the returned json look for the "username" and "password" values and note them down as well.

Alternatively, services can also be created by logging into your bluemix account using your browser.

1. Log in to https://console.bluemix.net/ with your credentials.
2. Click on the List icon at the top left corner and select "Watson".
3. Click on "Create Watson Service" on the right side of your screen.
4. Select **Visual Recognition** from the list of various services provided.
5. Check the details that are auto filled in, you may or may not want to make any changes to these. Click on "Create".
6. The service should now show up on your Dashboard. Go to the list icon again and select "Dashboard" for the view.
7. Click on the newly created service on your Dashboard. On the left side, you should see a tab named "Service Credentials". Click on it.
8. You should now have a view which gives you the key name of your service, the date of creation as well as Actions. Under Actions theres a
"View Credentials" option with a downward arrow. Click on it.
9. A view opens up with the json containing the credentials for your service.
10. Look for "api_key" and note down the value.
11. Follow the same steps to create a **Text to Speech** service. Select **Text to Speech** in Step 4 instead of "Visual Recognition".
 Also note down the "username" and "password" in the json you get in Step 9 instead of the "api_key"

branch_name: refs/heads/master


text:
###S3 Image Resizer
=====================

###Getting Started

Download the repo and create config.json in the root directory.

```javascript
{
	"s3": {
		"key": "",
		"secret": "",
		"bucket": ""
	},
	"resize": {
		"tempPath": "",
		"destPath": "",
		"width": "200",
		"height": "200^",
		"gravity": "Center",
		"extent": [ "200", "200" ]
	}
}
```

Only supported options are listed above. Documentation about Imagemagick size flags [here](http://www.imagemagick.org/Usage/resize/#resize).

From the root directory, run
```
npm start
```

You should see output similar to this

```bash
$ npm start

><EMAIL_ADDRESS>start /Users/thom/develop/opensource/s3-image-resizer
> node index.js

Resizing 20 images...
....................
Resizing complete.

```


text:
# max_coverage
Calculates [maximum coverage problem](https://en.wikipedia.org/wiki/Maximum_coverage_problem)

Given a list of sets (over a given base set) the question is: which _k_ sets have to be chosen to cover the base set as much as possible.

The solution is one (or more) _k_-sized subset of the given sets.

## build

    cmake -DCMAKE_BUILD_TYPE=Release . && make

### requirements
* [cmake](https://cmake.org/)
* C++11 compilant compiler
* optionals for __distributed parallelization__
  * [gnu parallel](https://www.gnu.org/software/parallel/)
  * python
  * bash

## usage
See `maxcover --help`

    Calculates maximum coverage of sets.
    Author: Gabor Borbely, contact<EMAIL_ADDRESS>
    The input is read from stdin, one line represents a set, a 'set' is a list of words separated by spaces.
    Command line arguments:
            -k <int>        the exact number of sets you can choose. positive integer, default: 5
            -p --progress --print   prints progress periodically to stderr, default: false
            --file -i --input <filename>    default: "-"
            -b --begin -f --from <indices>  starting subset
            -e --end -t --to <indices>      ending subset, not inclusive

    Example:
            maxcover -k 2 < test/01.txt
    Output:
            4/6
            0	1
            0	2
            1	2
    The first line of the output is the maximum coverage per the size of the union of the sets.
    The rest of the output are the optimal solutions. Each line is a list of k indices.
    The indices determine which sets to choose.

If you interrupt the calculation (CTRL+C) then the so-far-best solution(s) are printed, which is not the guaranteed maximum.
But later you can continue the search (see parallelization).

## algorithm
Simply looks all the *n*-choose-*k* possibilities, where _k_ is the number of sets to choose and _n_ is the number of the sets to choose from (lines of input).

The key components of the algorithm are compile time optimized.
This bloats the size of the compiled binary and forces some limitations on the size of the sets and on the _k_ parameter.
But those limitations can be easily expanded.
The number of sets (_n_) is not limited compile time.

### parallelization
The parallelization is done in the least fancy way possible, however quite effective.

For example you have 10 sets and _k=5_ and you want to work on 8 threads.
The total 10-choose-5 = 252  possibilities can be split into 8 subsets.
For each subset of combinations you can calculate the maximum solutions, in parallel.
The final solution is the maximum of those 8 sub-solutions.

Since the combinations can be ordered lexicographically, one can represent a subset of combinations with an interval-like notation.
For example:

    "0 1 2 3 4" - "0 1 3 8 9"
    "0 1 3 8 9" - "0 2 3 4 7"
    "0 2 3 4 7" - "0 2 5 6 8"
    "0 2 5 6 8" - "0 3 4 5 6"
    "0 3 4 5 6" - "0 3 4 5 7"
    "0 3 4 5 7" - "2 3 4 8 9"
    "2 3 4 8 9" - "2 5 7 8 9"
    "2 5 7 8 9" -

The last valid combination in this example is `"5 6 7 8 9"`.
In the example the size of the splits are quite uneven (the right end of the interval is exclusive):

    "0 1 2 3 4" - "0 1 3 8 9" ->  35
    "0 1 3 8 9" - "0 2 3 4 7" ->  23
    "0 2 3 4 7" - "0 2 5 6 8" ->  24
    "0 2 5 6 8" - "0 3 4 5 6" ->   9
    "0 3 4 5 6" - "0 3 4 5 7" ->   1
    "0 3 4 5 7" - "2 3 4 8 9" -> 113
    "2 3 4 8 9" - "2 5 7 8 9" ->  24
    "2 5 7 8 9" -             ->  23
    -------------------------------
    "0 1 2 3 4" -             -> 252

So in this case the subtask `"0 3 4 5 7" - "2 3 4 8 9"` is the bottleneck.
Nonetheless, if you choose these intervals then you can break down the search into subtasks, which can be calculated separately and remotely.
As you can see, the effectiveness of the parallelization relies on the **evenly split subtasks**.

A more even split would be:

    "0 1 2 3 4" - "0 1 6 7 8" -> 52
    "0 1 6 7 8" - "0 2 6 7 8" -> 35
    "0 2 6 7 8" - "0 6 7 8 9" -> 38
    "0 6 7 8 9" - "1 3 6 7 8" -> 52
    "1 3 6 7 8" - "1 6 7 8 9" -> 18
    "1 6 7 8 9" - "2 3 6 7 8" -> 17
    "2 3 6 7 8" - "2 6 7 8 9" -> 18
    "2 6 7 8 9" -             -> 22

The pseudo-code for parallelization:
1. break down the search space into intervals (use `generate_boundaries.py`)
1. compute all those using `test.sh`
1. find the maximum among the sub-tasks (with `post_process.sh`).

See `exp.sh` for example.


text:
---
hrs_structure:
  division: '2'
  volume: '11'
  title: '27'
  chapter: '490'
  section: '490:3-408'
type: hrs_section
tags:
  - Business
menu:
  hrs:
    identifier: HRS_0490-0003-0408
    parent: HRS0490
    name: '490:3-408 Drawee not liable on unaccepted draft'
weight: 77275
title: Drawee not liable on unaccepted draft
full_title: '490:3-408 Drawee not liable on unaccepted draft'
---
**§490:3-408 Drawee not liable on unaccepted draft.** A check or other draft does not of itself operate as an assignment of funds in the hands of the drawee available for its payment, and the drawee is not liable on the instrument until the drawee accepts it. [L 1991, c 118, pt of §1]

repository: SamMade/BlueAndKrabby

repo_name: SamMade/BlueAndKrabby


text:
---
name: Bug report
about: Create a report to help us improve
labels:

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
- If you are setting any flags, list them here.
- If the problem occurs when running a program, paste a link to a gist containing it.
- If the problem occurs elsewhere, explain where it is happening and how to reproduce the behavior.

**Expected behavior**
A clear and concise description of what you expected to happen.

**Output**
Paste output from Enact with the `-verbose` flag set.

**Platform**
 - Enact version: [e.g. 0.1.1]
 - OS [e.g. Ubuntu Linux, Windows]

**Additional context**
Add any other context about the problem here.

repository: enact-lang/enact

gha_license_id: MIT

repo_name: enact-lang/enact


text:
# Today I Learned

---

- [Protocol summary and example code - 3](https://github.com/VincentGeranium/Swift-Study/tree/master/2019-10-10-Protocol-3.playground)

- [UIViewController의 View의 상태변화에 따른 메소드](https://github.com/VincentGeranium/edwithStudy-project-3)

---

repository: VincentGeranium/TIL

repo_name: VincentGeranium/TIL


text:
2401\. Longest Nice Subarray

Medium

You are given an array `nums` consisting of **positive** integers.

We call a subarray of `nums` **nice** if the bitwise **AND** of every pair of elements that are in **different** positions in the subarray is equal to `0`.

Return _the length of the **longest** nice subarray_.

A **subarray** is a **contiguous** part of an array.

**Note** that subarrays of length `1` are always considered nice.

**Example 1:**

**Input:** nums = [1,3,8,48,10]

**Output:** 3

**Explanation:** The longest nice subarray is [3,8,48]. This subarray satisfies the conditions:

- 3 AND 8 = 0.

- 3 AND 48 = 0.

- 8 AND 48 = 0.

It can be proven that no longer nice subarray can be obtained, so we return 3.

**Example 2:**

**Input:** nums = [3,1,5,11,13]

**Output:** 1

**Explanation:** The length of the longest nice subarray is 1. Any subarray of length 1 can be chosen.

**Constraints:**

*   1 <= nums.length <= 105
*   1 <= nums[i] <= 109

repository: javadev/LeetCode-in-Java

gha_language: Java

repo_name: javadev/LeetCode-in-Java


text:
# Gnip Support

## Example simple scripts

*“As a developer wanting to exercise a Twitter Tweet API, I want an example script that I can quickly configure and start making API request, and see the raw output.”*

This repository contains example code that demonstrate the basic API methods available on Twitter Enterpise APIs. These simple scripts can be configured and executed quickly to start working with the API and better understand how it works. These examples are designed to run from the command-line and have no user-interface.

These examples should serve as an example only for the basic API functions, and do not provide additional functionality that will be crucuial to the success of your application (e.g. reconnect logic, batching rule updates, complying with rate limits, validating rules, retrying failed updates, error handling, etc.).

Examples are avaialble for the following APIs:

+ **Historical APIs**
  + Search API - Send requests to Twitter Search API
    + Works with enterprise search, both 30-day and full-archive APIs.
    + Separate examples for POST and GET requests.
  + Historical PowerTrack API - Create and monitor Historical PowerTrack jobs

+ **Real-time PowerTrack**
  + Real-time PowerTrack streaming API - Establish a streaming connection to Twitter PowerTrack and volume streams, using gzip compression
  + Real-time PowerTrack Rules API -Add, Delete, and List rules on PowerTrack real-time streams

### Language coverage

We try to provide examples in as many language as is practical. These examples are first written back in 2012, and were updated for PowerTrack 2.0 in 2016. These examples are mainly in Java, Python, Ruby, C#, and PHP. Next there will likely be examples in node. If you want to share some example code in other languages, please let us know at [https://twittercommunity.com].

### Other examples

Typically used in-house, often developed as a partner engineering tool.

Search API examples (these two work with premium and enterprise search APIs):
+ Python search client - https://github.com/twitterdev/twitter_search_api
+ Ruby search client - https://github.com/jimmoffitt/search-tweets-ruby

repository: gnip/support

repo_name: gnip/support


text:
# [Rhyme Master](http://alexa.amazon.com/#skills/amzn1.echo-sdk-ams.app.63b5aa4e-52e3-42bc-b321-95bb83bc6b40)
![1 stars](../../images/ic_star_black_18dp_1x.png)![1 stars](../../images/ic_star_border_black_18dp_1x.png)![1 stars](../../images/ic_star_border_black_18dp_1x.png)![1 stars](../../images/ic_star_border_black_18dp_1x.png)![1 stars](../../images/ic_star_border_black_18dp_1x.png) 1

To use the Rhyme Master skill, try saying...

* *Alexa open rhyme master*

* *I spit rhyme like hot fire*

* *come at the king you best not miss*

Rhyme Master spits rhyme at your command.
Just say anything and Rhyme Master will rhyme it.
Say repeat and Rhyme Master will repeat it.

***

### Skill Details

* **Invocation Name:** rhyme master
* **Category:** null
* **ID:** amzn1.echo-sdk-ams.app.63b5aa4e-52e3-42bc-b321-95bb83bc6b40
* **ASIN:** B01HOUKGCA
* **Author:** masterchan
* **Release Date:** June 29, 2016 @ 07:57:47
* **In-App Purchasing:** No


text:
# Grav Standard Administration Panel Plugin

This **admin plugin** for [Grav](https://github.com/getgrav/grav) is an HTML user interface that provides a convenient way to configure Grav and easily create and modify pages.  This will remain a totally optional plugin, and is not in any way required or needed to use Grav effectively.  In fact, the admin provides an intentionally limited view to ensure it remains easy to use and not overwhelming.  I'm sure power users will still prefer to work with the configuration files directly.

![](assets/admin-dashboard.png)

# Features

* User login with automatic password encryption
* Forgot password functionality
* Logged-in-user management
* One click Grav core updates
* Dashboard with maintenance status, site activity and latest page updates
* Notifications system for latest news, blogs, and announcements
* Ajax-powered backup capability
* Ajax-powered clear-cache capability
* System configuration management
* Site configuration management
* Normal and Expert modes which allow editing via forms or YAML
* Page listing with filtering and search
* Page creation, editing, moving, copying, and deleting
* Powerful syntax highlighting code editor with instant Grav-powered preview
* Editor features, hot keys, toolbar, and distraction-free fullscreen mode
* Drag-n-drop upload of page media files including drag-n-drop placement in the editor
* One click theme and plugin updates
* Plugin manager that allows listing and configuration of installed plugins
* Theme manager that allows listing and configuration of installed themes
* GPM-powered installation of new plugins and themes

# Support

#### Support

We have tested internally, but we hope to use this public beta phase to identify, isolate, and fix issues related to the plugin to ensure it is as solid and reliable as possible.

For **live chatting**, please use the dedicated [Discord Chat Room](https://getgrav.org/discord) for discussions directly related to Grav.

For **bugs, features, improvements**, please ensure you [create issues in the admin plugin GitHub repository](https://github.com/getgrav/grav-plugin-admin).

# Installation

First ensure you are running the latest **Grav 1.6.7 or later**.  This is required for the admin plugin to run properly (`-f` forces a refresh of the GPM index).

```
$ bin/gpm selfupgrade -f
```

The admin plugin actually requires the help of 3 other plugins, so to get the admin plugin to work you first need to install **admin**, **login**, **forms**, and **email** plugins.  These are available via GPM, and because the plugin has dependencies you just need to proceed and install the admin plugin, and agree when prompted to install the others:

```
$ bin/gpm install admin
```

### Manual Installation

Manual installation is not the recommended method of installation, however, it is still possible to install the admin plugin manually. Basically, you need to download each of the following plugins individually:

* [admin](https://github.com/getgrav/grav-plugin-admin/archive/develop.zip)
* [login](https://github.com/getgrav/grav-plugin-login/archive/develop.zip)
* [form](https://github.com/getgrav/grav-plugin-form/archive/develop.zip)
* [email](https://github.com/getgrav/grav-plugin-email/archive/develop.zip)

Extract each archive file into your `user/plugins` folder, then ensure the folders are renamed to just `admin/`, `login/`, `form/`, and `email/`.  Then proceed with the **Usage instructions below**.

# Usage

### Create User with CLI

After this you need to create a user account with admin privileges:

```
$ bin/plugin login new-user
```

### Create User Manually

Alternatively, you can create a user account manually, in a file called `user/accounts/admin.yaml`. This **filename** is actually the **username** that you will use to login. The contents will contain the other information for the user.

```
password: 'password'
email<EMAIL_ADDRESS>fullname: 'Johnny Appleseed'
title: 'Site Administrator'
access:
  admin:
    login: true
    super: true
```

Of course you should edit your `email`, `password`, `fullname`, and `title` to suit your needs.

> You can use any password when you manually put it in this `.yaml` file.  However, when you change your password in the admin, it must contain at least one number and one uppercase and lowercase letter, and at least 8 or more characters.

# Accessing the Admin

By default, you can access the admin by pointing your browser to `http://yoursite.com/admin`. You can simply log in with the `username` and `password` set in the YAML file you configured earlier.

> After logging in, your **plaintext password** will be removed and replaced by an **encrypted** one.

# Standard Free & Paid Pro Versions

If you have been following the [blog](https://getgrav.org/blog), [Twitter](https://twitter.com/getgrav), [Discord chat](https://getgrav.org/discord), etc., you probably already know now that our intention is to provide two versions of this plugin.

The **standard free version**, is very powerful, and has more functionality than most commercial flat-file CMS systems.

We also intend to release in the near future a more feature-rich **pro version** that will include enhanced functionality, as well as some additional nice-to-have capabilities. This pro version will be a **paid** plugin the price of which is not yet 100% finalized.

# Admin Events

## General events

- onAdminRegisterPermissions - (admin)
- onAdminThemeInitialized
- onAdminPage - (page)
- onAdminMenu
- onAdminTwigTemplatePaths - (paths)

## Page specific events

- onAdminDashboard
- onAdminTools - (tools)
- onAdminLogFiles - (logs)
- onAdminGenerateReports - (reports)

## Tasks

- onAdminControllerInit - (controller)
- onAdminTaskExecute - (controller, method)

## Editing

- onAdminData
- onAdminSave - (object)
- onAdminAfterSave - (object)

## Pages

- onAdminPageTypes - (types)
- onAdminModularPageTypes
- onAdminSave - (page)
- onAdminAfterSaveAs - (path)
- onAdminAfterSave - (page)
- onAdminAfterDelete - (page)
- onAdminAfterAddMedia - (page)
- onAdminAfterDelMedia - (page)
- onAdminCreatePageFrontmatter - (header, data)

# Running Tests

First install the dev dependencies by running `composer update` from the Grav root.
Then `composer test` will run the Unit Tests, which should be always executed successfully on any site.

repository: getgrav/grav-plugin-admin

branch_name: refs/heads/develop

gha_language: PHP

repo_name: getgrav/grav-plugin-admin


text:
# 2 Kings 14 General Notes
## Structure and formatting

The text begins to alternate between the kingdoms of Israel and Judah again.

## Special concepts in this chapter

### Pride
Pride in one’s success can make a person attempt and fail at something else. Amaziah defeated Edom so he wanted to fight Israel. But Israel defeated him and thoroughly humiliated him.

repository: mandolyte/uw-obsidian

repo_name: mandolyte/uw-obsidian


text:
# Packing Nodes
The idea behind Packing nodes is to bring in type definitions (partially) inside Dynamo and have a way of building multi-level custom types with basic validations.

In this example, the `Data Bridge` callback is used to allow the nodes to redefine their `InPorts` and `OutPorts` after running the graph so it matches an arbitrary defined type.

Below is a bit more information on that feature and its implementation.

## TypeDefinition
In order to bring in a way to define types for the Packing Nodes, this example uses [Sprache](https://github.com/sprache/Sprache/) to create a Typescript-like syntax parser.

### Syntax
The syntax is quite simple. The initial keyword is `Type`, which must be followed by a word representing the type name and then a pair of `{ }` containing one or more properties defined as `name`, `:`, `Type` and seperated by a `,`. Like in Typescript, `[]` can be added to a property Type to indicate a collection.

### Faulty Syntax

An error made in the syntax will be outlined by Sprache
![](./README_assets/sprache_faulty_syntax.png)

## Pack
The purpose of the Pack node is to take in a TypeDefinition (in this case from a string) and redefine its InPorts to fit with the given type. When running, some basic validation of types occurs.
Assuming no validation errors, it then outputs a dictionary (or list of dictionaries, as it does some lacing) corresponding to the input values.

![](./README_assets/validation-error.png)

## UnPack
The purpose of the UnPack node is to complete the Pack node in a symmetric way. It takes in a TypeDefinition (currently from a string) and redefine its outports to show every property of that type definition. It then expects a dictionary (or list of dictionary) as an additional input and unpacks its content by mapping them to the different OutPorts.

![](./README_assets/unpack-example.png)

## Nested Types
It's possible to define types and re-use them in other Pack/UnPack nodes.

![](./README_assets/nested-packs.png)

repository: Mabiro/DynamoSamples

repo_name: Mabiro/DynamoSamples


text:
Week 1 - Basics and simple functions
===

This 'week' is actually two calendar weeks :)
## Materials
* [Basics](../content/Basics.md)
* [Basic (int) Variables and Operators](../content/IntVariablesAndOperators.md)
* [Boolean variables](../content/Booleans.md)
* [Functions](../content/Functions.md)
* Book chapters
    + [Chapter 1 - The way of the program](http://greenteapress.com/thinkjava5/html/thinkjava003.html)
    + [Chapter 2 - Variables and types](http://greenteapress.com/thinkjava5/html/thinkjava004.html)
* Videos
    + [Java Bootcamp](https://www.youtube.com/watch?v=8nOg6mtH-oo&list=UUSH2TieRlco7uQOGU8Vppnw) - From Dr Chastine, 20 minutes or so
    + [Int variables and Operators](https://youtu.be/1JEtmEthcS4)
    + [Boolean variables and operators](https://www.youtube.com/watch?v=h7ss6NgYB5M&list=PLK5RwQeVk5YxjJnC17WLGWNmW2wW9ILrH&index=2)
    + [Relational operators](https://www.youtube.com/watch?v=ZIjRLlcHL4w&list=PLK5RwQeVk5YxjJnC17WLGWNmW2wW9ILrH&index=3)
    + [Simple functions - add](https://www.youtube.com/watch?v=Wg1zXRuZUck&list=PLK5RwQeVk5YxjJnC17WLGWNmW2wW9ILrH&index=4)
    + [isEven in CodingBat](https://www.youtube.com/watch?v=IHFXy_5Zp68&list=PLK5RwQeVk5YxjJnC17WLGWNmW2wW9ILrH&index=5)

Assignments:
* [Exercises (on CodingBat)](Assignments/A1.md)

license: Unlicense

repository: okaram/IntroJava

repo_name: okaram/IntroJava


text:
They are typically used for things like logos or buttons.

Each snippet must have:

 - An anchor point that determine where the snippet will be located
 - The name of the snippet to insert

Since our example image does not have any snippets in it, here's another example
of a `button`, `buttonhole`, and `logo` snippet added to a FreeSewing pattern:

<Example
  part="snippet"
  caption="An example of the use of snippets"
/>

repository: freesewing/markdown

gha_language: HTML

repo_name: freesewing/markdown


text:
# Installation

## Requirements

The supported Python versions are:

- `Python 3.7`
- `Python 3.8`
- `Python 3.9`
- `Python 3.10`
- `Python 3.11`

## Installation via pip

### Virtual Python environment

First create a new `venv` environment, for example called `foxes` and located at `~/venv/foxes` (choose any other convenient name and location in your file system if you prefer), by

```console
python3 -m venv ~/venv/foxes
```

Then activate the environment every time you work with `foxes`, by

```console
source ~/venv/foxes/bin/activate
```

You can leave the environment by

```console
deactivate
```

The `pip` installation commands below should be executed within the active `foxes` environment.

### Standard users

As a standard user, you can install the latest release via [pip](https://pypi.org/project/foxes/) by

```console
pip install foxes
```

This commands installs the version that correspond to the `main` branch at [github](https://github.com/FraunhoferIWES/foxes). Alternatively, you can decide to install the latest pre-release developments (non-stable) by

```console
pip install git+https://github.com/FraunhoferIWES/foxes@dev#egg=foxes
```

### Developers

For developers using `pip`, simply invoke the `-e` flag in the installation command in your local clone:

```console
git clone https://github.com/FraunhoferIWES/foxes.git
cd foxes
pip install -e .
```
The last line makes sure that all your code changes are included whenever importing `foxes`. Concerning the `git clone` line, we actually recommend that you fork `foxes` on GitHub and then replace that command by cloning your fork instead.

## Installation via conda

### Virtual Python environment

First create a new `conda` environment, for example called `foxes`, by

```console
conda create -c conda-forge --name foxes
```

Then activate the environment every time you work with `foxes`, by

```console
conda activate foxes
```

You can leave the environment by

```console
conda deactivate
```

The `conda` installation commands below should be executed within the active `foxes` environment.

### Standard users

The `foxes` package is available on the channel [conda-forge](https://anaconda.org/conda-forge/foxes). You can install the latest version by

```console
conda install -c conda-forge foxes
```

### Developers

For developers using `conda`, we recommend first installing foxes, then removing only the `foxes` package while keeping the dependencies, and then adding `foxes` again from a git using `conda develop`:

```console
conda install -c conda-forge foxes conda-build
conda remove foxes --force
git clone https://github.com/FraunhoferIWES/foxes.git
cd foxes
conda develop .
```
The last line makes sure that all your code changes are included whenever importing `foxes`. Concerning the `git clone` line, we actually recommend that you fork `foxes` on GitHub and then replace that command by cloning your fork instead.

repository: FraunhoferIWES/foxes

gha_language: Python

repo_name: FraunhoferIWES/foxes


text:
+++
title = "Designing Libraries for Users"
date = 2018-09-24T22:38:36-04:00
draft = true
type = "post"
+++

UX stands for user experience.  Every piece of software has users, and they all
have an experience when using your software.  Optimize your software to make it
a good experience, and your users will love your software.  It doesn't matter if
it's a backend library, a CLI tool, or a service in the cloud.  This article is
mostly focused on libraries, but it applies to the other products as well.

I often start writing software by designing the user experience I want first,
and then figuring out how to implement that later.  In this way, I'm not
restricting myself by what I think is possible or most performant, but I instead
focus on how it feels to *use* the end product.

## Actually Write Some Code

Pretend the library/tool/service already exists, and think about the common ways
people will want to interact with it.

Take a few of the common actions you expect people to perform with your code, and
actually write some code using your fictitious library.  DON'T SKIP THIS PART.
Actually write actual code in your actual editor.  It doesn't necessarily have
to run or compile (if applicable), but it needs to be as close to real
usage as possible.  Don't handwave conversion functions or setup functions...
that's actual code real users will need to write, so you need to write it, too,
to understand what it's like to interact with your code.  This is the only way
to really understand the ergonomics of your API.

This is traditionally one of the stated benefits of test driven development,
which I think is fine, but in my experience, good tests rarely mimic real
systems at any significant depth.  Real tests carefully mock out all outside
resources, uses very controlled input, and sets up complicated metrics for
testing usage, outputs, etc ... real code doesn't do any of that.  Real code
interacts with real systems and generally trusts the library to do what it says
it does (and report errors as appropriate).

### Types

Do people have to bend over backwards to get their types to align with what your
library takes?  Try to think about what other systems a user will be using as
inputs to your library or what systems they'll feed outputs of your library
into.  Are you using types that make those conversions easy or hard?

Are you using types that make the restrictions of your API clear?  One of the
key points to UX is making it easy to do the right thing, and hard or impossible
to do the wrong thing.  one of the benefit of statically typed languages is that
you *can't* pass a string into a function expecting an int.  But even in these
languages, it's easy to be misleading about your API.  If a function in your API
takes a string, but that string can only be one of three different values...
you're using the wrong type.  It shouldn't be a string, it should be an enum
(whatever that means in your language).

Choose the most restrictive type you can, without destroying ease of use...
and then ruthlessly check your inputs to make sure you return clear errors when
the type system can't properly define all the restrictions of your library.

## Usage Patterns

Are their footguns they have to avoid like not calling A before B?

repository: natefinch/npf

gha_language: CSS

repo_name: natefinch/npf


text:
# Ray-tracer-rs

[![](https://github.com/GarfieldZHU/ray-tracer-rs/workflows/Ray-tracer/badge.svg)](https://github.com/GarfieldZHU/ray-tracer-rs/actions?query=workflow%3ARay-tracer)
[![MIT licensed](https://img.shields.io/github/license/GarfieldZHU/ray-tracer-rs)](./LICENSE)
[![Last commit](https://img.shields.io/github/last-commit/GarfieldZHU/ray-tracer-rs)](.)

A simple ray tracer implemented in Rust, followed [Ray Tracing in One Weekend](https://raytracing.github.io/books/RayTracingInOneWeekend.html) seires.

## Get started

- Install the [Rust](https://www.rust-lang.org/).
  On MacOS or Linux, run the below command to get ready:
  ```bash
    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
  ```

- Clone this repo.
  ```bash
    git clone https://github.com/GarfieldZHU/ray-tracer-rs
  ```

- Run, get the ray tracing image (in [.ppm](https://en.wikipedia.org/wiki/Netpbm#File_formats) format):
  ```bash
    cargo run > raytracer.ppm
  ```

## Progress

#### Latest sample

- Preview

![sample](./image_sample/finalScene.png)

- High resolution

![sample_high-res](./image_sample/final_scene_high_resolution.png)

#### [In one weekend](https://raytracing.github.io/books/RayTracingInOneWeekend.html)
- [x] Output image
- [x] Ray and camera
- [x] Sphere with ray
- [x] Surface normal
- [x] Antialiasing
- [x] Surface material
- [x] Metal sphere
- [x] Dielectrics
- [x] Move camera
- [x] Defocus blur
- [x] Final scene

#### [The next week](https://raytracing.github.io/books/RayTracingTheNextWeek.html)

- [ ] Motion Blur  <- In progress
- [ ] Bounding Volume Hierarchies

#### [The Rest of Life](https://raytracing.github.io/books/RayTracingTheRestOfYourLife.html)

## References

- [Ray Tracing in One Weekend - The Book Series](https://raytracing.github.io/)

repository: GabrielFernandesDEV/ray-tracer-rs

repo_name: GabrielFernandesDEV/ray-tracer-rs


text:
# Windows specifics #

[GNUwin32 instructions](gnuwin32.md)

## Preparing build environment ##

### Windows (using MSYS2):

Direct USB access has not yet been tested on Windows, and will not work with these instructions. Stay tuned for updates here.
Manipulating the firmware and compiling the patches is supported, and instructions follow.

Install MSYS2 from https://msys2.github.io, and update it by following the instructions on the homepage.

Install needed MSYS2 dependencies:

    pacman -S git make unzip zip perl python2

Restart the MSYS2 shell to ensure default paths are updated.

Download the latest [GNU ARM Embedded Toolchain](https://launchpad.net/gcc-arm-embedded) and unpack to a desired location, ideally without spaces in the path.

Clone the repo to a desired location.

In MSYS2, the C drive is located at `/c/`. Add the ARM toolchain bin directory to the MSYS2 path:

    export PATH=$PATH:/c/path/to/gcc-arm-embedded/bin

To make the PATH variable permanent, add the above line to the `.bashrc`
file (located at `~/.bashrc`).

If you are interested in using radare2 on Windows, [download it](http://www.radare.org/) and unpack to a desired location. As radare2 does not currently work in the MSYS2 shell, it is suggested to run the commands in the Makefile directly from the CMD shell:

    cd \path\to\md380tools\annotations\2.032
	\path\to\radare2.exe -a arm -m 0x0800C000 -b 16 -i flash.r flash.img

gha_language: C


text:
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased](https://github.com/hubblo-org/scaphandre/commits/main)

## [0.1.1](https://github.com/hubblo-org/scaphandre/releases/tag/v0.1.1)

### Added

- `-s, --step` option added by @Uggla, to specify time step between two measurements, when using StdoutExporter

### Removed

- removed `energy_records_to_power_record` function `from src/sensors/mod.rs`. `get_records_diff_power_microwatts` functions from Topology and CPUSocket should be used instead

### Fixed

- README typos and misusage of english fixed by @Uggla and @florimondmanca
- @Uggla made init.sh script more robust
- cleaning of internal structs (records, cpustat, processes) was buggy, it is fixed
- linux kernels < 5, on intel CPUs (>2012) may me measurable now (fixed kernel modules names check)

## [0.1.0](https://github.com/hubblo-org/scaphandre/releases/tag/v0.1.0)

### Added

- Exporters and sensors design.
- Stdout exporter.
- Prometheus exporter.
- Powercap_rapl sensor.
- Qemu exporter.

## HELP

Here are the sub-sections that can be included in each release section:

- **Added** for new features.
- **Changed** for changes in existing functionality.
- **Deprecated** for soon-to-be removed features.
- **Removed** for now removed features.
- **Fixed** for any bug fixes.
- **Security** in case of vulnerabilities.


text:
# app-settings-loader

![build status](https://github.com/Sayan751/app-settings-loader/workflows/build/badge.svg)
[![Coverage Status](https://coveralls.io/repos/github/Sayan751/app-settings-loader/badge.svg?branch=master)](https://coveralls.io/github/Sayan751/app-settings-loader?branch=master)

[![NPM](https://nodei.co/npm/app-settings-loader.png)](https://nodei.co/npm/app-settings-loader/)

A simple webpack loader to load and customize application settings based on the provided environment.

## Why

We often specify the application settings in a JSON file and use it during development; something like below, for example.

```json
{
    "debug": true,
    "endpoint": "http://localhost:8080/",
    "basePath": "api/"
}
```

However, for production (or any other environment) we may need different settings/values for a subset of keys. For example,

```json
{
    "debug": false,
    "endpoint": "http://my.awesome.service/",
}
```

Using this loader, you can bundle environment specific values, given 2 JSON files exist.

## How

### Install

```bash
npm i -D app-settings-loader
```

### Use

Let us assume that we have following directory structure.

```text
project_root
|
+-config
| |
| +-appConfig.json
| +-appConfig.development.json
|
+-main.ts
+-webpack.config.js
```

Then you use the `appConfig.json` in `main.ts` as follows.

```typescript
// with "resolveJsonModule": true (and "esModuleInterop": true) in your tsconfig
import config from "./config/appConfig.json";

// or
const config = require("./config/appConfig.json");
```

In your webpack add the loader as follows.

```javascript
{
    test: /appConfig\.json$/i, // change this as per your file name
    use: [
        { loader: "app-settings-loader", options: { env: production ? 'production' : 'development' } },
    ]
},
```

With the above config, the loader will merge the customization coming from the `appConfig.development.json` with the base config in `appConfig.json`, when `production` is truthy.

### How does it work

The loader has only one option `env` (environment, default value is `"development"`). If the base JSON file name is `mysettings.json`, it looks for a JSON file named `mysettings.{env}.json` at the same directory path. If there is one, it merges the customization form that file with the base file, and returns the result. In case there is no customization file, it returns the base content. Note that if you want you may have more environment names, as per your need. That is you may set `env` as [`Betelgeuse5`](https://hitchhikers.fandom.com/wiki/Ford_Prefect), and provided you have a  JSON for that, it will load that too :)

#### Note

- **Merging configurations**: The merge operation keeps the schema of the base file intact. That is, no unknown properties or property value of different type, from the customization files can be applied on the base file. This makes sense because during development you expect a certain set of keys and values of certain datatype to be present in your config and you program against this known schema. Therefore any new keys present in the customization file cannot and should not play any part in the source code.
- **Valid JSON**: The content of the both base and customization file needs to be valid JSON. Otherwise, it will throw an error.
- **Do not store sensitive data**: As the config will be part of webpack bundle, you should not store any sensitive data in the customization file. The thumb rule is that any sensitive data that you don't want to keep in your source code, should also not be the part of either base or customization config file.

That's it. If you face any problem, feel free to open an issue.

gha_language: JavaScript


text:
---
title: Credits
---

The About window in a Mac application is viewed by selecting the app's name in the top menu bar, then choosing the About item in the menu. The image below displays Safari's About window.

![app credits safari](/swift-macos/images/credits-safari.png)

To add credits to the About window, add a file named `Credits.rtf` to the Xcode project. The text in the RTF file will appear in the About window below the app version and copyright. For example, the following text in `Credits.rtf` will appear under the version number in the About window:

```
My Credits

These are the credits for this app. They go in a rich text file named
"Credits" in the Xcode project. See below for an example of a list.

    •   First item is here
    •   Second item here
    •   Third item goes here
    •   Fourth items goes here
    •   Fifth item is here
    •   Six item is the last
```

![app credits](/swift-macos/images/credits.png)

repository: LoetLuemmel/swift-macos

repo_name: LoetLuemmel/swift-macos


text:
---
$category@: media
formats:
  - websites
teaser:
  text: Displays the Kaltura Player as used in Kaltura's Video Platform.
---

# amp-kaltura-player

## Example

The `width` and `height` attributes determine the aspect ratio of the player embedded in responsive layouts.

Example:

```html
<amp-kaltura-player
  data-service-url="cdnapisec.kaltura.com"
  data-uiconf="33502051"
  data-partner="1281471"
  data-entryid="1_3ts1ms9c"
  data-param-streamerType="auto"
  layout="responsive"
  width="480"
  height="270"
>
</amp-kaltura-player>
```

## Attributes

    data-serviceUrl
    The Kaltura service url. This attribute is optional.

    data-partner
    The Kaltura partner id. This attribute is mandatory.

    data-uiconf
    The Kaltura player id - uiconf id.

    data-entryid
    The Kaltura entry id.

    data-param-*

All data-param-* attributes will be added as query parameter to the player iframe src. This may be used to pass custom values through to player plugins, such as ad parameters or video ids for Perform players.

Keys and values will be URI encoded. Keys will be camel cased.

`data-param-streamerType="auto"` becomes `&flashvars[streamerType]=auto`

    common attributes
    This element includes common attributes extended to AMP components.

## Validation

See [amp-kaltura-player rules](https://github.com/ampproject/amphtml/blob/main/extensions/amp-kaltura-player/validator-amp-kaltura-player.protoascii) in the AMP validator specification.

repository: ampproject/amphtml

repo_name: ampproject/amphtml


text:
Tftpd Docker Image
==================

Tftpd in a Docker container, with data directory in a volume, and a configurable UID/GID for data files.

[![CircleCI](https://circleci.com/gh/wastrachan/docker-tftpd/tree/master.svg?style=svg)](https://circleci.com/gh/wastrachan/docker-tftpd/tree/master)
[![](https://img.shields.io/docker/pulls/wastrachan/tftpd.svg)](https://hub.docker.com/r/wastrachan/tftpd)

## Install

#### Docker Hub
Pull the latest image from Docker Hub:

```shell
docker pull wastrachan/tftpd
```

#### Manually
Clone this repository, and run `make build` to build an image:

```shell
git clone https://github.com/wastrachan/docker-tftpd.git
cd docker-tftpd
make build
```

If you need to rebuild the image, run `make clean build`.

## Run

#### Docker
Run this image with the `make run` shortcut, or manually with `docker run`.

```shell
docker run -v "$(pwd)/data:/data" \
           --name tftpd \
           -p 69:69/udp \
           -e PUID=1111 \
           -e PGID=1112 \
           --restart unless-stopped \
           wastrachan/tftpd:latest
```

#### Docker Compose
If you wish to run this image with docker-compose, an example `docker-compose.yml` might read as follows:

```yaml
---
version: "2"

services:
  tftpd:
    image: wastrachan/tftpd
    container_name: tftpd
    environment:
      - PUID=1111
      - PGID=1112
    volumes:
      - </path/to/data>:/data
    ports:
      - 69:69/udp
    restart: unless-stopped
```

## Configuration

#### User / Group Identifiers
If you'd like to override the UID and GID of the `tftpd` process, you can do so with the environment variables `PUID` and `PGID`. This is helpful if other containers must access your configuration volume.

#### Services
Service     | Port
------------|-----
TFTPD       | 69

#### Volumes
Volume          | Description
----------------|-------------
`/data`         | Data directory for files served by tftpd

## License
The content of this project itself is licensed under the [MIT License](LICENSE).

View [license information](https://www.isc.org/downloads/software-support-policy/isc-license/) for the software contained in this image.

license: MIT,ISC

repository: wastrachan/docker-tftpd

detected_licenses: MIT ISC

gha_language: Makefile

repo_name: wastrachan/docker-tftpd


text:
[![build status](https://secure.travis-ci.org/postwait/node-amqp.png)](http://travis-ci.org/postwait/node-amqp)

# node-amqp

This is a client for RabbitMQ (and maybe other servers?). It partially
implements the 0.9.1 version of the AMQP protocol.

## Table of Contents

- [Installation](#installation)
- [Synopsis](#synopsis)
- [Connection](#connection)
  - [Connection options and URL](#connection-options-and-url)
  - [connection.publish(routingKey, body, options, callback)](#connectionpublishroutingkey-body-options-callback)
  - [connection.disconnect()](#connectiondisconnect)
  - [connection.on('tag.change', callback)](#connectionontagchange-callback)
- [Queue](#queue)
  - [connection.queue(name[, options][, openCallback])](#connectionqueuename-options-opencallback)
  - [queue.subscribe([options,] listener)](#queuesubscribeoptions-listener)
  - [queue.subscribeRaw([options,] listener)](#queuesubscriberawoptions-listener)
  - [queue.unsubscribe(consumerTag)](#queueunsubscribeconsumertag)
  - [queue.shift([reject[, requeue]])](#queueshiftreject-requeue)
  - [queue.bind([exchange,] routing)](#queuebindexchange-routing-callback)
  - [queue.unbind([exchange,] routing)](#queueunbindexchange-routing)
  - [queue.bind_headers([exchange,] routing)](#queuebind_headersexchange-routing)
  - [queue.destroy(options)](#queuedestroyoptions)
- [Exchange](#exchange)
  - [exchange.on('open', callback)](#exchangeonopen-callback)
  - [connection.exchange()](#connectionexchange)
  - [connection.exchange(name, options={}, openCallback)](#connectionexchangename-options-opencallback)
  - [exchange.publish(routingKey, message, options, callback)](#exchangepublishroutingkey-message-options-callback)
  - [exchange.destroy(ifUnused = true)](#exchangedestroyifunused--true)
  - [exchange.bind(srcExchange, routingKey [, callback])](#exchangebindsrcexchange-routingkey--callback)
  - [exchange.unbind(srcExchange, routingKey [, callback])](#exchangeunbindsrcexchange-routingkey--callback)
  - [exchange.bind_headers(exchange, routing [, bindCallback])](#exchangebind_headersexchange-routing--bindcallback)

## Installation

    npm install amqp

## Synopsis

IMPORTANT: This module only works with node v0.4.0 and later.

An example of connecting to a server and listening on a queue.

```javascript
var amqp = require('amqp');

var connection = amqp.createConnection({ host: 'dev.rabbitmq.com' });

// add this for better debuging
connection.on('error', function(e) {
  console.log("Error from amqp: ", e);
});

// Wait for connection to become established.
connection.on('ready', function () {
  // Use the default 'amq.topic' exchange
  connection.queue('my-queue', function (q) {
      // Catch all messages
      q.bind('#');

      // Receive messages
      q.subscribe(function (message) {
        // Print messages to stdout
        console.log(message);
      });
  });
});
```

## Connection

`new amqp.Connection()` Instantiates a new connection. Use
`connection.connect()` to connect to a server.

`amqp.createConnection()` returns an instance of `amqp.Connection`, which contains
an instance of `net.Socket` at its `socket` property. All events and methods which work on
`net.Socket` can also be used on an `amqp.Connection` instance. (e.g., the
events `'connect'` and `'close'`.)

### Connection options and URL

`amqp.createConnection([options, [implOptions]])` takes two options
objects as parameters.  The first options object has these defaults:

    { host: 'localhost'
    , port: 5672
    , login: 'guest'
    , password: 'guest'
    , connectionTimeout: 10000
    , authMechanism: 'AMQPLAIN'
    , vhost: '/'
    , noDelay: true
    , ssl: { enabled : false
           }
    }

An example `options` object for creating an SSL connection has these properties:

    { host: 'localhost'
    , port: 5671
    , login: 'guest'
    , password: 'guest'
    , authMechanism: 'AMQPLAIN'
    , vhost: '/'
    , ssl: { enabled : true
           , keyFile : '/path/to/key/file'
           , certFile : '/path/to/cert/file'
           , caFile : '/path/to/cacert/file'
           , rejectUnauthorized : true
           }
    }

The key, certificate, and certificate authority files must be in pem format.
Alternatively, `pfxFile` can be used to read key and certificate from a single
file. If `port` is not specified, the default AMQPS port 5671 is used.
If `rejectUnauthorized` is not specified, it defaults to true.

Options can also be passed in a single URL of the form

    amqp[s]://[user:password@]hostname[:port][/vhost]

AMQPLAIN is assumed for the auth mechanism.

Note that the vhost must be URL-encoded and appear as the only segment
of the path, i.e., the only unencoded slash is that leading; leaving
the path entirely empty indicates that the vhost `/`, as
above, should be used (it could also be supplied as the path `/%2f`).

The `heartbeat` setting sets the heartbeat interval (in seconds) for
the connection.  There is no default for this option meaning no
heartbeating is taking place.

This URL is supplied as the field `url` in the options; for example

```javascript
var conn =
  amqp.createConnection({url: "amqp://guest:guest@localhost:5672"});

```

Options provided as individual fields will override values given in
the URL.

You can also specify additional client properties for your connection
by setting the `clientProperties` field on the `options` object.

    { clientProperties: { applicationName: 'myApplication'
                        , capabilities: { consumer_cancel_notify: true
                                        }
                        }
    }

If the `consumer_cancel_notify` capability is set to `true` (as above), then
RabbitMQ's [Consumer Cancel Notification](http://www.rabbitmq.com/consumer-cancel.html)
feature will be enabled.

By default the following client properties are set

    { product: 'node-amqp'
    , platform: 'node-' + process.version
    , version: nodeAMQPVersion
    }

The second options are specific to the node AMQP implementation. It has
the default values:

    { defaultExchangeName: ''
    , reconnect: true
    , reconnectBackoffStrategy: 'linear'
    , reconnectExponentialLimit: 120000
    , reconnectBackoffTime: 1000
    }

The defaultExchangeName is the default exchange to which
connection.publish will publish. In the past, the default exchange was
`amq.topic`, which is not ideal.  To emulate this behaviour, one can
create a connection like:

```javascript
var conn =
  amqp.createConnection({url: "amqp://guest:guest@localhost:5672"},
                        {defaultExchangeName: "amq.topic"});
```

 If the `reconnect` option is true, then the driver will attempt to reconnect using the
 configured strategy *any time* the connection becomes unavailable.  If this is not
 appropriate for your application, set this option to false.

 If you would like this option, you can set parameters controlling how aggressively the
 reconnections will be attempted.  Valid strategies are "linear" and "exponential".

 Backoff times are in milliseconds.  Under the "linear" strategy, the driver will pause
 `reconnectBackoffTime` ms before the first attempt, and between each subsequent attempt.
 Under the "exponential" strategy, the driver will pause `reconnectBackoffTime` ms before
 the first attempt, and will double the previous pause between each subsequent attempt
 until a connection is reestablished.

After a connection is established the `'connect'` event is fired as it is
with any `net.Connection` instance. AMQP requires a 7-way handshake which
must be completed before any communication can begin. `net.Connection` does
the handshake automatically and emits the `'ready'` event when the handshaking
is complete.

For backward compatibility, two additional options are available. Older
versions of this library placed the routingKey and deliveryTag for incoming
messages into the JSON payload received. This module was changed to
leave inbound JSON payloads pristine.  Some applications may need the
old behaviour. If the key `routingKeyInPayload` is set to true in the
connection `options`, the messages resulting from a subscribe call will
include a 'routingKey' key in the JSON payload.  If the key
`deliveryTagInPayload` is set to true in the connection options, the
deliveryTag of the incoming message will be placed in the JSON payload.

### connection.publish(routingKey, body, options, callback)

Publishes a message to the default exchange; if the defaultExchange is
left as `''`, this effectively publishes the message on the routing key named.

This method proxies to the default exchange's `publish` method and parameters are passed
through untouched.

### connection.disconnect()

Cleanly disconnect from the server, the socket will not be closed until the
server responds to the disconnection request.

### connection.on('tag.change', callback)

Fired when an existing consumer tag has changed. Use this event to update your consumer tag references.

When an error or reconnection occurs, any existing consumers will be automatically replaced with new ones.
If your application is holding onto a reference to a consumer tag (e.g. to unsubscribe later) and reconnects,
the held tag will no longer be valid, preventing the application from gracefully unsubscribing.

The `callback` function takes one parameter, `event`, which contains two properties: `oldConsumerTag` and `consumerTag`.

```javascript
var connection = amqp.createConnection({ host: 'dev.rabbitmq.com' });

// Local references to the exchange, queue and consumer tag
var _exchange = null;
var _queue = null;
var _consumerTag = null;

// Report errors
connection.on('error', function(err) {
    console.error('Connection error', err);
});

// Update our stored tag when it changes
connection.on('tag.change', function(event) {
    if (_consumerTag === event.oldConsumerTag) {
        _consumerTag = event.consumerTag;
        // Consider unsubscribing from the old tag just in case it lingers
        _queue.unsubscribe(event.oldConsumerTag);
    }
});

// Initialize the exchange, queue and subscription
connection.on('ready', function() {
    connection.exchange('exchange-name', function(exchange) {
        _exchange = exchange;

        connection.queue('queue-name', function(queue) {
            _queue = queue;

            // Bind to the exchange
            queue.bind('exchange-name', 'routing-key');

            // Subscribe to the queue
            queue
                .subscribe(function(message) {
                    // Handle message here
                    console.log('Got message', message);
                    queue.shift(false, false);
                })
                .addCallback(function(res) {
                    // Hold on to the consumer tag so we can unsubscribe later
                    _consumerTag = res.consumerTag;
                })
            ;
        });
    });
});

// Some time in the future, you'll want to unsubscribe or shutdown
setTimeout(function() {
    if (_queue) {
        _queue
            .unsubscribe(_consumerTag)
            .addCallback(function() {
                // unsubscribed
            })
        ;
    } else {
        // unsubscribed
    }
}, 60000);

```

## Queue

Events: A queue will call the callback given to the `connection.queue()`
method once it is usable. For example:

```javascript
var q = connection.queue('my-queue', function (queue) {
  console.log('Queue ' + queue.name + ' is open');
});
```

Declaring a queue with an empty name will make the server generate a
random name.

### connection.queue(name[, options][, openCallback])

Returns a reference to a queue. The name parameter is required, unlike pika which defaults the name to `''`. The options are

- `passive`: boolean, default false.
    If set, the server will not create the queue.  The client can use
    this to check whether a queue exists without modifying the server
    state.
- `durable`: boolean, default false.
    Durable queues remain active when a server restarts.
    Non-durable queues (transient queues) are purged if/when a
    server restarts.  Note that durable queues do not necessarily
    hold persistent messages, although it does not make sense to
    send persistent messages to a transient queue.
- `exclusive`: boolean, default false.
    Exclusive queues may only be consumed from by the current connection.
    Setting the 'exclusive' flag always implies 'autoDelete'.
- `autoDelete`: boolean, default true.
    If set, the queue is deleted when all consumers have finished
    using it. Last consumer can be cancelled either explicitly or because
    its channel is closed. If there was no consumer ever on the queue, it
    won't be deleted.
- `noDeclare`: boolean, default false.
    If set, the queue will not be declared, this will allow a queue to be
    deleted if you don't know its previous options.
- `arguments`: a map of additional arguments to pass in when creating a queue.
- `closeChannelOnUnsubscribe` : a boolean when true the channel will close on
    unsubscribe, default false.

### queue.subscribe([options,] listener)

An easy subscription command. It works like this

```javascript
q.subscribe(function (message, headers, deliveryInfo, messageObject) {
  console.log('Got a message with routing key ' + deliveryInfo.routingKey);
});

```

It will automatically acknowledge receipt of each message.

There are several options available.  Setting the options argument to
`{ ack: true }` (which defaults to false) will make it so that the AMQP
server only delivers a single message at a time. When you want the next
message, call `q.shift()`. When `ack` is false then you will receive
messages as fast as they come in.

You can also use the prefetchCount option to increase the window of how
many messages the server will send you before you need to ack (quality of service).
`{ ack: true, prefetchCount: 1 }` is the default and will only send you one
message before you ack. Setting prefetchCount to 0 will make that window unlimited.
If this option is used `q.shift()` should not be called. Instead the listener
function should take four parameters `(message, headers, deliveryInfo, ack)` and
`ack.acknowledge()` should be called to ack a single message.

The `routingKeyInPayload` and `deliveryKeyInPayload` options determine
if the reception process will inject the routingKey and deliveryKey,
respectively, into the JSON payload received.  These default to unset
thus adopting the parent connection's values (which default to false).
Setting these to true provide backward compatibility for older
applications.

The `exclusive` option will subscribe to the queue in exclusive mode. Only one
subscriber is allowed at a time, and subsequent attempts to subscribe to the
same queue will result in an exception. This option differs from the exclusive
option passed when creating in a queue in that the queue itself is not exclusive,
only the consumers. This means that long lived durable queues can be used
as exclusive queues.

The `messageObject` can be used to acknowledge a given message using:
```javascript
messageObject.acknowledge(false); // use true if you want to acknowledge all previous messages of the queue
```
If the `consumer_cancel_notify` capability was enabled when the connection was
created, the queue will emit `basicCancel` upon receiving a consumer cancel
notification from the server.  The queue's channel will be automatically closed.
In a clustered environment, developers may want to consider automatically
re-subscribing to the queue on this event.

This method will emit `'basicQosOk'` when ready.

### queue.subscribeRaw([options,] listener)

Subscribes to a queue. The `listener` argument should be a function which
receives a message. This is a low-level interface - the message that the
listener receives will be a stream of binary data. You probably want to use
`subscribe` instead. For now this low-level interface is left undocumented.
Look at the source code if you need to do this.

This method will emit `'basicConsumeOk'` when ready.

### queue.unsubscribe(consumerTag)

Unsubscribe from a queue, given the consumer tag. The consumer tag is
supplied to the *promise callback* of `Queue.subscribeRaw` or
`Queue.subscribe`:

```javascript
connection.queue('foo', function(queue) {
  var ctag;
  queue.subscribe(function(msg) {...})
    .addCallback(function(ok) { ctag = ok.consumerTag; });
  // ... and in some other callback
  queue.unsubscribe(ctag);
});
```

Note that `Queue.unsubscribe` will not requeue messages that have not
been acknowledged. You need to close the queue or connection for that
to happen. You may also receive messages after calling `unsubscribe`;
you will **not** receive messages from the queue after the unsubscribe
promise callback has been invoked, however.

### queue.shift([reject[, requeue]])

For use with `subscribe({ack: true}, fn)`. Acknowledges the last
message if no arguments are provided or if `reject` is false. If
`reject` is true then the message will be rejected and put back onto
the queue if `requeue` is true, otherwise it will be discarded.

### queue.bind([exchange,] routing[, callback])

This method binds a queue to an exchange.  Until a queue is
bound it will not receive any messages, unless they are sent through
the unnamed exchange (see `defaultExchangeName` above).

If the `exchange` argument is left out `'amq.topic'` will be used.

This method will emit `'queueBindOk'` when complete.

If `callback` is provided it will also be triggered when complete,
note that if you perform multiple bindings, only the last callback
will be called.

### queue.unbind([exchange,] routing)

This method unbinds a queue from an exchange.

If the exchange argument is left out `'amq.topic'` will be used.

This method will emit `'queueUnbindOk'` when complete.

### queue.bind_headers([exchange,] routing)

This method binds a queue to an exchange.  Until a queue is
bound it will not receive any messages.

This method is to be used on an "headers"-type exchange. The routing
argument must contain the routing keys and the `x-match` value (`all` or `any`).

If the `exchange` argument is left out `'amq.headers'` will be used.

### queue.unbind_headers([exchange,] routing)

This method unbinds a queue from an exchange.  Whilst a queue is
bound it will continue receive messages that have matching headers.

This method is to be used on an "headers"-type exchange. The routing
argument must contain the routing keys and the `x-match` value (`all` or `any`).

If the `exchange` argument is left out `'amq.headers'` will be used.

### queue.destroy(options)

Delete the queue. Without options, the queue will be deleted even if it has
pending messages or attached consumers. If +options.ifUnused+ is true, then
the queue will only be deleted if there are no consumers. If
+options.ifEmpty+ is true, the queue will only be deleted if it has no
messages.

Note: the successful destruction of a queue will cause a consumer cancel
notification to be emitted (for clients who have enabled the
`consumer_cancel_notify` option when creating the connection).

## Exchange

Events: An exchange will call the callback given to the `connection.exchange()`
method once it is usable. For example:

```javascript
var exc = connection.exchange('my-exchange', function (exchange) {
  console.log('Exchange ' + exchange.name + ' is open');
});
```

### exchange.on('open', callback)

The open event is emitted when the exchange is declared and ready to
be used. This interface is considered deprecated.

### connection.exchange()
### connection.exchange(name, options={}, openCallback)

An exchange can be created using `connection.exchange()`. The method returns
an `amqp.Exchange` object.

Without any arguments, this method returns the default exchange.
Otherwise a string, `name`, is given as the first argument and an `options`
object for the second. The options are

- `type`: the type of exchange `'direct'`, `'fanout'`, or `'topic'` (default).
- `passive`: boolean, default false.
    If set, the server will not create the exchange.  The client can use
    this to check whether an exchange exists without modifying the server
    state.
- `durable`: boolean, default false.
    If set when creating a new exchange, the exchange will be marked as
    durable.  Durable exchanges remain active when a server restarts.
    Non-durable exchanges (transient exchanges) are purged if/when a
    server restarts.
- `autoDelete`: boolean, default true.
    If set, the exchange is deleted when there are no longer queues
    bound to it.
- `noDeclare`: boolean, default false.
    If set, the exchange will not be declared, this will allow the exchange
    to be deleted if you dont know its previous options.
- `confirm`: boolean, default false.
    If set, the exchange will be in confirm mode, and you will get a
    'ack'|'error' event emitted on a publish, or the callback on the publish
    will be called.
- `arguments`: a map of additional arguments to pass in when creating an exchange.

An exchange will emit the `'open'` event when it is finally declared.

### exchange.publish(routingKey, message, options, callback)

Publishes a message to the exchange. The `routingKey` argument is a string
which helps routing in `topic` and `direct` exchanges. The `message` can be
either a Buffer or Object. A Buffer is used for sending raw bytes; an Object
is converted to JSON.

`options` is an object with any of the following

- `mandatory`: boolean, default false.
    This flag tells the server how to react if the message cannot be
    routed to a queue.  If this flag is set, the server will return an
    unroutable message with a Return method.  If this flag is false, the
    server silently drops the message.
- `immediate`: boolean, default false.
    This flag tells the server how to react if the message cannot be
    routed to a queue consumer immediately.  If this flag is set, the
    server will return an undeliverable message with a Return method.
    If this flag is false, the server will queue the message, but with
    no guarantee that it will ever be consumed.
- `contentType`: default `'application/octet-stream'`
- `contentEncoding`: default null.
- `headers`: default `{}`. Arbitrary application-specific message headers.
- `deliveryMode`: Non-persistent (1) or persistent (2)
- `priority`: The message priority, 0 to 9.
- `correlationId`: string, default null. Application correlation identifier
- `replyTo`: Usually used to name a reply queue for a request message.
- `expiration`: default null. Message expiration specification
- `messageId`: default null. Application message identifier
- `timestamp`: default null. Message timestamp
- `type`: default null. Message type name
- `userId`: default null. Creating user id
- `appId`: default null. Creating application id

`callback` is a function that will get called if the exchange is in confirm mode,
the value sent will be true or false, this is the presense of a error so true, means
an error occured and false, means the publish was successfull

### exchange.destroy(ifUnused = true)

Deletes an exchange.
If the optional boolean second argument is set, the server will only
delete the exchange if it has no queue bindings. If the exchange has queue
bindings the server does not delete it but raises a channel exception
instead.

### exchange.bind(srcExchange, routingKey [, callback])

Binds the exchange (destination) to the given source exchange (srcExchange).
When one exchange is bound to another, the destination (or receiving) exchange
will receive all messages published to the source exchange that match the
given routingKey.

This method will emit `'exchangeBindOk'` when complete.

Please note that Exchange to Exchange Bindings (E2E) are an extension to the
AMQP spec introduced by RabbitMQ, and that by using this feature, you will be
reliant on RabbitMQ's AMQP implementation. For more information on E2E
Bindings with RabbitMQ see:

http://www.rabbitmq.com/e2e.html

### exchange.unbind(srcExchange, routingKey [, callback])

Unbinds the exchange (destination) from the given source exchange (srcExchange).
This is the reverse of the exchange.bind method above, and will stop messages
from srcExchange/routingKey from being sent to the destination exchange.

This method will emit `'exchangeUnbindOk'` when complete.

### exchange.bind_headers(exchange, routing [, bindCallback])

This method is to be used on an "headers"-type exchange. The routing
argument must contain the routing keys and the `x-match` value (`all` or `any`).

repository: neurom-iot/naide

repo_name: neurom-iot/naide


text:
#Simple To Do List

![Demo](demo.gif)

## About

	A simple database driven to do list with Bootstrap front-end created using PHP, MySQL, JavaScript and jQuery.

## Features

	Any changes shown directly on page without reloading.

repository: ykoziy/small-projects

repo_name: ykoziy/small-projects


text:
static_transform_manager
========================

This provides a transformation manager node that broadcasts static transformations at 30Hz, in the same way that static transformations can
be created using static_tf_broadcaster. Using this node static transformations can be easier setup and removed than managing a static_tf_broadcasters as sub processes.

### Usage

```
rosrun static_transform_manager static_tf_services.py
```

will start the manager node. This provides two services:

- /static_transforms_manager/set_tf
- /static_transforms_manager/stop_tf

`set_tf` takes a single argument `geometry_msgs/TransformStamped transform`,
and returns a debug string `response` and a bool `success`. The supplied transform is broadcast at 30Hz.

`stop_tf` takes a single argument `string child_frame_id` which is the child frame to stop broadcasting.

### Example

`rosrun static_transform_manager rviz_click_to_tf.py` will listen to points clicked in rviz and turn them into a transformation in the TF tree.

branch_name: refs/heads/indigo-devel


text:
# Mafia: MI6 VS The Twelve V2

**Who will survive? MI6 or The Twelve ?!**

Play against other members to find out who amongst each other you can trust and who will betray you. Adapted from the card game *Mafia* played in 3x05. Only the stealthy and cunning will survive.

**Objective:** Eliminate as many of the opposing team as possible. The team with more survivors wins.

**How To Play**

*It is not recommended to play on mobile web. Please use Reddit Desktop, official Reddit App, or third party client that supports live chat.*

1. Each user is assigned to either MI6 or the Twelve.
2. You must investigate each other to determine who is on what side and eliminate the opponent.
3. Decipher and decrypt the clues provided in order to advance your rank and unlock more powerful investigation tools.
4. Vote out players who you suspect are the enemy. A player must receive a certain number of hits in order to be killed. After a certain amount of time, the number of votes required will be lowered to 1. Votes, aka hits, only last per round.
4. At the end of each round, an announcement will be made how many people are alive how many were killed.
5. You must choose your allies carefully to seek out the enemy.

**Tips:**

- This is a passive game, you are not required to be on actively. However, users who are inactive for more than 48 hours will be kicked.
- It is recommended that you use Reddit Desktop Redesign, official Reddit apps, or third party app client that supports Reddit's Live Chat feature.
- You do not need to make a new PM for each command. Simply reply to any existing PM from the bot.
- Working in pairs is the ultimate way to win! But who can you trust?
- Use the !digup command multiple times on the same user to get a better picture of their role.
- If you are not able to use a command because you are getting a comment participation message, use a different command, such as !stats, to refresh the database so that it pulls the latest information. Note: It may take Reddit up to 30 seconds to update its comments.

**Roles**

|Team|Role|Tier|Description|
|:-|:-|:-|:-|
|The Twelve|Trainee|1|Access to digup (low accuracy) and max 3 requests.|
|The Twelve|Assassin|2|Vote unlocked, Digup accuracy increased.|
|The Twelve|Handler|3|Digup accuracy increased. Unlocked locate and burn command (Tier 3 or lower). 3 Additional requests. Can escape hits.|
|The Twelve|Keeper|4|Revive and convert unlocked. Burn does not announce who you are.|
|MI6|Recruit|1|Access to digup (low accuracy) and max 3 requests.|
|MI6|Analyst|2|Vote unlocked, Digup accuracy increased.|
|MI6|Operative|3|Digup accuracy increased. Unlocked locate and burn command (Tier 3 or lower). 3 Additional requests. Can escape hits.|
|MI6|Supervisor|4|Revive and convert unlocked. Burn does not announce who you are.|

**Commands**

All commands must be sent privately to u/DozenIncBOT. To use investigative commands, use must comment at least once per round to avoid being kicked for inactivity.

|Command|Description|Unlock Tier|
|:-|:-|:-|
|!join|Join the game. Note: You cannot rejoin once the game has started.|1|
|!leave|Leave the game.|1|
|!list|Shows dead and alive players.|1|
|!request USERNAME|Ask for intel anonymously on a player. Limited number of uses.|1|
|!burn|Exposes one of your team members for guaranteed intelligence about the other team. Can only be used once.|3|
|!revive USERNAME|Brings back a player from the dead. Can only be used once|4|
|!vote USERNAME|Vote on who to eliminate. Can not be changed once voted per round.|2|
|!digup USERNAME|Investigate the roles of other users. Has varying degree of reliability based on your tier|1|
|!locate USERNAME|Shows the user's location. May give a clue as to what side they are on.|3|
|!convert USERNAME|Invite a user to switch to your team.|4|
|!accept|Accept an invitation to switch teams.|1|
|!unlock CODE|Enter a secret code in order to level up to the next tier.|1|
|!stats|Gets the current stats for the game.|1|
|!help|Shows all commands available.|1|
|!rules|Shows the rules.|1|

**Flairs**

|Flair|Description|
|:-|:-|
|Mafia: Alive|You are still alive and can participate.|
|Mafia: Killed|You have been eliminated and are now a spectator.|

repository: mikojimnz/MafiaBot

repo_name: mikojimnz/MafiaBot


text:
###atom-package-dependencies

Allows Atom package developers to enforce dependence on other Atom packages, similar to dependence on Node packages.

Include other Atom packages that you want to be installed when making your package.

###Usage

####Depending on other packages

1. In the root-level `package.json`, include `"atom-package-dependencies": "latest"`

2. Include an object `"package-dependencies"` and list the Atom packages your package depends on by name. Note that versioning is not yet supported, so if any version is installed, this is satisfied.

3. Run the `install` function from within your package to force update (see example below).

####Requiring other packages

Use the `apd.require` function to access commands from other packages.

```js
var apd = require('atom-package-dependencies');

var mdp = apd.require('markdown-preview');
mdp.toggle();
```

###Examples

Example excerpt of `package.json`:

```json
...

"dependencies": {
  "atom-package-dependencies": "latest"
},

"package-dependencies": {
  "merge-conflicts": "//version specification coming soon",
  "color-picker": "//this field will be ignored right now"
}

...
```
<br>Javascript example of forcing package installation:

```js
var apd = require('atom-package-dependencies');
apd.install();
```

###Notes

- This will install the listed Atom packages in the `.../.atom/packages/` directory. This means the packages are actually installed in the end-user's Atom like normal, rather than in a `node_modules` folder inside your package, and again in someone else's package.

- This project is in active development and will likely be superseded by something built into Atom in the future. The purpose is simply to give package developers an easy way to ensure that other packages are installed.