text:
# Browser Technologies @cmda-minor-web 1920

The Browser Technologies course will learn you how to make good, robust, accessible websites. You will learn about Progressive Enhancement, Feature Detection and Fallback.

## Nerdy T-shirts

## Introduction
Nerdy T-shirts is part of the course [cmda minor web - browser technologies](https://github.com/cmda-minor-web/browser-technologies-1920). You can design your own T-shirt with color, text and images. The idea is that the website is accessible to all users with all kind of browsers.

## Live demo
https://calm-reef-96534.herokuapp.com/

## Table of Contents
* [Installation](#Installation)
* [Progressive enhancement](#Progressive-enhancement)
  * [Functional / Reliable (HTML)]()
  * [Usable (HTML + CSS)]()
  * [Pleasurable (HTML + CSS + JS)]()
* [Test](#Test)
* [Sources](#Sources)
* [Conclusion](#Conclusion)
* [License](#License)

## Installation

1. Open your terminal

2. Change the directory to a folder in which you want to place the files

```
cd /~path
```

3. Clone the repository
```
git clone https://github.com/marissaverdonck/browser-technologies-1920
```
4. Change directory to repository
```
cd browser-technologies-1920
```
5. Install dependencies from package.json
```
npm install
```
6. Run application with Node
```
node server.js
```

## Progressive enhancement
Progressive enhancement is a strategy that first emphasizes the important content of the website. The HTML document contains this important content. This strategy then gradually adds more features and functions on top of the content with CSS and JS. The benefits of this strategy are that it gives everyone access to the basic content and functionality of a web page, while also providing an improved version of the page to those with more advanced browser software.

An example from the Nerdy Tshirt site: with HTML you can choose your design options and see the result on a new page. With CSS I give the design options and the result a styling. For example, if the user clicks on a color option, the button becomes thicker. If the browser supports JS, the user can see his design options directly on the same page.

### Code funtionality
I start with thinking about the core functionality: the user can choose how the design on the T-shirt will look like. This has to be accessible with only HTML. Step by step I'll enrich the user experience with CSS and JS.

### Feature detection
With feature detection you can check if a browser supports a certain block of code. If it doesn't support the code, you can use "fallbacks". A fallback let the browser run different code, so that the browser can always provide a working experience rather than crashing/erroring in some browsers.

## 1. Functional / Reliable (HTML)
### Features
* The user can design a T-shirt
  * The user can choose a color
  * The user can choose text
  * The user can choose a image
* The user can see the result on a new page

  Wireflow

  Code details

### 1. Form

index.ejs gives a form where the user can choose a color, image and fill in a text.

For color use, [Developer Mozilla](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value) recommend to use the color names like orange.

```
 <label for="powderblue">
        <input type="radio" id="powderblue" name="shirtColor" value="powderblue" />
    <span> Blue</span>
   </label>
```

### 2. Submit - server side

When the user clicks on the submit button from the form, de values will be passed to the URL. This is done server side so that it also works when JS is not present.

```
app.post('/', (req, res) => {
  res.redirect('/design/' + req.body.shirtColor + '/' + req.body.text + '/' + req.body.shirtImage)
})
```

### 3. URL parameters
The values from the URL are retrieved and passed to design.ejs.
```
app.get('/design/:shirtColor/:text/:shirtImage', (req, res) => {
  const shirtColor = req.param('shirtColor')
  const shirtText = req.param('text')
  const shirtImage = req.param('shirtImage')
  res.render('design', { shirtColor, shirtText, shirtImage })
})
```

### 4. SVG
In design.ejs a t-shirt SVG is shown. With the template engine: EJS I ensure that the color, image and text are adjusted to the input of the user. In this way, the user can also see his designed t-shirt without CSS and JS.

***Inline CSS:** This is inline CSS which is not very neat but for enhancement no problem. The only problem you can get, is that the HTML inline-CSS overlaps the CSS-file. Keep this in mind.

```
<svg id="shirt" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 197.65 199.45">
      <title>Your Nerdy Shirt</title>
      <path id="basic" class="cls-1" d="M323,265.12l37.46-47.72,4-2.68,29-11.15,5.9-4.46c6,6.27,11.69,7.87,14.41,8.37a43,43,0,0,0,9.06.38c4.28-.1,7.39-.18,10.77-1.13a26.75,26.75,0,0,0,12.1-7.62l4.83,4.46,28.55,10.26,5.35,2.67L519.28,270l-31.67,21.85-9.36-10.26,3.12,112a469.67,469.67,0,0,1-60.22,3.57,468,468,0,0,1-58.87-4l1.34-115.07q-4,5.34-8,10.7Z" fill="white" stroke="lightgrey" stroke-miterlimit= "10" transform="translate(-322.31 -198.21)"/>
      <path id="collar" class="cls-2" d="M393.52,203.57l5.9-4.46a24.29,24.29,0,0,0,8.85,13.06,23.72,23.72,0,0,0,12.88,4.64,24.32,24.32,0,0,0,15.77-5.06,25.46,25.46,0,0,0,8.84-12.64l4.83,4.46a28.94,28.94,0,0,1-9,13.24c-8.17,6.67-17.42,6.44-20.4,6.32a30.33,30.33,0,0,1-27.63-19.56Z" fill="white" stroke="lightgrey" stroke-miterlimit= "10" transform="translate(-322.31 -198.21)"/>
      <rect id="color" class="cls-3" x="62.21" y="47.62" width="79.07" height="112.59" rx="13.03"  fill= " <%=shirtColor%> ";/>
      <text id="text" class="cls-4" font-size= "10px" fill= "black" font-family= "Courier"  x="51%" y="65%"dominant-baseline="middle" text-anchor="middle"><%=shirtText%></text>
      <image id="image" transform="translate(73.13 71.53) scale(0.49)" xlink:href="/img/<%=shirtImage%>.png"/>
    </svg>
```

### Screenshot

## 2. Usable (HTML + CSS)
### Features
* Styled website
* The form is styled
  * Radio buttons are colors/images

  Wireflow

   Code details

### 1. Form labels

Style the labels

Koop wrote me an issue to nest the input in a label for better [accessibility](https://24ways.org/2015/the-accessibility-mindset/). This wasn't easy because I want to style the label when the radiobutton is checked. If the label becomes a parent element, this will not be possilble anymore. That is why I choose to use a span element inside the label:
```
<label for="green">
<input type="radio" id="darkseagreen" name="shirtColor" value="darkseagreen" />
<span>Green</span>
</label>
```

### 2. Colorblindness

To help people who can't see colors, I left the name of the color inside the button.

### Screenshot

## 3. Pleasurable (HTML + CSS + JS)

### Features
* The user can see directly the input result on the same page.
* Print the design with the print-button

  Wireflow

   Code details

### 1. See directly the result

XMLHttpRequest is a JS object that retrieves data from a URL/other HTML-page without having to do a full page refresh. On this way I can show the result directly next to the form. There is a fallback if the browser don't support XMLHttpRequest.

Source: [Developer.mozilla, XML Http requst](https://developer.mozilla.org/nl/docs/Web/API/XMLHttpRequest)

 ```
 function setupXHR() {
  if (!window.XMLHttpRequest) {
    console.log("XML wordt niet ondersteund")
  } else {
    console.log("XML wordt ondersteund")
    const request = new XMLHttpRequest();
    request.onload = function() {
      const shirtImage = request.response.querySelector("#result")
    }
    request.open('GET', pages[1]);
    request.responseType = 'document';
    request.send();
  }
}
 ```

### 2. Changes in form

When the user changes something in the form,  a function is called.

Source: [Developer.mozilla, Form Change](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event)

```
fieldset[0].addEventListener("change", function() {
      // Change SVG color
      const currentSVGColor = document.querySelector("#SVGcolor");
      currentSVGColor.removeAttribute("fill");
      currentSVGColor.setAttribute("fill", event.target.value);
```

Replace an value for a new one

Source: [Developer.mozilla, String.prototype.replace()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace)

```
const currentTextColorSelector = document.querySelector("#textColor");
let currentTextColor = currentTextColorSelector.textContent;
let newcurrentTextColor = currentTextColor.replace(currentTextColor, event.target.value);
currentTextColorSelector.textContent = "Color: " + newcurrentTextColor;
```

### 3. InnerHTML/textContent

I'll use textContent because it is supported by more browsers.

Source: [Can I use, InnerHTML/textContent ](https://caniuse.com/#search=insertAdjacentHTML)

### 4. Remove()
The submit button from the form navigates to the old URL so it has to be removed.

I use the fallback .style.opacity = "0" if .remove() is not supported by the browser.

```
function deleteSubmitButton() {
  const submitButton = document.querySelector("#submit");
  submitButton.remove()
  submitButton.style.opacity = "0";
}
```

### Screenshot

## Testing
The website is tested on several browsers/ devices. I used [Browserstack](https://www.browserstack.com/)for testing different devices and I've installed Chrome, Safari and Firefox on my Macbook Pro.

### 1. Browser test: Chrome
* No Problems

### 2. Browser test: Safari
* No Problems

### 3.  Browser test: Firefox
* No Problems

### 5. Device test: Motorola Moto G 2nd Gen, Android, v5. Browser: UC
* No Problems

### 6. Device test: Nokia Lumia 930 8.1
* There is no basic style and the submit button is still there. Fortunately, when the user changes the form, the shirt changes. So it is not a big issue. But something to look at when I have more time.

### 7. Device test: Windows 10, Microsoft Edge 15
* No Problems

### 8. Accessibility test: Color blindness
Because there is text in the color buttons, Color blindness should not be a problem.

### 9. Accessibility test: Turn off Images
The form images have an alt text in the form. But this is not yet in the svg result. This can be a problem so I have to add an alt-text here.

### 10. Accessibility test: 3. No mouse
It is possible to move over all the form inputs and the print button. Except the link in the header. This link navigates to the same page so I think this is the reason because the link in the header of the design page still works.

## Sources
* [Developer.mozilla, Color value](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value)
* [Developer.mozilla, Change event](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event)
* [Developer.mozilla, String.prototype.replace()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace)
* [Developer.mozilla, XML Http requst](https://developer.mozilla.org/nl/docs/Web/API/XMLHttpRequest)
* [Can I use](https://caniuse.com)
* [Browserstack](https://www.browserstack.com/)

## Conclusion
[See here the comprehensive conclusion](https://github.com/marissaverdonck/browser-technologies-1920/wiki/Conclusie)
* I've learned that a website should be accessible to all users on all devices.
* I've learned what progressive enhancement is and how you can apply it when creating a website.
* The core functionality is usable in the HTML and CSS and JS provide extra features.
* I've learned that you should check your codes for feature detection and use fallbacks when a feature is not supported.
* I've learned how to test a website.

## License
MIT License


text:
# Exercise 1
Using the text-edit of your choice (e.g., Atom), create a new file called `README.md`. Alternatively, you may clone this repository and edit this file.

In your `README.md` document, put your favorite quote in a block quote, and provide a link to a website that provides additional information about the quote.

Note that you can preview this Markdown in Atom to make sure it works correctly.

> The right man in the wrong place can make all the difference in the world - GMan

license: MIT

repository: VeachTech/book-exercises

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: VeachTech/book-exercises


text:
# Backend Developer's Guide

First review the [generic developer's guide](../README.md).

As a backend developer, it is worthwhile to learn how to run the server directly.
While you can develop portions of it under a simple ```run.py```,
running it directly removes the source of potential bugs from that one layer of indirection
 and lets you tweak command line arguments. To run the server directly, use:
```bash
$ python src/backend/server.py
```

It doesn't matter what folder you run the server from (_if it does seem to matter, file a bug report_)
```bash
$ cd src/backend
$ python server.py
```

If you add 'debug' as an argument to the server you will see the web logs:
```bash
$ cd src/backend
$ python server.py debug
2014-01-19 16:20:19-0500 [-] Log opened.
2014-01-19 16:20:19-0500 [-] Site starting on 8080
2014-01-19 16:20:19-0500 [-] Starting factory <twisted.web.server.Site instance at 0x2e4e680>
2014-01-19 16:20:19-0500 [-] Now open http://<IP_ADDRESS>:8080 in your browser
2014-01-19 16:20:20-0500 [HTTPChannelHixie76Aware,0,<IP_ADDRESS>] <IP_ADDRESS> - - [19/Jan/2014:21:20:20 +0000] "GET /assets/ HTTP/1.1" 404 145 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:26.0) Gecko/20100101 Firefox/26.0"
^C2014-01-19 16:20:25-0500 [-] Received SIGINT, shutting down.
2014-01-19 16:20:25-0500 [twisted.web.server.Site] (TCP Port 8080 Closed)
2014-01-19 16:20:25-0500 [twisted.web.server.Site] Stopping factory <twisted.web.server.Site instance at 0x2e4e680>
2014-01-19 16:20:25-0500 [-] Main loop terminated.
```

 (coming soon: extra arguments taking filenames of datalayers to load up)

## Developer's Tools

????
http://phantomjs.org/ might come in handy

## WebSocket Notes

We're using [autobahn](https://github.com/tavendo/AutobahnPython) as our backend implementation of the websocket protocol (it's a protocol that rides on top of HTTP, just to make the web stack even deeper).
WebSockets provide a (**TODO**: summarize and/or link why websockets) more efficient protocol--less bandwidth and much better latency--than typical request-response HTTP. We are using them because we expect (though we don't actually have any).

In Twisted, a "protocol" is a class which knows how to send and receive data in some particular way,
 and gets instantiated anew **for each connection**(!).
 To hook up a "protocol" to a server, you must wrap the protocol in a "ServerFactory" and pass that as a node to the actual server (this is already done and shouldn't have to be tweaked too much).
The tricky part of this for development is that since each 'protocol' happens new for each connection from each client,
you should not build any statefulness into your "protocols" even though they feel in some ways like the heart of the server. You need to make a tertiary class . Think of protocols as _views_ on your _model_ (and the twisted server which holds the listening TCP connections as the _controller_).
 You _can_ remember the position of your database cursor or your file's seek position within a single "protocol", but anything, updating the database needs to be external (and make the assumption that the connection can die at piece).
However, Twisted thought ahead and covered this situation: every instance of a protocol gains, as .factory, the Factory which created it; so any shared state can (and in most of the [examples](http://twistedmatrix.com/documents/current/core/examples/), is) shared there.

* [Server-side WebSocket API reference](https://github.com/tavendo/AutobahnPython/tree/master/doc)
* [Browser-side WebSocket API reference](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket).

WebSockets, like the _webservice_ protocols that came before them, are referenced like any other HTTP or object: with a URL.
A websocket URL looks like "ws://server:port/path/to/endpoint" or "wss://server:port/path/to/endpoint", the difference being that the latter causes the websocket to connect over SSL.

Autobahn is functional, but it's [website](http://autobahn.ws/python/tutorials/echo/) is currently (**TODO**: update this when this changes) out of date. The github docs and examples seem to be reasonably up to date (they have test cases and stuff, so they better be) so for now, use that as your reference.

Here's some guidance on debugging websockets. Debugging them means tweaking things in ```server.py``` and then opening up
a javascript console from a browser. These notes are in this **README** and not **[[../frontend/README.md]]** since this is really more of an issue--but both sides can and should refer and add to these notes.

When you're in the browser console, you can make a websocket to test with by:
```
   ws = new WebSocket("ws://server:9000/endpoint");
```
   If you drop the ```new``, it'll still work. The difference [is](http://trephine.org/t/index.php?title=Understanding_the_JavaScript_new_keyword) and [occasionally non-existent](

Using 'wss' is a good idea, but unless you've got SSL set up on the server it'll hang and you won't know why because neither the browser API nor Autobahn explicitly mention "SSL" when such a connection fails.

The hostname MUST be the same as the site you are on due to the same-origin policy (unless you do some server side black magic which we shall avoid)
 * In particular, when debugging, you should first open up the server in your webbrowser (autobahn gives a useful response if you hit it with http:// instead of ws://, so if your websocket is supposed to be ws://localhost:9242/ws, then first open http://localhost:9242/ws before trying to debug stuff)

This one-liner lets you test if a websocket is listening:
```
  s = new WebSocket("ws://localhost:8080"); s.onmessage = function(d) { console.log("recv: " + d.data); }; setTimeout(function() { s.send("butts")},1000);
```
  (the setTimeout is because the websocket needs a moment to wake up and handshake; better would be 'onopen'... but with this method you get an error instead of a silent an inexplicable hang)

## GIS Notes

"Shapefiles" are actually 4 (or sometimes 5 or 6) separate files all with the same name but different extensions in a folder. However, most tools can deal with the same files zipped up.
```
cd location_of_shapefile
zip myshapefile.zip *
````

```myshapefile.zip``` is now loadable into most GIS tools (try it in Arc or QGIS). The one tool which doesn't like zipped shapefiles is, frustratingly, GDAL. GDAL can handle folder shapefiles though using this definition "a shapefile is a folder with a .shp file inside of it"

## Gotchas

You must run the server under python2. Twisted is [the largest](https://wiki.python.org/moin/Python2orPython3) library yet to be ported to python3.

In twisted, node.putChild() must have its first argument **NOT** end with a '/'. That will cause mysterious 404s with no clue in the log.

* [Here](http://krondo.com/?p=1209)'s a fun (very poetic) book about Twisted.
* [Network programming with the Twisted framework, Part 1](http://www.ibm.com/developerworks/linux/library/l-twist1/index.html)

In OL3, when loading Vector layers, you (for some currently unknown reason) must pass 'renderer: ol.RendererHint.CANVAS' to the Map constructor or else they will fail with a nil ptr exception in the bowels of OL.

New additions regarding loading a simulation:
The file load_sim.py has been added to /src/backend. What this does is import all the needed files from the models folder. All the nasty
work is done here, such as configuration the initial simulation.

In sim_server.py (copied Nick's server.py), you need two lines to get the Simulation object:
import load_sim
sim = load_sim.sim

Then running sim.step() returns a Python dictionary of the next year in the simulation.
Note: Javascript Console is giving me an error about how it doesn't like to be formatted, BUT, the server sends
it just fine without halting.

What if we moved models inside backend? This reduces a TON of issues. For instance, certain counties number 58-341 (in guatemala.json)
fail to load for whatever reason when being called from outside the directory. I already altered map.py, yet this problem still persists.

If we make models a subdirectory of backend, we wouldn't have this problem whatsoever.

## Compatibility

we should at least cover:
Installing the server on
* Ubuntu
* Mac

repository: kousu/modex

gha_language: JavaScript

repo_name: kousu/modex


text:
# Microsoft Azure Notification Hubs

Azure Notification Hubs provide an easy-to-use, multiplatform, scaled-out push infrastructure that enables you to send mobile push notifications from any backend (in the cloud or on-premises) to any mobile platform. To learn more, visit our [Developer Center](https://azure.microsoft.com/en-us/documentation/services/notification-hubs).

## Getting Started

If you are new to Notification Hubs, you can get started by following our tutorials to push notifications to your [iOS apps](https://azure.microsoft.com/en-us/documentation/articles/notification-hubs-ios-get-started/), [Android apps](https://azure.microsoft.com/en-us/documentation/articles/notification-hubs-android-get-started/), and [Windows Universal apps](https://azure.microsoft.com/en-us/documentation/articles/notification-hubs-windows-store-dotnet-get-started/).

## Download Source Code

To get the source code of our SDKs via **git** just type:

    git clone https://github.com/Azure/azure-notificationhubs.git
    cd ./azure-notificationhubs/

## Useful Resources

* [Samples](https://github.com/Azure/azure-notificationhubs-samples)
* Tutorials and product overview are available at [Microsoft Azure Notification Hubs Developer Center](https://azure.microsoft.com/en-us/documentation/services/notification-hubs).
* Our product team actively monitors the [Notification Hubs Developer Forum](http://social.msdn.microsoft.com/Forums/en-US/notificationhubs/) to assist you with any troubles.

## Contribute Code or Provide Feedback

If you would like to become an active contributor to this project please follow the instructions provided in [Microsoft Azure Projects Contribution Guidelines](http://azure.github.com/guidelines.html).

If you encounter any bugs with the library please file an issue in the [Issues](https://github.com/Azure/azure-notificationhubs/issues) section of the project.

repository: Mojang/azure-notificationhubs

gha_language: Objective-C

repo_name: Mojang/azure-notificationhubs


text:
---
layout: post
current: post
cover:  assets/images/31_nes/cover.jpg
navigation: True
title: NES-Innovation Project Second Prize Award.
date: 2018-03-31 10:00:00
tags: [nes]
class: post-template
subclass: 'post tag-getting-started'
author: raheena
---

### Computer  Department NES-Innovation Project Award-2018.
> CAPTION:NES-Innovation Project Second Prize Award.

### Description about NES-Innovation Project Competition:

 NES ( Natarajan Education Society) Established by Dr. Ganesh Natarajan (Vice Chairman and CEO, Zensar Technologies).NES aims at building a team of professionals to create and implement innovative ideas for education and technology.NES is designed to upgrade relevant market skills in young people to make them more employable.

Computer Department has registered 17 groups in initial stage. The total 600 groups reviewed by Jury members which includes Mr. Amay Mashelkar son of Great scientist Dr. R. Mashelkar. Later from 600 groups they finalized 50 groups in which our 5 groups got selected. Our group worked towards completion of innovative projects technically. One of our group Inter Vehicular Communication using Li-Fi Technology (Sheetal Bedarkar,Sandhyarani Khadakhade, Manjulajadhav)  Guided by Ms. B. Padmavathi got Rs. 30000/- as second prize from Dr.RaghunathMashelkaron 29nd March 2018.

![students attending seminar](assets/images/31_nes/1.png  "31_nes_1")
![students attending seminar](assets/images/31_nes/2.png  "31_nes_2")

> Details of the News Coordinator:  Mrs. MansiBhonsle

> Department: COMPUTER ENGINEERING

> Organization : GHRCEM, Pune

> Date: (31/03/2018 )


text:
# Lunar Virtual/Digital Product Addon

[![Latest Version on Packagist](https://img.shields.io/packagist/v/armezit/lunarphp-virtual-product.svg?style=flat-square)](https://packagist.org/packages/armezit/lunarphp-virtual-product)
[![GitHub Tests Action Status](https://img.shields.io/github/actions/workflow/status/armezit/lunarphp-virtual-product/run-tests.yml?branch=main&label=tests)](https://github.com/armezit/lunarphp-virtual-product/actions?query=workflow%3Arun-tests+branch%3Amain)
[![GitHub Code Style Action Status](https://img.shields.io/github/actions/workflow/status/armezit/lunarphp-virtual-product/fix-php-code-style-issues.yml?branch=main&label=code%20style)](https://github.com/armezit/lunarphp-virtual-product/actions?query=workflow%3A"Fix+PHP+code+style+issues"+branch%3Amain)
[![Total Downloads](https://img.shields.io/packagist/dt/armezit/lunarphp-virtual-product.svg?style=flat-square)](https://packagist.org/packages/armezit/lunarphp-virtual-product)

Virtual products (also known as digital goods), represent non-tangible items such as memberships, services, warranties,
subscriptions and digital downloadable goods like games, virtual game tokens, books, music, videos, or other products.

The Virtual Product addon for Lunar allows you to define virtual/digital products in your
[Lunar](https://github.com/lunarphp/lunar) store.

## Requirements

- PHP ^8.1
- Laravel 9+

## Quick Setup

You can install the package via composer:

```bash
composer require armezit/lunarphp-virtual-product
```

Run the migrations with:

```bash
php artisan migrate
```

## Usage

_TBD._

## Installation

[Quick Setup](#quick-setup) covers the essential installation steps.
This section, however, is a detailed installation procedure,
containing all optional parts.

You can install the package via composer:

```bash
composer require armezit/lunarphp-virtual-product
```

### Migrations

Publish the migrations and run them with:

```bash
php artisan vendor:publish --tag="lunarphp-virtual-product-migrations"
php artisan migrate
```

::: tip Table names are configurable. See the config file. :::

### Config

You can publish the config file with:

```bash
php artisan vendor:publish --tag="lunarphp-virtual-product-config"
```

This is the contents of the published config file:

```php
return [

];
```

### Translations & Views

Optionally, you can publish the translations and views using

```bash
php artisan vendor:publish --tag="lunarphp-virtual-product-translations"
php artisan vendor:publish --tag="lunarphp-virtual-product-views"
```

### Service provider

By default, this package automatically register it\`s service providers when it is installed.

If for any reason you prefer to register them manually, you should add the package service providers
into your laravel application's `config/app.php` file.

```php
// ...
'providers' => [
    // ...
    Armezit\Lunar\VirtualProduct\VirtualProductServiceProvider::class,
    Armezit\Lunar\VirtualProduct\VirtualProductHubServiceProvider::class,
],
```

The `VirtualProductServiceProvider` bootstrap primary package features,
while the `VirtualProductHubServiceProvider` is used to register some
[Slots](https://docs.lunarphp.io/extending/admin-hub.html#slots) to be used in Lunar Admin Hub.

## Testing

```bash
composer test
```

## Changelog

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

## Contributing

Please see [CONTRIBUTING](https://github.com/armezit/.github/blob/main/CONTRIBUTING.md) for details.

## Security Vulnerabilities

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

## Credits

- [Armin Rezayati](https://github.com/armezit)
- [All Contributors](../../contributors)

## License

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

repository: armezit/lunarphp-virtual-product

branch_name: refs/heads/main

gha_language: PHP

gha_license_id: MIT

repo_name: armezit/lunarphp-virtual-product


text:
# Liquid Connector

## About Liquid

Liquid is a centralized exchange based in Tokyo, Japan launched by Quione in 2017. It also has offices in Singapore but is regulated and licensed by the Financial Services Agency of Japan. Over the past 12 months (as at May 2019) it has more than USD 50 billion in transactions on their exchanges.

## Using the Connector

The connector is for [Liquid](https://www.liquid.com/) based in Singapore (i.e. not for the local Japanese Liquid exchange). Because it is a centralized exchange, you will need to generate and provide your API key in order to trade using Hummingbot.

```
Enter your Liquid API key >>>
Enter your Liquid secret key >>>
```

Private keys and API keys are stored locally for the operation of the Hummingbot client only. At no point will private or API keys be shared to CoinAlpha or be used in any way other than to authorize transactions required for the operation of Hummingbot.

!!! tip "Copying and pasting into Hummingbot"
    See [this page](/faq/troubleshooting/#paste-items-from-clipboard-in-putty) for more instructions in our Support section.

### Creating Liquid API keys

This article below in their website under API information shows step-by-step instructions on how to create API keys in Liquid exchange.

* [How to create API tokens](https://help.liquid.com/en/articles/2285018-how-to-create-api-tokens)

!!! warning "API key permissions"
    We recommend using only **"trade"** enabled API keys; enabling **"withdraw", "transfer", or the equivalent** is unnecessary for current Hummingbot strategies.

## Miscellaneous Info

### Exchange Status

Users can go to https://status.liquid.com/ to check the status of the exchange and review past or ongoing incidents.

Developers can query the current status using the API, see documentation in https://status.liquid.com/api/.

### Minimum Order Sizes

There is no minimum order quantity for trading fiat currency. See [this page](https://help.liquid.com/en/articles/3339119-minimum-order-quantity) for minimum order sizes on crypto trading pairs.

If the token or trading pair isn't listed in the article, you can also get this information through their public API.

```
https://api.liquid.com/currencies
```

The minimum order size is the value next to `minimum_order_quantity`. For example, let's say you're trading ETH-BTC and ETH which is your **base currency** is not listed in the article above. Liquid's public API shows the minimum order size of ETH currency is `0.01`.

```
"currency_type": "crypto",
"currency": "ETH",
"symbol": "Ξ",
"assets_precision": 18,
"quoting_precision": 8,
"minimum_withdrawal": 0.02,
"withdrawal_fee": 0.0,
"minimum_fee": null,
"minimum_order_quantity": 0.01,
"display_precision": 5,
"depositable": true,
"withdrawable": true,
"discount_fee": 0.5,
"lendable": true,
"position_fundable": true,
"has_memo": false
```

### Transaction Fees

In this [blog post](https://blog.liquid.com/liquid-progressive-fee-update), Liquid announced their [new fee structure](https://www.liquid.com/fees/) that offers 0 trading fees on maker orders if a user's 30-day trading volume is less than $10,000 and 0.30% on taker. All users can get a 50% discount on trading fees if paid in QASH.

QASH is an ERC20 token designed to be used services on the Quione and Liquid platform. Effective April 1 2019, high-volume traders can also get rebates on trading fees.

Read through their articles below related to trading fees, and rebates.

* [Trading Fees](https://help.liquid.com/en/articles/2273126-trading-fees)
* [Trading fee rebate for high-volume traders](https://help.liquid.com/en/articles/2825019-trading-fee-rebate-for-high-volume-traders)

Users can override the default fees. See [Fee Overrides](/advanced/fee-overrides/).

repository: OceanEx/hummingbot

gha_language: Python

repo_name: OceanEx/hummingbot


text:
---
layout: post
title: 'Friday Links #166'
---
Just got back from vacation which is why this weeks links are late.

**Programming**

[Introducing the Knockout.Unobtrusive Plugin | User InExperience](http://userinexperience.com/?p=689)
[Announcing YUI 3.4.0 and the new YUILibrary.com » Yahoo! User Interface Blog (YUIBlog)](http://www.yuiblog.com/blog/2011/08/18/announcing-yui-3-4-0-and-the-new-yuilibrary-com/)
[spin.js](http://fgnass.github.com/spin.js/)
[A Really Nice Way To Handle Popup Information](http://css-tricks.com/13638-a-really-nice-way-to-handle-popup-information/)
[Top 10 Mobile Web Development JavaScript Frameworks](http://feedproxy.google.com/~r/SixRevisions/~3/j3vrkChE3nM/)
[Barrier in .NET 4.0 - Daily .Net Tips](http://dailydotnettips.com/2011/08/18/barrier-in-net-4-0/)
[Stephen Forte`s Blog - A New Era in Application Development, Part II: Kendo UI](http://www.stephenforte.net/PermaLink,guid,b3c6493d-c92b-4122-a150-d9674ecfdaea.aspx)
[Persistent Headers](http://css-tricks.com/13465-persistent-headers/)
[ThreadPool vs. Tasks - Paul Stovell](http://www.paulstovell.com/threadpool-vs-tasks)
[Welcome to Building Windows 8 - Building Windows 8 - Site Home - MSDN Blogs](http://blogs.msdn.com/b/b8/archive/2011/08/15/welcome-to-building-windows-8.aspx)

**Applications**

[touchfreeze - Utility for Windows that disables touchpad automatically while you are typing text](http://code.google.com/p/touchfreeze/)
[Find more while you browse with Google Related](http://feedproxy.google.com/~r/blogspot/MKuf/~3/HO50pIzMYKQ/find-more-while-you-browse-with-google.html)
[Introducing Gmail Mail Merge v2.0](http://www.labnol.org/tech/gmail-mail-merge/19972/)
[Copy any DVD to in two steps with BDLot DVD ISO Master](http://feedproxy.google.com/~r/Freewaregeniuscom/~3/GBi6c_O4gtM/)

**Science and Technology**

[13-Year-Old Designs Super-Efficient Solar Array Based on the Fibonacci Sequence](http://www.popsci.com/technology/article/2011-08/13-year-old-designs-breakthrough-solar-array-based-fibonacci-sequence)
[New Computer Chip Modeled on a Living Brain Can Learn and Remember](http://www.popsci.com/technology/article/2011-08/first-generation-cognitive-chips-based-brain-architecture-will-revolutionize-computing-ibm-says)
[Naturally Occurring Preservative Could Give Fresh Meats a Three-Year Shelf Life](http://www.popsci.com/technology/article/2011-08/naturally-occurring-preservative-could-give-fresh-meats-three-year-shelf-life)

**On the Web**

[Rain or shine, see the weather in Google Maps](http://feedproxy.google.com/~r/blogspot/MKuf/~3/hNibpLz64Zg/rain-or-shine-see-weather-in-google.html)
[Supercharging Android: Google to Acquire Motorola Mobility](http://feedproxy.google.com/~r/blogspot/MKuf/~3/VXawQY4HDIk/supercharging-android-google-to-acquire.html)

**Stuff I Just Like**

[How To Crack Your Own WEP Network To Find Out Just How Insecure It Really Is](http://feedproxy.google.com/~r/Makeuseof/~3/gVtKyuhuyN4/)
[Light-Up Bike Wheels Help Cyclists See the Road, and Help Motorists See the Bikes](http://www.popsci.com/diy/article/2011-08/light-bike-wheels-help-cyclists-see-road-and-help-motorists-see-bikes)
[A New Spin on Road Bike Frames Smooths Your Ride](http://www.popsci.com/gadgets/article/2011-08/new-spin-road-bike-frames-smooths-your-ride)

gha_language: HTML


text:
NetIP - TCP/IP networking multiple devices over serial
======================================================

For project website and documentation, see [here](https://fjfranklin.github.io/NetIP/).

## Overview

The aim of NetIP is to be able to link multiple devices into a network using serial
connections, so that any device in - or connected to - the network can talk to any
other. This is achieved using Serial Line Internet Protocol (SLIP) between devices,
and forwarding packets transparently at intermediate nodes. UDP is supported, and
also a subset of TCP/IP. (There is no support for fragmentation and reassembly.)

The principal target of NetIP is embedded devices, so the program code is small and
memory requirements small, with no dynamic allocation of memory that would lead to
fragmentation. The two 'architectures' currently supported are 'Unix' (tested on
Linux and Mac OS X) and 'Arduino' (tested on the Uno, Due and Teensy 3.5).

## TODO

* TCP/IP: Connect works; need to implement data & connection-close
* Add an interface for the gateway device to handle external routing
* Test with multiple devices
* Doxygen documentation + GitHub Pages site documentation
* Q. What happens when a serial link blocks?

# License

Unless otherwise stated, the code and examples here are
provided under the MIT License:

Copyright (c) 2018 Francis James Franklin

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

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

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

repository: FJFranklin/NetIP

repo_name: FJFranklin/NetIP


text:
# Prow Images

This directory contains all of the images used for any of our Prow pre- or post-
submit jobs.

## Building images

To build the images, run the following command:
```bash
./build-images.sh
```

This will tag each of the images with `prow/<type>` where `<type>` is the suffix
of the Dockerfile, for example `prow/test`.

## Releasing images

To push the images into an ECR public repository, first authenticate with the
corresponding account that has access to the public repository.

To publish a version of the images to your own repository, run the following
command:

```bash
DOCKER_REPOSITORY=<my-repository-uri> ./push-image.sh <image type>
```
Replacing `<my-repository-uri>` with the URI of the repository and <image type>
with the type of Dockerfile you wish to push.

To publish a new version of the images to the **official ACK repository**, run
the following command:

```bash
VERSION=X.Y.Z ./push-image.sh <image type>
```
Replacing `X.Y.Z` with the SemVer version tag of the images.

*Note: Only ACK core contributors will have access to the official ACK
repository*

repository: mbaijal/test-infra

repo_name: mbaijal/test-infra


text:
# go-boilerpipe

_Golang port of the [boilerpipe](https://github.com/kohlschutter/boilerpipe)
Java library written by Christian Kohlschütter_

[![Build Status](https://travis-ci.org/jlubawy/go-boilerpipe.svg?branch=master)](https://travis-ci.org/jlubawy/go-boilerpipe) [![GoDoc](https://godoc.org/github.com/jlubawy/go-boilerpipe?status.svg)](https://godoc.org/github.com/jlubawy/go-boilerpipe)

Boilerpipe removes boilerplate and extracts text content from HTML documents.

Currently it only supports article extraction which includes the title,
the date, and the content.

Best attempts will be made to follow [Semantic Versioning 2.0.0](https://semver.org/spec/v2.0.0.html#semantic-versioning-200) rules,
but no API guarantees will be made until version 1.0.0.

However, existing tags will not change guaranteeing that [vendoring](https://semver.org/spec/v2.0.0.html#semantic-versioning-200) will not break.

## Getting Started

To install: ```go get -u github.com/jlubawy/go-boilerpipe/...```

## Command-Line Tool

    $ boilerpipe help

    Boilerpipe removes boilerplate and extracts text content from HTML documents.

    Usage:

           boilerpipe command [arguments]

    The commands are:

           extract    extract text content from an HTML document
           serve      start a HTTP server for extracting text from HTML documents
           version    print boilerpipe version

    Use "boilerpipe help [command]" for more information about a command.

## Using the library

See examples in [filter_test.go](filter_test.go).

repository: jlubawy/go-boilerpipe

gha_license_id: NOASSERTION

repo_name: jlubawy/go-boilerpipe


text:
Ansible 'common' role
=====================

Applies basic configuration settings

**Important**: Only tested with servers and VMs running on IDRC's datacenter.

Role Variables
--------------

Available variables are listed below, along with default values (see `defaults/main.yml`):

These options are useful to ensure root logins are not permitted to certain servers (even if an attacker gains access to the console or can bypass SSH restrictions somehow -- physical access to hard disk renders these useless though):

    common_unset_root_password: yes
    common_remove_root_authorized_keys: yes

By default, this role will use TCP connections to remote syslog servers.

    common_syslog_port: 601

List of remote syslog servers. The rsyslog behavior is tweaked to ensure messages are sent to ALL servers simultaneously:

    common_syslog_servers: []

In case it's necessary to ensure certain RPM packages are installed across all servers (and they can't be added to the VM template or Cobbler/Kickstart configuration for any reason), list them here:

    common_packages: []

# NTP servers used by chrony (should be configured with the closest servers):

    common_ntp_servers:
      - 0.pool.ntp.org
      - 1.pool.ntp.org
      - 2.pool.ntp.org
      - 3.pool.ntp.org

# Default DNS resolvers to be used in /etc/resolv.conf

    common_nameservers:
      - <IP_ADDRESS>
      - <IP_ADDRESS>

# You may want to tweak how names are resolved (see resolv.conf(5) man page for more details)

    common_resolvconf_options: single-request-reopen

Example Playbook
----------------

    - hosts: localhost
      become: yes
      roles:
        - common

Tests
-----

Use [molecule](https://github.com/metacloud/molecule) to test this role.

Because this role depends on systemd and SELinux, only a Vagrant provider is configured at the moment.

License
-------

MIT

repository: idi-ops-archive/ansible-common

repo_name: idi-ops-archive/ansible-common


text:
---
layout: post
title: "TIL: pbcopy"
description: ""
category: ""
tags: [Mac, pbcopy, productivity]
---
{% include JB/setup %}

*TIL*: Discovered a super game changing technique. From command line, you can copy contents of any file to Mac OS clipboard by running this command:

1. `cat yourfilename.txt | pbcopy`
2. Open your other application, press `Command+V` to paste as normal
3. Profit. Immensely.


text:
linux_rails_server_setup_script
===============================

A simple install script for ubuntu 14.04 to install all of the packages needed for a working rails environment

Installs : Git, SSH Server, RVM, Ruby (latest stable), Rails (latest stable), MySQL, SSH Key

Quick Install
===============================

Get the file
```bash
wget https://raw.githubusercontent.com/cjbuchmann/linux_rails_server_setup_script/master/linux_rails_server_setup.sh
```

Edit the email and name in the file
```bash
nano linux_rails_server_setup.sh to change email and name
```

Run the file
```bash
chmod 755 ./linux_rails_server_setup.sh
./linux_rails_server_setup.sh
```

To use the latest ruby version, you'll need to manually set the version that rvm installed

```bash
source ~/.profile
rvm list
rvm use [version] --default
```


text:
# AZURE-DOCUMENTDB-THROTTLETEST

This console application attempts to hit the document db throttling limit by firing a number of parallel tasks at a single collection.

To use this application you'll need to update the following settings in the app.config to valid Azure document db settings.

``` xml
<appSettings>

    <add key="DatabaseServiceEndpoint" value="YOUR-DATABASE-SERVICE-ENDPOINT"/>

    <add key="DatabaseId" value="YOUR-DATABASE-ID"/>

    <add key="DatabaseAuthKey" value="YOUR-DATABASE-AUTH-KEY"/>

    <add key="DatabaseCollectionName" value="YOUR-COLLECTION-NAME"/>

    <add key="MaxPendingTasks" value="10"/>

  </appSettings>
  ```


text:
# PGLOG Analysis CSV Log Analysis

Pigsty provides a practical application for analyzing PG CSV log samples (PG 13+). It can be used to finely analyze failure site logs, slow query logs.

The CSV log format of > PostgreSQL 13 has changed to add a new `backend_type` field. For access to older versions of PostgreSQL CSV logs, please adjust the `pglog.sample` table definition (e.g. via `ALTER TABLE DROP COLUMN`)

## Graphical interface

You can access the following link to view a sample log analysis interface.

* [PGLOG Analysis](http://demo.pigsty.cc/d/pglog-analysis): Presents the entire sample CSV log details, aggregated by multiple dimensions.
* [PGLOG Session](http://demo.pigsty.cc/d/pglog-session): presents the details of one specific connection in the log sample.

## Usage

PGLOG uses the `pglog.sample` table in MetaDB as the data source, you just need to fill the logs into this table and then access the Dashboard.
Pigsty provides some handy commands for pulling csv logs and pouring them into the sample table.

### `pglog`

The `pglog` command reads CSV logs from stdin and pours them into the sample table

```bash
alias pglog="psql service=meta -AXtwc 'TRUNCATE pglog.sample; COPY pglog.sample FROM STDIN CSV;'" # useful alias
```

For example, suppose you have a ``postgresql-Tue.csv`` log, then you can use the following

```bash
postgresql-Tue.csv | pglog
```

to pour it into the analysis sample table.

### `catlog`

The ``catlog`` command pulls CSV database logs from a specific node for a specific date and writes them to ``stdout`

```bash
### default: get pgsql csvlog (localhost @ today)
function catlog(){ # getlog <ip|host> <date:YYYY-MM-DD>
    local node=${1-'<IP_ADDRESS>'}
    local today=$(date '+%Y-%m-%d')
    local ds=${2-${today}}
    ssh -t "${node}" "sudo cat /pg/data/log/postgresql-${ds}.csv"
}
```

By default, `catlog` pulls the logs for the current node for the current day, you can specify the node with the date via the parameter.

### Shortcuts

Use a combination of `pglog` and `catlog` to quickly pull database CSV logs for analysis.

```bash
catlog | pglog # Analyze the current node's logs for the current day
catlog node-1 '2021-07-15' | pglog # Analyze node-1's csvlog on 2021-07-15
```

repository: winsonsun/pigsty

repo_name: winsonsun/pigsty


text:
# 👹 jest-extended-snapshot

Additional Jest matchers for snapshot testing.

**📝 Read the [blog post](https://understandlegacycode.com/blog/3-steps-to-add-tests-on-existing-code-when-you-have-short-deadlines/).**

_Requires Jest version >= 23._

---

[![version](https://img.shields.io/npm/v/jest-extended-snapshot.svg?logo=npm)](https://www.npmjs.com/package/jest-extended-snapshot)
[![Build Status](https://travis-ci.org/nicoespeon/jest-extended-snapshot.svg?branch=master)](https://travis-ci.org/nicoespeon/jest-extended-snapshot)
[![Changelog](https://img.shields.io/badge/%F0%9F%93%94-changelog-CD9523.svg)](https://github.com/nicoespeon/jest-extended-snapshot/blob/master/CHANGELOG.md)

## Why?

If you find yourself in a scenario where you want to add tests after code has been written, you might want to use Jest snapshots.

A typical scenario is working with legacy code: it has no test, but you need to change/fix it. You should set up a test harness first, to ensure there would be no regression. Jest snapshots make this job easier.

This lib adds convenient matchers to work in such scenario.

 One approach to use in this situation is called "Approval testing".

It can get you test coverage quickly, without having to understand the code.

> Unit testing asserts can be difficult to use. Approval tests simplify this by taking a snapshot of the results, and confirming that they have not changed.

Further information: http://approvaltests.com/

## Installation

With npm:

```
npm install --save-dev jest-extended-snapshot
```

With yarn:

```
yarn add -D jest-extended-snapshot
```

## Set up

### Jest 23

Add `jest-extended-snapshot` to your Jest `setupTestFrameworkScriptFile` configuration. [See Jest website](https://archive.jestjs.io/docs/en/23.x/configuration#setuptestframeworkscriptfile-string) for more information.

```json
"jest": {
  "setupTestFrameworkScriptFile": "jest-extended-snapshot"
}
```

If you are already using another test framework, like [jest-extended](https://github.com/jest-community/jest-extended), you should create a test setup file to require each of the frameworks you are using.

For example:

```js
// ./test-setup.js
require("jest-extended-snapshot");
require("any other test framework libraries you are using");
```

Then in your Jest config:

```json
"jest": {
  "setupTestFrameworkScriptFile": "./test-setup.js"
}
```

### Jest version >= 24

Add `jest-extended-snapshot` to your `setupFilesAfterEnv` array in the Jest configuration. [See Jest website](https://jestjs.io/docs/configuration#setupfilesafterenv-array) for more information.

```json
"jest": {
  "setupFilesAfterEnv": ["jest-extended-snapshot"]
}
```

### TypeScript

If your editor does not recognise the custom `jest-extended-snapshot` matchers, add a `global.d.ts` file to your project with:

```ts
import "jest-extended-snapshot";
```

## List of additional matchers (API)

### `.toVerifyAllCombinations([args])`

Test all combinations of given parameters to the function under test, and match against snapshot.

Usage:

```js
expect(myFunction).toVerifyAllCombinations([args]);
```

#### Example

```js
function myFunction(aNumber, aString) {
  if (aNumber > 0) {
    return `${aString} #${aNumber}`;
  }

  if (aString === "foo") {
    return `${aNumber} bar`;
  }

  return "This is twisted…";
}

it("should continue working as before", () => {
  expect(myFunction).toVerifyAllCombinations([1, -1], ["random", "foo"]);
});
```

Will produce following snapshot:

```
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`should continue working as before 1`] = `
Object {
  "-1,foo": "-1 bar",
  "-1,random": "This is twisted…",
  "1,foo": "foo #1",
  "1,random": "random #1",
}
`;
```

#### How to use best

1. Determine the inputs you could combine to test your code
1. Determine the output you could make a snapshot from
1. Use test coverage to determine which parts are not covered yet
1. Augment your inputs combination until you cover all of the code
1. Perform little mutations in your covered code to check the quality of your snapshot
1. Augment your inputs combination until there is no way you can add mutations without the test failing
1. In the end, you got a snapshot of what your code does. And you can start refactoring with confidence

👌 I recommend you watch this video of Emily Bache, applying this over the Gilded Rose refactoring kata (in Java): https://youtu.be/zyM2Ep28ED8

## List of helpers

### `range(start, end)` / `range(end)`

Generate a list of numbers from `start` to `end`. Syntactic sugar to generate exhaustive combinations of number inputs.

Defaults `start` to `0` if called with a single parameter.

```ts
import { range } from "jest-extended-snapshot";

// All are equivalent
expect(myFunction).toVerifyAllCombinations([0, 1, 2, 3, 4], ["foo"]);
expect(myFunction).toVerifyAllCombinations(range(0, 4), ["foo"]);
expect(myFunction).toVerifyAllCombinations(range(4), ["foo"]);
```

repository: nicoespeon/jest-extended-snapshot

gha_language: TypeScript

repo_name: nicoespeon/jest-extended-snapshot


text:
Ti=BROWN UNIVERSITY OUTGOING MATERIAL TRANSFER AGREEMENT

0.1.sec=To: {Recipient.Scientist.US.Contract.Among.Block}

0.2.sec=Date: {Provider.Institution.SignDate.YMD}

0.3.sec=Subject:  Agreement for Providing Materials and Related Information and/or Data, for Testing, Evaluation and/or Research Purposes

0.4.sec=Dear {Recipient.Scientist.Name.First}:

0.5.sec=In response to your request for the "Material", identified as: {Material.Description.cl} from the laboratory of {Provider.Scientist.US.M/Ms_NameFull} at Brown University.  Brown University agrees to provide this Material to {Recipient.Institution.Name.Full} for conducting research entitled "{Recipient.Research.Title}" under the direction of {Recipient.Scientist.US.M/Ms_NameFull} under the following Terms and Conditions:

0.=[G/Z/paras/s5]

1.sec=The Material (defined herein as the original material and all modifications and derivatives produced from the original material) will be used for non-clinical research purposes only, and will not be used on humans.

2.sec=The Material will be used solely for studies conducted under the supervision of {Recipient.Scientist.US.M/Ms_NameFull} and will not be distributed or released to any person or laboratory not under the direct supervision of the {Recipient.Scientist.US.M/Ms_NameFull} or to outside third-parties or used for any other purposes except as provided hereunder without a prior written permission from Brown University.

3.sec=It is understood that the Material is the proprietary property of Brown University and said Material, including all modifications and derivatives produced from the original material, shall not be incorporated into a commercial product or used in any commercial application, including drug screening, without a license from Brown University.  It is understood that no right to a license is given, implied or intended by this Agreement.  Further, Brown makes no representation that the use of the Material will not infringe any patent or other proprietary right.

4.sec=Should your use of the Material result in potentially valuable commercial property you will promptly notify Brown University.  Further, {Recipient.Scientist.US.M/Ms_NameFull} and {Recipient.Institution.Name.Full} agree to provide appropriate acknowledgment of the source of the Material in all publications and to provide a copy of such publications to Brown University.

5.sec=Brown University's rights to distribute the Material to other commercial and non-commercial organizations are not limited in any way by this Agreement.

6.sec=You agree to use the Material in a safe manner and in compliance with Federal, State, and local laws, regulations, and guidelines, including the Guidelines of the National Institutes of Health.

7.sec=The {Recipient.Scientist.US.M/Ms_NameFull} and {Recipient.Institution.Name.Full} acknowledge the experimental nature of the material and that it is provided on an "as is basis", without warranty of merchantability or fitness for a particular purpose or any other warranty, expressed or implied, and that Brown University has no liability in connection with its use, storage, handling, or transportation.  Further the {Recipient.Scientist.US.M/Ms_NameFull} and {Recipient.Institution.Name.Full} agree to waive all claims against Brown University, and to defend and indemnify Brown University from all claims and damages arising from actions by the {Recipient.Scientist.US.M/Ms_NameFull} and/or {Recipient.Institution.Name.Full} related to their use of the Material.

8.sec={Recipient.Institution.Name.Full} certifies that the {Recipient.Institution.Name.Full}, the {Recipient.Scientist.US.M/Ms_NameFull}, and any person using the Material under the supervision of the {Recipient.Scientist.US.M/Ms_NameFull} (end-user), are not currently on a U.S. government Restricted Party List and do not have a debarment or restriction pending.

9.sec=The Material is being provided upon receipt of a one-time Fee of {TransferFee.$} to cover the costs of making, packaging and transferring the Material. Payment should be made to Brown University and sent to Brown University, Box 1949, Providence, RI 02912.

10.sec=Execution of this Agreement can be effected by exchange of paper copy, by facsimile signatures or by other electronic means. This Agreement may be executed in one or more counterparts, each of which shall be deemed to be an original but all of which, taken together, shall be deemed to be one and the same instrument.

11.0.sec=If the above terms are acceptable, please have this document signed by the {Recipient.Scientist.US.M/Ms_NameFull} and the Authorized Official of the {Recipient.Institution.Name.Full} and return them by email or if you prefer to send hard copy to:

11.1.sec={Provider.Institution.US.Notice.Block}
Email:  {Provider.Institution.Email}

11.=[G/Z/ol-none/s1]

Industry Engagement and Commercial Venturing
	Brown University
	Box 1949, 47 George Street
	Providence, RI 02912

00.1.sec=Sincerely,
{Provider.Scientist.US.M/Ms_NameFull}
Brown University Provider Scientist

00.2.sec=Accepted and Agreed: IN WITNESS WHEREOF, the parties hereto have executed this Agreement as of the date of the last party to sign this Material Transfer Agreement below.

00.3.0.sec=Recipient Institution:

00.3.1.sec=Recipient Scientist
{Recipient.Scientist.US.M/Ms_NameFull}
Date: {Recipient.Scientist.SignDate.YMD}

00.3.2.sec={Recipient.Institution.US.Contract.By.Block}

00.3.=[G/Z/ol-none/s2]

00.4.sec={Provider.Institution.US.Contract.By.Block}

00.=[G/Z/paras/s4]

=[G/Z/ol/s11]

repository: CommonAccord/Cmacc-Org

gha_language: CSS

repo_name: CommonAccord/Cmacc-Org


text:
# PaperGUI

A clone of [dat.GUI](https://github.com/dataarts/dat.gui) using nice
[Polymer](https://www.polymer-project.org/1.0/docs/) paper elements.

## Install

Building requires node, gulp and bower.

`npm install gulp bower`

`npm install`

`npm run-script build`

The `dist` folder contains the build. The `paper-gui.html` file is the only one
you need if you want to use webcomponent-style, synchronous import.
Otherwise, you'll need all 3 files in the `dist` folder as `paperGUI.js` loads
the other two.

To try out the demo, run a webserver in the papergui root folder, eg:

`python -m SimpleHTTPServer 8000`

then open http://localhost:8000/demo.html in a browser.

## TODO

- Improve documentation & demo
- Increase test coverage
- Add folders/tabs structure capability

## Known issues

- Select box change callback fires on controller creation (intended?)


text:
# AutoGetIt
The idea with this small Delphi program is to automate the [GetIt package manager](http://docwiki.embarcadero.com/RADStudio/Sydney/en/Installing_a_Package_Using_GetIt_Package_Manager) for RAD Studio (Delphi) by calling the GetIt command-line tool that comes with Delphi.  Every time there's an update or a need to reinstall, it's a pain to tediously and manually go through all the GetIt packages and reinstall them. Wouldn't it be nice if there was a saved checklist?

This Delphi program uses the DosCommand component (available on GetIt) to shell out to the GetItCmd.exe and show all the packages in a CheckListBox. You then simply check off all the packages you want to install, click the Install button, and sit back and watch them all get installed (some require authorization so it's not completely unattended). You can also right+click on this list to select all or none, or uninstall the checked packages instead, or install/uninstall just one package at a time.

_Written in Delphi 10.4.1, tested on the update to Delphi 10.4.2: installed over 75 packages in less than 30 mintues!_

## Batch files

If you don't want to run the GUI, I also wrote a bunch of batch files that do the same thing but with pre-selected groups of packages.  I basically dumped all the packages into a text file then prepended the GetIt command line to install them and separated them into variously grouped batch files, some duplicated among a couple of groups. If you haven't already done this for your install, this will help get you started.

To run the batch files, start a DOS Prompt as Administrator, run the `rsvars.bat` batch file from your Delphi folder, then run any of the batch files in the `batch`  folder. You will want to modify the batch files and comment out the packages you don't want.

## Links

- [Enabling GetIt Install Logs](https://blog.marcocantu.com/blog/2018-july-getit-install-logs.html)
- [Delphi 10.4.2 Release Notes](http://docwiki.embarcadero.com/RADStudio/Sydney/en/Release_Notes)

## Screenshot

![Screenshot](./AutoGetIt.png)

repository: painna/AutoGetIt

repo_name: painna/AutoGetIt


text:
kitchen-auto-spotify
====================

I like music. I combine permanent looking for something new and laziness to select what I want to
listen right now 90% of time. I'm also too lazy to turn it on quite often.

Partially inspired by
[this Twitter thread (in Russian)](https://twitter.com/turbojedi/status/1104744361139544066), tho
this implementation is much simpler.

How does it work
----------------

Hardware is based on Raspberry Pi with atteched PIR sensor for movement detection (well,
_technically_ it's heat waves detection but it works ok with moving people). When a human is nearby
the sensor for configurable period of time, and if there are no other playing devices detected
through Spotify API, it checks Spotify featured categories, picks one of them randomly, picks one
playlist from that category randomly, starts playing it. If there is no motion detected for some
time period, it shuts up automatically. Spotify player is installed on the same Raspberry Pi which
is connected to the external sound speaker.

What do you need if you want to have it
---------------------------------------

* [Raspbery Pi](https://www.raspberrypi.org/) (I use RPi 3 Model B+);
* PIR sensor (e.g. [this one](https://www.sparkfun.com/products/13285) or any other compatible with
  your RPi, there is shitton of them available for mere $1-2 at Aliexpress);
* three F-to-F jump wires (a.k.a. DuPont wires);
* microSD card with Raspbian Lite installed;
* external sound speaker with AUX IN (I use some noname crap I found at the nearest offline stock);
* computer with microSD card reader and SSH client installed.

How to setup
------------

Assuming that you already have RPi with installed basic Raspbian Lite (tested only with Buster
a.k.a. Debian 10).

By default, it uses only Ethernet connection, if you want to mess with cables a bit less, you might
use [this guide](https://raspberrypihq.com/how-to-connect-your-raspberry-pi-to-wifi/) and connect
your RPi to your home WiFi network.

#### 1. Connect PIR sensor to RPI GPIO.

Use GPIO pins scheme from
[this guide](https://maker.pro/raspberry-pi/tutorial/how-to-interface-a-pir-motion-sensor-with-raspberry-pi-gpio)
as an example. I use the following pins in my current setup:

  * pin 2 (5V) to VCC (power);
  * pin 7 (GPIO4) to OUT (data);
  * pin 9 (GND) to GND (ground).

Remember which pin you used for data connection, it matters!

It's highly unrecommended to hot plug or unplug GPIO powered devices to RPi. Power it off before
doing that.

![sensor.jpg](sensor.jpg)

#### 2. Adjust PIR sensor.

I recommend to set measure delay to minimum (10 seconds) by setting delay adjuster to the most left
position (carefully rotate it counter clockwise). Ensure that trigger method is set to repeatable
mode (H).

#### 3. Install all necessary software.

[spotifyd](https://github.com/Spotifyd/spotifyd) binaries and configuration documentation can be
found in project repo.

The following Debian packages are needed:

```bash
apt install -y python3 python3-rpi.gpio python3-pip git
```

I also use [tmux](https://en.wikipedia.org/wiki/Tmux) as one of ways to run the script in foreground
but make it sustainable to SSH connections drops. One day I'll update this project to make it
runnable as system service. Or not.

#### 4. Create Spotify application and obtain its tokens.

1. Go to [applications dashboard](https://developer.spotify.com/dashboard/applications). Log in and
   create the application.
2. Press big "Create an app" button.
3. Fill all data.
4. Go to app page and save client ID and secret from there.
5. Press "Edit settings" button.
6. Add `http://localhost:5500/` as redirect URI there.
7. Save settings.

#### 5. Download and configure scripts.

Because of technical limitations of the way, scripts should be run as superuser. I promise, there is
no `rm -rf /` in the code, you can inspect it by yourselves.

1. Clone this repo to RPi filesystem:

```bash
git clone https://github.com/archydragon/kitchen-auto-spotify
cd kitchen-auto-spotify
```

2. Install Python dependencies.

```bash
pip3 install -r requirements.txt
```

(Ignore possible errors which appear during this.)

3. Copy configuration:

```bash
mkdir -p ~/.config/kitchen
cp config.yml.sample ~/.config/kitchen/config.yml
vi ~/.config/kitchen/config.yml # feel free to use any other editor you prefer
```

See config sample comments about what exact values you should put where.

4. Create initial token.

```bash
python3 auth.py
```

It will show you instructions what to do. Don't be afraid of redirect to non-existent localhost:5500
address, just copy it from your browser.

5. Start the app.

```bash
python3 run.py
```

6. Enjoy.

repository: archydragon/kitchen-auto-spotify

repo_name: archydragon/kitchen-auto-spotify


text:
# RailsAdminSettings

Master repository has moved to gitlab, all new code will be there:

https://gitlab.com/rocket-science/rails_admin_settings

[![Build Status](https://secure.travis-ci.org/rs-pro/rails_admin_settings.png?branch=master)](http://travis-ci.org/rs-pro/rails_admin_settings)
[![Gem Version](https://badge.fury.io/rb/rails_admin_settings.svg)](https://badge.fury.io/rb/rails_admin_settings)
[![security](https://hakiri.io/github/rs-pro/rails_admin_settings/master.svg)](https://hakiri.io/github/rs-pro/rails_admin_settings/master)
[![Maintainability](https://api.codeclimate.com/v1/badges/de00cbec10559ebd2b4b/maintainability)](https://codeclimate.com/github/rs-pro/rails_admin_settings/maintainability)
[![Test Coverage](https://api.codeclimate.com/v1/badges/de00cbec10559ebd2b4b/test_coverage)](https://codeclimate.com/github/rs-pro/rails_admin_settings/test_coverage)

App settings editable via RailsAdmin with support for ActiveRecord and Mongoid.

Supports images, files, html with or without sanitization, code with codemirror, etc.

## Features

- Lazy loading - loads settings only if they are needed during request
- Loads all settings at once and caches them for the duration of request
- Supports lots of setting kinds - yaml, html with ckeditor, phone numbers etc
- Each setting can be enabled and disabled within rails_admin, if it's disabled it returns default value for kind

## Installation

Add this line to your application's Gemfile:

    gem 'rails_admin_settings'

For activerecord, generage migration:

    rails g rails_admin_settings:migration

Then migrate:

    rake db:migrate

## Gemfile order matters

- Put it after rails_admin to get built-in support
- Put it after rails_admin_toggleable to get built-in support
- Put it after ckeditor/glebtv-ckeditor/rich to get built-in support
- Put it after russian_phone to get built-in support
- Put it after sanitized to get built-in support
- Put it after safe_yaml to get built-in support
- Put it after validates_email_format_of to get built-in support
- Put it after geocoder to get built-in support
- Put it after carrierwave / paperclip to get built-in support
- Put it after addressable to get built-in support

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install rails_admin_settings

## Basic Usage (like RailsSettings)

    Settings.admin_email =<EMAIL_ADDRESS>    Settings.admin_email

## Advanced Usage

    Settings.content_block_1(kind: 'html', default: 'test', label: "Test Value")
    Settings.data(kind: 'yaml')
    Settings.data = [1, 2, 3]

    Settings.enabled?(:phone, kind: 'phone', default: '906 111-11-11') # also creates setting if it doesn't exist
    Settings.phone.area
    Settings.phone.subscriber

See more here: https://github.com/rs-pro/rails_admin_settings/blob/master/spec/advanced_usage_spec.rb

## Namespacing

Settings can have namespaces (useful for locale, etc)

    Settings.ns('test').s1 = 123
    Settings.ns('test').s1
    > "123"
    Settings.ns('main').s1
    > ""
    Settings.s1
    > ""
    Settings.ns_default = 'test'
    Settings.s1
    > "123"
    Settings.ns_default = 'main'
    Settings.ns_fallback = 'test'
    Settings.s1
    > "123"

## Value types

Supported types:

    string (input)
    text (textarea)
    boolean (checkbox)
    color (uses built-in RailsAdmin color picker)
    html (does NOT sanitize (allows ANY javascript) - for trusted admin, supports Rich, glebtv-ckeditor, ckeditor, but does not require any of them)
    code (does NOT sanitize (allows ANY javascript) - shows as codemirror, requires glebtv-ckeditor for codemirror)
    sanitized (requires sanitize gem -- sanitizes HTML before saving to DB [Warning: uses RELAXED config!])
    integer (stored as string)
    yaml (requires safe_yaml)
    phone (requires russian_phone)
    phones (requires russian_phone - multiple phones)
    email (requires validates_email_format_of)
    address (requires geocoder)
    file (requires paperclip or carrierwave)
    url (requires addressable)
    domain (requires addressable)
    sanitize (uses rails sanitize helper with default settings, shows as html)
    sanitize_code (uses rails sanitize helper with default settings, shows as codemirror textarea, can provide custom scrubber, defaults to Rails::Html::WhiteListSanitizer)
    strip_tags (uses strip_tags rails helper)
    simple_format (uses simple_format rails helper)
    simple_format_raw (does NOT sanitize (allows ANY javascript) - uses simple_format rails helper with sanitize: false)
    json

#### Sanitize settings

Sanitizer can be changed like this:
```
RalsAdminSettings.scrubber = Rails::Html::WhiteListSanitizer.new
```
defaults to Rails::Html::WhiteListSanitizer

Strings and html support following replacement patterns:

    {{year}} -> current year
    {{year|2013}} -> 2013 in 2013, 2013-2014 in 2014, etc

Sanitized types sanitize before storing to DB and not on display for performance.
Simple format types are stored in db as-is.

## Usage with Rails Admin

Rails admin management for settings is supported out of the box

It is recommended to disable new/create page (it is not supported by design, settings are defined in ruby code).
Disable via cancan:

```
cannot :create, RailsAdminSettings::Setting
```

## Contributing

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

gha_language: Ruby


text:
# Custom / Collected Eggs
In this reposetory i collect some eggs for pterodactyl which i use for my personal activities.

----

  ![commit-info][commit-info]
  ![contributors-info][contributors-info]
  ![reposize-info][reposize-info]

----

## Links to Eggs:

### Services:
- [nginx-fpm](/eggs/nginx-fpm/)

## DockerHub

Here is the link to our dockerhub repository with just the plain Dockerfiles: [https://hub.docker.com/r/lazybytez/eggs](https://hub.docker.com/r/lazybytez/eggs)

## Contributing

If you want to take part in contribution, like fixing issues and contributing directly to the code base, plase visit the [How to Contribute][github-contribute] document.

## Useful links:
[License][github-license] -
[Contributing][github-contribute] -
[Code of conduct][github-codeofconduct] -
[Issues][github-issues] -
[Pull requests][github-pulls] -
[Security][github-security]

<hr>

###### Copyright (c) [Lazy Bytez][github-team]. All rights reserved | Licensed under the MIT license. | 2020 - today

<!-- Variables -->
[github-team]: https://github.com/lazybytez

[github-license]: https://github.com/lazybytez/eggs/blob/master/LICENSE
[github-contribute]: https://github.com/lazybytez/eggs/blob/master/CONTRIBUTING.md
[github-codeofconduct]: https://github.com/lazybytez/eggs/blob/master/CODE_OF_CONDUCT.md
[github-issues]: https://github.com/lazybytez/eggs/issues
[github-pulls]: https://github.com/lazybytez/eggs/pulls
[github-security]: https://github.com/lazybytez/eggs/blob/master/SECURITY.md

[commit-info]: https://img.shields.io/github/last-commit/lazybytez/eggs?style=flat-square

[contributors-info]: https://img.shields.io/github/contributors/lazybytez/eggs?style=flat-square

[reposize-info]: https://img.shields.io/github/repo-size/lazybytez/eggs?style=flat-square

repository: RehanPlayz/eggs

repo_name: RehanPlayz/eggs


text:
# action-recognition
A codebase for simple action-recognition

## requirements
python3.6+
torch1.1+
tensorboard
tensorboardX
matplotlib
opencv-python

## Data Prepare
all image path are written in a .txt and store in data/ucf101/train_folder.txt (e.g.)
and have following format:
/path/to/img num_frames label


text:
# `Map.prototype.emplace`

ECMAScript proposal and reference implementation for `Map.prototype.emplace`.

**Author:** Brad Farias (GoDaddy)

**Champion:** Erica Pramer (GoDaddy)

**Stage:** 2

## Motivation

Adding and updating values of a Map are tasks that developers often perform
in conjunction. There are currently no `Map` prototype methods for either of
those two things, let alone a method that does both. The workarounds involve
multiple lookups and developer inconvenience while avoiding encouraging code
that is surprising or is potentially error prone.

## Solution: `emplace`

We propose the addition of a method that will add a value to a map if the map
does not already have something at `key`, and will also update an existing
value at `key`.
It’s worthwhile having this API for the average case to cut down on lookups.
It is also worthwhile for developer convenience and expression of intent.

## Examples & Proposed API

The following examples would all be optimized and made simpler by `emplace`.
The proposed API allows a developer to do one lookup and update in place:

```js
// given counts is a Map of object => id
counts.emplace(key, {
  insert(key, map) {
    return 0;
  },
  update(existing, key, map) {
    return existing + 1;
  }
});
```

### Normalization of values during insertion

Currently you would need to do 3 lookups:

```js
if (!map.has(key)) {
  map.set(key, value);
}
map.get(key).doThing();
```

With this proposal:

```js
map.emplace(key, {
  insert: () => value
}).doThing();
```

### Either update or insert for a specific key
You might get new data and want to calculate some aggregate if the key exists,
but just insert if it's the first value at that key.

```js
// two lookups
old = map.get(key);
if (!old) {
  map.set(key, value);
} else {
  map.set(key, updated);
}
```

With this proposal:

```js
map.emplace(key, {
  update: () => updated,
  insert: () => value
});
```

### Just insert if missing

You might omit an update if you're handling data that doesn't change, but
can still be appended.

```js
// two lookups
if (!map1.has(key)) {
  map1.set(key, value);
}
```

With this proposal:

```js
map.emplace(key, {
  insert: () => value
});
```

### Just update if present

You might want to omit an insert if you want to perform a function on
all existing values in a Map (ex. normalization).

```js
// three lookups
if (map.has(key)) {
  old = map.get(key);
  updated = old.doThing();
  map.set(key, updated);
}
```

With this proposal:

```js
if (map.has(key)) {
  map.emplace(key, {
    update: (old) => old.doThing()
  });
}
```

## Implementations in other languages

Similar functionality exists in other languages.

**Java**

* [`computeIfPresent`](https://docs.oracle.com/javase/9/docs/api/java/util/Map.html#computeIfPresent-K-java.util.function.BiFunction-) remaps existing entry
* [`computeIfAbsent`](https://docs.oracle.com/javase/9/docs/api/java/util/Map.html#computeIfAbsent-K-java.util.function.Function-) insert if empty. computes
the insertion value with a mapping function

**C++**

* [`emplace`](https://en.cppreference.com/w/cpp/container/map/emplace) inserts if missing
* [`map[] assignment opts`](https://en.cppreference.com/w/cpp/container/map/operator_at) inserts if missing
at `key` but also returns a value if it exists at `key`
* [`insert_or_assign`](https://en.cppreference.com/w/cpp/container/map/insert_or_assign) inserts if missing. updates existing value by replacing with a
specific new one, not by applying a function to the existing value

**Rust**

* [`and_modify`](https://doc.rust-lang.org/std/collections/hash_map/enum.Entry.html#method.and_modify) Provides in-place mutable access to an occupied entry
* [`or_insert_with`](https://doc.rust-lang.org/std/collections/hash_map/enum.Entry.html#method.or_insert_with) inserts if empty. insertion value comes from
a mapping function

**Python**

* [`setDefault`](https://docs.python.org/3/library/stdtypes.html#dict.setdefault)
Performs a `get` and an `insert`

**Elixir**

* [`Map.update/4`](https://hexdocs.pm/elixir/Map.html#update/4) Updates the item with given function if key exists, otherwise inserts given initial value

## FAQ

### Is the goal to simplify the API or to optimize it?

  - This proposal seeks to simplify expressing intent for programmers, and
  should ease optimization without complex analysis. For engines without
  complex analysis like IOT VMs this should see wins by avoiding multiple
  entry lookups, at potential call stack cost.

### Why not use existing JS engines that optimize by coalescing the lookup and mutation?

  - This does not cover all patterns (of which there are many), things such as
  ordering can cause the optimization to fail.

  ```mjs
  if (!x.has(a)) x.set(a, []);
  if (!y.has(b)) y.set(b, []);
  x.get(a).push(1);
  y.get(b).push(2);
  ```

### Why error if the key doesn't exist and no `insert` handler is provided.

  - This keeps the return type constrained to the union of insert and update without adding `undefined`. This alleviates a variety of static checker errors from code such as the following.

  ```mjs
  // map is a Map of object values
  let x;
  if (map.has(key)) {
    x = map.get(key); // can return undefined
  } else {
    x = {};
    map.set(key, x);
  }
  // x's type is `undefined | object`
  ```

  The proposal could guarantee that the type does not include `undefined`:

  ```mjs
  // map is a Map of object values
  let x = map.emplace(key, {
    insert: () => { return {}; }
  });
  // x's type is `object`
  ```

### Why not have a single function that has a boolean if performing an update and the potentially existing value?

  - By naming the handlers, you can increase readability and reduce overall boilerplate. Additionally, generally there are not common workflows that have code paths that cover both updating and insertion. See the following which only seeks to insert a value if none exists:

  ```mjs
  x = map.emplace(key, (updating, value) => updating ? value : []);
  ```

  The proposal allows a handler to avoid the boilerplate condition and focus only on the relevant workflows:

  ```mjs
  x = map.emplace(key, {
    insert: () => []
  });
  ```

### Why not have a single function that inserts the value if no such key is mapped?

  - By only having a single function that inserts a variety of workflows become
  less clear. In particular, by only having insert, a usage of a default value must
  be inserted with an anti-update operation already applied.

  ```mjs
  // have to set the default value to -1, not 0
  const n = counts.emplace(key, () => -1);
  // have to perform an additional set afterwards
  counts.set(key, n + 1);
  ```

  The proposal allows a handler to avoid the odd default value and avoid the
  extra `.set`. This does still require coding logic for both, but keeps the
  intent more readable and localized.

  ```mjs
  counts.emplace(key, {
    insert: () => 0,
    update: (v) => v + 1
  });
  ```

  - This can also lead to insertion of values that are incomplete/invalid regarding
  the intended type of the Map:

  ```mjs
  updateNameOf(key) {
    // contacts only has objects which must have a string value
    const contact = contacts.insert(key, () => ({name:null}));
    // inserted and can be assured of same reference on .get
    contact.name = getName();
    // if getName throws, contact is incomplete/invalid
    // .name remains null
  }
  ```

  This can be rewritten to be less error prone by moving `getName` above

  ```mjs
  updateNameOf(key) {
    const name = getName();
    const contact = contacts.insert(key, () => ({name:null}));
    contact.name = name;
  }
  ```

  This code is less error prone (unless contact.name fails assignment for
  example), but it still has an invalid value being inserted into the map.

  This can again be rewritten to be less constraint breaking by avoiding
  `insert()` entirely.

  ```mjs
  updateNameOf(key) {
    const name = getName();
    const existing = contacts.get(key) ?? {name:null};
    contact.name = name;
    contacts.set(key);
  }
  ```

  This design does avoid ever inserting the invalid value into the map, but is
  a bit confusing to read. This proposal by combining update and insert can be
  a little clearer:

  ```mjs
  updateNameOf(key, name) {
    const name = getName();
    contacts.emplace(key, {
      insert: () => ({name}),
      update: (contact) => {
        contact.name = name;
        return contact;
      }
    });
  }
  ```

  by having both operations co-located it would feel odd to try and `getName`
  after `.emplace` and no invalid value is inserted into the map.

### Why not have a single function that updates the value if no if the key is mapped?

  - By only having a single function that updates a variety of workflows
  become less clear. In particular in order to guarantee that the result type
  is not a union with `undefined` it should error if the key is not mapped.

  ```mjs
  let n;
  try {
    n = counts.emplace(key, (existing) => existing + 1);
  } catch (e) {
    // this is a fragile detection and quite hard to determine it was
    // counts.emplace that caused an error, and not something internal to
    // the update callback
    if (e instanceof MissingEntryError) {
      counts.set(key, n = 0);
    }
  }
  if (n > RETRIES) {
    // ...
  }
  ```

  A alteration to return a boolean to see if an action is taken requires
  boilerplate and reduces the utility of the return value:

  ```mjs
  let updated = counts.emplace(key, (existing) => existing + 1);
  if (!updated) {
    counts.set(key, 0);
  }
  let n = counts.get(key);
  if (n > RETRIES) {
    // ...
  }
  ```

  The proposal allows a handler to avoid the odd default value and avoid the
  extra `.set`.

  ```mjs
  let n = counts.emplace(key, {
    insert: () => 0,
    update: (v) => v + 1
  });
  if (n > RETRIES) {
    // ...
  }
  ```

### Why not have an API that exposes an Entry to collection types?

  - An Entry API is not prevented by this proposal. Explicit thought about
  re-entrancy was taken into consideration and was designed not to conflict with
  such an API. Desires for such an API should be done in a separate proposal.
  - An Entry API has much stricter implications on how implementations must
  store the backing data for a collection due to creating persistent references.
  - An Entry API is extremely complex regarding shared mutability and should be
  considered to be an extreme increase in scope to the goals of this proposal.
  See complexity such as the following about needing to think of an design an
  entire lifecycle and sharing scheme for multiple entry references:

  ```mjs
  let entry1 = map.mutableEntry(key);
  let entry2 = map.mutableEntry(key);
  entry2.remove();
  entry1.insertIfMissing(0);
  ```

### Why use functions instead of values for the parameters?

  - You may want to apply a factory function when inserting to avoid costs of
  potentially heavy allocation, or the key may be determined at insertion time.

  ```mjs
  // an example of when eager allocation of the value
  // is undesirable
  const sharedRequests = new Map();
  function request(url) {
    return sharedRequests.emplace(url, {
      insert: () => {
        return fetch(url).then(() => {
          sharedRequests.delete(url);
        });
      }
    });
  }
  ```

  - When updating, we will be able to perform a function on the existing value
  instead of just replacing the value. The action may also cause mutation or
  side-effects, which would want to be avoided if not updating.

  ```mjs
  const eventCounts = new Map();
  obj.onevent(
    (eventName) => {
      // this API allows working with value type and primitive values
      eventCounts.emplace(eventName, {
        update: (n) => n + 1,
        insert: () => 1
      });
    }
  );
  ```

  This is important as primitives like [BigInt], [Records, and Tuples](Records and Tuples), etc. are added to the language. This API should continue to be able to handle and work with such values as they are added.

### Why are we calling this `emplace`?

  - `updateOrInsert` and `insertOrUpdate` seem too wordy.
    - in the case that only an `insert` operation is provided it may do neither update nor insert.
  - `upsert` was seen as too unique a term and the ordering was problematic as there was a desire to focus on insertion.
    - ~~It is a combination of "update" & "insert" that is already used in other programming situations and many SQL variants use that exact term.~~
  - `emplace` matches a naming precedent from C++.

### What happens during re-entrancy?

  - Other methods like Array methods while iterating using a higher order function do not re-iterate if mutated in a re-entrant manner. This method will modify the underlying storage cell that contains the existing value and any mutation of the map will act on new storage cells if that cell is removed from the map. This method will not perform a second lookup if the storage cell in the collection for the key is replaced with a new one.
  - See [issue #9] for more.

## Specification

* [Ecmarkup source](https://github.com/tc39/proposal-upsert/blob/master/spec.emu)
* [HTML version](https://tc39.es/proposal-upsert/)

## Polyfill

A polyfill is available in the [core-js](https://github.com/zloirock/core-js) library. You can find it in the [ECMAScript proposals section](https://github.com/zloirock/core-js#mapupsert).

[BigInt]: https://tc39.es/ecma262/#sec-terms-and-definitions-bigint-value
[Records and Tuples]: https://github.com/tc39/proposal-record-tuple
[issue #9]: https://github.com/tc39/proposal-upsert/issues/9#issuecomment-552490289


text:
# MNPY SDK Laravel Wrapper
> Laravel 5 wrapper around the MNPY SDK

## Requirements

* PHP >= 7.0
* A [MNPY](https://mnpy.io/) account

## Installation

Add the package to the requirements of your composer file.

```sh
composer require mnpy/mnpy-laravel
```

Add the Service Provider to your `config/app.php` (not applicable for Laravel 5.5 and higher)

```php
MNPY\Laravel\MNPYServiceProvider::class
```

If you wish to use Facades instead of Dependency Injection you should add the following to your `config/app.php` file.

```php
'MNPYTransaction' => MNPY\Laravel\Facades\MNPYTransaction::class,
'MNPYPrice' => MNPY\Laravel\Facades\MNPYPrice::class
'MNPYToken' => MNPY\Laravel\Facades\MNPYToken::class
```

Now publish the config (or add `MNPY_API_KEY` to your .env file)
```sh
php artisan vendor:publish --provider="MNPY\Laravel\MNPYServiceProvider"
```

## Usage

This package serves as wrapper for [mnpy/mnpy-php-api-sdk](https://github.com/MNPY/mnpy-php-api-sdk). Please refer to the original package for documentation regarding usage.

----

Depency Injection

```php
use MNPY\SDK\Transaction;

class Foo {
    protected $transaction;

    public function __construct(Transaction $transaction) {
        $this->transaction = $transaction;
    }

    public function bar($transaction_id) {
        return $this->transaction->get($transaction_id);
    }
}
```

Facades

```php
use MNPY\Laravel\Facades\MNPYTransaction;

class Foo {
    protected $transaction;

    public function bar($transaction_id) {
        return MNPYTransaction::get($transaction_id);
    }
}
```

repository: chefbuitenhuis/mnpy-laravel

repo_name: chefbuitenhuis/mnpy-laravel


text:
# Jin.js
[![MIT](https://img.shields.io/cocoapods/l/AFNetworking.svg)](https://github.com/emilwallner/Screenshot-to-code-in-Keras/blob/master/LICENSE)

A JavaScript framework for building UI on the web.

# Installation

```html
<script src="Jin.js" type="text/javascript"></script>
```

# Features

You can declare some components in your page via `<script tyle="text/component"></script>` tag or import components-declared file by using `<script tyle="text/component" src></script>` tag in the `<head>...</head>` of your page.

Jin.js will handle these components, all you need to do is deploy these components in your page and customize them.

......

# Documentation

## Components Patten

A components-declared file (usually suffixed .js) contains several declarations as follows:

```html
[!#JinStart name="standardCard"]
<div style="background: white;
            box-shadow: 0 1px 2px grey;
            border-radius: 4px;
            margin: 20px auto;
            padding: 20px;
            max-width: 300px;">
	<h1 style="font-size: 18px;
             color: #0e0e0e;
             margin: 0;">
    	{{card_title}}
  	</h1>
	<p style="color: #808080;
            fonnt-size: 16px;
            margin: 10px 0 0 0;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: ellipsis;">
    {{card_content}}
  </p>
</div>
[!#JinEnd]
```

Apparently, the `[!#JinStart]` and `[!#JinEnd]` tag is for packing different components' HTML code, and a `name` parameter is nessary.

## Import Components

You have 3 ways to declare your components.

  ### 1. Using `<script tyle="text/components" src></script>` Tag
  Adding `<script tyle="text/component" src></script>` tag between your page's `<head>` and `</head>`, Jin.js will fetch the target file when DOM is rendered.

  eg:
  ```html
  <script src="components/component1.js" tyle="text/components"></script>
  ```

  ### 2. Using `<script tyle="text/components"></script>` Tag
  Drectly attach components declaration between rag `<script tyle="text/component" src>` and `</script>`

  eg:
  ```html
  <script tyle="text/component">
  [!#JinStart name="components1"]
    <div>{{content}}</div>
  [!#JinEnd]
  </script>
  ```

  ### 2. Using `new Jin(url)` Method

  eg:
  ```javascript
	const component_1 = new Jin('example-components/default2.html');
	component_1.ready( () => {
		alert('component_1 is ready');
	});
  ```
  ```javascript
	new Jin('example-components/default2.html').ready( () => {
		alert('component_1 is ready');
	});
  ```

  ### ! NOTICE

  In method 1 and 3, there might be cross-origin protection which will restrict Jin.js to fetch the component-declared file. To avoid this situation, please refer to ACCESS-CONTROL-ALLOW-ORIGIN or store the file in the same origin as the page. (You don't need to worry if you are using some hybrid platform such as phonegap, ionic etc)

## Jin.onReady

```javascript
Jin.onReady(function)
```

function will be called when all component-declared file imported by `<script>` tag are ready.

WRONG:

```html
<script src="component.js" tyle="text/component"></script>
<script>
card = Jin.append('body', 'card', {
	card_title: 'Hello World!'
});
// component1 is declared in component.js
</script>
```

CORRECT:

```html
<script src="component.js" tyle="text/component"></script>
<script>
Jin.onReady( () => {
	card = Jin.append('body', 'card', {
		card_title: 'Hello World!'
	});
});
// component1 is declared in component.js
</script>
```

## Jin.ready

```javascript
[Jin Object].ready(function)
```

function will be called when the component-declared file imported dynamicly is ready.

WRONG:

```javascript
new Jin('component.js');
card = Jin.append('body', 'card', {
	card_title: 'Hello World!'
});
// component1 is declared in component.js
```

CORRECT:

```javascript
<script>
new Jin('component.js').ready( () => {
	card = Jin.append('body', 'card', {
		card_title: 'Hello World!'
	});
});
// component1 is declared in component.js
</script>
```

## Jin.append

```javascript
Jin.append(parent, component, data)
```

## Dynamic Updata

After you initialize a component (for example A) in your page, you can change its data (such as A.title = 'Hello Beijing') directly, and the component in your page will updata automaticly.

eg:

```javascript
new Jin('component.js').ready( () => {
	card = Jin.append('body', 'card', {
		card_title: 'Hello World!'
	});
	card.card_title = 'Hello Beijing!';
});
```

......


text:
# Test Example

This example shos how to test application code with goka.
It can be executed with `go run main.go` but it does not do much, because no
events are produced by default. It is more about the test code.

# How to test with goka

Testing application code is supported in two ways:

* write unit tests mocking goka.Context
* write integration tests mocking the communication with Kafka.

# Mocking Context

TODO

repository: StevenJohnston/goka

repo_name: StevenJohnston/goka


text:
#  installation guide

## Windows

###  use VNStudio

#### 1. download VNStudio （Python 3.7 64 place ）

VNStudio yes vn.py team packed their own version of a key installation ， integration ：
- Python 3.7（ community official version )
- vn.py frameworks and other related libraries
- VN Station quantify workstation （vn.py frame graphical management tool ）

 download link ：[vnstudio-2.0.6.exe](https://download.vnpy.com/vnstudio-2.0.6.exe)

#### 2. installation VNStudio

 click on the way “ the next step ” to complete VNStudio installation ， after the installation is complete, you can view the run directory ：

- VNStudio the default installation path is C:\vnstudio；
- VNStudio default json configuration files and database path C:\Users\Administrator\.vntrader
- VN Station quantify workstation running directory C:\vnstudio\Scripts\vnstation.exe；
- vnpy run directory C:\vnstudio\Lib\site-packages\vnpy（ after entering the directory ， users can modify vnpy related functions ）

#### 3. landed VNStation

 enter the account password login or micro-channel scan code VNStation. （ community account through the micro channel scan code available ）

![](https://vnpy-community.oss-cn-shanghai.aliyuncs.com/forum_experience/yazhang/install.bat/login_VNConda.png "enter image title here")

#### 4. use VNStation
 after logging will enter into VN Station the main interface .
![](https://vnpy-community.oss-cn-shanghai.aliyuncs.com/forum_experience/yazhang/install.bat/login_VNConda_2.png "enter image title here")

 there are window below 5 options ：
- VN Trade Lite： run directly VN Trader ( only CTP interface )
- VN Trader Pro： first select the relevant save temporary files directory ， then run VN Trader ( and optionally an upper layer application module interfaces )
- Jupyter Notebook： first select the relevant save temporary files directory ， then run Jupyter Notebook
-  question for help ： asked questions ， administrators will regularly answer every day
-  background updating ： a key update VN Station

#### 5. update VNStation
 update VNStation apart from “ a key update ” outer ； you can also uninstall the old version ， install the new version ； or github download the latest on dev branch ， unpack the root directory vnpy folder ， correct C:\vnstudio\Lib\site-packages\vnpy replacement .

###  installation manual

#### 1. download and install the latest version Anaconda3.7 64 place

 download the following address ：[Anaconda Distribution](https://www.anaconda.com/distribution/)

( more lightweight Miniconda address ：[MiniConda Distribution](https://docs.conda.io/en/latest/miniconda.html))

#### 2. download and unzip vnpy

 enter vnpy of github home [vnpy](https://github.com/vnpy/vnpy).
 in the left Branch options ，master correspondence is the latest stable version ，dev it corresponds to the latest test version ；
 then the home page to the right of the green clone or download options ， select Download ZIP to download the compressed version to your local computer .

#### 3. installation vnpy
 double-click install.bat a key installation vnpy：
-  install ta_lib library and ib api
-  then install requirements.txt the paper dependent libraries.
-  finally copy vnpy to Anaconda inside

#### 4. start up VN Trader
 in the folder tests\trader found run.py file .  press and hold “Shift” +  right into the cmd window ， enter the following command to start VN Trader.
```
python run.py
```

## Ubuntu

### 1.  download and install the latest version Anaconda or Miniconda （Python 3.7 64 place ）

 with MiniConda a case study ， downloaded into the good  Miniconda3-latest-Linux-x86_64.sh  directory ， terminal run the following command to start the installation .
```
$ bash Miniconda3-latest-Linux-x86_64.sh
```

 the installation process can always press “Enter” key to continue ， in addition to this the following points ：

 when asked if the Miniconda set as Python  when the default environment ， the default "no" change “yes”.  the reason is Ubuntu 18.04 there comes Python 3.6 versus Python 2.7.

![](https://vnpy-community.oss-cn-shanghai.aliyuncs.com/forum_experience/yazhang/install.bat/install_Miniconda_ubuntu.png "enter image title here")

 restart Ubuntu rear ， open the direct input terminal "python"  then press “Enter” key :  if there is shown below ， said the success of the Miniconda set as Python default environment .

![](https://vnpy-community.oss-cn-shanghai.aliyuncs.com/forum_experience/yazhang/install.bat/Conda_Python_version.png "enter image title here")

### 2.  download and unzip vnpy
Linux users select tar.gz compressed version .  download the following address ：[vnpy releases](https://github.com/vnpy/vnpy/releases)

### 3.  installation vnpy
 install gcc translater ， used to compile C++ class interface .  enter the following command can be in the terminal .
```
sudo apt-get  install  build-essential
```

 then vnpy open a terminal root directory ， enter the following command to install a key vnpy.
```
bash install.sh
```

 installation process is divided into 4 step ：
-  download and install ta_lib library and numpy
-  installation requirements.txt the paper dependent libraries.
-  install chinese encoding （ for the english system ）
-  copy vnpy to Anaconda inside （ if running on a virtual machine ， memory adjusted to the needs 4g， otherwise error ）

### 4. start up VN Trader
 in the folder tests\trader found run.py file .  right into the terminal ， enter the following command to start VN Trader.
```
python run.py
```

repository: zbanga/pyalgotrader

repo_name: zbanga/pyalgotrader