text:
# i18n setup

We use three libraries to handle our i18n scenario

First, `react-intl` allows us to specify translations inside `json` files and load them inside our app

However, a simple use of this library leads to passing `json` keys as strings inside your code. This makes it difficult to detect if a translation is actually used and if you're following good practices.

To solve this, we use `babel-plugin-react-intl` which forces you to wrap the `json` keys in an special object though a `defineMessages` hook of `react-intl` inside your code that way the system can track which translations are used.

Now we can use `react-intl-translations-manager` to generate a report of our translations any any mistakes that there may be (unused strings, missing translations, etc.)

## Advantages/disadvantages with this setup

`babel-plugin-react-intl` forces us to pollute our code with all these `defineMessages` that require a default text also specified in the code. This causes duplication of the translations where it occurs in both our `json` and our source (you can see discussion about this [here](https://github.com/yahoo/babel-plugin-react-intl/issues/43)). We could fix this by wrapping `defineMessages` again with our own wrapper that removes this requirement.

Since the `defineMessages` occur inside our code, it means you have to compile the project to detect which translations are used. This makes switching branches problematic since switching branches will invalidate your `translation/messages` cache and you have to rebuild to fix it (if you call `manage-translations` before doing this, you will get bad results). To fix this, we have a custom git hook that automatically purges the cache whenever you switch branches.

One advantage is that this setup allows us to include the `translation-manager` results as part of our CI build (not done as of Oct 30th)

## How to add a new i18n text

**Warning**: You can only add / modify text for `en-US`. To modify other languages, you **must** make the change in [Crowdin](https://crowdin.com/project/yoroi-app/), otherwise Crowdin will override your changes.

Let's see an example of how to add a new i18n text. For this example let's **assume** we have the following supported locales.
1. [en-US](https://github.com/Emurgo/yoroi-frontend/blob/develop/app/i18n/locales/en-US.json)
2. [ja-JP](https://github.com/Emurgo/yoroi-frontend/blob/develop/app/i18n/locales/ja-JP.json)

The text we want to add is `I am testing i18n`

#### Steps
1. In [en-US](https://github.com/Emurgo/yoroi-frontend/blob/develop/app/i18n/locales/en-US.json) add a new key and the text.
```
{
    ...
    "test.text": "I am testing i18n"
    ...
}
```

2. Next you have to register the definitions using `defineMessages` method of `react-intl` module. If this text is going to be used in multiple components then you have to define it in [global-messages.js](https://github.com/Emurgo/yoroi-frontend/blob/develop/app/i18n/global-messages.js) otherwise define it in the target component. Let's assume that our target component is `TestText.js`. We have to modify `TestText.js` like below.
```
// @flow
import { Component } from 'react';
import { observer } from 'mobx-react';
import { defineMessages, intlShape } from 'react-intl';

const messages = defineMessages({
  testText: {
    id: 'test.text',
    defaultMessage: '!!!I am testing i18n',
  }
});

@observer
export default class TestText extends Component {

  static contextTypes = {
    intl: intlShape.isRequired,
  };

  render() {
    const { intl } = this.context;
    return (<div>{intl.formatMessage(messages.testText)}</div>);
  }
}
```

**WARNING:** If you did not register the definition using `defineMessages` method and try to [Rebuilding language cache](https://github.com/Emurgo/yoroi-frontend/tree/develop/app/i18n#rebuilding-language-cache) then your newly added keys will be deleted.

3. Follow steps of [Rebuilding language cache](https://github.com/Emurgo/yoroi-frontend/tree/develop/app/i18n#rebuilding-language-cache). New key for every locale will be added like below.

[en-US](https://github.com/Emurgo/yoroi-frontend/blob/develop/app/i18n/locales/en-US.json)
```
{
    ...
    "test.text": "I am testing i18n"
    ...
}
```

[AUTO-ADDED] [ja-JP](https://github.com/Emurgo/yoroi-frontend/blob/develop/app/i18n/locales/ja-JP.json)
```
{
    ...
    "test.text": "!!!I am testing i18n"
    ...
}
```

## Rebuilding language cache

After making changes that affect the languages files, please do the following **AFTER** backing up your work (these actions may edit your files in a way you would like to reverse).

1) `npm run translations:purge` (delete translation cache)
2) `npm run prod:build` (rebuild translation cache. Note: you **need** to do this but it doesn't have to be `dev`. Any task that causes a rebuild is fine.)
3) `npm run translations:manage` (check language config for mistakes. Note: auto-fix is dangerous)

repository: Emurgo/yoroi-frontend

repo_name: Emurgo/yoroi-frontend


text:
# beagleroy
Dynamic State Interface for React

# Description
Beagleroy creates an interface for maintaining and adjusting the state of an
application. This is still in the early state of development.

# Why beagleroy
This is a baseline attempt to make a state storage interactive through actions
that have side effects in as compact a space as possible.

# Current Spec
## primary usage

    const state = createStore('inventory');

    state.createAction('addItem', (name, price) => {
        ... return a pure version of the state
    })
    .meanwhile(*(state, action) => {
        ... asynchronous calls
    });

## config

    const state = createStore('inventory', configObject);

The `configObject` in the line above is how you pass in additional options into
the system. Some of the options will require that additional libraries be installed.
If those libraries are not installed and the environment is development you'll
get a warning in the console.

* *Logging:* `off` (default), `all`, `actions`, `sideEffects`. Requires library `beagleroy-logging`
    Logging only works in development modes.

# Goals
* Testability
* Compact action writing
* State maintaince and healing
* ease of use and understanding

repository: iwnnay/beagleroy

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: iwnnay/beagleroy


text:
# NativeGap.js

![NPM Version](https://img.shields.io/npm/v/nativegap.svg)
<img src="https://travis-ci.org/NativeGap/nativegap.js.svg?branch=master" />

Build native apps for all major platforms with NativeGap.

#### Platforms

* Android
* iOS
* Universal Windows Platform (Windows 10)
* Chrome (Extension)

#### How it works ...

1. Create and customize your apps from the [NativeGap dashboard](https://nativegap.com).
2. Add NativeGap.js to your app in order to track currently used apps and to add some custom styling.

#### Extensions

* [Ruby on Rails](https://github.com/jonhue/nativegap-rails)

---

## Table of Contents

* [Setup](#setup)
* [Usage](#usage)
* [To Do](#to-do)
* [Contributing](#contributing)
    * [Contributors](#contributors)
    * [Semantic Versioning](#semantic-versioning)
* [License](#license)

---

## Setup

While this package assists you in creating a true cross-platform app, [NativeGap](https://nativegap.com) is still needed to create the actual native code. That's not too big of a deal though, NativeApp can be used entirely for free ([learn more](https://nativegap.com/pricing)) and it has an extensive [documentation](https://nativegap.com/guide).

Getting started with NativeGap:

1. Create a new NativeGap app.
2. Wait until the platforms processed successfully.

That's it!

## Usage

Create a new instance of the `NativeGap` class whenever a page loads:

```javascript
import NativeGap from 'nativegap';
document.addEventListener( 'DOMContentLoaded', () => const nativegap = new NativeGap );

// Get the users platform
nativegap.platform;
```

### Options

You can pass an options hash when creating a new instance of the `NativeGap` class:

```javascript
let nativegap = new NativeGap({ path: 'nativegap' });
```

#### Global

Global options can be set by passing the options name as a hash key of the options hash.

* `android` Hash of platform specific options for your Android app. Defaults to `{ scale: 1.4 }`.
* `ios` Hash of platform specific options for your iOS app. Defaults to `{ scale: 1 }`.
* `windows` Hash of platform specific options for your Universal Windows Platform (Windows 10) app. Defaults to `{ scale: 1 }`.
* `chrome` Hash of platform specific options for your Chrome extension. Defaults to `{ scale: 1 }`.

#### Platform

Platform options can be set by passing the options name as a hash key of a platform hash.

* `scale` Sets the `font-size` of the HTML page to the product of `16` and the value of this option. Takes a float or an integer.

---

## To Do

[Here](https://github.com/NativeGap/nativegap.js/projects/1) is the full list of current projects.

To propose your ideas, initiate the discussion by adding a [new issue](https://github.com/NativeGap/nativegap.js/issues/new).

---

## Contributing

We hope that you will consider contributing to NativeGap.js. Please read this short overview for some information about how to get started:

[Learn more about contributing to this repository](CONTRIBUTING.md), [Code of Conduct](CODE_OF_CONDUCT.md)

### Contributors

Give the people some :heart: who are working on this project. See them all at:

https://github.com/NativeGap/nativegap.js/graphs/contributors

### Semantic Versioning

NativeGap.js follows Semantic Versioning 2.0 as defined at http://semver.org.

## License

MIT License

Copyright (c) 2018 Jonas Hübotter

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.

license: MIT

gha_language: JavaScript

gha_license_id: MIT


text:
# Current Status
GPU Ocelot project is not longer actively maintained. The latest system requirement and installation guide are available at [https://github.com/gtcasl/gpuocelot/wiki/Installation](https://github.com/gtcasl/gpuocelot/wiki/Installation)

# Overview
Ocelot is a modular dynamic compilation framework for heterogeneous system, providing various backend targets for CUDA programs and analysis modules for the PTX virtual instruction set. **Ocelot currently allows CUDA programs to be executed on NVIDIA GPUs, AMD GPUs, and x86-CPUs at full speed without recompilation.** For more information, check [http://gpuocelot.gatech.edu/](http://gpuocelot.gatech.edu/).

# Installation
Please check the installation guide [here](https://github.com/gtcasl/gpuocelot/wiki/Installation).

# Resources
* Source code documentation
[http://gpuocelot.gatech.edu/doxygen](http://gpuocelot.gatech.edu/doxygen)
* Mailing list
[http://groups.google.com/group/gpuocelot](http://groups.google.com/group/gpuocelot)

# News
March, 2013 - Actively seeking developers for AMD and Intel GPU backends. Please post on the mailing list if interested.

June 10, 2012 - GPU Ocelot tutorial to be presented at ISCA 2012.

May 14, 2012 - GPU Ocelot poster to be presented at GPU Technology Conference.

March 5, 2012 - Call for developers for the NVIDIA GPU device and the AMD GPU device. Initial implementations are in-place but we could greatly benefit from owners willing to test the code and add new features as new hardware (Kepler, GCN) comes out. Post on the mailing list if you are interested.

October 10, 2011 - Ocelot tutorial at PACT 2011.

# Contributing
## Documentation
Ocelot currently is lacking good documentation for installation and common usage. If anyone is interested in writing tutorials or howtos please post on the mailing list.

## Complete a Feature Request
If you would like to contribute to this project and help with any of the directions on our roadmap you can do the following:

1. Pull a task from the list of issues
2. Implement it on your own
3. Post a patch to the relevant issue
  * See the [requirements](https://github.com/gtcasl/gpuocelot/wiki/ContributingRequirements) for contributing a feature
  * If it is accepted we will merge it into the main codebase
4. Ask us about becoming a registered developer

## Branch Our Code
If you want to work on something not on our roadmap, but want to host your code on this site, contact us about becoming a developer and creating a branch.

## Start A New Project
If you want to work independently using Ocelot as a starting point, feel free to copy our most current release and use it internally.

# Special Thanks
We would like to thank the following people, who have contributed novel ideas, software, and tests to the project:

* Nathan Bell
* Sylvain Collange
* David Luebke
* Diogo Sampaio
* Ryuta Suzuki
* Steve Worley
* Ignacio Llamas
* James Bigler
* Greg Humphreys

repository: mprevot/gpuocelot

repo_name: mprevot/gpuocelot


text:
# The Use of Anaerobic Digestion in the processing of on site Food Waste

Repository for Scripts used in REST MSc Project

This contains scripts and data used in the Project

##Contents

1. Food Waste Sankey.py - draw a Sankey diagram of food waste flows based on WRAP data
2. ADSiteAnalysis.R - anlayse AD sites from ADBA/NNFCC data
3. Buswell.R - calculate volume of gas produced from a given formula and mass of feedstock using Buswell equation.
4. EconomicModel.R which takes the COD and amount of feedstock per day together with other variables and calculates the IRR.

repository: P-Askew-Eng/RESTMSc

repo_name: P-Askew-Eng/RESTMSc


text:
It is a Sass based, Object Oriented framework that is full of objects and
abstractions. inuit.css provides little-to-no design which means no undoing
things, no deleting CSS and no adhering to other peoples’ design decisions.

inuit.css is built on a [BEM](http://bem.info/)-style naming convention and
honed based on [work done by Nicolas Gallagher](https://gist.github.com/1309546).

inuit.css is ideally suited to designers who want to focus on the creative and
not code, and developers who understand the need for abstraction and an OO
approach.

inuit.css gives you design patterns, not design decisions. It features nestable,
fluid grids; a double-stranded heading hierarchy; sprites; buttons and a lot,
_lot_ more.

**Use inuit.css if:**

* You need a powerful library of objects and abstractions.
* You understand/appreciate the value of OO code and the need for scalability
  and reuse.
* You are a confident/competent developer comfortable with OOCSS and Sass, as
  well as familiarity with OO principles in general.

**Do not use inuit.css if:**

* You need a framework that supplies design (I’d recommend
  [Bootstrap](http://twitter.github.com/bootstrap/) for that).

## Browser support

inuit.css is a modern framework for modern browsers. It takes advantage of
[normalize.css](http://necolas.github.com/normalize.css/) and global
`box-sizing:border-box;` (optional). As such, inuit.css is intended for **IE8**
and above only.  The last release to support IE7 was
[v4.1.5](https://github.com/csswizardry/inuit.css/archive/v4.1.5.zip).

## The developer

There are a million-and-one different CSS frameworks out there so this rather
cringeworthy section is an attempt to validate inuit.css and give it some
credibility…

I am [Harry Roberts](http://hry.rbrts.me), I am a 22 year old developer and
front-end architect from the UK. I work as a Senior UI Developer for
[BSkyB](http://en.wikipedia.org/wiki/BSkyB) where it is my job to build scalable
front-ends, write internally used CSS frameworks and libraries, and to architect
CSS and front-end builds.

I [write](http://csswizardry.com), [tweet](http://twitter.com/csswizardry) and
[speak](http://speakerdeck.com/u/csswizardry/) about OOCSS, scalable CSS,
maintainability, working in large teams, CSS performance, CSS architecture and a
whole lot more.

inuit.css is the result of years of my specialism in CSS (as CSS is all I do).
It is a collection of design patterns, objects, and abstractions that have been
refined and bulletproofed over hours of development across an array of projects
of varying sizes. inuit.css is the result of hundreds of hours of work all
condensed into one powerful little framework.

## Installation

**Requires Sass 3.2**

[**Watch _An introduction to inuit.css_ screencast**](http://www.youtube.com/watch?v=IkaILVOgGRA&hd=1)

inuit.css is incredibly easy to get up and running (provided you’re all set for
Sass). Simply [download the latest version](https://github.com/csswizardry/inuit.css/zipball/master)
of inuit.css from right here on GitHub, unpack the zip file, rename
`your-project.scss` to whatever your project is called and then watch that file.

You can watch the file by `cd`ing into the directory that houses the `.scss`
and running the following:

    sass --watch [your-project].scss:[your-project].min.css --style compressed

…where `[your-project]` is the name you have chosen for your build.

Alternatively you can modify [`watch.sh`](https://github.com/csswizardry/inuit.css/blob/master/watch.sh)
to reflect the name of your project and simply run:

    sh watch.sh

…from the command line.

That’s it, your project is now set up on inuit.css.

To begin adding your styles on top of inuit.css just begin including things in
[`[your-project].scss`](https://github.com/csswizardry/inuit.css/blob/master/your-project.scss#L22)
_after_ you’ve called in your variables and the inuit.css framework.

If there are any  objects and abstractions you _don’t_ use in your project, it
is advisable that you comment out their inclusion in
[`inuit.scss`](https://github.com/csswizardry/inuit.css/blob/master/inuit.css/inuit.scss).
For example, if your project doesn’t require any pagination, text columns or
flyouts, you’d have:

       @import "partials/objects/grids";
       @import "partials/objects/flexbox";
    // @import "partials/objects/columns";
       @import "partials/objects/nav";
    // @import "partials/objects/pagination";
       @import "partials/objects/media";
       @import "partials/objects/island";
       @import "partials/objects/block-list";
       @import "partials/objects/matrix";
       @import "partials/objects/split";
       @import "partials/objects/this-or-this";
       @import "partials/objects/complex-link";
    // @import "partials/objects/flyout";
       @import "partials/objects/sprite";
       @import "partials/objects/icon-text";
       @import "partials/objects/buttons";
       @import "partials/objects/lozenges";
       @import "partials/objects/greybox";

This ensures that you aren’t packaging more than you need to.

## Footprint

**inuit.css is tiny.** The full framework – _including_ debug mode – once minified
and gzipped weighs **less than 5.6kB**

It is essential to **compile to a minified file** because inuit.css is packed
full of comments and whitespace; so much so that it would be detrimental to
your website’s performance to serve the unminified version.

## Documentation

There are no official docs for inuit.css because the code _is_ the
documentation. Everything is heavily commented with example HTML. If you
struggle with anything please tweet at [@inuitcss](http://twitter.com/inuitcss)
and/or [open an issue](https://github.com/csswizardry/inuit.css/issues) and I’ll
try help out and use your feedback to improve the documentation.

### Demos

Although there are no docs as such, there is [a dedicated inuit.css jsFiddle
account](http://jsfiddle.net/user/inuitcss/fiddles/) which houses plenty of
demos of various aspects of the framework.

### Development

You can keep up-to-date with upcoming features, suggestions and fixes by looking
at the [inuit.css Trello board](https://trello.com/board/inuit-css/50a16487543dea585502f3d2).

## Looking for a little LESS?

[Peter Wilson](http://twitter.com/pwcc) is maintaining a LESS port of inuit.css:
check [the GitHub repo](https://github.com/peterwilsoncc/inuit.css).

## Using Compass?

[Stephen Way](http://github.com/stephenway) is maintaining a Compass port of
inuit.css: check [the GitHub repo](https://github.com/stephenway/compass-inuit).

## Test-drive

If you would like to try inuit.css out before you download anything there is a
compiled version [on jsFiddle](http://jsfiddle.net/inuitcss/a6yS3/) that you
are encouraged to fork and play with. Refer back to
[the source here on GitHub](https://github.com/csswizardry/inuit.css/blob/master/inuit.css/inuit.scss)
for documentation.

## As used by

* [BSkyB](http://en.wikipedia.org/wiki/BSkyB)
* [pr.ofile.me](http://pr.ofile.me)
* [Lukas Bestle](http://lu-x.me)
* [Matthew Tyas](http://matthewtyas.com/)

### Using inuit.css?

If you use inuit.css on a live project then [tweet at me](http://twitter.com/inuitcss)
and I’ll send you some inuit.css stickers!

## Support inuit.css

If you use and/or like inuit.css, perhaps you might consider [supporting it
through Gumroad](http://gum.co/nOoht).

## Credits

inuit.css, although produced and maintained by one developer, could not have
been possible without inspiration and work from an array of other people.

* **[Nicole Sullivan](https://twitter.com/stubbornella)** for her work on OOCSS
* **[Jonathan Snook](https://twitter.com/snookca)** for his work on SMACSS
* **[Nicolas Gallagher](https://twitter.com/necolas)** for his work on numerous
  CSS things
* **[Bryan James](https://twitter.com/WengersToyBus)** for the inuit.css logo

And probably more…

branch_name: refs/heads/source


text:
# Youtube Downloader

Youtube Downloader is a Python Web application built with Django.

# FEATURES!

  - Download Youtube videos in every format ranging rom 144p to Full HD.
  - Easy to use, user friendly UI.

# REQUIREMENTS
  - This App Uses Python 3.9, Django 3.2, youtube-dl.
  * If you face server error 500, just upgrade youtube-dl by ```pip install youtube-dl --upgrade```

# INSTALLATION

Install the dependencies and devDependencies and start the server.

```ssh
$ https://github.com/sivaprassath99/Youtube_Video_downloader_Python.git
$ cd Youtube-Downloader
$ pip install -r requirements.txt
$ python manage.py runserver
```

The application will be available at : localhost:8000

MIT License

branch_name: refs/heads/main


text:
# v3.2.7 (Jul 7, 2022)

- chore: Updated dependencies.

# v3.2.6 (Jun 30, 2022)

- chore: Updated dependencies.

# v3.2.5 (May 11, 2022)

- chore: Updated dependencies.

# v3.2.4 (Mar 28, 2022)

- chore: Updated dependencies.

# v3.2.3 (Feb 16, 2022)

- chore: Updated dependencies.

# v3.2.2 (Feb 2, 2022)

- chore: Updated dependencies.

# v3.2.1 (Jan 14, 2022)

- chore: Bumped copyright to 2022.
- chore: Updated dependencies.

# v3.2.0 (Dec 21, 2021)

- fix: Fixed unhandled exception when sending crash error.
- chore: Updated dependencies.

# v3.1.0 (Dec 2, 2021)

- fix: Don't show available updates when `--json` flag is set.
- chore: Updated dependencies.

# v3.0.2 (Nov 5, 2021)

- chore: Updated dependencies.

# v3.0.1 (Oct 18, 2021)

- chore: Updated dependencies.

# v3.0.0 (Sep 24, 2021)

- BREAKING CHANGE: Require Node.js 12.13.0 LTS or newer.
  ([APIGOV-19220](https://jira.axway.com/browse/APIGOV-19220))
- refactor: Replaced `appcd-*` libraries with `@axway/amplify-utils`.
  ([APIGOV-20264](https://jira.axway.com/browse/APIGOV-20264))
- feat: Added `telemetry` to help improve Axway products.
  ([APIGOV-19209](https://jira.axway.com/browse/APIGOV-19209))
- feat: Add non-production environment title to banner.
- fix: Only error out when config file is bad when running a config command.
- refactor: Move `--env` from auth and oum CLI's to the Axway CLI.
- style: Fixed indentation of error messages.
- doc: Fixed Axway CLI documentation URL in post install message.

# v2.2.0 (Jul 30, 2021)

- feat: Checks if any installed CLI extension packages have updates available and prints them
  at the end of a command whenever the banner is rendered.
  ([APIGOV-19210](https://jira.axway.com/browse/APIGOV-19210))
- chore: Added unsupported architecture and 32-bit architecture deprecation warning to banner.
  ([CLI-130](https://jira.axway.com/browse/CLI-130))
- doc: Added "install Axway Central CLI" to post install next steps verbiage.
  ([CLI-128](https://jira.axway.com/browse/CLI-128))
- style: Adjusted error rendering.

# v2.1.0 (May 11, 2021)

- feat: Added post install welcome message.
- fix: Properly output errors when `--json` flag is set.
- chore: Added deprecation warning for Node.js 10 and older.
  ([CLI-110](https://jira.axway.com/browse/CLI-110))
- chore: Updated dependencies.

# v2.0.0 (Jan 22, 2021)

- Initial release of the Axway CLI, formerly AMPLIFY CLI.
  ([CLI-100](https://jira.axway.com/browse/CLI-100))
- BREAKING CHANGE: Require Node.js 10.19.0 or newer.
  ([CLI-89](https://jira.axway.com/browse/CLI-89))
- BREAKING CHANGE(config): `config` command does not return current value when doing a `set`,
  `push`, or `unshift`.
- BREAKING CHANGE(config): `config list` command no longer supports filtering, use `config get`
  instead.
- BREAKING CHANGE(config): Write operations such as `set` return `"OK"` instead of `"Saved"`.
- feat(config): Added proxy info to config help.
- feat: Added notificaiton if new version is available.
  ([CLI-22](https://jira.axway.com/browse/CLI-22))
- feat: Added `axway:config:save` action to `config` command.
  ([CLI-105](https://jira.axway.com/browse/CLI-105))
- refactor(config): Do not show the banner for `config` related commands.
- refactor(config): Replaced config action with subcommands for cleaner code and improved help
  information.
- fix(config): Latest cli-kit no longer requires `showHelpOnError` to be disabled.
- style: Prefix error message with an X symbol.
- chore: Updated dependencies.

gha_license_id: NOASSERTION


text:
[![Build Status](https://travis-ci.org/MSeal/py_cache_manager.svg?branch=master)](https://travis-ci.org/MSeal/py_cache_manager)

# CacheMan
A Python interface for managing dependent caches.

'Ba-Bop-Ba-Dop-Bop'

## Description
This module acts as a dependency manager for caches and is ideal for instances
where a program has many repeated computations that could be safely persisted.
This usually entails a DB layer to house key value pairs. However, such a layer
is sometimes overkill and managing a DB along with a project can be more effort
than it's worth. That's where CacheMan comes in and provides an interface
through which you can define savers, loaders, builders, and dependencies with
disk-based defaults.

By default all caches will auto save when 10k changes occur over 60 seconds, 10
changes occur over 300 seconds (but after 60 seconds), or 1 change occurs within
900 seconds (after 300 seconds). This behavior can be changed by instantiating
an AutoSyncCache from the autosync submodule.

## Dependencies
psutil -- for asynchronous cache saving

## Features
* Drop in replacement for local memory dictionaries
* Default persistent pickle caches
* Non-persistent caching
* Cache load/save/delete hooks w/ defaults
* Cache validation hooks
* Cache builder hooks
* Dependent invalidation
* Auto-Syncing caches

## How to use
Below are some simple examples for how to use the repository.

### Setting up a simple persistent cache
    from cacheman import cacher

    manager = cacher.get_cache_manager() # Optional manager name argument can be used here
    cache = manager.register_cache('my_simple_cache') # You now have a cache!
    print cache.get('my_key') # `None` first run, 'my_value' if this code was executed earlier
    cache['my_key'] = 'my_value'
    cache.save() # Changes are now persisted to disk
    manager.save_cache_contents('my_simple_cache') # Alternative way to save a cache

### Non-persistent caches
    from cacheman import cacher

    manager = cacher.get_cache_manager()
    cache = manager.register_custom_cache('my_simple_cache', persistent=False) # You cache won't save to disk
    cache.save() # This is a no-op

### Registering hooks
    from cacheman import cacher
    from cacheman import cachewrap

    def my_saver(cache_name, contents):
        print("Save requested on {} cache content: {}".format(cache_name, contents))

    def my_loader(cache_name):
        return { 'load': 'faked' }

    manager = cacher.get_cache_manager()

    cache = cachewrap.PersistentCache('my_cache', saver=my_saver, loader=my_loader)
    # Can also use manager to set savers/loaders
    #manager.retrieve_cache('my_cache')
    #manager.register_saver('my_cache', my_saver)
    #manager.register_loader('my_cache', my_loader)

    cache.save() # Will print 'Save ... : { 'load': 'faked' }'
    cache['new'] = 'real' # Add something to the cache
    cache.save() # Will print 'Save ... : { 'load': 'faked', 'new': 'real' }'

### Dependent caches
    from cacheman import cacher

    manager = cacher.get_cache_manager()
    edge_cache = manager.retrieve_cache('edge_cache')
    root_cache = manager.register_cache('root_cache')
    manager.register_dependent_cache('root_cache', 'edge_cache')

    def set_processed_value():
        # Computes and caches 'processed' from root's 'raw' value
        processed = edge_cache.get('processed')
        if processed is None:
            processed = (root_cache.get('raw') or 0) * 5
            edge_cache['processed'] = processed
        return processed

    # A common problem with caching computed or dependent values:
    print set_processed_value() # 0 without raw value
    root_cache['raw'] = 1
    print set_processed_value() # still 0 because it's cache in edge

    # Now we use cache invalidation to tell downstream caches they're no longer valid
    root_cache.invalidate() # Invalidates dependent caches
    print edge_cache # Prints {} even though we only invalidated the root_cache
    root_cache['raw'] = 1
    print set_processed_value() # Now 5 because the edge was cleared before the request
    print edge_cache # Can see {'processed': 5} propogated

### Setting cache directory
    from cacheman import cacher

    # Default cache directory is '/tmp/general_cacher' or 'user\appadata\local\temp\general_cache'
    # All pickle caches now save to namespaced directories within the base_cache_directory directory
    manager = cacher.get_cache_manager(base_cache_directory='secret/cache/location')

    cache = manager.register_cache('my_cache')
    cache['new'] = 'real' # Add something to the cache
    cache.save('my_cache') # Will save contents to 'secret/cache/location/general_cache/my_cache.pkl'

## Navigating the Repo
### cacheman
Package wrapper for the repo.

### tests
All unit tests for the repo.

## Language Preferences
* Google Style Guide
* Object Oriented (with a few exceptions)

## TODO
* Better argument checks
* Changelog

## Author
Author(s): Matthew Seal

gha_language: Python


text:
Sparkerl Server
===============

A server for the Spark protocol. ALPHA! Eventually this could replace the
Particle NodeJS server. Right now it is mostly a debug server.

Developing Locally
==================

Install Erlang R19

    make deps app shell

Add Keys
========

Keys for your cores need to be added to the `keys/` directory. This can be done
with the Particle CLI. I need to find a good way to get the ID :/

    particle keys save keys/ID

Right now the ID is logged when running the server as `SMT ID: ...`

repository: philipcristiano/sparkerl-server

repo_name: philipcristiano/sparkerl-server


text:
# Twilio Video Quickstart for Android

Use this project to get started with Twilio Video's Android SDK by [following along with the quickstart guide here](https://www.twilio.com/docs/api/video/guide/quickstart-android).

 [ ![Download](https://api.bintray.com/packages/twilio/releases/conversations-android/images/download.svg) ](https://bintray.com/twilio/releases/conversations-android/_latestVersion)

## Up and Running

1) Create a Twilio Video [Configuration Profile](https://www.twilio.com/user/account/video/profiles). If you haven't used Twilio before, welcome! You'll need to [Sign up for a Twilio account](https://www.twilio.com/try-twilio).

2) Download this project and open it in Android Studio.

3) Get an access token [Generate an Access Token](https://www.twilio.com/user/account/video/dev-tools/testing-tools). Pick your identity (such as Bob). Leave this web page open, because you'll use it as the other side of the video chat.

4) Paste the access token into ConversationActivity.java

5) Run your app on an Android device or the Android emulator

6) On the same web page where you generated the token, scroll down the bottom, put in the username that you generated the access token for, and click Create Conversation. Your video conversation should start immediately!

## What is this project?

This quick start will help you get video chat integrated directly into your Android applications using Twilio's Video Conversations SDK.

Inside this quick start project, you will find an Activity that contains all of the functionality necessary to show two video streams on one screen - one video stream for your phone's video camera, and one for a remote video stream.

You'll see how to set up key classes like TwilioAccessManager, ConversationsClient, LocalMedia, Conversation, and CameraCapturer. All of these Twilio classes have related listeners with implementations in ConversationActivity.java.

You can also see how Android's runtime permissions are implemented for access to the camera and the microphone on Android devices running version 6.0 (Marshmallow) or higher inside the onCreate() method in the ConversationActivity class. It's important to note that you shouldn't initialize the Twilio client until the user grants access to the camera and microphone.

## Prerequisites

This project is a native Android application written in Java. You will need an up-to-date version of Android Studio (at the time of this writing, 2.1.0), to build the application. You will also need version 23.0.2 of the Android build tools, which you can download through Android Studio if you do not have them installed.

The minimum supported Android version is 4.1 for devices or Android emulators. You can run the quick start on an x86 Android emulator - either 32-bit or 64-bit.

## Access Tokens and Servers

Using Twilio's Video client within your applications requires an access token. These access tokens can come from one of two places:

1) You can create a one-time use access token for testing on Twilio.com. This access token can be hard-coded directly into your mobile app, and you won't need to run your own server.

2) You can run your own server that provides access tokens, based on your Twilio credentials. This server can either run locally on your development machine, or it can be installed on a server. If you run the server on your local machine, you should use the ngrok utility to give the server an externally accessible web address. That way, you can run the quick start app on an Android device.

### Generating an Access Token

The first step is to [Generate an Access Token](https://www.twilio.com/user/account/video/dev-tools/testing-tools) from the Twilio developer console. Use whatever clever username you would like for the identity. You will get an access token that you can copy and paste into ConversationActivity.java

Once you have that access token in place, scroll down to the bottom of the page and you will get a web-based video chat window in the Twilio developer console that you can use to communicate with your Android app! Just invite that identity you just named above!

### Setting up a Video Chat Web Server

If you want to be a little closer to a real environment, you can download one of the video quickstart applications - for instance, [Video Quickstart: PHP](https://github.com/TwilioDevEd/video-quickstart-php) and either run it locally, or install it on a server.

 You'll need to gather a couple of configuration options from your Twilio developer console before running it, so read the directions on the quickstart. You'll copy the config.example.php file to a config.php file, and then add in these credentials:

 Credential | Description
---------- | -----------
Twilio Account SID | Your main Twilio account identifier - [find it on your dashboard](https://www.twilio.com/user/account/video).
Twilio Video Configuration SID | Adds video capability to the access token - [generate one here](https://www.twilio.com/user/account/video/profiles)
API Key | Used to authenticate - [generate one here](https://www.twilio.com/user/account/messaging/dev-tools/api-keys).
API Secret | Used to authenticate - [just like the above, you'll get one here](https://www.twilio.com/user/account/messaging/dev-tools/api-keys).

#### A Note on API Keys

When you generate an API key pair at the URLs above, your API Secret will only
be shown once - make sure to save this in a secure location.

#### Running the Video Quickstart with ngrok

If you run your video chat application on an Android device, you'll need to provide an externally accessible URL for the app. The [ngrok](https://ngrok.com/) tool creates a publicly accessible URL that you can use to send HTTP/HTTPS traffic to a server running on your localhost. Use HTTPS to make web connections that retrieve a Twilio access token.

When you get a URL from ngrok, go ahead and update ConversationActivity.java with the new URL. At the very bottom is the retrieveAccessTokenfromServer() method.  If you go down this path, be sure to follow the directions in the comments in the initializeTwilioSdk() method at the top of the source file - you will need to comment out everything under "OPTION 1" and uncomment the one line under "OPTION 2". You will also need to update the code if your ngrok URL changes.

## Have fun!

This is an introduction to Twilio's Video Conversations SDK on Android. From here, you can start building applications that use video chat across the web, iOS, and Android platforms.

## License

MIT

repository: csemrm/video-quickstart

repo_name: csemrm/video-quickstart


text:
---
layout: default
---

# 1995-12-07 - Re: Is there a lawyer in the house?

## Header Data

From<EMAIL_ADDRESS>(Timothy C. May)

To<EMAIL_ADDRESS>Message Hash: 453180461b7a03f69026bd3abddcff6f2b2f9a984c3662977df27047227bfa64

Message ID<EMAIL_ADDRESS>Reply To: _N/A_

UTC Datetime: 1995-12-07 23:11:28 UTC

Raw Date: Thu, 7 Dec 95 15:11:28 PST

## Raw message

```
{% raw  %}From<EMAIL_ADDRESS>(Timothy C. May)
Date: Thu, 7 Dec 95 15:11:28 PST
To<EMAIL_ADDRESS>Subject: Re: Is there a lawyer in the house?
Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

At 9:27 PM 12/7/95<EMAIL_ADDRESS>wrote:

>It could be even worse.  I was on a panel last year with Scott Charney (sp?)
>(I believe from DoJ) during which he commented that if you give your secret
>key to anyone -- e.g., your own company -- then you have given up the
>presumption of privacy.  That leaves the police open to get that secret
>without a warrant.  This claim should be checked by a real lawyer.

Huh?

You mean if you give me your key the police can get it from me without a
warrant? What if I don't want to give it up, and you don't? How would the
police get it without a warrant?

(And "I" could be your employer, so the point is clear.)

And even more strikingly, what if you give your private key to your lawyer
for safekeeping? Has attorney-client privilege gone away?

(Granted, there are ways to break attorney-client privilege, but these are
rare exceptions. In any case, the police could not get the private key
without a court order, warrant, whatever.)

I can believe that some cases of giving up keys wipes out one's arguments
based strictly on "privacy," but not that it wipes out other arguments.

It seems to me that if one wants to voluntarily escrow private keys, for
safekeeping, one's personal lawyer is a safe bet: it is very difficult to
break this kind of attorney-client confidentiality, from what I know of
such things.

--Tim May

Views here are not the views of my Internet Service Provider or Government.
---------:---------:---------:---------:---------:---------:---------:----
Timothy C. May              | Crypto Anarchy: encryption, digital money,
<EMAIL_ADDRESS>408-728-0152 | anonymous networks, digital pseudonyms, zero
Corralitos, CA              | knowledge, reputations, information markets,
Higher Power: 2^756839      | black markets, collapse of governments.
"National borders are just speed bumps on the information superhighway."

{% endraw %}
```

## Thread

+ Return to [December 1995](/archive/1995/12)

+ Return to "[Black Unicorn <unicorn@schloss.li>](/authors/black_unicorn_unicorn_at_schloss_li_)"
+ Return to "[Brian Davis <bdavis@thepoint.net>](/authors/brian_davis_bdavis_at_thepoint_net_)"
+ Return to<EMAIL_ADDRESS>(Futplex)](/authors/futplex_at_pseudonym_com_futplex_)"
+ Return to "[Jeff Weinstein <jsw@netscape.com>](/authors/jeff_weinstein_jsw_at_netscape_com_)"
+ Return to "[Michael Froomkin <froomkin@law.miami.edu>](/authors/michael_froomkin_froomkin_at_law_miami_edu_)"
+ Return to "[sameer <sameer@c2.org>](/authors/sameer_sameer_at_c2_org_)"
+ Return to<EMAIL_ADDRESS>(Timothy C. May)](/authors/tcmay_at_got_net_timothy_c_may_)"

+ 1995-12-07 (Thu, 7 Dec 95 15:11:28 PST) - Re: Is there a lawyer in the house? -<EMAIL_ADDRESS>(Timothy C. May)_
  + 1995-12-08 (Thu, 7 Dec 95 17:48:04 PST) - [Re: Is there a lawyer in the house?](/archive/1995/12/9ba301d6db224603d6a0e5478fa026da4381536aa7d40d7d0c9f3f548f44ea0e) - _Michael Froomkin<EMAIL_ADDRESS>  + 1995-12-08 (Thu, 7 Dec 95 18:16:24 PST) - [Re: Is there a lawyer in the house?](/archive/1995/12/189bab3abb0349ba3fe67608151018c04edbe56d70254e6934bb1e491cac132c) - _Black Unicorn<EMAIL_ADDRESS>    + 1995-12-08 (Thu, 7 Dec 95 18:31:50 PST) - [Re: Is there a lawyer in the house?](/archive/1995/12/8bf307370dbeefe4d88ac637b9dcaeaeea86ed6f6a49b7261ac03176de7cffee) - _sameer<EMAIL_ADDRESS>      + 1995-12-08 (Thu, 7 Dec 95 18:49:03 PST) - [Re: Is there a lawyer in the house?](/archive/1995/12/91ff2de3e99a06c1e4d7562492f31dd09f7ff83619144704c00a562ee958ce85) - _Black Unicorn<EMAIL_ADDRESS>      + 1995-12-08 (Thu, 7 Dec 95 20:54:05 PST) - [Re: Is there a lawyer in the house?](/archive/1995/12/0e99d38deca02d8f11648b3c0ad56649ae126da02349b65c233966362ecae297) - _Jeff Weinstein<EMAIL_ADDRESS>        + 1995-12-08 (Fri, 8 Dec 95 00:54:29 PST) - [Re: Is there a lawyer in the house?](/archive/1995/12/aee170d904ea9cb1da9682214a922455b26ce0c9144d7f398474867be224b33e) - _Black Unicorn<EMAIL_ADDRESS>          + 1995-12-10 (Sat, 9 Dec 95 22:27:59 PST) - [Re: Is there a lawyer in the house?](/archive/1995/12/9a68e8c9da4c3e5778974e36ce68018ed031c9b5a6bdc9022628430f93f06557) - _Brian Davis<EMAIL_ADDRESS>            + 1995-12-10 (Sat, 9 Dec 95 22:53:53 PST) - [Re: Is there a lawyer in the house?](/archive/1995/12/dfe3c1fd4c6be2bc5c8d3c36719a25c06586b8eb635c7a5898ceb690c037eddc) - _Black Unicorn<EMAIL_ADDRESS>              + 1995-12-10 (Sat, 9 Dec 95 23:32:53 PST) - [Re: Is there a lawyer in the house?](/archive/1995/12/6676be2bfba4a1b00f875be429cfddfbc5662efbd97f2ccb8e3a445536aa57bf) - _Brian Davis<EMAIL_ADDRESS>                + 1995-12-10 (Sat, 9 Dec 95 23:47:40 PST) - [Re: Is there a lawyer in the house?](/archive/1995/12/adeca43b01240d0c0de3639eaec8131b4b56f0155554572fefc825c80c8193d6) - _Black Unicorn<EMAIL_ADDRESS>            + 1995-12-10 (Sat, 9 Dec 95 23:29:07 PST) - [Re: Is there a lawyer in the house?](/archive/1995/12/ee1f112a7b3a84738187f148a5602532e64e01ec50b2ed42a059ac3d17e75d11) - _Brian Davis<EMAIL_ADDRESS>    + 1995-12-08 (Thu, 7 Dec 95 21:53:04 PST) - [Re: Is there a lawyer in the house?](/archive/1995/12/683fd33e9059bead12fad45a18633f654a1ed2fe81ddffaab3f4f5c29b0104c2) -<EMAIL_ADDRESS>(Futplex)_
      + 1995-12-08 (Fri, 8 Dec 95 00:58:15 PST) - [Re: Is there a lawyer in the house?](/archive/1995/12/1ed12ece226a6a783cc82f3f1e4a05b5cc82aef6db488f94eb4ca8794c99a82b) - _Black Unicorn<EMAIL_ADDRESS>      + 1995-12-08 (Fri, 8 Dec 95 07:47:50 PST) - [Re: Is there a lawyer in the house?](/archive/1995/12/cb2a34c78a226c61af644a94f9c879784416f2c18686eff01c010eee50ae8c70) - _Brian Davis<EMAIL_ADDRESS>


text:
---
layout: default
---

# 1995-09-30 - SAIC Shows Crime-Fighting Technology

## Header Data

From<EMAIL_ADDRESS>To<EMAIL_ADDRESS>Message Hash: d5ce53d0efc3aac46d30897c5695b2047a18c6aa481fdd8ec623b1721eae539f

Message ID<EMAIL_ADDRESS>Reply To: _N/A_

UTC Datetime: 1995-09-30 11:16:25 UTC

Raw Date: Sat, 30 Sep 95 04:16:25 PDT

## Raw message

```
{% raw  %}From<EMAIL_ADDRESS>Date: Sat, 30 Sep 95 04:16:25 PDT
To<EMAIL_ADDRESS>Subject: SAIC Shows Crime-Fighting Technology
Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

URL: http://www.saic.com/corporate/news/news03-17-95.html

   *** About SAIC ***

_________________________________________________________________

   SAIC SHOWS CRIME-FIGHTING TECHNOLOGY

   (SAN DIEGO, CA) March 17, 1995 -- Illegal contraband hidden
in trucks,
   boats and airplanes can be detected with the assistance of
   state-of-the-art technology developed by Science
Applications
   International Corporation (SAIC).

    The portable system is being demonstrated Friday as part of
the
   opening of the federal Border Research and Technology Center
at the
   Otay Mesa port-of-entry. The center, which has been
established
   through the efforts of San Diego U.S. Attorney Alan D.
Bersin, will be
   the focal point for driving the design, development,
manufacture and
   acquisition of specialized law-enforcement technologies. The
center is
   expected to identify specific programs for development that
could be
   used by a variety of law-enforcement agencies.

   Various technologies for fighting cross-border crime will be
   demonstrated during a mock Otay border crossing by a driver
attempting
   to evade the law.

   San Diego-based SAIC's portable contraband detection system
scans
   inaccessible areas such as wheel wells, bumpers, boat hulls
and
   aircraft fuselages. The system uses a micro-processor, a
   self-contained low-level radioactive sources and a sensitive
detector.
   As surfaces are scanned, concealed objects including
weapons,
   narcotics, alcohol and explosives reflect the radiation,
which is
   sensed by the detector.

   The system operator is alerted by both a backlit digital
display,
   visible in all light conditions, and an audio beeper that
increases in
   rate as the contraband is detected. The handheld system's
total weight
   is about two pounds.

   SAIC also will show how vehicles can be "tagged" by radio
transponders
   which can provide positive identification of cars, trucks or
trains
   passing through a specific area. Already in use by several
   SAIC-equipped automated toll collection systems across the
U.S, the
   transponders or "tags" are issued to specific vehicles.
Attached to
   bumpers or placed on dashboards, the tags are read as the
vehicle
   passes near an antenna installed over or at the side of the
roadway.
   The signal is displayed on a computer screen, and the data
is stored
   and available for further use.

   The system could be used to speed commuters or other
law-abiding
   vehicles regularly crossing the border. Violators can be
caught
   because the "smart" system senses when a vehicle crosses
without a
   tag, and can trigger alarms, crossing gates or other
barriers, as well
   as recording the violator on video tape. Operators can
electronically
   enhance license plate photos to be read clearly and process
   enforcement action.

   "We at SAIC are encouraged by the opening of the Border
Research
   Technology Center today. This Center will provide the
opportunity to
   apply high-technology solutions in support of increased
trade as a
   result of NAFTA as well as support national law enforcement
efforts at
   the border," said Dr. Donald M. Kerr, executive corporate
vice
   president of SAIC.

   SAIC also provides other vehicle tracking systems that can
trace the
   movements of railroad cars and detect motorists who evade
barriers
   such as railroad grade crossings. The high-technology
company also has
   developed methods of tracing small motorized boats,
submersibles and
   even swimmers crossing strategic waterways, as well as other
imaging
   applications.

   SAIC provides services and products to government and the
private
   sector in the areas of law enforcement, transportation,
energy,
   environment, health care and systems integration. With
annual revenues
   of $1.9 billion, the company and its subsidiaries have
nearly 20,000
   employees and more than 300 locations worldwide.

_________________________________________________________________

   Copyright SAIC Home

_________________________________________________________________

    Last updated on 07-05-95

{% endraw %}
```

## Thread

+ Return to [September 1995](/archive/1995/09)

+ Return to "[anonymous@freezone.remailer](/authors/anonymous_at_freezone_remailer)"

+ 1995-09-30 (Sat, 30 Sep 95 04:16:25 PDT) - SAIC Shows Crime-Fighting Technology -<EMAIL_ADDRESS>


text:
Introduction
-----

AngularJS $http interceptor library which allows you to globally hook into any $http call. Great for things like creating spinners, logging, etc.

Usage
----
Plug this into your app, and wire up the preIntercept function like in the script to do anything to transform the request before it fires. Then use the promise callbacks to intercept the response as needed.


text:
# steamidutil
Handle and convert Steam IDs.

## Usage
Let's create a few Steam IDs first.
```
SteamId steam3Id = new SteamId("STEAM_0:1:102685685");
SteamId steamId32 = new SteamId("[U:1:205371371]");
SteamId steamId64 = new SteamId("76561198165637099");
```
`SteamId`s are represented internally as steam3Id, so it does not matter which format you use to instantiate it with.

But Steam IDs aren't much fun if we're not doing anything with their values, are they?
```
String mySteamId64 = steamId32.getSteamId64(); // "76561198165637099"
```

For convenience, `SteamId` overrides `toString`, for example:
```
System.out.println(new SteamId("76561198165637099"));
// prints "de.linkd.steamidutil.SteamId@15db9742[steam3Id=[U:1:205371371]]"
```

## Conversion
Do you simply want to convert a Steam ID from one format to another? Easy as pie.
```
SteamId.convert3IdToId32("STEAM_0:1:102685685"); // "[U:1:205371371]"
SteamId.convert3IdToId64("STEAM_0:1:102685685"); // "76561198165637099"

SteamId.convertId32To3Id("[U:1:205371371]"); // "STEAM_0:1:102685685"
SteamId.convertId32ToId64("[U:1:205371371]"); // "76561198165637099"

SteamId.convertId64To3Id("76561198165637099"); // "STEAM_0:1:102685685"
SteamId.convertId64ToId32("76561198165637099"); // "[U:1:205371371]"
```

repository: reallinkD/steamidutil

repo_name: reallinkD/steamidutil


text:
# rendactive.js

Experimental reactive template rendering with Bacon.js + Meteor Spark

Bacon.js: https://github.com/raimohanska/bacon.js
Spark: https://github.com/meteor/meteor/wiki/Spark

This is just a proof-of-concept so far -- it's not recommended for real use. The API is probably too limited/sucky for anything serious.

# Examples:

## flickr instant search with pagination:
Demo: http://roboteddy.github.com/rendactive.js/examples/flickr/index.html

Source: https://github.com/RoboTeddy/rendactive.js/blob/master/examples/flickr/flickr.coffee

## todo (in the style of todomvc.com):
Demo: http://roboteddy.github.com/rendactive.js/examples/todo/index.html

Source: https://github.com/RoboTeddy/rendactive.js/blob/master/examples/todo/todo.coffee

Notes:
======

An advantage of this simple implementation is that it doesn't care which template engine you use. The first argument to rendactive is just any function that takes a hash of data and returns a string of html.

A disadvantage of this simple implementation is that DOM recomputes aren't as granular as they could be. The DOM fragment returned by a given call to rendactive is fully redrawn whenever any of the properties passed in change. This means that if your application had one rendactive call that rendered the entire page, it might end up doing too much work on each property change. A DOM-heavy application using this version of rendactive may need to split up its ui into multiple rendactive calls, each of which depends on a smaller number of properties. This might be cumbersome for a lot of applications, especially since it means that reactive templates can't efficiently include reactive sub-templates.

A solution is to add/wrap features of the template engine such that smaller reactive contexts are created automatically whenever a template is included from a different template (or created expressly via a template directive). This is what Meteor does. They extend/hack Handlebars to make it happen (they build an AST of handlebars templates in order to explicitly label pathways through it).

If we end up wanting this functionality, we could either pull in Meteor's handlebar extensions, or perhaps use https://github.com/bminer/node-blade, which has Spark tie-ins. I'm wary of both options -- they both involve template preprocessing, Blade looks a bit immature, and Meteor's hacked handlebars might be a moving target. So, I don't see any good short-term options. On the plus side, I Spark itself seems solid.

Sidenote: if you pass a property to a template with rendactive, the template will recompute on property changes regardless of whether or not the template actually uses the value rendered by that property. For now, this isn't that bad, since it's pretty easy to only pass in properties that a given template actually depends on. If we end up tying rendactive in with specific template engine(s), this wouldn't be too hard to fix.


text:
# Zoe Contract Facet

<Zoe-Version/>

A Zoe Contract Facet is an API object for a running contract instance to access the Zoe state
for that instance. A Zoe Contract Facet is accessed synchronously from within the contract,
and usually is referred to in code as `zcf`.

The contract instance is launched by `E(zoe).startInstance()`, and is given access to
the `zcf` object during that launch. In the operations below, `instance` is
the handle for the running contract instance.

## start

This section covers the code you need to have at the start of your contract code.

To warn if the correct return values for your contract are not being returned,
add this right before the start of your contract code. It also lets TypeScript-aware
tools (IDEs like vsCode and WebStorm) inform the developer about required parameters
and return values and warn when methods are misused.

```js
/**
 * @type {ContractStartFn}
 */
```
Your contract code must export a function `start` as a non-default export.
`zcf` is the Zoe Contract Facet and is the only argument provided to the contract

```js
const start = zcf => {
  ...
  // your code here
  return harden({ creatorFacet, creatorInvitation, publicFacet });
}
harden(start);
export { start };
```
The contract must return a record with any (or none) of the following:

- `creatorFacet` - an object, usually with admin authority. It is only given to the entity that
calls `E(zoe).startInstance()`; i.e. the party that was the creator of the current contract `instance`.
It creates `invitations` for other parties, and takes actions that are unrelated to making offers.
- `creatorInvitation` - a Zoe `invitation` only given to the entity that calls `E(zoe).startInstance()`; i.e.
the party that was the creator of the current contract `instance`.
This is usually used when a party has to make an offer first, such as escrowing the underlying good
for sale in an auction or covered call.
- `publicFacet` - an object available through Zoe to anyone who knows the contract instance. Use the `publicFacet` for general queries and actions, such as getting the current price or creating public `invitations`.

## zcf.makeZCFMint(keyword, amountMathKind)
- `keyword` `{String}`
- `amountMathKind` `{AmountMathKind}` (defaults to `MathKind.NAT`)
- Returns: `{Promise<ZCFMint>}`

Creates a synchronous Zoe mint, allowing users to mint and reallocate digital assets synchronously
instead of relying on an asynchronous ERTP `mint`.

**Important**: `ZCFMints` do **not** have the same methods as an ERTP `mint`. Do not try to use
ERTP methods on a `ZCFMint` or vice versa.

**Important**: On the other hand, the `issuer`, `brand`, and `amountMath` associated with a `zcfMint`
do have the same methods as their ERTP-derived counterparts. Assets created by a `zcfMint` are treated
the same as ERTP `mint`-created assets by ERTP methods.

`ZCFMints` have three methods:
- `getIssuerRecord()`
  - Returns: `{IssuerRecord}`
  - Returns an `issuerRecord` containing the `issuer`, `brand`, or `amountMath` associated with the `zcfMint`.
- `mintGains`
  - `gains`: `AmountKeywordRecord`
  - `zcfSeat`: `{ZCFSeat}` - optional
  - Returns: `{ZCFSeat}`
  - All `amounts` in `gains` must be of this `ZCFMint`'s `brand`.
    The `gains`' keywords are in that `seat`'s namespace.
    Mint the `gains` `amount` of assets and add them to
    that `seat`'s `allocation`. If a `seat` is provided,
    it is returned. Otherwise a new `seat` is returned.
  - `zcfMint.mintGains({ Token: amount }, seat);`
- `burnLosses`
  - `losses`: `AmountKeywordRecord`
  - `zcfSeat` : `{ZCFSeat}`
  - Returns: void
  - All `amounts` in `losses` must be of this `ZCFMint`'s `brand`.
    The `losses`' keywords are in that `seat`'s namespace.
    Subtract `losses` from that `seat`'s `allocation`, then
    burn that `amount` of assets from the pooled `purse`.
  - `zcfMint.burnLosses({ Token: amount }, seat);`

`AmountKeywordRecord` is a record in which the keys are keywords, and
the values are `amounts`. Keywords are unique identifiers per contract,
that tie together the `proposal`, `payments` to be escrowed, and `payouts`
to the user. In the below example, `Asset` and `Price` are keywords.

Users should submit their `payments` using keywords:
```js
const payments = { Asset: quatloosPayment };
```

And, users will receive their `payouts` with keywords as the keys of a `payout`:
```js
quatloosPurse.deposit(payout.Asset);
```

For example:
```js
const quatloos5 = quatloosAmountMath.make(5n);
const quatloos9 = quatloosAmountMath.make(9n);
const myAmountKeywordRecord =
{
  Asset: quatloos5,
  Price: quatloos9
}
```
The following demonstrates `zcf.makeZCFMint`:

**Note**: The call to make the `ZCFMint` is asynchronous, but
calls to the resulting `ZCFMint` are synchronous.
```js
const mySynchronousMint = await zcf.makeZCFMint('MySyncMint', 'set');
const { amountMath, brand, issuer } = mySynchronousMint.getIssuerRecord();
mySynchronousMint.mintGains({ MyKeyword: amount }, seat);
```

## zcf.getInvitationIssuer()
- Returns: [`{Issuer}`](/ertp/api/issuer.md)

Zoe has a single `invitationIssuer` for the entirety of its
lifetime. This method returns the Zoe `InvitationIssuer`, which
validates user-received `invitations` to participate
in contract instances.

"All `invitations` come from this single `invitation` `issuer` and its `mint`, which
mint `invitations` and validate their `amounts`."

```js
const invitationIssuer = await zcf.getInvitationIssuer();
```

## zcf.saveIssuer(issuer, keyword)
- `issuer` `{Issuer}`
- `keyword` `{String}`
- Returns: `{Promise<IssuerRecord>}`

Informs Zoe about an `issuer` and returns a promise for acknowledging
when the `issuer` is added and ready. The `keyword` is the one associated
with the new `issuer`. It returns a promise for `issuerRecord` of the new `issuer`

This saves an `issuer` in Zoe's records for this contract `instance`.
It also has saved the `issuer` information such that Zoe can handle offers involving
this `issuer` and ZCF can provide the `issuerRecord` synchronously on request.

An `IssuerRecord` has three fields, each of which holds the namesake object
associated with the `issuer` value of the record:
`issuerRecord.amountMath`, `issuerRecord.brand`, and `issuerRecord.issuer`)

```js
await zcf.saveIssuer(secondaryIssuer, keyword);
```
## zcf.makeInvitation(offerHandler, description, customProperties)
- `offerHandler` `{ZCFSeat => Object}`
- `description` `{String}`
- `customProperties` `{Object}`
- Returns: [`{Promise<Invitation>}`](/ertp/api/payment.md#payment)

Make a credible Zoe `invitation` for a smart contract. Note that `invitations` are a special case
of an ERTP `payment`. They are associated with the `invitationIssuer` and its `mint`, which
validate and mint `invitations`. `zcf.makeInvitation()` serves as an interface to
the `invitation` `mint`.

The `invitation`'s
`value` specifies:
- The specific contract `instance`.
- The Zoe `installation`.
- A unique `handle`

The second argument is a required `description` for the `invitation`,
and should include whatever information is needed for a potential recipient of the `invitation`
to know what they are getting in the optional `customProperties` argument, which is
put in the `invitation`'s `value`.

```js
const creatorInvitation = zcf.makeInvitation(makeCallOption, 'makeCallOption')
```

## zcf.makeEmptySeatKit()
- Returns: `{ZCFSeat, Promise<UserSeat>}`

Returns an empty `ZCFSeat` and a promise for a `UserSeat`

Zoe uses `seats` to represent offers, and has two seat facets (a
particular view or API of an object;
there may be multiple such APIs per object) a `ZCFSeat` and a `UserSeat`.
```js
const { zcfSeat: mySeat } = zcf.makeEmptySeatKit();
```
## ZCFSeat object

Zoe uses `seats` to access or manipulate offers. Seats represent active
offers and let contracts and users interact with them. Zoe has two kinds
of seats. `ZCFSeats` are used within contracts and with `zcf` methods.
`UserSeats` represent offers external to Zoe and the contract.

A `ZCFSeat` includes synchronous queries for the current state of the
associated offer, such as the amounts of assets that are currently
allocated to the offer. It also includes synchronous operations
to manipulate the offer. The queries and operations are as follows:

- `hasExited()`
  - Returns: `{ Boolean }`
  - Returns `true` if the `seat` has exited, `false` if it is still active.
- `getNotifier()`
  - Returns: `{ Notifier<Allocation> }`
  - Returns a `notifier` associated with the `seat`'s `allocation`. You use a `notifier`
    wherever some piece of code has changing state that other code wants updates on.
    This `notifier` provides updates on changing `allocations` for this `seat`, and tells
    when the `seat` has been exited. For more on `notifiers`, see the [Distributed Programming Guide](/guides/js-programming/notifiers.md).
- `getProposal()`
  - Returns: `{ ProposalRecord }`
  - A `Proposal` is represented by a `ProposalRecord`. It is the rules
    accompanying the escrow of `payments` dictating what the user expects
    to get back from Zoe. It has keys `give`, `want`, and
    `exit`. `give` and `want` are records with keywords as keys and
    `amounts` as values. The `proposal` is a user's understanding of the
    contract that they are entering when they make an offer. See
    [`E(zoe).offer()`](./zoe.md#e-zoe-offer-invitation-proposal-paymentkeywordrecord) for full details.
  - Example:
    ```js
    const { want, give, exit } = sellerSeat.getProposal();
    ```
- `getAmountAllocated(keyword, brand)`
  - Returns: `{ Amount }`
  - Returns the `amount` from the part of the `allocation` that matches the
    `keyword` and `brand`. If the `keyword` is not in the `allocation`, it
    returns an empty `amount` of the `brand` argument. (After
    `exit()` has been called, it continues to report the final allocation balance,
    which was transferred to a payout.)

    This is similar to the next method, `getCurrentAllocation()`. `getAmountAllocated()`
    gets the `allocation` of one keyword at a time, while `getCurrentAllocation()` returns
    all the current `allocations` at once.
- `getCurrentAllocation()`
  - Returns: `{ <Allocation> }`
  - An `Allocation` is an `AmountKeywordRecord` of key-value pairs where
    the key is a keyword such as `Asset` or `Price` applicable to the
    contract. The value is an `amount` with its `value` and `brand`.

    `Allocations` represent the `amounts` to be paid out to each `seat` on exit. (After
    `exit()` has been called, the final allocation balances, which were transferred to
    payouts, continue to be reported.)
    Normal reasons for exiting are the user requesting to exit or the contract
    explicitly choosing to close out the `seat`. The guarantees also hold if the contract
    encounters an error or misbehaves. There are several methods for finding out
    what `amount` a current `allocation` is.

    This is similar to the previous method, `getAmountAllocated()`. `getAmountAllocated()`
    gets the `allocation` of one keyword at a time, while `getCurrentAllocation()` returns
    all the current `allocations` at once.

    An `Allocation` example:
    - ```js
      {
        Asset: quatloosAmountMath.make(5n),
        Price: moolaAmountMath.make(9n)
      }
      ```
 - `exit(completion)`
   - Returns: `void`
   - Causes the `seat` to exit, concluding its existence. All `payouts`, if any,
     are made, and the `seat` object can no longer interact with the contract.
     The `completion` argument is usually a string, but this is not required. Its
     only use is for the notification sent to the contract instance's `done()` function.
     Any other still open seats or outstanding promises and the contract instance continue.
 - `fail(msg)`
   - Returns: `void`
   - The `seat` exits, displaying the optional `msg` string, if there is one, on the console.
     This is equivalent to exiting, except that `exit` is successful while
     `fail()` signals an error occured while processing the offer. The contract
     still gets its current `allocation` and the `seat` can no longer interact with the contract.
     Any other still open seats or outstanding promises and the contract instance continue.
 - `kickOut(msg)` **Renamed fail(msg) as of 4-OCT-2020. DO NOT USE**
   - Returns: `void`
   - The `seat` exits, displaying the optional `msg` string, if there is one, on the console.
     This is equivalent to exiting, except that `exit` is for a successful transaction while
     `kickOut()` aborts the transaction attempt and signals an error. The contract
     still gets its current `allocation` and the `seat` can no longer interact with the contract.
 - `stage(newAllocation)`
   - Returns: `{ SeatStaging }`
   - A `seatStaging` is an association of a `seat` with reallocations. `reallocate()` takes
     at least two `seatStagings` as arguments and does its reallocation based on them.

     You can create multiple independent `seatStagings` for a `seat`. None of them has
     any effect until submitted to `reallocate()`. Each call to `stage()` starts from the
     `seat`'s current `allocation` and uses the `newAllocation` as a replacement for the
     current state. Any keywords not mentioned in `newAllocation` retain the
     same `amounts`. All keywords mentioned in the `newAllocation` have their `amounts`
     replaced with the corresponding `amount` from `newAllocation`.

     Note that ZoeHelpers [`trade()`](./zoe-helpers.md#trade-zcf-left-right-lefthasexitedmsg-righthasexitedmsg) and [`swap()`](./zoe-helpers.md#swap-zcf-leftseat-rightseat-lefthasexitedmsg-righthasexitedmsg) might
     be easier to use for simple cases.
 - `isOfferSafe(newAllocation)`
   - Returns `{ Boolean }`
   - Takes an `allocation` as an argument and returns `true` if that `allocation`
     satisfies offer safety, `false` if is doesn't. Essentially, it checks
     `newAllocation` for offer safety, against the `seat`'s `proposal`.
     It checks whether `newAllocation` fully satisfies
     `proposal.give` (giving a refund) or whether it fully satisfies
     `proposal.want`. Both can be fully satisfied. See the ZoeHelper
     [`satisfies()`](./zoe-helpers.md#satisfies-zcf-seat-update) method for more details.

## zcf.getBrandForIssuer(issuer)
- `issuer` `{Issuer}`
- Returns: `{Brand}`

Returns the `brand` associated with the `issuer`.

## zcf.getIssuerForBrand(brand)
- `brand` `{Brand}`
- Returns: `{Issuer}`

Returns the `issuer` of the `brand` argument.

## zcf.getAmountMath(brand)
- `brand` `{String}`
- Returns: `{amountMath}`

Returns the `amountMath` object associated with the `brand` argument.
```js
const assetAmountMath = zcf.getAmountMath(assetAmount.brand);
```
## zcf.stopAcceptingOffers()
- The contract requests Zoe to not accept offers for this contract instance.
It can't be called from outside the contract unless the contract explicitly makes it accessible.

## zcf.shutdown(completion)

Shuts down the entire vat and contract instance and gives payouts.

All open `seats` associated with the current `instance` have `fail()`
called on them.

Call when:
- You want nothing more to happen in the contract, and
- You don't want to take any more offers

The `completion` argument is usually a string, but this
is not required. It is used for the notification sent to the
contract instance's `done()` function. Any still open seats or
other outstanding promises are closed with a generic 'vat terminated'
message.
```js
zcf.shutdown();
```
## zcf.getTerms()
- Returns: `{Object}`

Returns the `issuers`, `brands`, `maths`, and custom `terms` the current contract `instance` was instantiated with.

The returned values look like:
```js
{ brands, issuers, maths, customTermA, customTermB ... }
// where brands, issuers, and maths are all keywordRecords, like:

{
    brands: { A: moolaKit.brand, B: simoleanKit.brand },
    issuers: { A: moolaKit.issuer, B: simoleanKit.issuer },
    maths: { A: moolaKit.amountMath, B: simoleanKit.amountMath },
    customTermA: 'something',
    customTermB: 'something else',
 };
 ```

Note that there is also an `E(zoe).getTerms(instance)`. Often the choice of which to use is not which method
to use, but which of Zoe Service or ZCF you have access to. On the contract side, you more easily have access
to `zcf`, and `zcf` already knows what instance is running. So in contract code, you use `zcf.getTerms()`. From
a user side, with access to Zoe Service, you use `E(zoe).getTerms()`.
```js
const { brands, issuers, maths, terms } = zcf.getTerms()
```

## zcf.getZoeService()
- Returns: [ZoeService](./zoe.md)

This is the only way to get the user-facing [Zoe Service API](/zoe/api/zoe.md#zoe) to
the contract code as well.
```js
// Making an offer to another contract instance in the contract.
const zoeService = zcf.getZoeService();
E(zoeService).offer(creatorInvitation, proposal, paymentKeywordRecord);
```

## zcf.assertUniqueKeyword(keyword)
- `keyword` `{String}`
- Returns: Undefined

Checks if a keyword is valid and not already used as a `brand` in this `instance` (i.e. unique)
and could be used as a new `brand` to make an `issuer`. Throws an appropriate error if it's not
a valid keyword, or is not unique.
```js
zcf.assertUniqueKeyword(keyword);
```
## zcf.reallocate(seatStagings)
- `seatStagings` `{SeatStaging[]}` (at least two)
- Returns: `{void}`

The contract reallocates over `seatStagings`, which are
associations of `seats` with new `allocations` to be used in reallocation.
There must be at least two `seatStagings` in the array argument.

The reallocation only succeeds if it:
1. Conserves rights (the specified `amounts` have the same total value as the
  current total amount)
2. Is 'offer-safe' for all parties
  involved. Offer safety is checked at the staging step.

The reallocation is partial, only applying to `seats` associated
with the `seatStagings`. By induction, if rights conservation and
offer safety hold before, they hold after a safe reallocation.

This is true even though we only re-validate for `seats` whose
`allocations` change. A reallocation can only effect offer safety for
those `seats`, and since rights are conserved for the change, overall
rights are unchanged.

`reallocate()` throws these errors:
- `reallocating must be done over two or more seats`
- `The seatStaging was not recognized`
- `The seatStaging was not recognized`
- `keyword must be unique`
- If the total `amount` per `brand` is not equal to the total `amount` per `brand`
  in the proposed reallocation. (no message)
```js
zcf.reallocate(
    seat.stage(seatAAllocation),
    seat.stage(seatBAllocation),
  );
```

repository: Hayai-XxX/documentation

repo_name: Hayai-XxX/documentation


text:
This is the llvmtcl extension based on the Tcl Extension Architecture (TEA).
Please see the the [Tcler's wiki page](http://wiki.tcl.tk/26308)
for more details.

This package is a freely available open source package.  You can do virtually
anything you like with it, such as modifying it, redistributing it, and selling
it either in whole or in part.  See the file [`license.terms`](./license.terms) for complete
information.

REQUIREMENTS
============

* Tcl 8.6
* LLVM 3.7

CONTENTS
========

The following is a short description of the files you will find in
the sample extension.

    Makefile.in     Makefile template.  The configure script uses this file to
                    produce the final Makefile.

    README          This file.

    license.terms   License info for thie package.

    aclocal.m4      Generated file.  Do not edit.  Autoconf uses this as input
                    when generating the final configure script.  See "tcl.m4"
                    below.

    configure       Generated file.  Do not edit.  This must be regenerated
                    anytime configure.in or tclconfig/tcl.m4 changes.

    configure.in    Configure script template.  Autoconf uses this file as input
                    to produce the final configure script.

    pkgIndex.tcl.in Package index template.  The configure script will use
                    this file as input to create pkgIndex.tcl.

    llvmtcl-gen.inp Input for llvmtcl-gen.tcl. It contains reformatted function
                    declarations of the llvm C API.

    llvmtcl-gen.tcl Script to generate the Tcl API to the llvm C API. The
                    llvmtcl-gen.inp is the input for this script.

    generic/        This directory contains various source files, some only
                    generated during compilation (i.e., after `make`).

       llvmtcl.cpp  File containing most non-generated parts of the Tcl API to
                    the LLVM C API. Also includes some sections which can only
                    be implemented using the LLVM C++ API.

       llvmtcl.h    File containing all the internal APIs of llvmtcl.

       attributes.cpp
                    File containing the Tcl API to the LLVM attribute
                    management code.

       debuginfo.cpp
                    File containing the Tcl API to the LLVM debugging
                    information generation code.

       powidf2.cpp  File continaing the implementation of one of the LLVM
                    intrinsics, needed on some platforms and with some linkers.

       testcode.cpp Code only used for testing purposes.

    llvmtcl.tcl     Scripts using the Tcl API to the llvm C API.

    tests           Some tests for the package.

    tclconfig/      This directory contains various template files that build
                    the configure script.  They should not need modification.

       install-sh   Program used for copying binaries and script files
                    to their install locations.

       tcl.m4       Collection of Tcl autoconf macros.  Included by
                    aclocal.m4 to define SC_* macros.

UNIX BUILD
==========

This is a C++ extension, so make sure to set the CC environment variable to a
c++ compiler (e.g. g++).

Building under most UNIX systems is easy, just run the configure script
and then run make. For more information about the build process, see
the `tcl/unix/README` file in the Tcl src dist. The following minimal
example will build and install the extension:

    $ cd llvmtcl
    $ ./configure --with-tcl=... --with-llvm-config=...
    $ make
    $ make test
    $ make install

Add the llvm lib directory containing the llvm shared object files to the
`LD_LIBRARY_PATH` environment variable.

WINDOWS BUILD
=============

Not available.

INSTALLATION
============

The installation of a TEA package is structure like so:

             $exec_prefix
              /       \
            lib       bin
             |         |
       PACKAGEx.y   (dependent .dll files on Windows)
             |
      pkgIndex.tcl (.so|.dll files)

The main `.so`|`.dll` library file gets installed in the versioned PACKAGE
directory, which is OK on all platforms because it will be directly
referenced with by `load` in the `pkgIndex.tcl` file.  Dependent DLL files on
Windows must go in the bin directory (or other directory on the user's
PATH) in order for them to be found.

USING llvmtcl
=============

* To load the extension into a Tcl interpreter:

        package require llvmtcl

* The package makes a `llvmtcl` ensemble command. The subcommands are the LLVM C
  API functions with LLVM trimmed from the front. All supported types,
  enumerators and functions can be found in [here](http://github.com/jdc8/llvmtcl/blob/master/llvmtcl-gen.inp).

* Functions taking a pointer argument followed by an unsigned argument to
  specified the number of elements the pointer is pointing to are converted to
  ensemble commands where the pointer and the unsigned argument are replaced by
  a Tcl list.

EXAMPLES
========

`examples/test.tcl` - Example using the LLVM API to create a factorial function

`examples/test2.tcl` - Example using the LLVM API to create a function adding 4 and 6 to an argument, optimize that function and execute it.

`examples/tebc.tcl` - Example converting Tcl into LLVM

`examples/ffidle.tcl` - Example calling functions in shared libraries

license: TCL


text:
# HTML To RTF
>This project convert html to rtf format in the browser. It is based on the oziresrds/html-to-rtf awesome project.
>I looked into the 20+ forks to try get the best parts glued to in one place. This could be called html-to-rtf-frankenstein lol.

> Highlight for the developers:
* Ozires for the base framework. Without him, we would not have this.
* Heron Silva for several improvements (as font-family support) (heronsilva / html-to-rtf)
* wodka for making it possible to use in browser (wodka/html-to-rtf).
* Leon Strauß for image support (MinePlay96/html-to-rtf).

If I missed some functionality in other forks, please let me know, or make a PR.

## Prerequisites
>This project work in the browser (maybe it works on the server side, but this is not the main goal.

## Installation
```
$ npm install html-to-rtf-browser
```
## Getting Started
```javascript
const HtmlToRtfBrowser = require('html-to-rtf-browser');
var htmlToRtf = new HtmlToRtfBrowser();
var html = `
<h1>Title <span style="color:rgb(255,0,0);">with</span> tag h1<h1>
<p> start of an image (with width and height defined): </p>
<img style="width: 5cm; height: 300px" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFQAAABdCAAAAAAeDx7VAAAAAmJLR0QA
/4ePzL8AAAAJcEhZcwAACxIAAAsSAdLdfvwAAAGxSURBVFjD7dctdsMwDABgQcPCwMDCwsHAwsLCwcLeoLBHCMwRDAsHB3uMHCFQs52sP4llW7H33oDEmtZf/WxZcgD/IEBQQQUVVFBBOaFrqLvCaK8AQGWgt9oA7/MaH50y0ApcqNkj7flpOjqab/MyH/fen3LQhEf/ATUbXbdmc5quIHqeFvVlq/LR4fNXLYg+2Of+T3+yOFNZJ0rBMnez0asnd7NRKgQVVFBBw3Fr2vKouThciqO2RyWqjB61t+W4L4uOqrquQV/7+lw9WDVhrgu08lwNH6GVt3tGUaqXj3H2ds9MFPUO4lmwEFR0iJ1tHdwv8A0Jqy4L4M5B3ZDQiOn6c+CgODTmfjyEV+AeXnnwj9h+h9ULc6aIJ7tmKSeHg2K3MepXYRT7D5M1A5OKodhvfC9diyAKBbWJXVL1JAoFmRmHFJXILBJ1hyCmctGUo8VH3dEKpThiy0fd0Qo1Jfu2f+SiaAuH6sivTUHbeZM5iLqmRK9r5X/bj3ZTvQVoiBXoyVIVa9F3IFudqTu7dehYsqjQK9Gp1Xljj2tRfL6DzuI45KDcEFRQQQUVtEz8AL3L59EiRcoBAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDIwLTA4LTIxVDA5OjE3OjE0KzAyOjAwSUJYdgAAACV0RVh0ZGF0ZTptb2RpZnkAMjAyMC0wOC0yMVQwOToxNzoxNCswMjowMDgf4MoAAAAASUVORK5CYII="></img>
<p> end of an image</p>
<div>
	<p style="color:#333; margin:5px;" class="test" align="center">
	    text of paragraph <b>text with bold <i>text with italic and bold</i></b><i>text with italic</i>
	</p>
	<p style="color:rgb(255,0,0);" align="right">red paragraph => right with tag</p>
	<p style="color:rgb(0,0,255); text-align:center;">blue paragraph => center with style</p>
	<table>
		<tbody>
			<tr>
                <td><mark>column 1</mark></td>
                <td>column 2</td>
				<td><mark>column 3</mark></td>
				<td>column 4</td>
			</tr>
			<tr>
				<td>content 1</td>
				<td>content 2<br></td>
				<td>content 3<br></td>
				<td>content 4<br></td>
			</tr>
		</tbody>
	</table>
</div>
`
const rtf = htmlToRtf.convertHtmlToRtf(html)
// from here on, works only on browser
const blob = new Blob([rtf], {type: "application/rtf;charset=utf-8"});
const link=window.URL.createObjectURL(blob);
window.location=link;

```
>  Now test in your preferred text editor (wordpad, word, libreoffice, ...).
##

##### Important:
#
> You can't copy the output of terminal or console.
> Save the output at a file.rtf. See above for an example

### Allowed html tags
```html
<b>, <br>, <center>, <div>, <em>, <font>, <h1>, <h2>, <h3>, <h4>,
<h5>, <h6>, <i>, <li>, <mark>, <p>, <ol>, <s>, <span>, <sub>, <sup>,
<strong>, <table>, <td>, <th>, <tr>, <u>, <ul>, <a>, <img> (PNG and JPG in base64 - experimental support to BMP - fixed size)
```
### Allowed style properties

> color(Hex and Rgb), font-family, font-size(px/pt), text-align, text-indent (px/cm), margin-left (px/cm), padding-left (px/cm)

> inside img tag: width and height (px/cm)

## Running the tests
```
$ gulp tests
```

## Author

> * **antoniolucasnobar**

## License
This project is licensed under the MIT License

repository: antoniolucasnobar/html-to-rtf-browser

repo_name: antoniolucasnobar/html-to-rtf-browser


text:
---
layout: post
date: 2017-04-16
title: Jekyll Archive By Tag
description: Using jekyll to create tag archive page
categories: jekyll
tags: jekyll
---

## Problems

This is one of the challenge I faced. When I building this blog with Jekyll, it's how to create beautiful tag archive page. I also find out that it's the exact same way you can make category page, which I will explain more details.

## Implement

First, creating a `/_layouts/tagpage.html` layout file will save us a lot of effort. This basically create a template which shows posts in same tag. The reason why I choose to use {{ page.tag }} is I will create a bunch of 'dummy' tag pages which we can link to. And in these 'dummy' tag pages, we can specific which tag we want, like 'python', 'jekyll' and so on.

###### tapage layout

{% raw %}
```html
---
layout: default
---

<h1>Articles in tag "{{ page.tag }}"</h1>
<br/>

<ul>
  {% for post in site.tags[page.tag] %}
  <li>{{ post.date | date: "%m/%d/%Y" }}:
    <a href="{{ post.url }}">{{ post.title }}</a>
    <p><em>{{ post.meta }}</em></p>
  </li>
  {% endfor %}
</ul>
```
{% endraw %}

This will collect all articles from same tag. It will also generate `url` and `title` for us, as well as including `meta` data. Then we just need to create our pages in tag folder like `/tag/python/`. And it also serve as the link address we will visit. And let Jekyll know what exactly is the tag we want to filter. In this case, it's `python`. And keep adding folders in our tag folder to expand future tags. As I mentioned you can use exact same method to make a category page. Simply change all `tags` in above code to `categories` keyword. I believe in `Jekyll`, `tags` and `categories` are interchangeable, meaning they just the same thing.

###### Front matter
{% raw %}
```html
---
layout: tagpage
title: Articles in tag "python"
tag: python
permalink: /tag/python/
---
```
{% endraw %}

We also flatten these pages by using `permalink`. We can visit our tag archive page by `/tag/python/`. Even we didn't create `/tag/python/` folder, which makes our tag folder a lot cleaner. To know more, please see [Jekyll Permalink](https://jekyllrb.com/docs/permalinks/).

###### File structure
```html
website/
├── .../
└── tag/
    ├── python.html
    ├── ruby.html
    └── ...
```

Now we have created all pages we need. We can now organized everything back in single `tag.html` or `category.html` page. If you want to create a category page, then just change `site.tags` to `site.categories`. In the following example. `tag[0]` is the name of tag. And `tag[1]` is the list of posts in this tag. Therefore we can use `tag[1] | size` to count how many posts in a tag.

###### Liquid code

{% raw %}
```html
{% for tag in site.tags %}
<li>
  <div class="tag-title">
    <a href="/tag/{{ tag[0] }}">
      {{ tag[0] | capitalize }}: {{ tag[1] | size }}
    </a>
  </div>
</li>
{% endfor %}
```
{% endraw %}

We can flattening these folders and pages by using `permalink`, like in example below. Then we can still visit our tag archive page by `/tag/python/`. Even we didn't create `/tag/python/` folder, which makes our tag folder a lot cleaner. To know more, please see [Jekyll Permalink](https://jekyllrb.com/docs/permalinks/).


text:
# Specifications for the Angular Assessment

Specs:
- [x] Use Angular to build the app
      Angular is used.

- [X] Must contain some sort of nested views
      The Home state is initially loaded. Login and Signin are nested beneath the home state.

- [X] Must contain some sort of searching as well as filtering based on some criteria. Ex: All items in the "fruit" category, or all tasks past due
      Includes the ability to search and a filter for spending items over $100.

- [X] Must contain at least one page that allows for dynamic updating of a single field of a resource. Ex: Allow changing of quantity in a shopping cart
      The update item page allows to update any of the fields.

- [X] Links should work correctly. Ex: Clicking on a product in a list, should take you to the show page for that product
      I believe all links go to where they should.

- [X] Data should be validated in Angular before submission
      Angular validates the fields are filled and ngMessages is used to display errors.

- [X] Must talk to the Rails backend using $http and Services
      The app talks to Rails using Services and $http.

- [X] Your README.md includes a short description, install instructions, a contributors guide and a link to the license for your code
      The README.md covers required sections.

repository: matthewpaulmcgowan/money-management

gha_language: Ruby

repo_name: matthewpaulmcgowan/money-management


text:
+++
widget = "blank"
headless = true  # This file represents a page section.
active = true  # Activate this widget? true/false
weight = 11  # Order that this section will appear.

# ... Put Your Section Options Here (title etc.) ...
title = "Meel Group"
subtitle = "Department of Computer Science
University of Toronto"

[design]
  # Choose how many columns the section has. Valid values: 1 or 2.
  columns = "2"
+++
Welcome to the Meel Group’s web page. We are situated at the University of Toronto.

Interests

 Artificial Intelligence

 Constrained Sampling and Counting

 Knowledge Representation and Reasoning

 Formal Methods

 Interpretable Models

repository: meelgroup/meelgroup-website

gha_language: TeX

repo_name: meelgroup/meelgroup-website


text:
A simple logging simulator used to test long running microservices on
Azure Container Service. A simple autoscaler is included.

This project consists of a number of Docker containers each desinged
to perform a specific function. The main containers are:

  * logging_base - the container on which all other containers are
    based
  * simulate_logging - a container that simluates a period of logging
    activity, writes log items into the queue
  * rest-enqueue - provides a REST API for adding messages to the
    queue. At present this is not visible to the public internet.
  * rest-query - provides a REST API for querying the state of the
    application data. This is accessible on port 8080.
  * analyze_logs - reads log queue and creates summary log data
  * microscaling - an autoscaler that scales te analyer up and down
    depending on the amount of work needed
  * web - a simple Web UI that shows the status of the queue and
    summary table. If the master-proxy is also available this page
    will also show the management UI for the cluster.
  * master-proxy - an INSECURE proxy that allows access to the cluster
    masters without an SSH tunnel (use http://YOUR_FQDN:8080)
  * cli - a simple CLI tool for working with the data produced by the
    simulateion and he analyzer

At present it uses Azure Storage Queues and Tables.

## How it works

One or more "producer" containers put "work" into a queue.

One or more "consumer" containers pull work from the queue, process
it and write some summary data to a table.

[Optionally] A rest service allows "work" to be placed into the queue

[Optionally - DC/OS only] a "microscaler" scales the consumers up/down
in response to the amount of work in the queue.

[Optionally] - A web interface that shows the current status of the
queue and summary table, along with INSECURE access to the cluster
(note this will only work if the master-proxy is running)

[Optionally] The CLI is used to query the state of the queue and table

## Setup

Create a n Azure Storage Account for your application to use. Then copy
`env.conf.tmpl` to `env.conf` and add values for all the properties
that are necessary.

## Running on Azure Container Service

Create an
[ACS cluster](https://azure.microsoft.com/en-us/documentation/articles/container-service-deployment/).

For convenience we will use the unnofficial
[ACS CLI](https://github.com/rgardler/acs-cli) to create and manage
the cluster. We provide an example cluster config file in
`acs-logging.ini`, you can use this or you can create your own using
this as a template..

Copy `marathon.json.tmpl` to `marathon.json` and replace all
occurences of `FIXME... with appropriate values. Then deploy the
application with.

To create the cluster:

```
acs --config-file=acs-logging.ini service create
acs --config-file=acs-logging.ini app deploy --app-config=marathon.json
```

### OPTIONAL: Open Rest API port

If you want to use the REST API from the public Internet then you will
need to open port 5555 in your cluster. To do this with the cli tool
run the following:

``` bash
acs --config-file=acs-logging.ini lb open --port=5555
```

### REST Enqueue API

To run the REST endpoint:

`docker run -d -p 5000:5000 --env-file env.conf rgardler/acs-logging-test-rest-enqueue`

To post messages to this endpoint:

POST to `http://localhost:5000/enqueue' with a a form data payload as
follows:

`queue=<queue_name>&message=<message_text>`

For example:

```
curl -X POST -d queue=acsdemo -d message=messagetext http://localhost:5000/enqueue
```

For more information see the README in the [`rest_enqueue`](rest_enqueue) folder.

### Simulation

Run `autoscale.sh` for a scripted demo of the application, showing the
scaling of the analyzer container.

You can run the application with `docker-compose up -d`, this will
start a simulated environment in which the temperature of a room is
being controlled. It will throw errors if too hot or cold, warnings if
a little warm or cold and info if just right. The analyzer in this
demo counts the number of each type of message and stores the results
in the table.

You can scale components with commands such as `docker-compose scale
analyzer=5` or `docker-compose scale producer=2`

## Command Line Interface

The CLI container provides basic tooling for interacting with the
application. It is run with:

```bash
docker run --env-file env.conf cli COMMAND
```

Where COMMAND is replaced with one of the following available commands:

### summary

Prints a summary of the current status of the logging application, for example:

```
Queue Length is approximately: 0

Processed events:
Errors: 3941
Warnings: 608
Infos: 5803
Debugs: 0
Others: 0
```

### length

Outputs the approximate length of the queue.

### createQueue

Create the queue. It will automatically be recreted if you restart a
producer. This is provided for testing purposes only.

### deleteQueue

Delete the queue. It will automatically be recreted if you restart a
producer.

### createTable

Create the table. It will automatically be recreted if you restart a
producer. This is provided for testing purposes only.

### deleteTable

Delete the table. It will automatically be recreted if you restart a
producer.

## Slack Channel

Messages from the test suite are sent to the Slack channel
https://azurecontainerservice.slack.com, this is configurable in
env.conf.

# Running the tests

Build the containers with:

```
docker build -t rgardler/acs-logging-test-base .
docker build -t rgardler/acs-logging-test-simulate simulated_logging
docker build -t rgardler/acs-logging-test-analyze analyze_logs
docker build -t rgardler/acs-logging-test-cli cli
```

Ensure that the volume is created:

```
docker create -v /logs --name base rgardler/acs-logging-test-base /bin/true
```

Simulate some test data (you might want to run this on a schedule):

```
docker run --rm -e SMTP_PASSWORD=password --volumes-from base --name simulate rgardler/acs-logging-test-simulate
```

You can configure the simulattion with the following environment variables (which can be passed in the docker run commadn using `-e`):

SIMULATION_ACTIONS: the number of actions to be simulated on this run (0 means continue until stopped)

SIMULATION_DELAY: the delay between simulated events

Analyze the log data in the queue:

```
docker run --rm -e SMTP_PASSWORD=password --volumes-from base --name analyze rgardler/acs-logging-test-analyze
```

You can control the behaviour of the analyzer task:

ANALYZER_KEEP_RUNNING: If False, exit when there are no more items on the queue to analyze (default False)

ANALYZER_SLEEP_TIME: If ANALYZER_KEEP_RUNNING is True, this is the sleep time in seconds before checking for more items on the queue (default 0)

To get some insight into what has happened you can run the CLI container:

```
docker run -it -e SMTP_PASSWORD=password --rm --volumes-from base --name cli rgardler/acs-logging-test-cli
```

# Automating the tests

Ensure DOCKER_HOST is set to your Swarm endpoint.

Ensure that the volume is created:

```
docker create -v /logs --name base rgardler/acs-logging-test-base /bin/true
```

Now add lines such as the following to the cronteb (use `crontab -e`):

```
*/5 * * * * docker -H :2375 run -e SMTP_PASSWORD=password --rm --volumes-from base rgardler/acs-logging-test-simulate
*/22 * * * * docker -H :2375 run -e SMTP_PASSWORD=password --rm --volumes-from base rgardler/acs-logging-test-analyze
```

Alternatively just use the second line as a cron job and use one or more long running task for the first, such as:

docker -H :2375 run -d --restart="on-failure:5" -e SMTP_PASSWORD=password -e SIMULATION_ACTIONS=0 --volumes-from base rgardler/acs-logging-test-simulate

# Development

Run your chosen container in interactive mode:

```
docker run -e SMTP_PASSWORD=password --rm -it rgardler/acs-logging-test-simulate bash
```

Now you can run commands to test things out.

repository: John-Thunder/acs-logging-test

repo_name: John-Thunder/acs-logging-test