text:
# Controls

Ember foxy forms comes packed with support with the default set of html5 controls, as well as a few 'emberized' ones that
make interacting with ember-data / ember-objects a little more straight forward. They can be selected using the 'using'
attribute. If you provide no ```@using``` or ```@control``` attribute the form will default to using the text type.

## Text Input Variants

{{#docs-demo as |demo|}}
  {{#demo.example name="text-input.hbs"}}
    <Form @for={{this.model}} as |form|>
      <form.field @for="string" @using="input" @label="Text" />
      <form.field @for="string" @using="password" @label="Password" />
      <form.field @for="password" @using="input" @label="Password" />
      <form.field @for="email" @using="email" @label="Email" />
      <form.field @for="url" @using="url" @label="Url" />
      <form.field @for="tel" @using="tel" @label="Telephone" />
      <form.field @for="search" @using="search" @label="Search" />
      <form.field @for="number" @using="number" @label="Number" />
    </Form>
  {{/demo.example}}
  {{demo.snippet "text-input.hbs"}}
{{/docs-demo}}

## Textarea

{{#docs-demo as |demo|}}
  {{#demo.example name="textarea-control.hbs"}}
      <Form @for={{this.model}} as |form|>
        <form.field @for="text" @using="textarea" />
      </Form>
  {{/demo.example}}
  {{demo.snippet "textarea-control.hbs"}}
{{/docs-demo}}

## Range Slider

{{#docs-demo as |demo|}}
  {{#demo.example name="range-control.hbs"}}
      <Form @for={{this.model}} as |form|>
        <form.field @for="number" @using="range" />
      </Form>
  {{/demo.example}}
  {{demo.snippet "range-control.hbs"}}
{{/docs-demo}}

## Color Selector

{{#docs-demo as |demo|}}
  {{#demo.example name="color-control.hbs"}}
      <Form @for={{this.model}} as |form|>
        <form.field @for="color" @using="color" />
      </Form>
  {{/demo.example}}
  {{demo.snippet "color-control.hbs"}}
{{/docs-demo}}

## Date & Time Selector

{{#docs-demo as |demo|}}
  {{#demo.example name="date-time-control.hbs"}}
      <Form @for={{this.model}} as |form|>
        <form.field @for="date" @using="date" @label="Date" />
        <form.field @for="time" @using="time" @label="Time" />
        <form.field @for="datetime" @using="datetime" @label="Datetime" />
      </Form>
  {{/demo.example}}
  {{demo.snippet "date-time-control.hbs"}}
{{/docs-demo}}

## Checkbox

A checkbox can take an optional label attribute.

{{#docs-demo as |demo|}}
  {{#demo.example name="checkbox-control.hbs"}}
      <Form @for={{this.model}} as |form|>
        <form.field @for="boolean" @using="checkbox" @label="Boolean" as |ff|>
          <ff.control @label="Checkbox Label" />
        </form.field>
      </Form>
  {{/demo.example}}
  {{demo.snippet "checkbox-control.hbs"}}
{{/docs-demo}}

## Select

FoxyForms comes with two select controls out of the box that work with both primitive arrays (numbers and strings) or
ember objects. When working with objects you can specify an identifier key `@idKey` and a label key `@labelKey`
these will be used to identify your object and to label the drop down.
Also you can disable an option by setting `disabled: true` in your value object in values array.

{{#docs-demo as |demo|}}
  {{#demo.example name="select-control.hbs"}}
      <Form @for={{this.model}} as |form|>
        <form.field
          @for="objectSelect"
          @using="select"
          @label="Object Select"
          @values="1:one,2:two,3:three"
         />
        <form.field
          @for="objectSelecttWithDisabledOption"
          @using="select"
          @label="Object Select With Disabled Option"
          @values={{this.valuesForSelectObjectWithDisabledOption}} {{!-- [{ id: '1', label: 'one' }, { id: '2', label: 'two', disabled: true }, { id: '3', label: 'three' }] --}}
         />
        <form.field
          @for="primitiveSelect"
          @using="select"
          @label="Primitive Select"
          @values="1,2,3"
         />
        <form.field
          @for="objectCheckboxSelect"
          @using="checkbox-select"
          @label="Object Select"
          @values="1:one,2:two,3:three"
         />
        <form.field
          @for="objectCheckboxSelect"
          @using="checkbox-select"
          @label="Object Select With Custom Label"
          @values="1:one,2:two,3:three"
          as |ff|
         >
          <ff.control as |value id|>

              Custom Checkbox Select: {{value.label}}

          </ff.control>
        </form.field>
        <form.field
          @for="primitiveCheckboxSelect"
          @using="checkbox-select"
          @label="Primitive Select"
          @values="1,2,3"
         />
        <form.field
          @for="radio"
          @using="radio"
          @label="Radio Control"
          @values="1:One,2:Two,3:Three"
         />
        <form.field
          @for="radioCustom"
          @using="radio"
          @label="Custom Radio Control Label"
          @values="1:One,2:Two,3:Three"
          as |ff|
          >
          <ff.control @noneText="None" as |value id|>

              Custom RadioSelect: {{value.label}}

          </ff.control>
        </form.field>
      </Form>
  {{/demo.example}}
  {{demo.snippet "select-control.hbs"}}
{{/docs-demo}}

## Custom Controls

You can extend form for to provide custom controls, your component must simply conform to the control interface:

A form control is any component which implements the following interface.

{{#docs-snippet name="custom-controls.js"}}
  interface FormControl {
    // current value of the control
    value: any;
    // optional list of values to select from (handy for buidling selects)
    values: array;
    // passed in by the field layer to identify your control
    controlId: string;
    // optional placeholder text
    placeholder: string;
    // whether or not this control is disabled
    disabled: boolean;
    // whether or not this control is readonly
    readonly: boolean;
    // callback function when the values controlled by this control is changed
    onChange(){};
  }
{{/docs-snippet}}

If you follow this convention values will be seamlessly managed by the field / form layers. Some examples of custom controls
we have built are:

- Image Select Control
- Map Editor Control
- Price Range Select
- Rich Text editor
- JSON editor

By default Foxy Forms looks for your custom controls in the component directory form-controls of your application,
but you can also specify the full path to the control.

{{#docs-demo as |demo|}}
  {{#demo.example name="custom-controls-usage.hbs"}}
      <Form @for={{this.object}} as |form|>
        <form.field @for="number" @using="custom" />
        <form.field @for="number" @control="form-controls/ff-custom" />
      </Form>
  {{/demo.example}}
  {{demo.snippet "custom-controls-usage.hbs"}}
{{/docs-demo}}

## Control Paths and Prefixes

TODO:

repository: Foodee/ember-foxy-forms

repo_name: Foodee/ember-foxy-forms


text:
# Discord Webhook

## Installation
```
composer require florianrambur/discord-webhook
```

## Usage
Here is a simple example
```php
<?php

use FlorianRambur\DiscordWebhook\Client;

$config = [
    'url' => 'https://your-discord-webhook-url',
    'author' => [
        'username' => 'Florian',
        'avatar_url' => 'https://i.imgur.com/ZGPxFN2.jpg',
    ],
];

$client = new Client($config);

$response = $client->send([
    'content' => 'This is the main content',
]);
```
![Simple Example](https://i.ibb.co/f9ycPF9/simple-example.png)

## Work with Embed
This package give you the opportunity to work with a simple `Embed` class that allow you to create an advanced message. To do that, you can pass data into the constructor or use some methods like `name($value)`
```php
<?php

$embed = (new Embed())
    ->add(new Author([
        'name' => 'This is the author',
        'url' => 'https://github.com/florianrambur/discord-webhook',
        'icon_url' => 'https://github.com/florianrambur/discord-webhook/icon.jpg',
    ]))
    ->add(new Body([
        'title' => 'Webhook Title',
        'description' => 'Webhook Description',
        'color' => 5814783,
    ]))
    ->add(new Images([
        'images' => ['https://i.imgur.com/ZGPxFN2.jpg'],
    ]))
    ->add(new Footer([
        'text' => 'This is the footer',
        'timestamp' => '2021-07-06T22:00:00.000Z',
    ]));
```

```php
<?php

$author = (new Author())
    ->name('This is the author')
    ->url('https://github.com/florianrambur/discord-webhook')
    ->iconUrl('https://github.com/florianrambur/discord-webhook/icon.jpg');

$body = (new Body())
    ->title('Webhook Title')
    ->description('Webhook Description')
    ->color(5814783);

$image = (new Image())->image('https://i.imgur.com/ZGPxFN2.jpg');

$footer = (new Footer())
    ->text('This is the footer')
    ->timestamp('2021-07-06T22:00:00.000Z');

$embed = (new Embed())->addMany([$author, $body, $image, $footer]);
```
The `Embed` provides two methods to add an attribute class
```php
<?php

(new Embed())
    ->add($body)
    ->add($footer);

(new Embed())->addMany([$body, $footer]);
```

Then, pass your data and your config to the `Client` class
```php
<?php

$config = [
    'url' => 'https://your-discord-webhook-url',
    'author' => [
        'username' => 'Florian',
        'avatar_url' => 'https://i.imgur.com/ZGPxFN2.jpg',
    ],
];

$client = new Client($config);

$response = $client->send([
    'embeds' => [
        $embed->toArray(),
    ],
]);
```
![Embed Example](https://i.ibb.co/dkPYbKG/embed-example.png)

## What's next
This package is under development and few things are missing :
- constraints on attributes (e.g check if every fields are ok)
- few templates will be created to give you the possibility to create a message easier and faster

license: MIT

repository: DeGraciaMathieu/discord-webhook

branch_name: refs/heads/main

extension: md

gha_license_id: MIT

license_type: permissive

repo_name: DeGraciaMathieu/discord-webhook


text:
---
title: The port opens to ship
tags:
  - Feb 1926
---

The port opens to ship traffic. [Photo on page 6B.]

Newspapers: **Miami Morning News or The Miami Herald**

Page: **2**, Section: **A**

branch_name: refs/heads/master


text:
# Advanced Interface Features

There's more to cover on the [Interface](https://gradio.app/docs#interface) class. This guide covers all the advanced features: Using [Interpretation](https://gradio.app/docs#interpretation), custom styling, loading from the [Hugging Face Hub](https://hf.co), and using [Parallel](https://gradio.app/docs#parallel) and [Series](https://gradio.app/docs#series).

## Interpreting your Predictions

Most models are black boxes such that the internal logic of the function is hidden from the end user. To encourage transparency, we've made it very easy to add interpretation to your model by simply setting the `interpretation` keyword in the `Interface` class to `default`. This allows your users to understand what parts of the input are responsible for the output. Take a look at the simple interface below which shows an image classifier that also includes interpretation:

$code_image_classifier_interpretation

In addition to `default`, Gradio also includes [Shapley-based interpretation](https://christophm.github.io/interpretable-ml-book/shap.html), which provides more accurate interpretations, albeit usually with a slower runtime. To use this, simply set the `interpretation` parameter to `"shap"` (note: also make sure the python package `shap` is installed). Optionally, you can modify the `num_shap` parameter, which controls the tradeoff between accuracy and runtime (increasing this value generally increases accuracy). Here is an example:

```python
gr.Interface(fn=classify_image,
            inputs=image,
            outputs=label,
            interpretation="shap",
            num_shap=5).launch()
```

This will work for any function, even if internally, the model is a complex neural network or some other black box. If you use Gradio's `default` or `shap` interpretation, the output component must be a `Label`. All common input components are supported. Here is an example with text input.

$code_gender_sentence_default_interpretation

So what is happening under the hood? With these interpretation methods, Gradio runs the prediction multiple times with modified versions of the input. Based on the results, you'll see that the interface automatically highlights the parts of the text (or image, etc.) that contributed increased the likelihood of the class as red. The intensity of color corresponds to the importance of that part of the input. The parts that decrease the class confidence are highlighted blue.

You can also write your own interpretation function. The demo below adds custom interpretation to the previous demo. This function will take the same inputs as the main wrapped function. The output of this interpretation function will be used to highlight the input of each input component - therefore the function must return a list where the number of elements corresponds to the number of input components. To see the format for interpretation for each input component, check the Docs.

$code_gender_sentence_custom_interpretation

Learn more about Interpretation in the [docs](https://gradio.app/docs#interpretation).

## Custom Styling

If you'd like to have more fine-grained control over any aspect of your demo, you can also write your own css or pass in a filepath to a css file, with the `css` parameter of the `Interface` class.

```python
gr.Interface(..., css="body {background-color: red}")
```

If you'd like to reference external files in your css, preface the file path (which can be a relative or absolute path) with `"file="`, for example:

```python
gr.Interface(..., css="body {background-image: url('file=clouds.jpg')}")
```

**Warning**: Custom CSS is _not_ guaranteed to work across Gradio versions as the Gradio HTML DOM may change. We recommend using custom CSS sparingly and instead using [Themes](/guides/theming-guide/) whenever possible.

## Loading Hugging Face Models and Spaces

Gradio integrates nicely with the [Hugging Face Hub](https://hf.co), allowing you to load models and Spaces with just one line of code. To use this, simply use the `load()` method in the `Interface` class. So:

- To load any model from the Hugging Face Hub and create an interface around it, you pass `"model/"` or `"huggingface/"` followed by the model name, like these examples:

```python
gr.Interface.load("huggingface/gpt2").launch();
```

```python
gr.Interface.load("huggingface/EleutherAI/gpt-j-6B",
    inputs=gr.Textbox(lines=5, label="Input Text")  # customizes the input component
).launch()
```

- To load any Space from the Hugging Face Hub and recreate it locally (so that you can customize the inputs and outputs for example), you pass `"spaces/"` followed by the model name:

```python
gr.Interface.load("spaces/eugenesiow/remove-bg",
                  inputs="webcam",
                  title="Remove your webcam background!").launch()
```

One of the great things about loading Hugging Face models or spaces using Gradio is that you can then immediately use the resulting `Interface` object just like function in your Python code (this works for every type of model/space: text, images, audio, video, and even multimodal models):

```python
io = gr.Interface.load("models/EleutherAI/gpt-neo-2.7B")
io("It was the best of times")  # outputs model completion
```

## Putting Interfaces in Parallel and Series

Gradio also lets you mix interfaces very easily using the `gradio.Parallel` and `gradio.Series` classes. `Parallel` lets you put two similar models (if they have the same input type) in parallel to compare model predictions:

```python
generator1 = gr.Interface.load("huggingface/gpt2")
generator2 = gr.Interface.load("huggingface/EleutherAI/gpt-neo-2.7B")
generator3 = gr.Interface.load("huggingface/EleutherAI/gpt-j-6B")

gr.Parallel(generator1, generator2, generator3).launch()
```

`Series` lets you put models and spaces in series, piping the output of one model into the input of the next model.

```python
generator = gr.Interface.load("huggingface/gpt2")
translator = gr.Interface.load("huggingface/t5-small")

gr.Series(generator, translator).launch()
# this demo generates text, then translates it to German, and outputs the final result.
```

And of course, you can also mix `Parallel` and `Series` together whenever that makes sense!

Learn more about Parallel and Series in the [docs](https://gradio.app/docs#parallel).

repository: gradio-app/gradio

gha_language: Python

repo_name: gradio-app/gradio


text:
constexpr_hash_map
===============
# please make sure you compile this code with the latest GCC
Constexpr hash map, generates a constant KV hash map at compile time.

This is part of the bigger project that I am working on, called Basic Model
View Controller, an HMVC strutured web framework based on Node.js.

The objective for this project is to move the construction time of a hashmap
to run-time, at the cost of compile time. The code uses a lot of template
programming as well as lots of c++11 features such as constant expression,
decltype, variadic template.

This code is inspired by D.Abraham and partly based on his github gist.
Please visit https://gist.github.com/1457531

I was considering to build a const hashmap until I came across constexpr, which
enables things to be evaluated at compile time, so the hash map will be copied
into memory while the program is initialized, minimizing the overhead for
hash_map creation. This is useful also for rtti system solution if one does
not desire QObject that comes with a rather large overhead which aims to solve
a lot of problems

=============

MIT License

Copyright (c) 2016 Yufei (Benny) Chen

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


text:
### Analysis
As seen in fligures below for temperature and precipitation. As Hawaii has temp same whole year so its hard to point out difference
* Number of data points are more in June than December.
* Mean temperature/precipitaition for all the years from 2010 to 2017 is almost same for both December and June.
* Maximum frequency of temperature is for both month of December and June is between 70-75 degrees.


text:
---
layout: post
title:      "That's a Wrap!"
date:       2021-03-07 20:39:15 +0000
permalink:  thats_a_wrap
---

I feel like I'm throwing out a rubik's cube here. I've been puzzling over how to write a forecast function for my multivariate model, and I'm afraid that at this point, it's time to step away and wrap this particular page up. The frustrating part is that I can't escape the feeling that I'm one turn away from solving rubik's cube. Alas, let me share the journey I went on.
I began by reviewing my predict_ values() function:
```
def predict_values(training_data, output):
  ''' A function that takes in training data and uses a tuned LSTM neural
  network to recursively predict data for a given number of steps.

  Inputs: training_data: The last 5 points of the models training set
    output: user provided dataframe formatted with a desired time period to be predicted
    as a pd.TimeStamp
  Returns: The output parameter with a scaled prediction and unscaled prediction column
  appended'''

  predictions = []
  predictions.append(training_data)
  x_array = np.array(predictions)
  #ammend function to intake number of input variables
  x_array = x_array.reshape(1, 5, 1)
#Generate predictions
  model = model_5
  for n in range(len(output)):
    pred = model.predict(x_array)
    x_array = np.append(x_array, pred)
    predictions.append(pred)

    x_array = x_array[-5:].reshape(1, 5, 1)

#Add predictions to output df, unlist the values
  predictions = predictions[1:]
  pred_list = []
  for n in range(len(output)):
    pred_list.append(predictions[n].tolist())

  unlisted = []
  for n in range(len(pred_list)):
    var = pred_list[n]
    var = var[0]
    unlisted.append(var)

  output['Scaled Prediction'] = unlisted

#Unscale predicted value
  unlisted_array = np.array(unlisted)
  unlisted_array = unlisted_array.reshape(-1, 1)
  output['Predicted Value'] = scaler.inverse_transform(unlisted_array)

  return output
```
The first and most obvious issue is the training_data input. In a univariate model, this is just the last 5 data points in the training set. However, I could not use this for the multivariate, because the last 5 would have been made of 1 target value, and 4 variable values for the same row.

I attempted to solve this by created a dataframe train_df, that contained a row for each data point: 1 target, and 10 variables. I created predict_array (which would later become training_data), by calling the last 5 rows of train_df.
```
	predict_array = train_df[-5:].values
```

I realized that my data was still mismatched though- each row in train_df was still taking the 5 lags into account. The problem was becoming overwhelming in a hurry. I decided that in the interest of getting a working function, I would use a single lag and investigate the difference in MSE. With 5 lags, MSE was 67.19 and with one lag it went up to 94.68. This difference feels significant, but keep in mind that the MSE for the univariate models was in the hundreds. I decided to keep trying to write a forecast function.

Once again, I used my predict_array, but reshaped it to be three dimensional, per the input shape of the multivariate model. My final shape used was (1, 5, 10). The target column was not needed, because the model.predict() function is predicting the target.

Finally, I was able to generate a prediction! However, my final realization occured. The predict() function is only going to predict one value- the target. This is what I want, except that in order to make recursive predictions, I need the 10 variable values to go with that row, in order to use 10 variables to predict the next target, and so on.

So this is where I'm calling it. I believe that it is technically possible- it would just involve reworking the data to make each variable the target value in turn. There comes a time when you have to wonder if you are doing something because it is worth it, or if you are doing it just to check a box and say you did. Maybe I will come back to it when I have more experience, time and resources. But for now, I think I have accomplished what I set out to do.

Next week, expect a high level overview, along with a link to a YouTube video where I will present my findings. If anyone has advice or suggestions, I'd love to hear them! Even though I feel a little frustrated with the way this is ending, I've still enjoyed this further exploration, and I can't wait to hear feedback and hope that somebody may find this as exciting as I do. Until next Sunday!

extension: markdown


text:
# standup-summary

You know the awesome [git-standup](https://github.com/kamranahmedse/git-standup) right? That is heart of this gem.
Standup-Summary pulls all your nested git-standups from directory of choice (eg. work in my case) and shows you number of your commits in given time span and percentage of commits per directory.

## Installation

Just install gem to your global ruby version.

    $ gem install standup-summary

## Usage
Use `standup` in your command line with these options:

| Option      |                             Description                            |
|-------------|:------------------------------------------------------------------:|
| -p, --path  | Sets path to execute git-standup from, relative to your $HOME path |
| -t, --today | Use commits from today                                             |
| -w, --week  | Use commits from this week                                         |
| -m, --month | Use commits from this month                                        |
| -f, --diff  | Analyze diffs instead of commits                                   |
| -r, --recursive  | When using -f go through folders recursively, use -l option to set limit|
| -l, --limit LIMIT| Set limit for options -r -f, defaults to 3|

## Development

After checking out the repo, run `bin/setup` to install dependencies.

To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).

## Todo

- [x] add option to analyze diffs
  - [ ] figure out way to combine instertions/deletions/changes scores
- [ ] support for ruby controll

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/podruh/standup_summary. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.

## License

The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).

## Code of Conduct

Everyone interacting in the StandupSummary project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/podruh/standup_summary/blob/master/CODE_OF_CONDUCT.md).

repository: podruh/standup-summary

gha_language: Ruby

repo_name: podruh/standup-summary


text:
# Udacity_Project1

Data visualization to understand of coding during youth in order to success in tech field

## Motivation

A typical confusion about developers is that they’ve all been programming since youth. I want to see if it is true using data.

## Technology used

* [Stack Overflow Annual Developer Survey](https://insights.stackoverflow.com/survey) - The data set used
* [Python Pandas library](https://pandas.pydata.org)
* [Python Numpy library](https://numpy.org)

## Summary

- There is little to no gap between developers who program since your with those who break into the field
- The average time spent to learn before getting a professional job is increasing

## What's included

```
* source.ipynb - the main file in which all the calculation is done
```

## CRISP-DM

```
  * Business Understanding: Find out the relationship between salary and years of coding prior to developers' first jobs.
  * Data Understanding: Stack Overflow Annual survey: the annual survey for developers with over 150 questions about every thing: their preferred language, salary, age, etc...
  * Data Preparation: In this project, I drop all the rows with NaN values in these columns: "Salary", "YearsProgram", "YearsCodedJob"
  * Modeling: plot chart to understand the trend and relationship between developers and their experience
  * Evaluation: You can read about it in my blog post

```

## Question answered

```
  1) What is the distribution of the years of learning to code before first professional(YearsProgramPrior) jobs among developers
  2) What is the avarage salary and career satisfaction among these developers group by YearsProgramPrior
  3) What is the trend of YearsProgramPrior
```
## Blog post

* [link to my Medium blog post](https://medium.com/@phanchithanh091/this-is-why-you-can-start-your-career-as-a-programmer-right-now-4eb2076cdd79)


text:
# Template for a Web Components project

## Installation

This project template uses Yarn 2 in [Zero-Installs](https://yarnpkg.com/features/zero-installs)
mode, so there is no initial installation required aside from cloning or forking the repo - just run
`yarn start` to spin up the Hello World app.

Note that when you change the package name to begin your own coding project, you will need to
`yarn install` to have that name change reflected in the yarn lockfile, otherwise you'll get an
error on `yarn start`. However, committing the resulting changes will then mean that others
cloning and running your app will not need to `yarn install`.

You can opt out of Zero-Installs if you wish; see the above link for more info. You will need to
modify the `.gitignore` as well. You can also revert to Yarn 1 if you wish, although Yarn wouldn't
recommend that :)

## Run (developer mode)

* `yarn start`
* visit `http://localhost:8080`

## Build and Run (production mode)

* `yarn build`
* `yarn dlx serve dist`
* visit `http://localhost:5000`

## Further thoughts
I have included a literal "template" tag for generating and cloning a template element, to remove
some common boilerplate code. However, there is far more that could be done. Repetitive boilerplate
for creating Custom Elements and configuring their behaviour can be avoided by using a third-party
library. Popular examples include:

### [LitElement](https://lit-element.polymer-project.org/)

LitElement is a class-based library for Custom Elements. It provides its own custom attribute syntax
for binding event handlers and values to a Custom Element and its attributes, and it also has a
number of rules and configuration settings for property-attribute binding and when updates occur.
All of which basically makes LitElement _yet another framework_ .... Yikes!

### [Hybrids](https://github.com/hybridsjs/hybrids)

In contrast to most other Custom Element helper libraries, Hybrids takes a _functional_ approach to
defining Custom Elements. Again there's a new API to learn, but it's not too arduous. Unlike other
libraries, Hybrids recommends only using html attributes for static, initialization-time config
values, and to use property setters/getters for everything else; this avoids any overhead in
converting objects to/from JSON strings.

license: Unlicense

repository: chriswilty/web-components-template

repo_name: chriswilty/web-components-template


text:
# Wraith Error Report Template

Below is the template for an error report for any Wraith tools. You `MUST` use this format exactly and fill it out to the `best of your ability`.

> **WARNING:** Failure to do so will result in your report being deleted and constant failures will result in a block from submission.

## Wraith Error Report

- [ ] I have an official copy of the game on Steam (Or other game distribution platforms).
- [ ] My copy of the game is up-to-date.
- [ ] If importing an animation, you verified that your SEAnim plugin is `up-to-date`.
- [ ] I am running the latest version of `<INSERT TOOL NAME HERE>` available at the current time.
- [ ] The tool has already been updated to support the `latest` update of the game.
- I am submitting this error because: `<Wraith crashed>` or `<An export failed or you believe is incorrect>` (Pick one)
- The `FULL` asset name you believe is causing this issue, if you used export all, find the asset which caused it to crash.
- Describe the exact steps you take to reproduce this error (Including the formats used to export).
- List your OS Version, and Anti-Virus installed (If any).

repository: dtzxporter/ModmeWiki

gha_language: Lua

repo_name: dtzxporter/ModmeWiki


text:
# Warfork Version Manager

Simple way to install any version of Warfork FPS on your Linux machine. Use it
to play any version of the game with different profiles, or to run multiple
isolated servers with different configs!

## Installation

Create a directory, where all your warfork installations will be contained:

```
mkdir warfork
cd warfork
```

Download the script using either `curl` or `wget`:

```
curl -o wvm.sh https://raw.githubusercontent.com/Warfork/wvm/master/wvm.sh
wget -O wvm.sh https://raw.githubusercontent.com/Warfork/wvm/master/wvm.sh
```

Source the script and install the latest Warfork version:

```
source wvm.sh
wvm init
wvm install latest
```

And you're done!

You can add the line `source <path_to>/wvm.sh` to your `~/.bashrc`, so
it injects `wvm` into your bash session every time you open the console!

## Usage

```
Warfork Version Manager

Usage:
    wvm help          Show this help message
    wvm init          Initialize this folder to use with wvm
    wvm list          List installed versions
    wvm list remote   List remote versions available to install
    wvm install       Download and install a version of Warfork
    wvm current       Show current version of Warfork
    wvm use           Set current version of Warfork
    wvm run           Run Warfork
    wvm profile       Show profiles or switch a profile
    wvm server        Start/stop a Warfork server

Example:
    wvm install latest
    wvm profile foo
    wvm run

Server example:
    wvm install latest
    wvm server init foo (then edit server.cfg)
    wvm server start foo
    wvm server list
    wvm server stop foo
```

repository: Warfork/wvm

repo_name: Warfork/wvm


text:
# Mycena picta (Fr.) Harmaja, 1979 SPECIES

#### Status
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Karstenia 19: 52 (1979)

#### Original name
Agaricus pictus Fr., 1815

### Remarks
null

repository: mdoering/backbone

path: /life/Fungi/Basidiomycota/Agaricomycetes/Agaricales/Mycenaceae/Xeromphalina/Xeromphalina picta/ Syn. Mycena picta/README.md

repo_name: mdoering/backbone


text:
noflo-prompts
=============

Prompt components for noflo ( browser ).
As you may know they are all blocking until the user interacts with the dialog, so keep that in mind.
The motivation for this component pack is to lower the barrier of tinkering in noflo-ui.

Components:

Alert
------
Displays an alert.
Makes one alert per text packet from IN.
Sends true from OUT after 'OK'.

Confirm
-------
Displays a confirmation.

Makes one Confirmation per text packet from IN.
Sends true or false depending on 'OK' or 'Cancel' from OUT.

Prompt
-------
Displays a text prompt.

Makes one Prompt per text packet from IN.
Sends entered text from OUT.

Copyright 2014 Alfredo Consebola.

gha_language: CoffeeScript


text:
##Core APIs
The IWC Bus defaults to having the following 4 APIs:

 * [Data API](data/overview.md):
A simple key/value JSON store for sharing common resources amongst applications. Creating, updating, and deleting Data
API resources persists to the Data APIs endpoint.

 * [Intents API](intents/overview.md):
Handling for application intents. Follows the idea of android intents. Allows applications to register to handle
certain intents (ex. graphing data, displaying HTML). Like android, the IWC Intents api presents the user with a
dialog to choose what application should handle their request.

 * [Names API](names/overview.md):
Status of the bus. This api exposes information regarding applications connected to the bus. This is a read-only API.

 * [System API](system/overview.md):
Application registrations of the bus. This api gives connections to the bus awareness of what applications the bus
has knowledge of. Different then the names api, these application's are not the current running applications, rather
these are registrations of where applications are hosted and default configurations for launching them. This gives
IWC clients the capability to launch other applications. This is a read-only API.

repository: TensorWrench/ozp-demo

repo_name: TensorWrench/ozp-demo


text:
![GitHub license](https://img.shields.io/github/license/mashape/apistatus.svg?style=flat-square)
![GitHub license](https://img.shields.io/badge/state-experimental-red.svg?style=flat-square)
[![GitHub license](https://img.shields.io/badge/feedback-welcome-brightgreen.svg?style=flat-square)](https://github.com/sbruggmann/WebExcess.Neos.Backup/issues)

# WebExcess.Neos.Backup

**Neos CMS Module for the incremental & encrypted Backup Package WebExcess.Flow.Backup**

Note: This package is still experimental and not for production. I'm happy about every inputs!

![Neos CMS Backup Module](/Documentation/Images/Screenshot-01.png?raw=true "Neos CMS Backup Module")

Important
---------

**Test it tough!** And test it on the stage of your final environment.

The backup files are encrypted. If you lose the keyfile, your backup is worthless.

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

```
composer require webexcess/neos-backup
```

Commands
--------

Since this package only is a graphical implementation of WebExcess.Flow.Backup,
please have a look on the base backage too:

[https://github.com/sbruggmann/WebExcess.Flow.Backup](https://github.com/sbruggmann/WebExcess.Flow.Backup)


text:
## [Nakadi Event Broker](https://zalando.github.io/nakadi/)

[![Build Status](https://travis-ci.org/zalando/nakadi.svg?branch=master)](https://travis-ci.org/zalando/nakadi)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/785ccd4ab5e34867b760a8b07c3b62f1)](https://www.codacy.com/app/aruha/nakadi?utm_source=www.github.com&utm_medium=referral&utm_content=zalando/nakadi&utm_campaign=Badge_Grade)

Nakadi is a distributed event bus broker that implements a RESTful API abstraction on top of Kafka-like queues, which can be used to send, receive, and analyze streaming data in real time, in a reliable and highly available manner.

One of the most prominent use cases of Nakadi is to decouple micro-services by building data streams between producers and consumers.

Main users of nakadi are developers and analysts. Nakadi provides features like REST based integration, multi consumer, ordered delivery, interactive UI, fully managed, security, ensuring data quality, abstraction of big data technology, and push model based consumption.

Nakadi is in active developement and is currently in production inside Zalando as the backbone of our microservices sending millions of events daily with a throughput of more than hundreds gigabytes per second. In one line, Nakadi is a **high-scalability data-stream for enterprise engineering teams**.

![Nakadi Deployment Diagram](docs/img/NakadiDeploymentDiagram.png)

More detailed information can be found on our [website](http://zalando.github.io/nakadi/).

### Project goal

The goal of Nakadi (**ნაკადი** means *stream* in Georgian) is to provide an event broker infrastructure to:

- Abstract event delivery via a secured [RESTful API](https://zalando.github.io/nakadi/manual.html#nakadi-event-bus-api).

    This allows microservices teams to maintain service boundaries, and not directly depend on any specific message broker technology.
    Access can be managed individually for every queue and secured using *OAuth* and custom authorization plugins.

- Enable convenient development of event-driven applications and asynchronous microservices.

    Event types can be defined with [Event type schemas](https://zalando.github.io/nakadi/manual.html#using_event-types)
    and managed via a registry. All events will be validated against the schema before publishing.
    This guarantees data quality and consistency for consumers.

- Efficient low latency event delivery.

    Once a publisher sends an event using a simple [HTTP POST](https://zalando.github.io/nakadi/manual.html#using_producing-events),
    consumers can be pushed to via a [streaming](https://zalando.github.io/nakadi/manual.html#using_consuming-events-lola)
    HTTP connection, allowing near real-time event processing.
    The consumer connection has keepalive controls and support for managing stream offsets using
    [subscriptions](https://zalando.github.io/nakadi/manual.html#using_consuming-events-hila).

### Development status

- Nakadi is high-load production ready.
- Zalando uses Nakadi as its central Event Bus Service.
- Nakadi reliably handles the traffic from thousands event types with the throughput of more than hundreds gigabytes per second.
- The project is in active development.

### Presentations

- [Watch the talk on Nakadi at Fosdem](https://archive.fosdem.org/2018/schedule/event/nakadi/)
- [Background on the Zalando Microservices platform](https://www.youtube.com/watch?v=gEeHZwjwehs)

#### Features

* Stream:
    * REST abstraction over Kafka-like queues.
    * CRUD for event types.
    * Event batch publishing.
    * Low-level interface (**deprecated**).
        * manual client side partition management is needed
        * no support of commits
    * High-level interface (Subscription API).
        * automatic redistribution of partitions between consuming clients
        * commits should be issued to move server-side cursors
* Schema:
    * Schema registry.
    * Several event type categories (Undefined, Business, Data Change).
    * Several partitioning strategies (Random, Hash, User defined).
    * Event enrichment strategies.
    * Schema evolution.
    * Events validation using an event type schema.
* Security:
    * OAuth2 authentication.
    * Per-event type authorization.
    * Blacklist of users and applications.
* Operations:
    * [STUPS](https://stups.io/) platform compatible.
    * [ZMON](https://zmon.io/) monitoring compatible.
    * SLO monitoring.
    * Timelines:
        * this allows transparently switch production and consumption to different cluster (tier, region, AZ) without
        moving actual data and any service degradation.
        * opens the possibility for implementation of other streaming technologies and engines besides Kafka
        (like Amazon Kinesis or Google Cloud Pub/Sub)

Read more about latest development on the [releases page](https://github.com/zalando/nakadi/releases).

#### Additional features that we plan to cover in the future are:

* Support for different streaming technologies and engines. Nakadi currently uses [Apache Kafka](http://kafka.apache.org/)
    as its broker, but other providers (such as Kinesis) will be possible.
* Filtering of events for subscribing consumers.
* Store old published events forever using transparent fall back backup shortages like AWS S3.
* Separate the internal schema register to standalone service.
* Use additional schema formats and protocols like Avro, protobuf and [others](https://en.wikipedia.org/wiki/Comparison_of_data_serialization_formats).

#### Related projects

The [zalando-nakadi](https://github.com/zalando-nakadi/) organisation contains many useful related projects
like

* [Use Nakadi with a client in your language of choice](https://nakadi.io/manual.html#using_clients),
* SDK,
* [Web UI](https://github.com/zalando-incubator/nakadi-ui),
* DevOps tools, and more.

## How to contribute to Nakadi

Read our [contribution guidelines](CONTRIBUTING.md) on how to submit issues and pull requests, then get Nakadi up and running locally using Docker:

### Dependencies

The Nakadi server is a Java 8 [Spring Boot](https://projects.spring.io/spring-boot/) application.
It uses [Kafka 1.1.1](https://kafka.apache.org/11/documentation.html) as its broker and
 [PostgreSQL 9.5](https://www.postgresql.org/docs/9.5/static/release-9-5.html) as its supporting database.

Nakadi requires recent versions of docker and docker-compose. In
particular, docker-compose >= v1.7.0 is required. See [Install Docker
Compose](https://docs.docker.com/compose/install/) for information on
installing the most recent docker-compose version.

The project is built with [Gradle](http://gradle.org).
The `./gradlew` [wrapper script](http://www.gradle.org/docs/current/userguide/gradle_wrapper.html) will bootstrap
the right Gradle version if it's not already installed.

### Install

To get the source, clone the git repository.
```sh
git clone https://github.com/zalando/nakadi.git
```
### Building

The gradle setup is fairly standard, the main tasks are:

- `./gradlew build`: run a build and test
- `./gradlew clean`: clean down the build

Some other useful tasks are:

- `./gradlew startNakadi`: build Nakadi and start docker-compose services: nakadi, postgresql, zookeeper and kafka
- `./gradlew stopNakadi`: shutdown docker-compose services
- `./gradlew startStorages`: start docker-compose services: postgres, zookeeper and kafka (useful for development purposes)
- `./gradlew fullAcceptanceTest`: start Nakadi configured for acceptance tests and run acceptance tests

For working with an IDE, the `eclipse` IDE task is available and you'll be able to import the `build.gradle` into Intellij IDEA directly.

### Running a Server

**Note**: Nakadi Docker for ARM processors is available at [here](./docker-arm)

From the project's home directory you can start Nakadi via Gradle:

```sh
./gradlew startNakadi
```

This will build the project and run docker compose with 4 services:

- Nakadi (8080)
- PostgreSQL (5432)
- Kafka (9092)
- Zookeeper (2181)

To stop the running Nakadi server:

```sh
./gradlew stopNakadi
```

## Using Nakadi and its API

Please read the [manual](https://zalando.github.io/nakadi/manual.html) for the full API usage details.

### Creating Event Types

The Nakadi API allows the publishing and consuming of _events_ over HTTP.
To do this the producer must register an _event type_ with the Nakadi schema
registry.

This example shows a minimalistic `undefined` category event type with a wildcard schema:

```sh
curl -v -XPOST http://localhost:8080/event-types -H "Content-type: application/json" -d '{
  "name": "order.ORDER_RECEIVED",
  "owning_application": "order-service",
  "category": "undefined",
  "schema": {
    "type": "json_schema",
    "schema": "{ \"additionalProperties\": true }"
  }
}'
```
**Note:** This is not a recommended category and schema. It should be used only for testing.

You can read more about this in the [manual](https://zalando.github.io/nakadi/manual.html#using_event-types).

### Consuming Events

You can open a stream for an event type via the `events` sub-resource:

```sh
curl -v http://localhost:8080/event-types/order.ORDER_RECEIVED/events

HTTP/1.1 200 OK

{"cursor":{"partition":"0","offset":"82376-000087231"},"events":[{"order_number": "ORDER_001"}]}
{"cursor":{"partition":"0","offset":"82376-000087232"}}
{"cursor":{"partition":"0","offset":"82376-000087232"},"events":[{"order_number": "ORDER_002"}]}
{"cursor":{"partition":"0","offset":"82376-000087233"},"events":[{"order_number": "ORDER_003"}]}
```
You will see the events when you publish them from another console for example.
The records without `events` field are `Keep Alive` messages.

**Note:** the [low-level API](https://zalando.github.io/nakadi/manual.html#using_consuming-events-lola) should be
used only for debugging. It is not recommended for production systems.
For production systems, please use the [Subscriptions API](https://zalando.github.io/nakadi/manual.html#using_consuming-events-hila).

### Publishing Events

Events for an event type can be published by posting to its "events" collection:

```sh
curl -v -XPOST http://localhost:8080/event-types/order.ORDER_RECEIVED/events \
 -H "Content-type: application/json" \
 -d '[{
    "order_number": "24873243241"
  }, {
    "order_number": "24873243242"
  }]'

HTTP/1.1 200 OK
```

Read more in the [manual](https://zalando.github.io/nakadi/manual.html#using_producing-events).

## Contributing

Nakadi accepts contributions from the open-source community.

Please read [`CONTRIBUTING.md`](CONTRIBUTING.md).

Please also note our [`CODE_OF_CONDUCT.md`](CODE_OF_CONDUCT.md).

## Contact

This [email address](MAINTAINERS) serves as the main contact address for this project.

Bug reports and feature requests are more likely to be addressed
if posted as [issues](https://github.com/zalando/nakadi/issues) here on GitHub.

## License

Please read the full [`LICENSE`](LICENSE)

The MIT License (MIT) Copyright © 2015 Zalando SE, https://tech.zalando.com

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the “Software”), to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions
of the Software.

 IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

repository: zalando/nakadi

gha_language: Java

repo_name: zalando/nakadi


text:
# RDSS - Preservation Action Registry
*Defining interoperability for Preservation Action Regisitries*

Data model and API definitions to facilitate sharing and exchange of digital preservation best practise within the community and between presevation systems.

## Open Source
The data model, APIs and associated software in this repository are open source, under the terms of the [Apache 2.0 licence](LICENCE).

## Status
Current JSON schemas and API definitions should be considered early drafts and subject to change.

## Getting started
To get started you'll need to clone this GitHub repository:
`git clone https://github.com/JiscRDSS/rdss-par.git`, move to the project
directory: `cd rdss-par/` and update the git submodule to download the examples
directory: `git submodule update --init --recursive`.

An example bash session under linux is shown below:

```bash
cfw@dm-wrkstn:/tmp$ git clone git@github.com:JiscRDSS/rdss-par.git
Cloning into 'rdss-par'...
remote: Enumerating objects: 661, done.
remote: Total 661 (delta 0), reused 0 (delta 0), pack-reused 661
Receiving objects: 100% (661/661), 1.53 MiB | 1.54 MiB/s, done.
Resolving deltas: 100% (358/358), done.

cfw@dm-wrkstn:/tmp$ cd rdss-par/

cfw@dm-wrkstn:/tmp/rdss-par$ git submodule update --init --recursive
Submodule 'examples' (https://github.com/JiscRDSS/rdss-par-examples.git) registered for path 'examples'
Cloning into '/tmp/rdss-par/examples'...
Submodule path 'examples': checked out 'edec3997b38e73d967e7ba1ba3c76345e02097f0'

cfw@dm-wrkstn:/tmp/rdss-par$
```

### Project Layout
```
rdss-par
    |- api          The PAR API definitions and documentation.
    |- docs         The contents of the GitHub pages parecore.org site.
    |- examples     Practical JSON examples of data model usage.
    |- schemas      The PAR data model defined as JSON schema.
    |- scripts      Helper scripts for testing, etc.
    |- testing      Pytests that validate the examples using the schema.
```

### Dependencies
To run the tests you'll need [Python](https://www.python.org/) 2.7 or higher with the following:
- [`pip`](https://pypi.org/project/pip/) to install Python dependencies;
- [`demjson`](https://pypi.org/project/demjson/) for command line JSON linting;
- [`jsonschema`](https://pypi.org/project/jsonschema/) for JSON schema validation;
- [`pytest`](https://pypi.org/project/pytest/) to run the schema validation tests.

Once you have Pythton and pip you can install the other dependencies so: `pip install -r requirements.txt`

### Testing
Automated testing currently consists of:
- [JSONLint](https://jsonlint.com/) validation of all JSON files in the `api`, `examples` and `schemas` directories; and
- validation of the example sets against the schema using these [Python tests](testing/test_main.py).

To run the tests locally, first run the JSON linting script:
```shell
./scripts/lint-json-dirs

JSONLINT - All files in dir schemas.
===================================
./rdss-par/scripts/../schemas/business_rule.json: ok
./rdss-par/scripts/../schemas/format.json: ok
./rdss-par/scripts/../schemas/par_property.json: ok
./rdss-par/scripts/../schemas/preservation_action.json: ok
./rdss-par/scripts/../schemas/preservation_action_type.json: ok
./rdss-par/scripts/../schemas/tool.json: ok
./rdss-par/scripts/../schemas/types.json: ok

JSONLINT - All files in dir api.
===================================
./rdss-par/scripts/../api/par-api.json: ok

JSONLINT - All files in dir examples.
===================================
./rdss-par/scripts/../examples/br-1.json: ok
./rdss-par/scripts/../examples/br-2.json: ok
./rdss-par/scripts/../examples/br-3.json: ok
./rdss-par/scripts/../examples/fmt-43.json: ok
./rdss-par/scripts/../examples/md5check.json: ok
./rdss-par/scripts/../examples/md5prop.json: ok
./rdss-par/scripts/../examples/md5sum.json: ok

```
then run the `pytest` tests

```shell
pytest

===================== test session starts ===============================
platform linux2 -- Python 2.7.12, pytest-3.6.2, py-1.5.3, pluggy-0.6.0
rootdir: /home/cfw/proj/JISC/rdss-par, inifile:
collected 7 items

testing/test_main.py .......                                                                                [100%]

===================== 7 passed in 0.06 seconds ========================
```
## Documentation
Coming soon https://parcore.readme.io

repository: JiscSD/rdss-par

repo_name: JiscSD/rdss-par


text:
# Bashlan

 ![](https://img.shields.io/badge/Version-1.00.00-red)
 [![](https://img.shields.io/badge/APK-bashlan.apk-red)](https://github.com/Nathan770/Bashlan/blob/master/bashlan.apk)

# About

Cooking and food management application , finds recipes from food in your home.
The application helps you on a daily basis by offerring a variety of recipes based on food products you have at home!
You can also manage your food's shopping list through this app.
The app uses the Spoonacular API and Firebase for register and login.

# Including
 - Custum recipes
 - Shopping list
 - BMI calculator

# Example page
  Login page :

  Menu :

  Fridge page :

  Recipes page :

  Profile page (check your IMC):

  Shopping page :

  ## License

    Copyright 2020 Nathan Amiel

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

## Credits

Icon made by Flat Icons (www.flat-icons.com) from www.flaticon.com


text:
# Hotfix for Alfresco issue [MNT-21313](https://issues.alfresco.com/jira/browse/MNT-21313)

This project is a hotfix for issue [MNT-21313](https://issues.alfresco.com/jira/browse/MNT-21313)
 (upgrade pdf.js to v1.10.100) that still affects Alfresco 5.x and 6.x.

Alfresco 6.x will get an updated version of pdf.js in one of the next service releases.
Merge requests for Alfresco 6.x.N have already been merged.
- [MNT-21313 - upgrade pdf.js to version 1.10.100 6.0.N #168](https://github.com/Alfresco/share/pull/168)
- [MNT-21313 - upgrade pdf.js to version 1.10.100 6.1.N #169](https://github.com/Alfresco/share/pull/169)
- [MNT-21313 - upgrade pdf.js to version 1.10.100 6.2.N #170](https://github.com/Alfresco/share/pull/170)

## Problem

Alfresco 5.x and 6.x are still using an older version of pdf.js; version 1.5.188 released on 2016-04-21.
Pdf.js is a popular library for rendering PDF documents. The latest version of pdf.js is version 2.2.228
 released on 2019-07-10. Version 2.2.228 contains a lot of improvements and bugfixes compared to v1.5.188.
For more details consult the [pdf.sj release log](https://github.com/mozilla/pdf.js/releases)

## Solution

For Alfresco 6.x.N the pdf.js library is updated to version 1.10.100 released on 2018-06-06.
Version 1.10.100 is the latest v1.x release of pdf.js.

This AMP overrides the pdf.js component files in Alfresco Share and updates them to version v1.10.100.

## Building and Installing

This project uses the [alfresco-gradle-sdk](https://github.com/xenit-eu/alfresco-gradle-sdk). Clone
this project and use `./gradlew amp` to build. Find the resulting AMP at `./build/dist/` and install
it into Alfresco Share.

gha_language: JavaScript


text:
# Known Problems

## Use of smartctl

Invoking `smartctl` to retrieve hard drive temperatures requires root
privileges.  It is a very BAD idea to run python code with such privileges.

repository: eschava/psmqtt

repo_name: eschava/psmqtt


text:
# solid-common-vocab-rdf

This repository acts as a mono-repo for all the RDF vocabularies defined and controlled
by Inrupt.

It also stores Artifact Generator configuration files that allow us generate
programming-language-specific artifacts (e.g. Java JARs, NPM modules, etc.) that provide
convenient constants representing the individual terms from RDF vocabularies (including
from RDF vocabularies that are not under our control, such as common vocabularies like
Schema.org, or FOAF, or Dublin Core, etc.).

## Published vocabulary bundles

Currently this repository bundles the following sets of vocabularies (each configured in
its own directory from the root of this repository) :

 - Common RDF, including dozens of well-known RDF vocabularies: [FOAF](http://xmlns.com/foaf/spec/),
 [LDP](http://www.w3.org/ns/ldp#), [OWL](http://www.w3.org/2002/07/owl#), [RDFS](http://www.w3.org/2000/01/rdf-schema#),
 etc. To learn more about common vocabularies, have a look at the [Solid project website](https://solidproject.org/for-developers/apps/vocabularies)
    - [@inrupt/vocab-common-rdf](https://www.npmjs.com/package/@inrupt/vocab-common-rdf) on NPM
 - Solid RDF, including vocabularies related to Solid like [Solid Terms](https://www.w3.org/ns/solid/terms),
 [WebACL](http://www.w3.org/ns/auth/acl#), the [Workspace Ontology](http://www.w3.org/ns/pim/space), etc.
    - [@inrupt/vocab-solid-common](https://www.npmjs.com/package/@inrupt/vocab-solid-common) on NPM
 - Inrupt RDF (Inrupt-specific vocabularies, such as product-specific vocabs, or our UI components)
    - [@inrupt/vocab-inrupt-common](https://www.npmjs.com/package/@inrupt/vocab-inrupt-common) on NPM

To see how and where these bundles are packaged and published, you'll need to look at the
YAML files in each of the respective directories (since different bundles can be generated for
different programming languages, and published to multiple places - i.e. the generation process
is very flexible!).

## Put the vocabularies to action

If you want to use these vocabularies in an app to read/write data in your Solid Pod, have a look at our [Solid Client library](https://github.com/inrupt/solid-client-js).

repository: nicolasmondada/solid-common-vocab-rdf

gha_license_id: NOASSERTION

repo_name: nicolasmondada/solid-common-vocab-rdf


text:
# tokensearch.js

[![Dependency Status](https://gemnasium.com/neophob/tokensearch.js.svg)](https://gemnasium.com/neophob/tokensearch.js) [![Build Status](https://secure.travis-ci.org/neophob/tokensearch.js.png?branch=master)](http://travis-ci.org/neophob/tokensearch.js)

**tokensearch.js** is a simple substring search functions for collections. You can search for multiple search tokens in a json file, the result array contains the original object plus a search `score` (0: perfect, 1: forget it). See the example or unit tests for more details.

Inspired by https://github.com/krisk/Fuse, users.json file is ripped from this project.

## Options

```
Tokensearch.defaultOptions = {
  //split strings with those delimiters, default delimiters: space and dash
  delimiter: /[\s-]+/,

  // At what point does the match algorithm give up. A threshold of '0.0' requires a perfect match
  // (of both letters and location), a threshold of '1.0' would match anything.
  threshold: 0.7,

  // How many search tokens are considered
  maxFilterTokenEntries: 5,

  // search key
  collectionKeys: [],

  //the result just contains unique results (based on collection keys)
  unique: false,

  // search all 'needles' in the 'haystack', return a score for each function call
  searchAlgorithm: function(haystack, needles) {
    var score = 0;
    var arrayLength = needles.length;
    for (var i = 0; i < arrayLength; i++) {
      var needle = needles[i];
      var stringPos = haystack.indexOf(needle);
      if (stringPos > -1) {
        if (haystack === needle) {
          score += 6;
        } else if (stringPos === 0) {
          score += 2;
        } else {
          score += 1;
        }
      }
    }
    return score;
  },

  //postprocess all elements (=contains all elements with a score)
  postprocessAlgorithm: function(collection, maxScore, threshold) {
    var normalizedScore = 1 / maxScore;
    var result = [];
    collection.forEach(function(e) {
      e.score = 1-e.score*normalizedScore;
      if (e.score <= threshold) {
        result.push(e);
      }
    });
    return result;
  },

  // sort the result array (=output of the postprocess step)
  sortAlgorithm: function(array) {
    return array.sort(function(a, b) {
    return a.score - b.score;
    });
  }};
```

You can pass one or multiple parameter when creating the object, for example

```
new Tokensearch(myCollection, { collectionKeys: ['key1', 'key2'], threshold: 0.5 });
```

## Examples

### Simple
Search for text tokens in one JSON field, use space as delimiter.

**Setup:**

```
var collection = [{
  "name": "JOHN PETER DOW",
  "id": "123"
}, {
  "name": "FOO BAR JOHN",
  "id": "127",
}, {
  "name": "BODE JON MULLER",
  "id": "147",
}];
var tokenSearch = new Tokensearch(collection, { collectionKeys: ['name'] });

```

**Search:**
```
var result = tokenSearch.search('JOHN BAR');
```

**Result:**
```
[
  {"item":{"name":"FOO BAR JOHN","id":"127}","score":0},
  {"item":{"name":"JOHN PETER DOW","id":"123"},"score":0.5}
]
```

### Advanced 1
Search for text tokens in two JSON fields, use space and : as delimiter.

**Setup:**

```
var collection = [{
  "name": "JOHN PETER DOW",
  "address": "a:funny:street:44",
  "id": "123"
}, {
  "name": "FOO BAR JON",
  "address": "bullvd:33",
  "id": "127",
}, {
  "name": "BODE JOHN MULLER",
  "address": "upside:street",
  "id": "147",
}];
var tokenSearch = new Tokensearch(collection, { collectionKeys: ['name', 'address'], delimiter: /[\s:]+/, threshold: 0.5});

```

**Search:**
```
var result = tokenSearch.search('JOHN:street');
```

**Result:**
```
[
  {"item":{"name":"JOHN PETER DOW","address":"a:funny:street:44","id":"123"},"score":0},
  {"item":{"name":"BODE JOHN MULLER","address":"upside:street","id":"147"},"score":0}
]
```

### Advanced 2
Search for text tokens in two JSON fields, use space and : as delimiter, use a custom search algorithm.

**Setup:**

```
    var collection = [{
      "name": "JOHN DOE",
      "address": "a:funny:street:44",
      "id": "123"
    }, {
      "name": "FOO BAR JON",
      "address": "bullvd:33",
      "id": "127",
    }, {
      "name": "BODE MULLER",
      "address": "john:upside:street",
      "id": "147",
    }];

    var tokenSearch = function(haystack, needles) {
      var score = 0;
      var arrayLength = needles.length;
      for (var i = 0; i < arrayLength; i++) {
        var needle = needles[i];
        if (haystack === needle) {
          score ++;
        }
      }
      return score;
    };
    var tokenSearch = new Tokensearch(collection, { collectionKeys: ['name', 'address'], delimiter: /[\s:]+/, threshold: 0.5, searchAlgorithm: tokenSearch});

```

**Search:**
```
var result = tokenSearch.search('JOHN');
```

**Result:**
```
[
  {"item":{"name":"JOHN DOE","address":"a:funny:street:44","id":"123"},"score":0},
  {"item":{"name":"BODE MULLER","address":"john:upside:street","id":"147"},"score":0}
]
```

## Build
- to run **tests**: `npm test`
- to run **jshint**: `npm run-script jshint`
- to create a new **release**: `npm run-script release`
- to check code **coverage**: `npm run-script coverage`

repository: reservdel/SimplePlex

repo_name: reservdel/SimplePlex


text:
# gmX

gmX is a library built on top of Spark GraphX that implements Belief Propagation algorithm.

# License

Copyright (c) 2015, University of Barcelona
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.

# Requirements

* `scala 2.10.4`

* `maven > 3.0.4`

# Tests

To run tests, simply execute maven test goal:

    mvn test

# Usage

## Integration as dependency

gmX can be included as dependency in your scala Spark project via maven:

    <dependency>
      <groupId>org.blackbox.gmx</groupId>
      <artifactId>gmx-core</artifactId>
      <version>1.0.0-SNAPSHOT</version>
    </dependency>

Since gmX does not have a remote public repository you have to install it first in your local
repository by downloading the project and executing in the root of project's directory:

    mvn install

Or if your project does not support maven then put the packaged jar in the classpath of your app.
The jar can be obtained in `target/` directory after execute the maven goal `package`:

    mvn package

## Code usage

In order to use gmX you have to define a cluster graph. Here you have two chances. First passing
a set of factors that builds a Bethe cluster graph:

    ClusterGraph.apply(factors: Set[Factor], sc : SparkContext)

Second passing a cluster graph definition:

    ClusterGraph.apply(clusters: Map[Set[Variable], Set[Factor]], edges: Set[(Set[Variable], Set[Variable])], sc: SparkContext)

You can find in `edu.ub.guillermoblascojimenez.gmx.impl.BeliefPropagationTest` class some examples where the graph
is built this way.

Then you can calibrate the cluster graph with the method `calibrated` and you'll get in return
a cluster graph with equal topology but the vertices shall be calibrated.

The `edu.ub.guillermoblascojimenez.gmx.model` package contains the model classes required to build a cluster graph:

* `Factor`

* `Variable`

Look at test to see some examples of usage of these classes.

repository: GuillermoBlasco/gmX

repo_name: GuillermoBlasco/gmX


text:
# JavaScript Features #

Features is an opinionated framework for structured, unobtrusive, jQuery-based JavaScript in Ruby on Rails apps. If you follow a few conventions, lots of things will "just work", just like they do in Rails.

## Using it ##

1.  Add the gem to your Gemfile: `gem 'javascript_features'`
2.  Add the middleware to your Rack stack: `use Rack::JavascriptFeatures`
3.  Include the JavaScript in your layout, e.g. in ERB:

        <html>
          <head>
            <%= include_javascript_features %>
          </head>
          <body class="<%= javascript_feature_classes %>">
            …
          </body>
        </html>

4.  Add any jQuery plugins you want to use. These should live in `/public/javascripts/lib`
5.  Start writing JavaScript features. Each should have its own file in `/public/javascripts/main` and should look like this:

        Features.my_feature = {
          init: function() {
            // This code will be run on pages that
            // explicitly activate this feature
          },
          global_init: function() {
            // This code will be run on every page
          }
        };

6.  Within your templates, activate specific features by called `<% use_javascript_for :my_feature %>` to make sure the `init` function is called. You can also specify several features at once: `<% use_javascript_for :first_feature, :second_feature %>`.

## Working with AJAX ##

If you load some HTML via AJAX and inject it into your page, the relevant JavaScript features will still be initialised for the asynchronously loaded content, as long as the call to `use_javascript_for` is part of the view or partial that is rendered in response to the AJAX request. However, to make this work correctly you need to make sure that the same bit of markup doesn't get enhanced twice.  There are two ways to do this:

1.  ### Write defensive `init` functions ###

    You can add a class to the markup you are enhancing, and only enhance markup that doesn't already have that class. For example:

        Features.my_feature = {
          init: function() {
            // Find all elements with class "my_feature" but not class "enhanced"
            $(".my_feature:not(.enhanced)").each(function() {
              // Set up your feature…
              // Make sure this element isn't enhanced again
              $(this).addClass("enhanced");
            });
          }
        };

2.  ### Use jQuery's AJAX context option ###

    If you take this approach you will need to set a context when you make AJAX requests:

        jQuery.ajax({
          url: "/some/path",
          context: $("div#ajax_target"),
          success: function(data) {
            $(this).html(data);
          }
        });

    The context will then be passed to your init functions:

        Features.my_feature = {
          init: function(context) {
            context.find(".my_feature").each(function() {
              // Set up your feature…
            });
          }
        };

    When the init function is called on DOM ready, the whole document will be passed as context.

## Testing ##

The `JavascriptFeatures::TestCase` class is used by the gem to test it's own JavaScript. If you want to test your JavaScript within a minimal HTML page that is isolated from your application then you might also want to use this in you applications. Of course, just because your JavaScript works with a minimal doesn't mean you application's markup hasn't changed and introduced a regression. In most cases it's probably more sensible to test your JavaScript in the context of a real page in your application with something like [HolyGrail](https://github.com/georgebrock/holygrail) or [Selenium](http://seleniumhq.org/).

See `javascript-features/test/javacript_test.rb` and `xhr_test.rb` for examples.

## Other bits and bobs ##

*  You can created multiple sets of features.  Just put them in different sub-folders and then pass the name of the folder to `include_javascript_features`, e.g. you can include the features from `/public/javascripts/foo` by calling `include_javascript_features('foo')`

## License ##

You may use, copy and redistribute this library [under the same terms as Ruby](http://www.ruby-lang.org/en/LICENSE.txt) itself or under the [MIT license](http://creativecommons.org/licenses/MIT/).

license: MIT,Ruby

detected_licenses: MIT Ruby


text:
# Windows

## God Mode

http://www.howtogeek.com/howto/8711/stupid-geek-tricks-enable-the-secret-how-to-geek-mode-in-windows/

## Access Denied
http://windows.microsoft.com/en-US/windows-vista/Troubleshoot-access-denied-when-opening-files-or-folders
use lock hunter...

## Lessons Learned

Use https://ninite.com to install Chrome, Firefox DropBox, Evernote, Google Drive etc

Don't forget DropBox takes forever.
* Sync only a few folders at a time
* Start with just one or two folders

Create a recovery drive in a USB drive

* Needs 8GB

## windows find

https://technet.microsoft.com/en-us/library/cc732459.aspx

findstr /p /s /i "word word"  *.html

### Start Menus

C:\ProgramData\Microsoft\Windows\Start Menu\Programs

look into
bitLocker
homeGroup

### startup

**window-R > shell:startup** <<<

## Startup

C:\Users\tarmo\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup

## Speed Keys

Win + E = My Computer
Win + F = Search
Win + M = minimize windows
Win + R = Run dialog
Shift + Del = Bypass Recycle
Control + Shift + Escape = Windows Task Manager

## Windows Shutdown

C:\WINDOWS\system32\shutdown.exe -i -r -f -t15

C:\WINDOWS\system32\shutdown.exe /s -/t 60 << the one to use.

http://support.microsoft.com/kb/317371  << win 2000
-r restart not shutdown
-f force running apps to close
-i gui must be first
-t time in seconds

-s shutdown
command window shutdown /?
Open a Command Prompt From the Desktop Right-Click Menu
Just hold down the Shift key and right-click on the desktop…
Command line stuff
ipconfig
dxdiag

## Symlinks

mklink ~ symlinks
http://www.howtogeek.com/howto/windows-vista/using-symlinks-in-windows-vista/

> mklink /D C:\TestFolder C:\Users\Geek\TestFolder
// mklink /D C:\Dropbox\Public\code-cookbook\three.js C:\Dropbox\2012-reference\git-repos\three.js

mklink /D C:\Dropbox\Public\code-cookbook\three.js C:\Dropbox\Public\git-repos\three.js

// mklink /D  c:\Dropbox\xampp\htdocs\pub c:\Dropbox\public\
mklink /D C:\Dropbox\apps-portable\PortableApps\xampp\htdocs\pub c:\Dropbox\public\

mklink /D c:\Dropbox\apps-portable\ d:\apps-portable\

mklink /D c:\

How to get rid of log on screen at boot up?
http://www.sevenforums.com/tutorials/377-log-automatically-startup.html
run netplwiz

http://archive.atomicmpc.com.au/forums.asp?s=2&c=8&t=17415

Go to Control Panel, and User Accounts. Click 'Change the way users log on or off', then untick 'Use the welcome screen.'

Goto start then run and type control userpasswords2
Untick the users must enter password & choose which user always logs on.

## background image

http://www.sevenforums.com/tutorials/67200-remove-background-images-where-available.html

## windows xp Set My Documents Folder

Change My Documents: right-click My Documents icon > Properties

## Regedit

windows keyboard shortcuts
http://support.microsoft.com/kb/301583

## defaults

Windows normal screen dark blue is RGB 58 110 165

## Windows

Turn off Thumbs.db

In "Files and Folders", simply check the button next to "Always show icons, never thumbnails"

repository: theo-armour/pages

repo_name: theo-armour/pages


text:
# Toks

**WARNING: I wouldn't reccomend using this for your own stuff, but feel free to fork or PR if you want**

## Installation

```elixir
def deps do
  [
    {:toks, "~> 0.1.0"}
  ]
end
```

## Config
```elixir
config :toks,
  key: <your_tokbox_project_api_key>,
  secret: <your_tokbox_project_api_secret>
```

repository: cjfreeze/toks

repo_name: cjfreeze/toks


text:
###### Note on parallel HDF5

0. First of all, your `PYTHONPATH` should be correctly set to the one corresponding to the python intrepeter used in pybind:

```export PYTHONPATH="/path/to/python/site-packages"```

It is recommended that you use python virtual environment to install mpi4py and parallel h5py.

1. You will need to install `mpi4py` and `cached_property`

```
pip3 install mpi4py
pip3 install cached-property
```

You can check that it works by testing:

```
python3 hello.py

# hello.py
from mpi4py import MPI
comm = MPI.COMM_WORLD
rank = comm.Get_rank()
print("hello world from process ", rank)
```

2. You will need a parallel variant of hdf5. The one shipped by default by homebrew is not.

```
brew uninstall --ignore-dependencies hdf5
brew install hdf5-mpi
```

You can then check that it works using:

`h5pcc -showconfig`

3. You will need to build h5py manually since the variant installed with pip doesn’t support MPI. Besides, you cannot directly install in system directories so you will have to specify the path.

```bash
cd csr/dependencies
git clone git@github.com:h5py/h5py.git
python3 setup.py configure --mpi —hdf5=/usr/local/Cellar/hdf5-mpi/1.12.0
python3 setup.py install —home=./install
mv ./install/lib/python/h5py-2.10.0-py3.8-macosx-10.15-x86_64.egg/h5py $PYTHONPATH
```

4. You will have to set the correct python interpreter in CMake for pybind11 by adding:

`-DPYTHON_EXECUTABLE=//path/to/python/python3`

repository: ckhuang-lanl/cosyr

repo_name: ckhuang-lanl/cosyr


text:
# fetch-mock
Adding a `^` to the beginning of a string means a url must _begin_ with the rest of the string. e.g.
```
fetchMock.mock('^http://example.com', 200);
```
Will match http://example.com, http://example.com/thing.html etc.
- - -
If mocking lots of routes you can name them
```
fetchMock({
    name: 'example',
    matcher: 'http://example.com.thing.html'
    response: 200
})
```
- - -
Since version 4.5.4 a bug's been fixed, meaning your tests should run in environments where `fetch` doesn't exist as a global in the test environment, though is assumed to in production. There shouldn't be any need to use the deprecated `useNonGlobalFetch()` method ever either
- - -
To delay responses you can wrap the response in a `Promise`
```
fetchMock.mock('^http://example.com', new Promise(res => setTimeout(res, 200)).then(() => 200));
```
- - -
For test involving complex asynchronous interactions use functions that return Promises
```
fetchMock.mock('^http://example.com', (url, opts) => {
    return opts.headers.Auth ? callApi().then(200) : 403
});
```
- - -
By default any unmatched calls go straight through to `fetch`. Set `fetchMock.greed = 'bad'` to make them all error, or `fetchMock.greed = 'good'` to return `200` responses
- - -
When using webpack and it's variety of plugins alongside karma, fetch-mock, isomorphic fetch and others sometimes the easiest way to define `fetch` in the environment is to include it as a standalone script (`npm install whatwg-fetch`) and leave it out of your main bundle. Or run your tests in firefox/chrome, where fetch is native

repository: winterstefan/fetch-mock

repo_name: winterstefan/fetch-mock


text:
![Travis Status](https://api.travis-ci.org/devmynd/tabs.png)

# Tabs

Tabs is a redis-backed metrics tracker for time-based events that supports counts, sums,
averages, and min/max, and task based stats sliceable by the minute, hour, day, week, month, and year.

## Installation

Add this line to your application's Gemfile:

    gem 'tabs'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install tabs

## Usage

Metrics come in three flavors: counters, values, and tasks.

### Counter Metrics

A counter metric simply records the number of events that occur within a given timeframe.  To create a counter metric called ‘website-visits’, simply call:

```ruby
Tabs.create_metric("website-visits", "counter")
```

Tabs will also create a counter metric automatically the first time you
increment the counter.

To increment a metric counter, simply call:

```ruby
Tabs.increment_counter("website-visits")
```

If you need to retroactively increment the counter for a specific
timestamp, just pass it in.

```ruby
Tabs.increment_counter("wibsite-visits", Time.now - 2.days)
```

To retrieve the counts for a given time period just call `Tabs#get_stats` with the name of the metric, a range of times defining the period for which you want stats, and the resolution at which the data should be aggregated.

```ruby
Tabs.get_stats("website-visits", 10.days.ago..Time.now, :hour)
```

This will return stats for the last 10 days by hour in the form of a `Tabs::Metrics::Counter::Stats` object.  This object is enumerable so you can iterate through the results like so:

```ruby
results = Tabs.get_stats("website-visits", 10.days.ago..Time.now, :hour)
results.each { |r| puts r }

#=>
  { timestamp: 2000-01-01 00:00:00 UTC, count: 1 }
  { timestamp: 2000-01-01 01:00:00 UTC, count: 0 }
  { timestamp: 2000-01-01 02:00:00 UTC, count: 10 }
  { timestamp: 2000-01-01 03:00:00 UTC, count: 1 }
  { timestamp: 2000-01-01 04:00:00 UTC, count: 0 }
  { timestamp: 2000-01-01 05:00:00 UTC, count: 0 }
  { timestamp: 2000-01-01 06:00:00 UTC, count: 3 }
  { timestamp: 2000-01-01 07:00:00 UTC, count: 0 }
  ...
```

The results object also provides the following methods:

```ruby
results.total       #=> The count total for the given period
results.min         #=> The min count for any timestamp in the period
results.max         #=> The max count for any timestamp in the period
results.avg         #=> The avg count for timestamps in the period
results.period      #=> The timestamp range that was requested
results.resolution  #=> The resolution requested
```

Timestamps for the given period in which no events occurred will be "filled in" with a count value to make visualizations easier.

The timestamps are also normalized.  For example, in hour resolution, the minutes and seconds of the timestamps are set to 00:00.  Likewise for the week resolution, the day is set to the first day of the week.

Lastly, you can access the overall total for a counter (for all time)
using the `counter_total` method.

```ruby
Tabs.counter_total("website-visits") #=> 476873
```

### Value Metrics

Value metrics record a value at a point in time and calculate the min, max, avg, and sum for a given time resolution.  Creating a value metric is easy:

To record a value, simply call `Tabs#record_value`.

```ruby
Tabs.record_value("new-user-age", 32)
```

If you need to retroactively record a value for a specific
timestamp, just pass it in.

```ruby
Tabs.increment_counter("new-user-age", 19, Time.now - 2.days)
```

This will also create a value metric the first time, you can manually create
a metric as well:

```ruby
Tabs.create_metric("new-user-age", "value")
```

Retrieving the stats for a value metric is just like retrieving a counter metric.

```ruby
Tabs.get_stats("new-user-age", 6.months.ago..Time.now, :month)
```

This will return a `Tabs::Metrics::Value::Stats` object.  Again, this
object is enumerable and encapsulates all the timestamps within the
given period.

```ruby
results = Tabs.get_stats("new-user-age", 6.months.ago..Time.now, :month)
results.each { |r| puts r }
#=>
  { timestamp: 2000-01-01 00:00:00, count: 9, min: 19, max: 54, sum: 226, avg: 38 }
  { timestamp: 2000-02-01 01:00:00, count: 0, min: 0, max: 0, sum: 0, avg: 0 }
  { timestamp: 2000-03-01 02:00:00, count: 2, min: 22, max: 34, sum: 180, avg: 26 }
  ...
```

The results object also provides some aggregates and other methods:

```ruby
results.count       #=> The total count of recorded values for the period
results.sum         #=> The sum of all values for the period
results.min         #=> The min value for any timestamp in the period
results.max         #=> The max value for any timestamp in the period
results.avg         #=> The avg value for timestamps in the period
results.period      #=> The timestamp range that was requested
results.resolution  #=> The resolution requested
```

### Task Metrics

Task metrics allow you to track the beginning and ending of a process.
For example, tracking a user who downloads you mobile application and
later visits your website to make a purchase.

```ruby
Tabs.start_task("mobile-to-purchase", "2g4hj17787s")
```

The first argument is the metric key and the second is a unique token
used to identify the given process.  You can use any string for the
token but it needs to be unique.  Use the `complete_task` method to
finish the task:

```ruby
Tabs.complete_task("mobile-to-purchase", "2g4hj17787s")
```

If you need to retroactively start/complete a task at a specific
timestamp, just pass it in.

```ruby
Tabs.start_task("mobile-to-purchase", "2g4hj17787s", Time.now - 2.days)
Tabs.complete_task("mobile-to-purchase", "2g4hj17787s", Time.now - 1.days)
```

Retrieving stats for a task metric is just like the other types:

```ruby
Tabs.get_stats("mobile-to-purchase", 6.hours.ago..Time.now, :minute)
```

This will return a `Tabs::Metrics::Task::Stats` object:

```ruby
results = Tabs.get_stats("mobile-to-purchase", 6.hours.ago..Time.now, :minute)
results.started_within_period       #=> Number of items started in period
results.completed_within_period     #=> Number of items completed in period
results.started_and_completed_within_period  #=> Items wholly started/completed in period
results.completion_rate             #=> Rate of completion in the given resolution
results.average_completion_time     #=> Average time for the task to be completed
```

### Resolutions

When tabs increments a counter or records a value it does so for each of the following "resolutions".  You may supply any of these as the last argument to the `Tabs#get_stats` method.

    :minute, :hour, :day, :week, :month, :year

It automatically aggregates multiple events for the same period.  For instance when you increment a counter metric, 1 will be added for each of the resolutions for the current time.  Repeating the event 5 minutes later will increment a different minute slot, but the same hour, date, week, etc.  When you retrieve metrics, all timestamps will be in UTC.

#### Custom Resolutions

If the built-in resolutions above don't work you can add your own.  All
that's necessary is a module that conforms to the following protocol:

```ruby
module SecondResolution
  include Tabs::Resolutionable
  extend self

  PATTERN = "%Y-%m-%d-%H-%M-%S"

  def name
    :seconds
  end

  def serialize(timestamp)
    timestamp.strftime(PATTERN)
  end

  def deserialize(str)
    dt = DateTime.strptime(str, PATTERN)
    self.normalize(dt)
  end

  def from_seconds(s)
    s / 1
  end

  def to_seconds
    1
  end

  def add(timestamp, num_of_seconds)
    timestamp + num_of_seconds.seconds
  end

  def normalize(ts)
    Time.utc(ts.year, ts.month, ts.day, ts.hour, ts.min, ts.sec)
  end
end

```

A little description on each of the above methods:

*`name`*: unique symbol used to reference registered resolution

*`serialize`*: converts the timestamp to a string.  The return value
here will be used as part of the Redis key storing values associated
with a given metric.

*`deserialize`*: converts the string representation of a timestamp back
into an actual DateTime value.

*`from_seconds`*: should return the number of periods in the given
number of seconds.  For example, there are 60 seconds in a minute.

*`to_seconds`*: should return the number of seconds in '1' of these time periods.  For example, there are 3600 seconds in an hour.

*`add`*: should add the number of seconds in the given resolution to the
supplied timestamp.

*`normalize`*: should simply return the first timestamp for the period.
For example, the week resolution returns the first hour of the first day
of the week.

*NOTE: If you're doing a custom resolution, you should probably look into
the code a bit.*

Once you have a module that conforms to the resolution protocol you need
to register it with Tabs.  You can do this in one of two ways:

```ruby
# This call can be anywhere before you start using tabs
Tabs::Resolution.register(SecondResolution)

# or, you can use the config block described below
```

#### Removing a Resolution

You can also remove any resolution (custom or built-in) by calling the `unregister_resolutions` method in the config block (see config section below).  Or, you can remove manually by calling:

```ruby
Tabs::Resolution.unregister(:minute, :hour)
```

### Inspecting Metrics

You can list all metrics using `list_metrics`:

```ruby
Tabs.list_metrics #=> ["website-visits", "new-user-age"]
```

You can check a metric's type (counter of value) by calling
`metric_type`:

```ruby
Tabs.metric_type("website-visits") #=> "counter"
```

And you can quickly check if a metric exists:

```ruby
Tabs.metric_exists?("foobar") #=> false
```

### Drop a Metric

To drop a metric, just call `Tabs#drop_metric`

```ruby
Tabs.drop_metric!("website-visits")
```

This will drop all recorded values for the metric so it may not be un-done...be careful.

To drop only a specific resolution for a metric, just call `Tabs#drop_resolution_for_metric!`

```ruby
Tabs.drop_resolution_for_metric!("website-visits", :minute)
```

Even more dangerous, you can drop all metrics...be very careful.

```ruby
Tabs.drop_all_metrics!
```
### Aging Out Old Metrics

You can use the expiration features to age out old metrics that may no longer be in your operational data set.  For example, you may want to keep monthly or yearly data around but the minute or day level data isn't necessary past a certain date.  You can set expirations for any resolution:

```ruby
Tabs.configure do |config|
  config.set_expirations(minute: 1.day, day: 1.week)
end
```

The expiration date will start counting at the beginning of the end of the given resolution.  Meaning that for a month resolution the given expiration time would start at the end of a given month.  A month resolution metric recorded in January with an expiration of 2 weeks would expire after the 2nd week of February.

*NOTE: You cannot expire task metrics at this time, only counter and
values.*

### Configuration

Tabs just works out of the box. However, if you want to override the default Redis connection or decimal precision, this is how:

```ruby
Tabs.configure do |config|

  # set it to an existing connection
  config.redis = Redis.current

  # pass a config hash that will be passed to Redis.new
  config.redis = { :host => 'localhost', :port => 6379 }

  # pass a prefix that will be used in addition to the "tabs" prefix with Redis keys
  # Example: "tabs:my_app:metric_name"
  config.prefix = "my_app"

  # override default decimal precision (5)
  # affects stat averages and task completion rate
  config.decimal_precision = 2

  # registers a custom resolution
  config.register_resolution :second, SecondResolution

  # unregisters any resolution
  config.unregister_resolutions(:minute, :hour)

  # sets TTL for redis keys of specific resolutions
  config.set_expirations({ minute: 1.hour, hour: 1.day })

end
```

#### Prefixing

Many applications use a single Redis instance for a number of uses:
background jobs, ephemeral data, Tabs, etc.  To avoid key collisions,
and to make it easier to drop all of your tabs data without affecting
other parts of your system (or if more than one app shares the Redis
instance) you can prefix a given 'instance'.

Setting the prefix config option will cause all of the keys that tabs
stores to use this format:

```
tabs:#{prefix}:#{key}..."
```

## Change Log & Breaking Changes

### v0.6.0

Please note that when the library version went from v0.5.6 to v0.6.0 some of
the key patterns used to store metrics in Redis were changed.  If you upgrade
an app to v0.6.0 the previous set of data will not be picked up by tabs.
Please use v0.6.x on new applications only.  However, the 'Task' metric
type will only be available in v0.6.0 and above.

### v0.8.0

In version 0.8.0 and higher the get_stats method returns a more robust
object instead of just an array of hashes.  These stats objects are
enumerable and most existing code utilizing tabs should continue to
function.  However, please review the docs for more information if you
encounter issues when upgrading.

### v0.8.2

In version 0.8.2 and higher the storage keys for value metrics have been
changed.  Originally the various pieces (avg, sum, count, etc) were
stored in a JSON serialized string in a single key.  The intent was that
this would comprise a poor-mans transaction of sorts.  The downside
however was a major hit on performance when doing a lot of writes or
reading stats for a large date range.  In v0.8.2 these component values
are stored in a real Redis hash and updated atomically when a value is
recorded.  In future versions this will be changed to use a MULTI
statement to simulate a transaction.  Value data that was recorded prior
to v0.8.2 will not be accessible in this or future versions so please
continue to use v0.8.1 or lower if that is an issue.

### v1.0.0

_WARNING: Version 1.0.0 is not compatible with previous versions of
Tabs_

We have made a number of changes related to how our metric keys are stored
in Redis.  At this point we'll be following semantic versioning and will
support backwards compatability between major versions.  In this release
we've added a number of major features:

* Metric expiration
* Key prefixes
* Support for unregistering resolutions
* A number of small numeric fixes

## Contributing

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request

repository: keithrowell/tabs

repo_name: keithrowell/tabs


text:
# Animated Carousel Card

Display an animated carousel Card within the animated card carousel. Each animated carousel card consist of Subheader, Header, Description and Image.

## Usage

Add the front-end-component library to your project

```bash
yarn add @verndale/front-end-components
```

Import the style to your main style file in your project

```scss
@import '../../node_modules/@verndale/front-end-components/lib/cards/animated-carousel-card/styles';
```

Copy and paste to your project any of the markup in the link variations - you can find the markup in the **HTML tab**.

---

## Styling

The component will already have a default style/theme set, so it will work out of the box.
The testimonials cards has a set of variables that may be overriden, or you may choose to just override the actual styles in your project.
It is recommended to use the overrides if you can as it will be less code in your project.

Below is the list of variables you can override. You may also find these in the **Assets tab** under `_variables.scss`

```scss
$primary-color
$background-carousel-card-color

```

**_You always need to set your overrides before the import of you component - for example:_**

```scss
$background-carousel-card-color: #fff;
$primary-color: #06847b;
@import '../../node_modules/@verndale/front-end-components/lib/cards/animated-carousel-card/styles';
```


text:
---
layout: design
title: DocNow Backend
creator: Ed Summers
created: 2019-10-11
---

## Problem

It currently costs $250/month to run the demo.docnow.io instance of DocNow on
Amazon Web Services using their Elastic Compute Cloud (EC2), ElasticCache
(Redis) and ElasticSearch services. ElastiCache is running on a cache.m3.medium
instance, and accounts for about 55% of the cost. The ElasticSearch instance is
running one m4.large node and accounts for 45% of the cost. The DocNow app
itself runs on a t2.micro instance and amounts for a little less than 5% of the
cost.

Even when you consider that this infrastructure can be brought up on demand
using our Terraform deployment, it is still quite costly to use DocNow,
especially if you want to do long term data collection. So far we have resisted
positioning demo.docnow.io as a central service and instead have been
encouraging people to install the application themselves. However the cost of a
even modestly sized instance which can comfortably hold 3 million or so tweets
is likely beyond the budgets of many small community archives that are have
become our primary audience.

Design of the DocNow application began in Phase 1 (2015) when we were focused on
high volume, scalable data collection. ElasticSearch was selected as a the
primary data store because it provides an architecture that can be scaled on
demand to hold billions of documents by simply growing the number of nodes in
the cluster. Redis was initially used as a pub/sub queue to coordinate work
amongst multiple processes for streaming data from Twitter, and web crawling.
However over time we started using it for other things too, like keeping track
of what urls are found in tweets, and url unshortening, and web page metadata
extraction.

The problem is that both ElasticSearch and Redis are memory hungry, and are fast
because they can store things in RAM, or can swap things into RAM quickly. They
index everything and make it easy to develop an application without thinking
about how to optimize a database schema. This is great if money is no object,
but for the Documenting the Now project the cost increasingly matters. We want
people in the community archives space to be able to easily run a modest size
instance for collecting things that are relevant for them. But at the moment
this is both technically and financially beyond their reach.

## Requirements

Ideally the DocNow application would be able to modest data collection for a
small community using much less compute resources, such a single Amazon EC2
micro instance ($15/month), or a desktop computer. Indeed it would be great if
the app could be functional running on a RaspberryPi. For this to work the
application would need to be much less memory hungry.

## Proposal

We could try swapping out the ElasticSearch and Redis backend for a flexible
relational database like PosgreSQL which should be more efficient when it comes
to memory usage. Using a relational database will require us to define a
database schema up front, however PostgreSQL also has support [JSON] types which
should allow us to store tweets as JSON blobs without indexing them every which
way. Now that the dimensions of the DocNow app are largely known it ought be
possible to decide what does need to be indexed.

PostgreSQL also supports simple [queue notifications] which should allow the
DocNow app to signal when the stream-loader and url-loader processes need to
start and stop work. There would be significant work in moving the counting that
is happening in Redis over to PostgreSQL queries. But it ought to be possible,
and perhaps if some metrics are too costly to calculate they can be cut from the
application. The core functionality of the app should move from trying to
provide detailed analytics of millions of tweets to helping archivists, and
researchers engage in conversation with content creators.

While PostgreSQL will use less resources (memory) for modest collecting it also
should also in principle scale to larger data collection if needed using
approaches like [Citus](https://docs.citusdata.com/en/v8.3/) that allow
PostgreSQL to work as a cluster.

## Action Items

* Examine library options for Node/PostgreSQL db connections.
* Examine existing application metrics to derive a base database schema.
* Experiment with storing tweet using JSON Postgres data type.
* Experiment with PostgreSQL queue notifications from Node.
* Estimate effort involved in rewriting server/db.js and server/redis.js functions
* Try running PostgreSQL on a RasPi.

[JSON]: https://www.postgresql.org/docs/9.4/datatype-json.html
[queue notifications]: https://www.postgresql.org/docs/9.1/sql-notify.html

gha_language: HTML