text:
# Sources and Sinks
## Sources
- Python Function/Generator/Async Function/Async Generator
- Curve - yield through an iterable
- Const - yield a constant
- Timer - yield on an interval
- Random - generates a random dictionary of values
- File - streams data from a file, optionally loading each line as a json
- HTTP - polls a url with GET requests, streams data out
- HTTPServer - runs an http server and streams data sent by clients
- Websocket - strams data from a websocket
- WebsocketServer - runs a websocket server and streams data sent by clients
- SocketIO - streams data from a socketIO connection
- SocketIOServer - streams data from a socketIO connection
- SSE - streams data from an SSE connection
- Kafka - streams data from kafka
- Postgres - streams data from postgres

## Sinks
- Func - data to a python function
- File - data to a file
- HTTP - POSTs data to an url
- HTTPServer - runs an http server and streams data to connections
- Websocket - streams data to a websocket
- WebsocketServer - runs a websocket server and streams data to connections
- SocketIO - streams data to a socketIO connection
- SocketIOServer - runs a socketio server and streams data to connections
- SSE - runs an SSE server and streams data to connections
- Kafka - streams data to kafka
- Postgres - streams data to postgres
- Email - streams data and sends it in emails
- TextMessage - streams data and sends it via text message

# Transforms
## Modulate
- Delay - Streaming wrapper to delay a stream
- Throttle - Streaming wrapper to only tick at most every interval
- Debounce - Streaming wrapper to only tick on new values
- Apply - Streaming wrapper to apply a function to an input stream
- Window - Streaming wrapper to collect a window of values
- Unroll - Streaming wrapper to unroll an iterable stream
- UnrollDataFrame - Streaming wrapper to unroll a dataframe into a stream
- Merge - Streaming wrapper to merge 2 inputs into a single output
- ListMerge - Streaming wrapper to merge 2 input lists into a single output list
- DictMerge - Streaming wrapper to merge 2 input dicts into a single output dict. Preference is given to the second input (e.g. if keys overlap)
- Reduce - Streaming wrapper to merge any number of inputs
- FixedMap - Map input stream to fixed number of outputs
- Subprocess - Open a subprocess and yield results as they come. Can also stream data to subprocess (either instantaneous or long-running subprocess)

## Calculations
Note that `tributary` can also be configured to operate on **dual numbers** for things like lazy or streaming autodifferentiation.

### Arithmetic Operators
- Noop (unary) - Pass input to output
- Negate (unary) - -1 * input
- Invert (unary) - 1/input
- Add (binary) - add 2 inputs
- Sub (binary) - subtract second input from first
- Mult (binary) - multiple inputs
- Div (binary) - divide first input by second
- RDiv (binary) - divide second input by first
- Mod (binary) - first input % second input
- Pow (binary) - first input^second input
- Sum (n-ary) - sum all inputs
- Average (n-ary) - average of all inputs
- Round (unary)
- Floor (unary)
- Ceil (unary)

### Boolean Operators
- Not (unary) - `Not` input
- And (binary) - `And` inputs
- Or (binary) - `Or` inputs

### Comparators
- Equal (binary) - inputs are equal
- NotEqual (binary) - inputs are not equal
- Less (binary) - first input is less than second input
- LessOrEqual (binary) - first input is less than or equal to second input
- Greater (binary) - first input is greater than second input
- GreaterOrEqual (binary) - first input is greater than or equal to second input

### Math
- Log (unary)
- Sin (unary)
- Cos (unary)
- Tan (unary)
- Arcsin (unary)
- Arccos (unary)
- Arctan (unary)
- Sqrt (unary)
- Abs (unary)
- Exp (unary)
- Erf (unary)

### Financial Calculations
- RSI - Relative Strength Index
- MACD - Moving Average Convergence Divergence

## Converters
- Int (unary)
- Float (unary)
- Bool (unary)
- Str (unary)

## Basket Functions
- Len (unary)
- Count (unary)
- Min (unary)
- Max (unary)
- Sum (unary)
- Average (unary)

## Rolling
- RollingCount - Node to count inputs
- RollingMin - Node to take rolling min of inputs
- RollingMax - Node to take rolling max of inputs
- RollingSum - Node to take rolling sum inputs
- RollingAverage - Node to take the running average
- SMA - Node to take the simple moving average over a window
- EMA - Node to take an exponential moving average over a window

## Node Type Converters
- Lazy->Streaming

repository: timkpaine/tributary

repo_name: timkpaine/tributary


text:
[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)

# Dependancy:

Tested on Ubuntu 18.04.5 LTS running on virtual machine

Running Python 3.6.9 (default, Jan 26 2021, 15:33:00)

Robotic toolbox version - Downloaded 9.3.2021 - Realease 6 v0.9.1 [Toolbox](https://github.com/petercorke/robotics-toolbox-python)

For additional python packages check /info_folder/versions_info

# Installation steps

After installation of Robotic toolbox you will need to add:

__init__.py and CM6.py from robotic_toolbox_CM6_models folder to installation folder of robotic toolbox library:

...robotic-toolbox-python/robotictoolbox/models/DH

* After everything is installed when you run Multi_proc_main.py you should get a screen as shown on first image. If you get error for this step: in get_send_data.py file comment s.open() part of code.
* To run this code in tandem with your robot you will need to modify get_send_data.py to your COM port. And you will need to be running mainboard code on your MCU.
* Mainboard code is configured for teensy 4.1.
* Connection diagram and more info can be found here: - [Main CM6 project page](https://github.com/PCrnjak/CM6_COBOT_ROBOT)

# CM6_control_software

CM6_control_software allows "easy" programming of CM6 robot. GUI software was written in python and heavily relies on Peter Corke's robotic toolbox for python! It was tested on Linux virtual machine, laptop running Linux, and raspberry pi 4!

The software offers real-time monitoring of robots:

* Motor position, current, speed, temperature
* End effector position
* Operating modes, errors...
*
Available modes at this moment are:

* Individual motor jogging
* freehand teach
* move from point to point

Each of these modes of movement can be recorded and replayed!

# Support the project

This project is completely Open source and free to all and I would like to keep it that way, so any help
in terms of donations or advice is really appreciated. Thank you!

[![Check the arm in action !](https://user-images.githubusercontent.com/30388414/86798915-a036ba00-c071-11ea-824d-4456f2cdf797.png)](https://paypal.me/PCrnjak?locale.x=en_US)

# Project is under MIT Licence

license: MIT

branch_name: refs/heads/main

extension: md

license_type: permissive


text:
# NEO in Linux distributions

## Level Zero specific

* [distributions](https://github.com/intel/compute-runtime/blob/master/level_zero/doc/DISTRIBUTIONS.md)

## OpenCL specific

* [distributions](https://github.com/intel/compute-runtime/blob/master/opencl/doc/DISTRIBUTIONS.md)

## Intel software for General Purpose GPU capabilities

* Documentation and instructions for installing, deploying, and updating Intel software to enable general purpose GPU (GPGPU) capabilities for Linux*-based operating system distributions can be found on:
    [https://dgpu-docs.intel.com](https://dgpu-docs.intel.com)

* An Intel brand integrated and global search accessible Linux graphics landing page [https://intel.com/linux-graphics-drivers](https://intel.com/linux-graphics-drivers)

## Packages mirror

Starting with [release 19.43.14583](https://github.com/intel/compute-runtime/releases/tag/19.43.14583) all packages are mirrored on
[SourceForge](https://sourceforge.net/projects/intel-compute-runtime) as older packages are automatically deleted on
[launchpad](https://launchpad.net/~intel-opencl/+archive/ubuntu/intel-opencl) and [copr](https://copr.fedorainfracloud.org/coprs/jdanecki/intel-opencl).

## Neo in docker containers

Docker images are provided in [intel-opencl](https://hub.docker.com/r/intelopencl/intel-opencl) repository.

Example for Fedora* 33

```
docker run -it --device /dev/dri:/dev/dri --rm docker.io/intelopencl/intel-opencl:fedora-33-copr clinfo
```

repository: JacekDanecki/compute-runtime

branch_name: refs/heads/master

gha_license_id: MIT

repo_name: JacekDanecki/compute-runtime


text:
## Getting started:

- [TypeScript: Stop Using 'any', There's a Type For That](https://thoughtbot.com/blog/typescript-stop-using-any-there-s-a-type-for-that)
- [Dead Code Elimination in Javascript](https://debugpai.com/dead-code-elimination-in-javascript)
- [Dissecting A Dweet #9: City Sunset](https://frankforce.com/dissecting-a-dweet-9-city-sunset/)

## Articles & News:

- [Svelte for Sites, React for Apps](https://dev.to/swyx/svelte-for-sites-react-for-apps-2o8h)
- [Faster Web App Delivery with PRPL](https://addyosmani.com/blog/the-prpl-pattern/)
- [How we built the Chrome DevTools WebAuthn tab](https://developers.google.com/web/updates/2020/10/webauthn-tab)

## Tips, tricks & bit-sized awesomeness:

- [Introducing: The Async Cookie Store API](https://medium.com/nmc-techblog/introducing-the-async-cookie-store-api-89cbecf401f)
- [Microsoft Edge WebView2 General Availability](https://blogs.windows.com/msedgedev/2020/10/19/edge-webview2-general-availability/)
- [Meet Face ID and Touch ID for the Web](https://webkit.org/blog/11312/meet-face-id-and-touch-id-for-the-web/)
- [Introducing Microsoft Edge preview builds for Linux](https://blogs.windows.com/msedgedev/2020/10/20/microsoft-edge-dev-linux/)
- [MDN Web Docs: Editorial strategy and community participation](https://hacks.mozilla.org/2020/10/mdn-web-docs-editorial-strategy-and-community-participation/)

## Releases:

- [Node.js v15.0.0](https://nodejs.medium.com/node-js-v15-0-0-is-here-deb00750f278)
- [Firefox 82](https://www.mozilla.org/en-US/firefox/82.0/releasenotes/)
- [React v17](https://reactjs.org/blog/2020/10/20/react-v17.html)
- [Create-React-App v4](https://github.com/facebook/create-react-app/blob/master/CHANGELOG.md#400-2020-10-23)

## Libs & demos:

- [turtleDB](https://github.com/turtle-DB/turtleDB)
- [wasmbin](https://github.com/GoogleChromeLabs/wasmbin)
- [spaghetti-audio](https://github.com/woodwoerk/spaghetti-audio)
- [markdown-wasm](https://github.com/rsms/markdown-wasm)
- [fcal](https://github.com/5anthosh/fcal)
- [FSHistory](https://github.com/s-macke/FSHistory)

## Interesting & silly stuff:

- [bongo.cat](https://bongo.cat/)

repository: BuildingXwithJS/bxjs-weekly

gha_language: JavaScript

repo_name: BuildingXwithJS/bxjs-weekly


text:
# geoclaw_tutorial_csdms2019

### You can also access this repository using https://tinyurl.com/y3g2adcp

For [CSDMS](https://csdms.colorado.edu/wiki/Main_Page) webinar, May 7, 2019.
[Abstract and video](https://csdms.colorado.edu/wiki/Presenters-0439)

You can view html versions of the notebooks [here](http://depts.washington.edu/clawpack/geoclaw/tutorial_csdms2019/)

## Contents

 - `geoclaw_examples` has two examples to be run from the command line in
   the way GeoClaw is normally used.

    - `chile2010a` -- a simplified version of the GeoClaw example found in
      [`$CLAW/geoclaw/examples/tsunami/chile2010](http://www.clawpack.org/gallery/gallery/gallery_geoclaw.html#chile-2010-tsunami).
      This version has only one grid level.
    - `chile2010b` -- A second version of this example, with 3 levels of AMR,
    regions, and gauges added.

 - `notebooks` contains Jupyter notebook versions of the two examples to
   lead the new user through the process.

## Installation

 - If you clone this repository, you can run the code locally on your computer
   provided you have Clawpack and its dependencies installed, see
   [Clawpack Installation Instructions](http://www.clawpack.org/installing.html).

 - Alternatively, if you have [docker](https://docs.docker.com/) installed, then
   the `Dockerfile` in this repository can be used to start a notebook server from a docker
   container, from which the notebooks can be run.  You can also open a
   terminal from the Jupyter page from which the examples in `geoclaw_examples`
   can be run.  See [Clawpack docker Instructions](http://www.clawpack.org/docker_image.html).

## Running on binder

 - Alternatively, you can start a Jupyter server running on
   [mybinder.org](https://mybinder.org/) by clicking on this badge:

   [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/clawpack/geoclaw_tutorial_csdms2019/master)

   This has Clawpack and all dependencies already installed, based on the `Dockerfile`
   in this repository.


text:
---
layout: post
title: "DJANGO-CBVs(2)"
comments: true
categories: Django
---

####  DJANGO CBVs(Class Based Views): List Views and Detail Views

In models.py,

from django.shorcuts import render
from django.views.generic import View, TemplateView

class School(models.Model):
    name = models.CharField(max_length = 256)
    principal = models.CharField(max_length = 256)
    location = models.CharField(max_length = 256)

    def __str__(self):
        return self.name

class Student(models.Model):
    name = models.CharField(max_length=256)
    age = models.PositiveIntegerField()
    school = models.ForeignKey(School, related_name = 'students')

    def __str__(self):
        return self.name

In admin.py,
By doing so, you can manage your models(data) in the admin page.

from django.comtrib import admin
from app_name.models import School, Student

# Register your models here.
admin.site.register(School)
admin.site.register(Student)

In views.py

from django.shorcuts import render
from django.views.generic import View, TemplateView, ListView, DetailView
from . import models

class SchoolListView(ListView):
    context_object_name = 'schools'
    model = models.School

class SchoolDetailView(DetailView):
    context_object_name = 'school_detail'
    model = models.School
    template_name = 'app_name/school_detail.html' # pointing to a template

In the project's urls.py,

    ...
    urlpatterns = [
        path('', {% raw %}views.IndexView.as_view(){% endraw %}),
        path('app_name/', {% raw %}include('app_name.urls', namespace = 'app_name'){% endraw %}),
    ]

In the app's urls.py,

...
app_name = 'app_name' # This allows you to write href url tagging in html files(ex. href = "{% raw %}{% url 'app_name:list' %}{% endraw %}")
urlpatterns = [
    path('',views.SchoolListView.as_view(), name = 'list'), # This name allows to do the href url tagging above.
    path('(?P<pk>[-\w]+)/', views.SchoolDetailView.as_view(), name='detail'), The regular expression makes the href in the html file to return a single number(primary key) and links to that specific schools detail view.
]

In the School_list.html file inside the template folder within the app folder,

- When SchoolListView is called in views.py, dajngo lowercases the model name(= School -> school) and concats '_list'. This is where 'school_list' comes from in the for loop below. You can also define the name by adding context_object_name = 'schools' in the SchoolListView class.
- By default, DetailView just returns lowercase of the model name(=school)
- Django automatically generates 'school.id' for the primary key that is referred from the ForeignKey of the Student model. Once the primary key is used, you need to take care of it in the urls.py with regular expressions.

...
    {% for school in schools %}

{{school.name}}

    {% endfor %}
...

In the School_detail.html file inside the template folder within the app folder,
- '.students' comes from the defined related_name of Student model which is to match students to the School as a foreign key.

...

School details:

Name: {{school_detail.name}}

Principal: {{school_detail.principal}}

location: {{school_detail.location}}

Students:

    {% for student in school_detail.students.all %}

{{student.name}} who is {{student.age}} years old.

    {% endfor %}
...

gha_language: HTML


text:
# Nimiq Cashlink Generator

Nimiq Cashlink Generator is a small tool to generate multiple cashlinks for contests, giveaways or events.

## Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

## License

[MIT](https://choosealicense.com/licenses/mit/)

repository: lunanimous/cashlink-generator

repo_name: lunanimous/cashlink-generator


text:
# Bucketlist

[![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)

This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 1.3.1.
This project is hosted at [https://buckellist.herokuapp.com/](https://buckellist.herokuapp.com/)

## How to use the application

Login
![User Login](https://github.com/elbertbiggs360/bucketlist/blob/master/src/assets/screenshots/login.png)

Home page. Use the controls below to create a bucketlist as well as log out
![Searching for a bucketlist](https://github.com/elbertbiggs360/bucketlist/blob/master/src/assets/screenshots/home.png)

The page populated with bucketlists looks like this
![Updating an item](https://github.com/elbertbiggs360/bucketlist/blob/master/src/assets/screenshots/bucketlist.png)

Clicking the bucketlist name accesses the bucketlist details with items.
![Updating an item](https://github.com/elbertbiggs360/bucketlist/blob/master/src/assets/screenshots/item.png)

An item can be added, edited,marked as complete. Double clicking the item allows you to edit it
![Updating an item](https://github.com/elbertbiggs360/bucketlist/blob/master/src/assets/screenshots/editItems.png)
You can also sweep delete or sweep mark as complete to handle all the bucketlist items in one action.
Progress indicators help identify the status of the bucketlist goals

## Features
* Create bucketlists
* Edit bucketlists
* View progress indicators
* Mark as complete
* Recover items from deleted bucketlist when you recreate it
* Mark multiple items as complete

## Development server

Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.

## Code scaffolding

Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.

## Build

Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `-prod` flag for a production build.

## Running unit tests

Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).

## Running end-to-end tests

Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
Before running the tests make sure you are serving the app via `ng serve`.

## Further help

To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).

## License
>You can check out the full license [here](https://github.com/Elbertbiggs360/bucketlist/blob/master/LICENSE)

This project is licensed under the terms of the **MIT** license.

repository: kisakyegordon/bucketlist

repo_name: kisakyegordon/bucketlist


text:
# eWAY Rapid Java Library

[![Latest version on Maven Central][ico-version]][link-maven]
[![Software License][ico-license]](LICENSE.md)
[![Build Status][ico-travis]][link-travis]

A Java library to integrate with eWAY's Rapid Payment API.

Sign up with eWAY at:
 - Australia:    https://www.eway.com.au/
 - New Zealand:  https://eway.io/nz/
 - Hong Kong:    https://eway.io/hk/
 - Malaysia:     https://eway.io/my/
 - Singapore:    https://eway.io/sg/

For testing, get a free eWAY Partner account: https://www.eway.com.au/developers

## Install

### Include with Maven

The eWAY Rapid Java library can be easily added to your Maven project's pom.xml:

```xml
    <dependency>
      <groupId>com.ewaypayments</groupId>
      <artifactId>eway-rapid-java</artifactId>
      <version>1.4.0</version>
    </dependency>
```

### Building

The eWAY Rapid Java library can also be built with Maven. To do so:

 1. Clone the eWAY Rapid GitHub project or download the zip
 2. Navigate to the folder with the pom.xml file and run
```bash
$ mvn package
```
 3. The compiled jar file will be in the "target" directory

## Usage

See the [eWAY Rapid API Reference](https://eway.io/api-v3/) for usage details.

A simple Direct payment example:

```java
import com.eway.payment.rapid.sdk.*;
import com.eway.payment.rapid.sdk.beans.external.*;
import com.eway.payment.rapid.sdk.output.*;

public class EwayRapid {
    public static void main(String[] args) {
        String apiKey = "Rapid API Key";
        String password = "Rapid API Password";
        String rapidEndpoint = "Sandbox";

        RapidClient client = RapidSDK.newRapidClient(apiKey, password, rapidEndpoint);

        CardDetails cardDetails = new CardDetails();
        cardDetails.setName("John Smith");
        cardDetails.setNumber("4444333322221111");
        cardDetails.setExpiryMonth("12");
        cardDetails.setExpiryYear("25");
        cardDetails.setCVN("123");

        Customer customer = new Customer();
        customer.setCardDetails(cardDetails);

        PaymentDetails paymentDetails = new PaymentDetails();
        paymentDetails.setTotalAmount(1000);

        Transaction transaction = new Transaction();
        transaction.setCustomer(customer);
        transaction.setPaymentDetails(paymentDetails);
        transaction.setTransactionType(TransactionType.Purchase);

        PaymentMethod method = PaymentMethod.Direct;
        CreateTransactionResponse response = client.create(method, transaction);

        if (response.getTransactionStatus().isStatus()) {
            System.out.println("Transaction successful! ID: " + response.getTransactionStatus().getTransactionID());
        }
    }
}
```

## Change log

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

## Testing

Tests are written with JUnit and can be run using Maven:

```bash
$ mvn test
```

## License

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

[ico-version]: https://img.shields.io/maven-central/v/com.ewaypayments/eway-rapid-java.svg?style=flat-square
[ico-license]: https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square
[ico-travis]: https://img.shields.io/travis/eWAYPayment/eway-rapid-java/master.svg?style=flat-square

[link-maven]: https://search.maven.org/#search%7Cga%7C1%7Ca%3A%22eway-rapid-java%22
[link-travis]: https://travis-ci.org/eWAYPayment/eway-rapid-java

repository: eWAYPayment/eway-rapid-java

gha_language: Java

repo_name: eWAYPayment/eway-rapid-java


text:
---
title: CryptoKitties
description:
published: true
date: 2021-05-07T05:08:42.087Z
tags: ethereum, cryptokitties
editor: markdown
dateCreated: 2021-03-15T22:55:52.976Z
---

![CryptoKitties](https://txstreet.com/static/img/singles/house_logos/cryptokitties.png)

## Summary

In the blockchain-based game known as [CryptoKitties](https://www.cryptokitties.co/), users collect and breed digital creatures called CryptoKitties. Each kitty has a unique genome that defines its appearance and traits which can be viewed on the respective NFT, both in marketplaces or in game.

## Config

Below is a json config file used by TxStreet, including a list of contracts. [cryptokitties.json](/ethereum/houses/cryptokitties.json) [cryptokitties.json](/ethereum/houses/cryptokitties.json) [cryptokitties.json](/ethereum/houses/cryptokitties.json)


text:
---
layout: post
title: System Module
section: system
permalink: api/system/index.html
---

To start using, you must `require` a reference to the `system` module:

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

repository: saibotsivad/phantomjs

repo_name: saibotsivad/phantomjs


text:
---
layout: post
title: Handheld Tascam Tutorial
permalink: audio/handheld-tascam-tutorial.html
---
## Initial Set Up

1. Press and hold the Home button to turn on the Tascam.
2. Check the battery indicator and replace if the battery is low.
3. Check to see if the SD card is actually in the device; if not, find one and insert it.

## Empty the memory to ensure there's enough space for your recording:

1.	Press menu button to get to the menu
2.	Use plus or minus buttons to scroll down to others, press enter
3.	Scroll down to system, press enter
4.	Scroll down to quick format, press enter.  Exec, enter.
5.	“All data erased. Are you sure?” Press enter and you’re done.

Press menu to get back to the record screen and press the Rec Mode button to choose an input.

Stay in “stereo” and then select your input under “source”.

Your source will be either "Internal microphone" or "External in 1&2" (your XLR 1&2).

## There are three methods of taking a recording in the Penthouse:

<br>
**Plan to use the Tascam's built-in mic as default because it is much easier and you can place it anywhere.**

1. To record using the mic, all you need to do is press record twice to begin the recording.
2. Make sure to test it!

**If the group specifically wants you to take a board feed:**

1.	Connect 2 XLRs between Stereo Alt Out on the back of the board and the Tascam
2.	Press the little AB button near the master fader to enable the output
3.	On the side of the Tascam, choose “Line” under the the Ext In selector
4.	Test the mics and ensure you’re getting signal

**If the group specifically asks you to get a recording from the hanging house mics:**

1.	Start in the patch bay and connect the “hanging house mics 2 & 3” to the AVP nearest your mix position
2.	Connect two gender changers and XLRs from that AVP to the Tascam
3.	On the side of the Tascam, choose “Mic+Phantom” under the Ext In selector.
4.	Test the mics and ensure you’re getting signal

When the performance ends, press the stop button and eject the SD card.

Bring the SD card to the computer in the recording booth or at FOH and insert it into the USB SD card reader (or insert it into any cage laptop checked out).

Download the content to the Archival Audio file folder and use the naming convention as follows:

Year.Month.Date_Description_Engineer.mp3 (Example: 14.3.19_FOTA_Kyle.mp3)

Then, send the file to:

<EMAIL_ADDRESS>
1. Go to the website WeTransfer.com
2. Upload the recording to the site
3. Enter Erin’s email address (above)
4. Enter your email address press Send.

Now go put the SD card back into the handheld Tascam device and you’re done!

gha_license_id: NOASSERTION


text:
# About
This is a sample Flask application providing endpoints for exchanging currencies with fake exchange rates, querying rates for a specific base currency etc.

The purpose of this sample project is twofold:

- Showcase Flask and Flask-RESTful as minimal Python frameworks for developing RESTful APIs
- Demonstrate how to containerize, run & test Flask applications with Docker and Kubernetes, all done locally

The following sections go through the process of running and testing the API from within three distinct environments in ascending order of complexity & flexibility:

- [Local environment](#quick-run)
- [Docker Host](#docker)
- [Kubernetes cluster](#kubernetes)

## API features

### Endpoints
The application provides the following endpoints:

- /exchange - POST
- /exchangeMany - POST
- /exchange/{base-currency} - POST
- /currency - GET
- /currencies  - GET

All valid requests and responses are in JSON format.

The app currently supports the following base/target currencies:
- EUR
- GBP
- USD

**DISCLAIMER**: Conversion rates provided and used by this sample API are **NOT** real; they are defined for demonstration purposes.

For examples and details on how to use each endpoint defined above, please refer to the [Postman](#postman-tests) section below.

# Getting started

## Pre-requisites

For local run & testing (without Docker or K8S):
- Python 3.8 (or above)
- PyCharm Community Edition 2020 (or any other modern IDE like VS Code)
- Postman v8.0.5 (or above)
- Git

**Additionally**, to build and run with **Docker**:
- VS Code - optional but **highly recommended**, especially for Windows+WSL2 users, + extensions:
  - Python
  - Docker
  - Remote - Containers
  - Kubernetes
  - Remote - Kubernetes
  - Remote - WSL (for WSL2 users)
- Docker Engine 20.10.3 (or higher)

For Mac users, just download and install the latest version of [Docker Desktop for Mac](https://docs.docker.com/docker-for-mac/install/).

For Windows users, it is **highly** recommended to install Docker Desktop for Windows with the WSL2 backend enabled. This is also officialy the recommended way of developing Docker apps with Windows going forward; for further details check [this](https://docs.docker.com/docker-for-windows/wsl/) guide.

For Linux users, just install Docker Engine directly by following one of [these](https://docs.docker.com/engine/install/ubuntu/) guides (Ubuntu distro for example).

Finally, to run & test your Dockerized container on a local K8S cluster:

- [Kind](https://kind.sigs.k8s.io/docs/user/quick-start/#installation) (or equivalent clients such as Minikube, K3S)
- [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/)

## Installation
1. Clone this repo on your local machine
```git
git clone https://github.com/ckarakannas/currency-converter-api.git
```
2. Navigate to the projet directory and create a Python virtual environment. For example with the standard **venv** module:
  - On macOS and Linux:
  ```bash
  python3 -m venv venv
  ```
  - On Windows:
  ```cmd
  py -m venv venv
  ```
3. Activate the virtual environment:
- On macOS and Linux:
```bash
source venv/bin/activate
```
- On Windows:
```cmd
.\venv\Scripts\activate
```
4. Install Python dev dependancies
```bash
pip install -r requirements-dev.txt
```
5. Open the project from the root directory with either PyCharm or VS Code. Remember to point the IDE to the venv Python interpreter.

## Quick local run
From the command line or within your IDE, with the Python `venv` interpreter activated, run the ```api.py``` file. The app is now listening on `localhost:5000`. To check that the app is running, you can navigate to [localhost](http://localhost:5000/) on your web-browser and you should see a welcome message.

# Docker

This repo includes the ``Dockerfile`` used to build the Flask app image, which you can pull from [Docker Hub](https://hub.docker.com/r/chrisk14/currency-exchange). As expected, the image is based on the official Python Docker image. Below is a typical workflow on how to containerize and run a Flask app locally with Docker, purposed for two separate environments - dev & prod.

### Dev example

Building and running the app from source code, on a local dev env is as simple as running

```bash
docker build -t cex-api:dev .
```

followed by

```bash
docker run -it --name cex-api-dev -p 5000:5000 cex-api:dev python api.py
```

Alternatively, you can do this in one go by grabbing the existing dev image from Docker Hub:

```bash
docker run -it --name cex-api-dev -p 5000:5000 chrisk14/currency-exchange:dev python api.py
```

### Prod example

For a production-like image with a Gunicorn server hosting the app instance, build using this command

```bash
docker build -t cex-api:prod . --build-arg API_ENV=Production
```

NOTE: The --build-arg 'API_ENV' is case sensitive and API_ENV=Production instructs Docker to build the image using production dependencies, including Gunicorn. By default, the API_ENV is set to 'Deployment'.

Subsequently, to get a running, production-like container, run

```bash
docker run -it -p 5000:5000 --name cex-api-prod cex-api:prod gunicorn -w 4 -b <IP_ADDRESS>:5000 run:app
```

Again, you can do this in one go by grabbing the existing image from Docker Hub:

```bash
docker run -it -p 5000:5000 --name cex-api-prod chrisk14/currency-exchange:prod gunicorn -w 4 -b <IP_ADDRESS>:5000 run:app
```

## Docker-Compose

For your reference, this repo includes docker-compose YAML files. With these, you can build from source code and run with a single command using the ``docker-compose`` client. From the root of the repo, run

```bash
docker-compose up -d --build
```

The above defaults to a local dev container. For a production-like container running Gunicorn WSGI, use this command:

```bash
docker-compose -f docker-compose.yml -f production.yml up -d --build
```

# Kubernetes

You can take this one step further by setting up and running the app within your locally managed K8S cluster.

The instructions below are based on the [kind](https://kind.sigs.k8s.io/) client. Feel free to experiment with other Kubernetes clients, such as Minikube etc.

## Creating a local cluster
1. Install kubectl & [Kind](https://kind.sigs.k8s.io/docs/user/quick-start/#installation) - see [pre-requisites](#pre-requisites)
2. Create a single node cluster with preconfigured port mappings and mounts (for dev env) from:

```bash
kind create cluster --config=kubernetes/cluster-config.yaml --name local
```
The ``cluster-config.yaml`` file includes all the config settings required for local deployment with an interactive dashboard explained below. Feel free to experiment with this, but only if you understand how Kind configuration works.

3. This creates a K8S cluster named ``local``. Verify this by running:

```bash
kind get clusters
```
## Create an interactive K8S dashboard

1. Apply the following resources for an interactive K8S dashboard

  ```bash
  kubectl apply -f kubernetes/dashboard-resources.yaml

  kubectl apply -f kubernetes/dashboard-admin-resources.yaml
  ```

2. Start a kubectl proxy

  ```bash
  kubectl proxy --port=51658
  ```

3. Open another terminal and grab secret token for dashboard login

  ```bash
  kubectl -n kubernetes-dashboard describe secret $(kubectl -n kubernetes-dashboard get secret | grep admin-user | awk '{print $1}')
  ```
4. Access the dashboard through this [link](http://localhost:51658/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy/). Copy the token printed in the previous step from your terminal, and paste it to login.

With this dashboard, you will be able to view deployments and any other objects you provision within your local cluster.

### Deployment example in K8S

To deploy the sample Flask app on your local cluster run the following on your terminal

```bash
kubectl apply -f kubernetes/dev/flask-deployment.yaml
kubectl apply -f kubernetes/dev/flask-service.yaml
```
These commands will provision a flask-deployment with 2 replicas serving on localhost:30000.

The deployment YAML files instruct Kubernetes to create pods based on the images hosted on my Docker Hub repo, which were created in the previous steps (see the [Docker](#docker) section). Feel free to experiment with these files under the ``kubernetes`` directory to modify the deployment or services.

To scale up or down run
```bash
kubectl scale deployment flask-deployment --replicas=<INT>
```

Similarly for a production-equivalent Flask app, run

```bash
kubectl apply -f kubernetes/prod/flask-deployment.yaml
kubectl apply -f kubernetes/prod/flask-service.yaml
```

### Access on your webrowser

To access these instances on your web browser, simply go to ``localhost:30000`` for dev Pod instances and ``localhost:32000`` for prod Pod instances.

## Deleting cluster

To spin down the local cluster, just run

```
kind delete cluster --name local
```
This will delete the cluster along with all the resources and objects created in this section.

# Postman & Tests
For usage examples and a test collection, run Postman and import all the json files within the ``postman`` directory, including the environment files.

This includes:
- CEX-API.postman_collection.json - refer to this as the basis for interacting with the API and sending valid requests. Make sure you switch to the right environment when you do so
- Environments:
  - Local (when running on local machine and plain Docker Host)
  - K8S-Local-Dev (when running a Dev Pod instance on your local K8S cluster configured as explained [previously](#deployment-example-in-k8s))
  - K8S-Local-Prod (when running a Prod Pod instance on your local K8S cluster configured as explained [previously](#deployment-example-in-k8s))
- CEX-API-Collection-Tests.postman_collection.json
  - A collection that can be used for testing. You can run this tests collection and check that your deployments of this project are working as follows:
    - Run Postman
    - Switch to the correct environment
    - Open a Runner tab
    - Choose the ``CEX-API-Collection-Tests`` as the collection
    - Where it says `Data`, press `Select File`, browse to the `postman` directory from the root and select test_data.csv
    - Finally run the tests. All tests & iterations should return green, as in succesful

# Contributing

Feel free to contribute to this project. Fork and open a pull request.

# License

[Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0)

repository: ckarakannas/currency-converter-api

gha_language: Python

repo_name: ckarakannas/currency-converter-api


text:
# MuxPhp\DeliveryUsageApi

All URIs are relative to *https://api.mux.com*

Method | HTTP request | Description
------------- | ------------- | -------------
[**listDeliveryUsage**](DeliveryUsageApi.md#listDeliveryUsage) | **GET** /video/v1/delivery-usage | List Usage

## listDeliveryUsage

> \MuxPhp\Models\ListDeliveryUsageResponse listDeliveryUsage($page, $limit, $asset_id, $timeframe)

List Usage

Returns a list of delivery usage records and their associated Asset IDs or Live Stream IDs.

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
**optional_params** | **[]** | Assocaiative Array of optional parameters, specifically: | (optional) |
**optional_params[page]** | int | Offset by this many pages, of the size of `limit` (optional, default to 1)
**optional_params[limit]** | int | Number of items to include in the response (optional, default to 100)
**optional_params[asset_id]** | string | Filter response to return delivery usage for this asset only. (optional)
**optional_params[timeframe]** | string[] | Time window to get delivery usage information. timeframe[0] indicates the start time, timeframe[1] indicates the end time in seconds since the Unix epoch. Default time window is 1 hour representing usage from 13th to 12th hour from when the request is made. (optional)

### Return type

[**\MuxPhp\Models\ListDeliveryUsageResponse**](../Model/ListDeliveryUsageResponse.md)

### Authorization

[accessToken](../../README.md#accessToken)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints)
[[Back to Model list]](../../README.md#documentation-for-models)
[[Back to README]](../../README.md)


text:
# Genome Nexus Annotation Pipeline
These tools allow for annotation of genomic variants from a MAF for import into
the cBioPortal using [Genome Nexus](http://genomenexus.org).

## MAF Annotation
The `annotationPipeline` module is a command line tool to annotate a maf using genome nexus.

**Pre-build steps**

Create your `application.properties`:

```
cp annotationPipeline/src/main/resources/application.properties.EXAMPLE annotationPipeline/src/main/resources/application.properties
```

If you have your own
installation of Genome Nexus, you can point to it by modifying the
`application.properties` file located in
`annotationPipeline/src/main/resources`.

Create your `log4j.properties`:

```
cp annotationPipeline/src/main/resources/log4j.properties.EXAMPLE annotationPipeline/src/main/resources/log4j.properties
```

Modify the property `log4j.appender.a.File` in your `log4j.properties` file to the desired log file path.

To use it, build the project using maven and run it like so:

    mvn clean install
    $JAVA_HOME/bin/java -jar annotationPipeline/target/annotationPipeline-*.jar \
        --filename <INPUT_MAF> \
        --output-filename <OUTPUT DESTINATION> \
        --isoform-override <mskcc or uniprot>

You can choose to replace the gene symbols in the new maf by the gene symbols
found by Genome Nexus by supplying the `-r` optional parameter. To output error
reporting to a file, supply the `-e` option a location for the file to be
saved. By running the jar without any arguments or by providing the optional
parameter `-h` you can view the full usage statement.

## Annotate data with Docker
Genome Nexus Annotation Pipeline is available on Docker: https://hub.docker.com/r/genomenexus/gn-annotation-pipeline.

#### Usage instruction
```
docker run -v ${PWD}:/wd genomenexus/gn-annotation-pipeline:master --filename /wd/input.txt  --output-filename /wd/output.txt
```
- `-v ${PWD}:/wd`: This option maps the current working directory to a volume within the Docker container at the path `/wd`. This makes it possible for files in the host directory to be accessed and modified between container and host.
- `--filename /wd/input.txt`: This option specifies the input file location at `/wd/input.txt`, which should be under the same directory as output file.

- `--output-filename /wd/output.txt`: This option specifies the output file where the annotated results will be saved. The file will be created at `/wd/output.txt`, which should be under the same directory as input file.

#### View logging file
To enable logging in the Genome Nexus Annotation Pipeline and access the log file, you need to mount your local path to view the log file locally. By default, the log file is stored at `/genome-nexus-annotation-pipeline/logs/genome-nexus-annotation-pipeline.log`. Use the following command as an example:
```
docker run  -v ${PWD}:/wd -v ${PWD}/logs:/genome-nexus-annotation-pipeline/logs gn-annotation-pipeline:master --filename  /wd/input.txt  --output-filename /wd/output.txt
```
- `-v ${PWD}/logs:/genome-nexus-annotation-pipeline/logs` flag mounts the logs directory inside the current working directory to the corresponding directory inside the Docker container.
- Other flags are the same as above

Make sure to adjust the file paths according to your specific requirements. Once the command is executed, the log file will be generated and stored in the logs directory within your local directory.

### Optional parameters
| Short | Long | Description |
| ------ | ------  | ------ |
| `-h` | `--help` | shows this help document and quits|
| `-f` | `--filename` |Mutation filename|
| `-o` | `--output-filename` | Output filename (including path)|
| `-t` | `--output-format`  | extended, minimal or a file path which includes output format (FORMAT EXAMPLE: Chromosome,Hugo_Symbol,Entrez_Gene_Id,Center,NCBI_Build)|
| `-i` | `--isoform-override` | Isoform Overrides. Options: mskcc or uniprot|
| `-e` | `--error-report-location` | Error report filename (including path)|
| `-r` | `--replace-symbol-entrez` | Replace gene symbols and entrez id with what is provided by annotator"|
| `-p` | `--post-interval-size` | Number of records to make POST requests to Genome Nexus with at a time |
| `-s` | `--strip-matching-bases` | Strip matching allele bases. Options: first, all, none. For example: AAC/AAT, strip-off first: AC/AT, strip-off all: C/T, strip-off none: AAC/AAT  |
| `-a` | `--add-original-genomic-location` | Add original genomic location data columns into the output, name columns with prefix 'IGNORE_Genome_Nexus_Original_'). This would be useful if saving a reference of original input is needed and won't be changed in any condition|
| `-d` | `--ignore-original-location` | Genome-nexus-annotation-pipeline reads original genomic location info as input by default, if not existing, reading from normal genomic location info columns. Adding `-d` ignores original genomic location info columns (columns with prefix 'IGNORE_Genome_Nexus_Original_') and only use whatever in normal genomic location info columns. This would be helpful if you'd like to stick with current genomic location info columns.|

### Annotation fields
| Field | Source | Note |
| --| -- | -- |
| Hugo_Symbol |||
|Entrez_Gene_Id|||
|Center|||
|NCBI_Build|||
|Chromosome|GN response / Input||
|Start_Position|GN response / Input||
|End_Position|GN response / Input||
|Strand|||
|Consequence|||
|Variant_Classification|||
|Variant_Type|||
|Reference_Allele|GN response / Input||
|Tumor_Seq_Allele1|||
|Tumor_Seq_Allele2|GN response / Input||
|dbSNP_RS|||
|dbSNP_Val_Status|||
|Tumor_Sample_Barcode|||
|Matched_Norm_Sample_Barcode|||
|Match_Norm_Seq_Allele1|||
|Match_Norm_Seq_Allele2|||
|Tumor_Validation_Allele1|||
|Tumor_Validation_Allele2|||
|Match_Norm_Validation_Allele1|||
|Match_Norm_Validation_Allele2|||
|Verification_Status|||
|Validation_Status|||
|Mutation_Status|||
|Sequencing_Phase|||
|Sequence_Source|||
|Validation_Method|||
|Score|||
|BAM_File|||
|Sequencer|||
|t_ref_count|||
|t_alt_count|||
|n_ref_count|||
|n_alt_count|||
|HGVSc|||
|HGVSp|||
|HGVSp_Short|||
|Transcript_ID|||
|RefSeq|VEP||
|Protein_position|VEP||
|Codons|VEP||
|Exon_Number|VEP||
|gnomAD_AF|myvariant.info|Need to add "my_variant_info" in "genomenexus.enrichment_fields"|
|gnomAD_AFR_AF|myvariant.info|Need to add "my_variant_info" in "genomenexus.enrichment_fields"|
|gnomAD_AMR_AF|myvariant.info|Need to add "my_variant_info" in "genomenexus.enrichment_fields"|
|gnomAD_ASJ_AF|myvariant.info|Need to add "my_variant_info" in "genomenexus.enrichment_fields"|
|gnomAD_EAS_AF|myvariant.info|Need to add "my_variant_info" in "genomenexus.enrichment_fields"|
|gnomAD_FIN_AF|myvariant.info|Need to add "my_variant_info" in "genomenexus.enrichment_fields"|
|gnomAD_NFE_AF|myvariant.info|Need to add "my_variant_info" in "genomenexus.enrichment_fields"|
|gnomAD_OTH_AF|myvariant.info|Need to add "my_variant_info" in "genomenexus.enrichment_fields"|
|gnomAD_SAS_AF|myvariant.info|Need to add "my_variant_info" in "genomenexus.enrichment_fields"|
|MA:FIS|Mutation Assessor|Need to add "mutation_assessor" in "genomenexus.enrichment_fields"|
|MA:FImpact|Mutation Assessor|Need to add "mutation_assessor" in genomenexus.enrichment_fields"|
|MA:link.MSA|Mutation Assessor|Need to add "mutation_assessor" in "genomenexus.enrichment_fields"|
|MA:link.PDB|Mutation Assessor|Need to add "mutation_assessor" in "genomenexus.enrichment_fields"|
|Polyphen_Prediction|Polyphen|Need to add "polyphen" in "genomenexus.enrichment_fields"|
|Polyphen_Score|Polyphen|Need to add "polyphen" in "genomenexus.enrichment_fields"|
|SIFT_Prediction|SIFT|Need to add "sift" in "genomenexus.enrichment_fields"|
|SIFT_Score|SIFT|Need to add "sift" in "genomenexus.enrichment_fields"|
|Ref_Tri||Need to add "nucleotide_context" in "genomenexus.enrichment_field"|
|Var_Tri||Need to add "nucleotide_context" in "genomenexus.enrichment_field"|
|oncokb_geneExist|OncoKb|Need to add "oncokb" in "genomenexus.enrichment_fields" and provide your OncoKB token in "oncokb.token"|
|oncokb_highestDXLevel|OncoKb|Need to add "oncokb" in "genomenexus.enrichment_fields" and provide your OncoKB token in "oncokb.token"|
|oncokb_highestPXLevel|OncoKb|Need to add "oncokb" in "genomenexus.enrichment_fields" and provide your OncoKB token in "oncokb.token"|
|oncokb_highestResistanceLevel|OncoKb|Need to add "oncokb" in "genomenexus.enrichment_fields" and provide your OncoKB token in "oncokb.token"|
| oncokb_highestSensitiveLevel |OncoKb|Need to add "oncokb" in "genomenexus.enrichment_fields" and provide your OncoKB token in "oncokb.token"|
| oncokb_mutationEffect|OncoKb|Need to add "oncokb" in "genomenexus.enrichment_fields" and provide your OncoKB token in "oncokb.token"|
|oncokb_mutationEffectCitations|OncoKb|Need to add "oncokb" in "genomenexus.enrichment_fields" and provide your OncoKB token in "oncokb.token"|
| oncokb_oncogenic|OncoKb|Need to add "oncokb" in "genomenexus.enrichment_fields" and provide your OncoKB token in "oncokb.token"|
| oncokb_variantExist   |OncoKb|Need to add "oncokb" in "genomenexus.enrichment_fields" and provide your OncoKB token in "oncokb.token"|
|Annotation_Status||FAILED / SUCCESS|

### Add additional annotation columns
Genome Nexus supports additional annotation columns with the setting of "enrichment_fields". The configuration for these enrichment fields is managed through the `application.properties` file, please refer to `Pre-build steps` section.
To configure the enrichment fields, you need to include the desired field names from the provided list in the `-Dgenomenexus.enrichment_fields=` parameter of the command line, or directly add field names in `genomenexus.enrichment_fields=` in `application.properties` file. Multiple field names can be specified by separating them with commas. `annotation_summary` is highly recommended to add as default since it's crucial for lots of annotation fields.
**Example**:
```
java
-Dgenomenexus.enrichment_fields=annotation_summary,my_variant_info
-jar annotationPipeline/target/annotationPipeline-*.jar \ -r \
--filename test/data/minimal_example.in.txt \
--output-filename test/data/minimal_example.out.uniprot.txt \
--isoform-override uniprot
```
##### Available enrichment fields:
- annotation_summary:
    - This field is essential for most annotation processes.
- my_variant_info
    - This field provides gnomAD information. Genome Nexus caches static myvariant.info annotation into database.  Upon adding `my_variant_info` to the `enrichment_fields`, Genome Nexus will query the existing variant information from the myvariant.info cache within the database for relevant variants. For new variants, Genome Nexus will retrieve the data from myvariant.info and store it in the database.
- polyphen
- sift
- mutation_assessor
    - 'mutation_assessor' provides V3 version annotation from Mutation Assessor, which is currently stored in Genome Nexus database
- nucleotide_context
- oncokb:
    - 'oncokb' provides annotations of the biological consequences and clinical implications from OncoKB website. OncoKB token is required (see more information from: [https://www.oncokb.org/apiAccess](https://www.oncokb.org/apiAccess)). Please also provide your token in `-Doncokb.token=abc123` command line parameter, or directly add `oncokb.token=abc123`in the `application.properties`. No OncoKB annotation columns will be added if no valid token is provided

### Minimal MAF Example

For an example minimal input file see
[test/data/minimal_example.in.txt](test/data/minimal_example.in.txt) and
corresponding output
[test/data/minimal_example.out.uniprot.txt](test/data/minimal_example.out.uniprot.txt).
The output file was generated with:

    $JAVA_HOME/bin/java -jar annotationPipeline/target/annotationPipeline-*.jar \
        -r \
        --filename test/data/minimal_example.in.txt  \
        --output-filename test/data/minimal_example.out.uniprot.txt \
        --isoform-override uniprot

## Direct Database Annotation
If you have data already loaded into a cBioPortal database but did not properly
annotate it or discovered issues later, you can use the `databaseAnnotator`
utility to fix it.

You will need to specify some database connection parameters inside the
`application.properties` file located in
`databaseAnnotator/src/main/resources`. Once this is done, build the project
using maven and run like so:

    $JAVA_HOME/bin/java -jar databaseAnnotator/target/databaseAnnotator-*.jar \
        --isoform <mskcc or uniprot>

As with the above tool, running the jar without any arguments or by providing
the optional parameter `-h` will bring up the full usage statement. You can
also specify a single study or set of studies to annotate by using the
`--studies` parameter.

## Annotator
The `annotator` module is the client code that makes calls to the Genome Nexus
server and interprets the response. The other two modules use this as a
dependency.

## Updating the Genome Nexus Annotation Pipeline
The annotation pipeline uses models brought in by the auto-generated **genome-nexus-java-api-client** [here](https://github.com/averyniceday/genome-nexus-annotation-pipeline/blob/2356cad06aa602ee423b08d5792c50e903200a1d/pom.xml#L77) and [here](https://github.com/averyniceday/genome-nexus-annotation-pipeline/blob/2356cad06aa602ee423b08d5792c50e903200a1d/pom.xml#L82) .

In the event of an update to the Genome Nexus server (e.g adding to an existing model), the `genome-nexus-java-api-client` must be regenerated and propagated to this codebase. To generate the newest `genome-nexus-java-api-client`, refer to instructions [here](https://github.com/genome-nexus/genome-nexus-java-api-client/blob/master/README.md).

Once updated, update the pom with the newest commit hash from the `genome-nexus-java-api-client` codebase.


text:
# RPC

Simple RPC style APIs with generated clients & servers.

## About

All RPC methods are invoked with the POST method, and the RPC method name is placed in the URL path. Input is passed as a JSON object in the body, following a JSON response for the output as shown here:

```sh
$ curl -d '{ "project_id": "ping_production" }' https://api.example.com/get_alerts
{
  "alerts": [...]
}
```

All inputs are objects, all outputs are objects, this improves future-proofing as additional fields can be added without breaking existing clients. This is similar to the approach AWS takes with their APIs.

## Commands

There are several commands provided for generating clients, servers, and documentation. Each of these commands accept a `-schema` flag defaulting to `schema.json`, see the `-h` help output for additional usage details.

 See the [example schema](./examples/todo/schema.json).

## FAQ

  Why did you create this project?
  There are many great options when it comes to building APIs, but to me the most important aspect is simplicity, for myself and for the end user. Simple JSON in, and JSON out is appropriate for 99% of my API work, there's no need for the additional performance provided by alternative encoding schemes, and rarely a need for more complex features such as bi-directional streaming provided by gRPC.

  Should I use this in production?
  Only if you're confident that it supports everything you need, or you're comfortable with forking. I created this project for my work at Apex Software, it may not suit your needs.

  Why JSON schemas?
  I think concise schemas using a DSL are great, until they're a limiting factor. Personally I have no problem with JSON, and it's easy to expand upon when you introduce a new feature, such as inline examples for documentation.

  Why doesn't it follow the JSON-RPC spec?
  I would argue this spec is outdated, there is little reason to support batching at the request level, as HTTP/2 handles this for you.

  What does the client output look like?
  See the Apex Logs Go client for an example, client code is designed to be concise and idiomatic.

---

[![GoDoc](https://godoc.org/github.com/apex/rpc?status.svg)](https://godoc.org/github.com/apex/rpc)
![](https://img.shields.io/badge/license-MIT-blue.svg)
![](https://img.shields.io/badge/status-stable-green.svg)

Sponsored by my [GitHub sponsors](https://github.com/sponsors/tj):

[](https://sponsors-api-u2fftug6kq-uc.a.run.app/sponsor/profile/0)
[](https://sponsors-api-u2fftug6kq-uc.a.run.app/sponsor/profile/1)
[](https://sponsors-api-u2fftug6kq-uc.a.run.app/sponsor/profile/2)
[](https://sponsors-api-u2fftug6kq-uc.a.run.app/sponsor/profile/3)
[](https://sponsors-api-u2fftug6kq-uc.a.run.app/sponsor/profile/4)
[](https://sponsors-api-u2fftug6kq-uc.a.run.app/sponsor/profile/5)
[](https://sponsors-api-u2fftug6kq-uc.a.run.app/sponsor/profile/6)
[](https://sponsors-api-u2fftug6kq-uc.a.run.app/sponsor/profile/7)
[](https://sponsors-api-u2fftug6kq-uc.a.run.app/sponsor/profile/8)
[](https://sponsors-api-u2fftug6kq-uc.a.run.app/sponsor/profile/9)
[](https://sponsors-api-u2fftug6kq-uc.a.run.app/sponsor/profile/10)
[](https://sponsors-api-u2fftug6kq-uc.a.run.app/sponsor/profile/11)
[](https://sponsors-api-u2fftug6kq-uc.a.run.app/sponsor/profile/12)
[](https://sponsors-api-u2fftug6kq-uc.a.run.app/sponsor/profile/13)
[](https://sponsors-api-u2fftug6kq-uc.a.run.app/sponsor/profile/14)
[](https://sponsors-api-u2fftug6kq-uc.a.run.app/sponsor/profile/15)
[](https://sponsors-api-u2fftug6kq-uc.a.run.app/sponsor/profile/16)
[](https://sponsors-api-u2fftug6kq-uc.a.run.app/sponsor/profile/17)
[](https://sponsors-api-u2fftug6kq-uc.a.run.app/sponsor/profile/18)
[](https://sponsors-api-u2fftug6kq-uc.a.run.app/sponsor/profile/19)
[](https://sponsors-api-u2fftug6kq-uc.a.run.app/sponsor/profile/20)
[](https://sponsors-api-u2fftug6kq-uc.a.run.app/sponsor/profile/21)
[](https://sponsors-api-u2fftug6kq-uc.a.run.app/sponsor/profile/22)
[](https://sponsors-api-u2fftug6kq-uc.a.run.app/sponsor/profile/23)
[](https://sponsors-api-u2fftug6kq-uc.a.run.app/sponsor/profile/24)
[](https://sponsors-api-u2fftug6kq-uc.a.run.app/sponsor/profile/25)
[](https://sponsors-api-u2fftug6kq-uc.a.run.app/sponsor/profile/26)
[](https://sponsors-api-u2fftug6kq-uc.a.run.app/sponsor/profile/27)
[](https://sponsors-api-u2fftug6kq-uc.a.run.app/sponsor/profile/28)
[](https://sponsors-api-u2fftug6kq-uc.a.run.app/sponsor/profile/29)
[](https://sponsors-api-u2fftug6kq-uc.a.run.app/sponsor/profile/30)
[](https://sponsors-api-u2fftug6kq-uc.a.run.app/sponsor/profile/31)
[](https://sponsors-api-u2fftug6kq-uc.a.run.app/sponsor/profile/32)
[](https://sponsors-api-u2fftug6kq-uc.a.run.app/sponsor/profile/33)
[](https://sponsors-api-u2fftug6kq-uc.a.run.app/sponsor/profile/34)
[](https://sponsors-api-u2fftug6kq-uc.a.run.app/sponsor/profile/35)
[](https://sponsors-api-u2fftug6kq-uc.a.run.app/sponsor/profile/36)
[](https://sponsors-api-u2fftug6kq-uc.a.run.app/sponsor/profile/37)
[](https://sponsors-api-u2fftug6kq-uc.a.run.app/sponsor/profile/38)
[](https://sponsors-api-u2fftug6kq-uc.a.run.app/sponsor/profile/39)
[](https://sponsors-api-u2fftug6kq-uc.a.run.app/sponsor/profile/40)
[](https://sponsors-api-u2fftug6kq-uc.a.run.app/sponsor/profile/41)
[](https://sponsors-api-u2fftug6kq-uc.a.run.app/sponsor/profile/42)
[](https://sponsors-api-u2fftug6kq-uc.a.run.app/sponsor/profile/43)
[](https://sponsors-api-u2fftug6kq-uc.a.run.app/sponsor/profile/44)
[](https://sponsors-api-u2fftug6kq-uc.a.run.app/sponsor/profile/45)
[](https://sponsors-api-u2fftug6kq-uc.a.run.app/sponsor/profile/46)
[](https://sponsors-api-u2fftug6kq-uc.a.run.app/sponsor/profile/47)
[](https://sponsors-api-u2fftug6kq-uc.a.run.app/sponsor/profile/48)
[](https://sponsors-api-u2fftug6kq-uc.a.run.app/sponsor/profile/49)
[](https://sponsors-api-u2fftug6kq-uc.a.run.app/sponsor/profile/50)
[](https://sponsors-api-u2fftug6kq-uc.a.run.app/sponsor/profile/51)
[](https://sponsors-api-u2fftug6kq-uc.a.run.app/sponsor/profile/52)
[](https://sponsors-api-u2fftug6kq-uc.a.run.app/sponsor/profile/53)
[](https://sponsors-api-u2fftug6kq-uc.a.run.app/sponsor/profile/54)
[](https://sponsors-api-u2fftug6kq-uc.a.run.app/sponsor/profile/55)
[](https://sponsors-api-u2fftug6kq-uc.a.run.app/sponsor/profile/56)
[](https://sponsors-api-u2fftug6kq-uc.a.run.app/sponsor/profile/57)
[](https://sponsors-api-u2fftug6kq-uc.a.run.app/sponsor/profile/58)
[](https://sponsors-api-u2fftug6kq-uc.a.run.app/sponsor/profile/59)
[](https://sponsors-api-u2fftug6kq-uc.a.run.app/sponsor/profile/60)
[](https://sponsors-api-u2fftug6kq-uc.a.run.app/sponsor/profile/61)
[](https://sponsors-api-u2fftug6kq-uc.a.run.app/sponsor/profile/62)

repository: apex/rpc

gha_language: Go

repo_name: apex/rpc


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

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

## [0.5.0] - 2017/11/1
### Added
- PPAV new and PPAV hot.

## [0.4.2] - 2017/10/22
### Added
- Add subscribe actions.

### Changed
- Upgrade toolbot-core-experiment to bottender which improves sendMessaage speed.
- fix disclaimer words and buttons.
- mark paid video source.

## [0.4.1] - 2017/10/13
### Added
- Encrypt `userId` to let redirect server knows user.
- Add subscribe hints in some messages.

### Changed
- Replace `encodeURI` with `encodeURIComponent`.

## [0.4.0] - 2017-10-03
### Added
- New feature: Sucsribe "gginin Hour".
- Randomly reply some simple text.
- Add `.dockerignore`.

### Changed
- Remove refuse disclaimer button.
- Upgrade `prettier` to 1.7.0 version.
- Update tutorial.
- Open video view_count. Let user know each source has been clicked how many times.

### Fixed
- Fix checkAcceptDisclaimer text bug.

## [0.3.1] - 2017-09-10
### Added
- Insert logs when keywords that users search are not found.

### Changed
- Send five videos at one time.
- Upgrade Bottender to 0.12.0 version.
- Update videos seed according to latest schema.

## [0.3.0] - 2017-09-06
### Added
- Use Elasticsearch as search database.
- Fuzzy search. User recently can search videos by only one prefix, and get result with high probability.
- Use redirect url as video's url.
- Add maximum video count to constraint too much searching result.
- Show tags and video length in message.
- Send a random video when searching result is none.
- Add tutorial button, and PPAV shortcut key in main menu.

### Fixed
- Check user information at very beginning.
- More accurately Docker commend.

### Changed
- Rewrite babel settings.
- Split saving search information models into saving keywords and hot keywords.

## [0.2.0] - 2017-08-17
### Added
- Import circleci 2.0 as CI tool and unit test by jest.
- Use [dashbot](https://www.dashbot.io/) as our bot analytics tool.
- Start using "CHANGELOG.md" throughout the site to differentiate between the file and the purpose of the file — the logging of changes.
- Connect with image analytic server. It will post to the server when user uploads a photo.
- Use [node-mongo-seeds](https://github.com/toymachiner62/node-mongo-seeds) to inject basic data into local mongo database.

### Changed
- Replace [node-telegram-bot-api](https://github.com/yagop/node-telegram-bot-api) with [toolbot-core-experiment](https://github.com/Yoctol/toolbot-core-experiment).
  Improve code quality a lot.

### Fixed
- Replace strange character in string. It will lead to posting telegram API failed.
- Fix some typo.

## 0.1.0 - 2017-07-24
### Added
- Create Telegram bot by [node-telegram-bot-api](https://github.com/yagop/node-telegram-bot-api).
- Let user select language, including English and traditional Chinese.
- Before officially useing PPAV bot, user should accept disclaimer.
- Show persistent menu after accepting disclaimer, including Show disclaimer, About PPAV, Report problems, Contact us and Settings.
- Create basic video message with image, website link and page buttons.
- Auto delete bot message.

repository: PPAV-inc/telegram-bot

repo_name: PPAV-inc/telegram-bot


text:
# Slack messages tile

[![Latest Version on Packagist](https://img.shields.io/packagist/v/enflow/laravel-dashboard-slack-tile.svg?style=flat-square)](https://packagist.org/packages/enflow/laravel-dashboard-slack-tile)
[![GitHub Tests Action Status](https://img.shields.io/github/workflow/status/enflow/laravel-dashboard-slack-tile/run-tests?label=tests)](https://github.com/enflow/laravel-dashboard-slack-tile/actions?query=workflow%3Arun-tests+branch%3Amaster)
[![Total Downloads](https://img.shields.io/packagist/dt/enflow/laravel-dashboard-slack-tile.svg?style=flat-square)](https://packagist.org/packages/enflow/laravel-dashboard-slack-tile)

This tile can be used on [the Laravel Dashboard](https://docs.spatie.be/laravel-dashboard).

It uses the Slack messages webhook to listen for new messages and present them on the dashboard.

## Installation

You can install the package via composer:

```bash
composer require enflow/laravel-dashboard-slack-tile
```

## Usage

In your dashboard view you use the `livewire:slack` component.

```html
<x-dashboard>
    <livewire:slack position="d5:d12" />
</x-dashboard>
```

Add or append the following in ```config\dashboard.php```
```
'tiles' => [
    'slack' => [
        'user' => 'ABCDEFGH',
        'channels' => [
            'C1234ABCD' => 'channel-name',
        ],
    ],
],
```

## Testing
``` bash
$ composer test
```

## Contributing
Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

## Security
If you discover any security related issues, please email<EMAIL_ADDRESS>instead of using the issue tracker.

## Credits
- [Bart Noordsij](https://github.com/abartn)
- [Michel Bardelmeijer](https://github.com/mbardelmeijer)
- [All Contributors](../../contributors)

## About Enflow
Enflow is a digital creative agency based in Alphen aan den Rijn, Netherlands. We specialize in developing web applications, mobile applications and websites. You can find more info [on our website](https://enflow.nl/en).

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

repository: enflow/laravel-dashboard-slack-tile

repo_name: enflow/laravel-dashboard-slack-tile


text:
# electron-rollup-boilerplate

> Starting point for Electron app using Rollup to bundle and minify JS code. Also using SASS. Minimal dependencies.

## Features

- Windows build using [electron-builder](https://github.com/electron-userland/electron-builder)
- [Babel](https://babeljs.io) transpiler
- JS bundling using [rollup](https://rollupjs.org)
- [Dart Sass](https://github.com/sass/dart-sass) to bundle SASS files into single CSS
- [ESLint](https://eslint.org) config & .editorconfig

##Commands

### Installation

- `yarn install`

### Development - watch changes

- `yarn watch`

### Generate package directory

- `yarn pack`

### Create package for production

- `yarn package`

## What is not included

There is no testing library or framework included. Install your own according to personal preferences.

repository: OriginalSin/electron-rollup-boilerplate

repo_name: OriginalSin/electron-rollup-boilerplate


text:
[WIP]React SeriveWorkerSideRendering Example
=======================================

make ssr & offline-first friendly code.

Tech
---------------------------------------
:white_check_mark:WITH
✔ Webpack2
✔ Typescript2
✔ @types
✔ serviceworker
✔ react
✔ react-router

:x:WITHOUT
✖ ~~babel~~(only typescript2)
✖ ~~gulp~~ (only webpack2)
✖ ~~typings~~ (only @types)

Usage
---------------------------------------
`npm install`: setup
`npm run build`: build
`npm run dev`: watch and serve

Demo
--------------------------------------
* [simple counter](https://mkgaru.github.io/react-swsr-example/)

repository: MKGaru/react-swsr-example

repo_name: MKGaru/react-swsr-example


text:
#### Scripture

We believe that the sixty-six books of the King James Holy Bible constitute the perfectly preserved, inspired, and infallible Word of God to English speaking people. As such, we hold it to be the highest authority for our lives.

Furthermore, we believe that all Scripture is profitable to us today for doctrine, for reproof, for correction, and for instruction in righteousness.

* 2 Timothy 3:16
* 2 Peter 1:20-21
* Proverbs 30:5
* Hebrews 4:12

extension: markdown

gha_language: SCSS


text:
# Gigaupload: a simple file uploader

This is a simple file uploading utility similar to (but hopefully less shady than) megaupload. Hence the amazingly creative name.

This project was developed as an exercise to gather experience working with nodejs webapps.

# How to deploy

Check out gigaupload and run

```
npm run start
```

Then open `localhost:8080` in your browser.

If you wish to start with a different port (for example 3000), run:

```
PORT=3000 npm run start
```

repository: erikbonner/giga-upload

repo_name: erikbonner/giga-upload


text:
# tasker-toggl
A port of the Toggl API for [Tasker](https://play.google.com/store/apps/details?id=net.dinglisch.android.taskerm&hl=en). Each API action is a separate task.

## Setup
There are two ways to use tasker-toggl. Most actions use an API token (saved in the `%TOGGL_TOKEN` [global variable](http://tasker.dinglisch.net/userguide/en/variables.html)) as an authentication method, but that can be swapped out for using email and password (set as `%TOGGL_EMAIL` and `%TOGGL_PW`). The example action using email/password authentication is [this one](https://github.com/HHErebus/tasker-toggl/blob/v8/single%20actions/me/me%20-%20email%20and%20password.tsk.xml).

Some tasks (PUT, DELETE, and most POST endpoints) require [RESTask](https://play.google.com/store/apps/details?id=com.freehaha.restask&hl=en).

## Usage
Each task is a simple port of the Toggl API ([documentation](https://github.com/toggl/toggl_api_docs/blob/master/toggl_api.md)): tasks that require an input have `Variable Set` actions that you can fill in, tasks that return data assign that data to some variable, and as a general they check for `200` return codes or flash the error message to the screen.

To import tasks, tap at the Tasks tab. After selecting "Import", goto the folder where you have downloaded the Tasker XML files, and select any of them. Keep in mind that tasks must have the `.tsk.xml` extentions to be considered as such by Tasker.

That's it! You can now use the tasks you imported as you please.

## Contributing
See the [contribution guidelines](https://github.com/HHErebus/tasker-toggl/blob/v8/CONTRIBUTING.md). As a rule of thumb you're welcome to contribute anything, just make it easy for end-users if you can.

Cheers!

Christian

[![forthebadge](http://forthebadge.com/images/badges/built-for-android.svg)](http://forthebadge.com)[![forthebadge](http://forthebadge.com/images/badges/makes-people-smile.svg)](http://forthebadge.com)[![forthebadge](http://forthebadge.com/images/badges/you-didnt-ask-for-this.svg)](http://forthebadge.com)

repository: EquineOntology/tasker-toggl

repo_name: EquineOntology/tasker-toggl


text:
# 🔔 Section 3: Type Annotations

## 14. Type Annotations and Inference

### Definitions

**Type Annotations:** Code we add to tell TypeScript what type of value a variable will refer to (we devs tell TS the type)

**Type Inference:** TypeScript tries to figure out what type of value a variable refers to (TS guesses the type)

## 15. Annotations with Variables

- Refer to features/annotations/variables.ts

```ts
const apples: number = 5;
```

**CODE DECONSTRUCTION:** In the code snippet above, our type annotation is the `: number =` part of the variable declaration.

This tells TS that the variable `apples` will only ever have a value of a `number`.

Another example could be with built in objects (instance of a class):

```ts
// built in objects
let now: Date = new Date();
```

**CODE DECONSTRUCTION:** Here, we are defining a variable called `now` and we are telling TS that the variable is going to be of type `Date`. On the other side, we assign it an instance of a `Date` object.

## 16. Object Literal Annotations

- Refer to features/annotations/variables.ts

Let's take a look at an example of defining a type annotation for an Array:

```ts
// Array
let colors: string[] = ["red", "green", "blue"];
```

**CODE DECONSTRUCTION:** In the variable declaration above, it's important to note that the annotation (`string[]`) doesn't actually create an array. It just tells TS that the string will contain the value of an array.

We can see the same thing happen with other types of values:

```ts
let myNumbers: number[] = [1, 2, 3];
let truths: boolean[] = [true, true, false];
```

With **classes**, type annotations look like this:

```ts
// Classes
class Car {}
let car: Car = new Car();
```

**CODE DECONSTRUCTION:** Here, we are defining a class named `Car` and declaring a variable named `car` that that takes in a type of `Car` and creates an instance of class `Car`.

With **objects**, type annotations would look like this:

```ts
// Object Literal
let point: { x: number; y: number } = {
  x: 10,
  y: 20,
};
```

**CODE DECONSTRUCTION:** Here, we are defining an object named `point` that has two values, `x` and `y`. In the type annotation, we are telling TypeScript that the values of `x` and `y` can only ever be numbers, as evidenced above.

### 17. Annotations Around Functions

- Refer to features/annotations/variables.ts

**Example:**

```ts
// Function
const logNumber: (i: number) => void = (i: number) => {
  console.log(i);
};
```

**CODE DECONSTRUCTION:**

- We are declaring an arrow function called `logNumber` with the `const` keyword
- The portion of the arrow function on the left side of the equals sign and after the colon is the type annotation
- We are telling TS that the argument `i` will be of type `number`
- After that, we are telling TS that the output will result in `void`
- On the right-hand side of the equals sign is the actual argument of the function `logNumber,`i`, which in this case has been given a type of`number`
- After that, we are logging `i` (the function's argument), to the console

## 18. Understanding Inference

**Variable Declaration**: `const color =`
**Variable Initialization**: "red";

- If on the same line, TS can still decupher the Type of the variable

## When do we actually need Type annotations or Type inference?

**Inference:**: Always!
**Type annotations**: Jump to the next section =>

## 19. The 'Any' Type

- Refer to features/annotations/variables.ts

```ts
// When to use annotations
// 1) Function that returns the 'any' type
const json = '{"x": 10, "y": 20}';
const coordinates = JSON.parse(json);
console.log(coordinates); // {x: 10, y: 20};
```

- Here, we are defining a variable with `const` called `json` that contains a string
- The `coordinates` variable takes the string and parses it with `JSON.parse()`
- Then, we log `coordinates` to the console with the final line of code

**'Any' Type**: TypeScript has no clue what this is - can't check for correct property references

- **AVOID VARIABLES WITH 'ANY' AT ALL COSTS**
- TS cannot help us catch errors

## 20. Fixing the 'Any' Type

- Refer to features/annotations/variables.ts

- Add in type annotations to the `coordinates` declaration, as such:

```ts
const json = '{"x": 10, "y": 20}';
const coordinates: { x: number; y: number } = JSON.parse(json);
console.log(coordinates); // {x: 10, y: 20};
```

**CODE DECONSTRUCTION:**

- We added the code snippet `{ x: number; y: number }` to specify to TS the what type each parameter is going to have

## 21. Delayed Initialization

When we are declaring a value on one line and then calling it on another, this is known as `Delayed Initialization`. We can prevent the value from being of type 'Any' by using Type Annotation:

```ts
// 2) When we declare a variable on one line
// and initialize it later
let words = ["red", "green", "blue"];
let foundWord: boolean;

for (let i = 0; i < words.length; i++) {
  if (words[i] === "green") {
    foundWord = true;
  }
}
```

## 22. When Inference Doesn't Work

- Refer to features/annotations/variables.ts

In the following snippet:

```ts
// 3) Variable whose type cannot be inferred correctly
let numbers = [-10, -1, -12];
let numberAboveZero = false;

for (let i = 0; i < numbers.length; i++) {
  if (numbers[i] > 0) {
    numberAboveZero = numbers[i];
  }
}
```

**CODE DECONSTRUCTION**:

- We are defining two variables with `let`: `numbers` and `numberAboveZero`.
- Below, we are creating a for loop that checks if there is a number greater than 0 in the `numbers` array.
  The `if` statement inside of the for loop will return an error, as we are assigning `numberAboveZero` (currently just a boolean) to a number.
- We can fix this using type annotations and making the type of `numberAboveZero` both a `boolean` and a `number`, as such:

```ts
// 3) Variable whose type cannot be inferred correctly
let numbers = [-10, -1, -12];
let numberAboveZero: boolean | number = false;

for (let i = 0; i < numbers.length; i++) {
  if (numbers[i] > 0) {
    numberAboveZero = numbers[i];
  }
}
```

repository: filippo-fonseca/learning

repo_name: filippo-fonseca/learning


text:
# sinusbot-scripts
## Autoplaylist.js
This script plays random music from the catalog if nothing is playing/queued.

### Installation
Just copy the autoplaylist.js file to your sinusbot installation "scripts" folder and restart the program.

### Usage
1) Install the script and reboot the program;
2) Create a playlist named Autoplaylist and add songs to it. Only the
songs in this playlist are going to be played by this script;
3) Activate it on the Scripts GUI page;
4) Configure your preference for the starting mode when the instance starts (ON or OFF).
5) Configure your preference for the auto volume setting (one for songs from the catalog, another for external ones). Usually you should use both or none of these settings.

### New Commands
!autoplay - Starts the autoplay mode, in case it's off for any reason (initial configuration or disable by other commands);

### Modified Original Commands
!stop - Besides stopping the current song, it also disables the autoplay mode;
!!stop - Besides stopping the current song and clearing the idle queue, it also disables the autoplay mode.

### Attention Points
Please do not use this script together with the native "Play when idle"
feature. They are incompatible and things will break if you try it.

This is my first attempt at a script at my free time, so don't expect it
to be super stable. Tested only on SinusBot v1.0.0-beta.10-202ee4d with
the Discord backend.

repository: rtrind/sinusbot-scripts

repo_name: rtrind/sinusbot-scripts


text:
#Windows PC Setup(USB Dongle Required)

1. Power up tracking camera with the provided USB cable.
>Note : The light on bottom of the camera will be flashing once connected to a power source. When you mount the camera on a wall or on a tripod, it is recommended to make sure the tracking camera is sitting at your eye level.

1. Run `reg.bat` as **administrator** to setup dev environment.
>Note: It is necessary to make sure the file path of the `reg.bat` file doesn't contain any space, or it wouldn't run successfully. For simplicity, it is recommend to unzip the folder and put the folder under C drive root folder.

1. Connect head tracking blob to one of the USB ports on your PC.
>Note : The blue light on bottom of the tracking camera should start blinking in blue at this point.

1. At this point, you will only be able to get controller position data through tracking camera. To get controller button and IMU data, please follow the guide below:

    * Make sure both controllers are turned on.

    * Plugin CSR 4.0 USB module into one of your PC USB port.

    * Download CSR Drivers [here](https://github.com/Ximmerse/SDK/tree/master/Drivers/CSR%20Drivers) and install the driver that is compatible to your Windows operation system.

    * Run ``"XDeviceMonitor.exe"`` executable which can be downloaded [here](https://github.com/Ximmerse/SDK/blob/master/Tools/XDeviceMonitor/XDeviceMonitor.rar?raw=true)

    * Most of the time, once ``"XDeviceMonitor.exe"`` starts, it should try to automatically search and pair your controllers. However, if this doesn't auto-connect after a while, you can always RIGHT click on controller icon and select ``"Auto-Connect"``.

    * Once both controllers are connected, the LED on the controllers should turn blue, and the icons in ``"XDeviceMonitor.exe"`` application should turn green with BLE address displayed.

1. Your hardware is now ready to be used on your PC. If our Unity SDK is downloaded(which can be downloaded [here](https://github.com/Ximmerse/SDK/tree/master/Unity)) and imported, you can run ``"02 - Pick Cubes"`` sample scene and start moving around.

repository: nomagame/NOMA

repo_name: nomagame/NOMA


text:
# AudioKit Developer Resources

These are projects specifically designed for developers who are working on the
internals of AudioKit and are not only using AudioKit's framework for personal projects.

Reasons you might want to use these projects include:

* To develop a new DSP algorithm for eventual inclusion in AudioKit
* To fix a bug in AudioKit
* To extend AudioKit's functionality

## iOSDevelopment and macOSDevelopment

This project provides a small sample app that you can use to test code and/or access a development playground.

Use the iOS project if you need to target iOS on a real or simulated device. Use the macOS project if you need to target macOS or prefer the speed of working with your OS directly.

## Extending AudioKit (For both iOS and macOS)

An example of creating a node outside of AudioKit.

### Using the AudioKit Framework or Using AudioKit Source code directly

Inside the project folders for both OSes, you will find two xcodeproj files: one
that has AudioKit included as a framework, and one that uses AudioKit's source code as a subproject.
Using the AudioKit framework will give you fast compilation, but using AudioKit as a subproject will allow you to conveniently look into AudioKit's source code. Since you theoretically won't have to compile AudioKit more than once,
you should use the xcodeproj file that uses AudioKit as a subproject. If you find that Xcode
needs to compile AudioKit all the time, you may want to use the AudioKit framework. You can
always look at AudioKit's source code on Github or in an editor.

repository: LIFX/AudioKit

repo_name: LIFX/AudioKit


text:
# BlocHacks2018
Hackathon project for Blochacks2018

## Useful links:

* [Summary](#summary)
* [Demo](#demo)
* [Running your project](#run)

##  Summary:

As a team consisting of mostly 1st and 2nd generation immigrants, the refugee crisis happening in various regions across the globe is something we hold at heart. Compatriot allows users to create a direct relationship with individuals, groups and organizations of refugees to strengthen their personal bonds with them. Donors can create a Compatriot account to have access to full posts and stories and can send supportive messages and donate for causes of their choosing. Urgent community refugee cases will be written by representative volunteers and will be given priority on the main page. Refugees have the option of creating a page with their personal stories.

##  Demo:

### Landing page

The landing page is separated into 3 sections:
- Slogan and shortcuts: showcases our reasoning and purpose behind making the website.

![](/public/css/res/slogan.png?raw=true)

- "Most in Need" slideshow: features the cases that need the most attention.

![](/public/css/res/mostInNeed.png?raw=true)

- Stories: features all the stories based on date.

![](/public/css/res/stories.png?raw=true)

### Profile pages

There are 2 types of profiles:
- Donor: This profile is made to support refugees by either monetary donations or
by helping the case gain more popularity through the "support" function.

- Migrant: This profile is for migrants to display their stories and what they need help with.

Personal profile view:

![](/public/css/res/personalProfile.png?raw=true)

Non-Donor view:

![](/public/css/res/nonDonorView.png?raw=true)

Note: Both types of account can modify their profile pictures and posts.

### Login/SignUp

An interface for newcomers to join the community and for users to reconnect.

![](/public/css/res/signup.png?raw=true)

##  Running our project:

#### Dependencies:
* [Node.js v8+ (and npm)](https://nodejs.org/en/)
* [MongoDB](https://www.mongodb.com/)

#### Set-up:
Clone repository and `cd` into it.

Run the following:
```
$ mongod
```
And leave it open in its own terminal.

In another terminal, run:
```
$ npm install && npm start
```

In your browser, open [localhost:3005](localhost:3005)


text:
##### For example usage, see:
https://github.com/michael-ross-ven/vengeance_example/blob/main/vengeance_example/flux_example.py

https://github.com/michael-ross-ven/vengeance_example/blob/main/vengeance_example/excel_example.py

## Managing data stored as rows and columns shouldn't be complicated.

When given a list of lists in Python, your first instinct is to loop over rows and modify column values, in-place. It's the most
natural way to think about the data, because **conceptually, each row is some entity, and each column is a property of that row**,
much like a list of objects.

A headache when dealing with list of lists however, is having to keep track of columns by integer elements; it would be nice to
replace the indices on each row with named attributes, and have these applied even when the columns are not known ahead of time,
such as when pulling data from a sql table or csv file.

    for row in matrix:
        row[17]            # what's in that 18th column again?

    for row in matrix:
        row.customer_id    # oh, duh

### Doesn't the pandas DataFrame already already solve this?
In a DataFrame, data is taken out of its default nested list format and is organized in column-major order, which comes with some
advantages as well as drawbacks.

##### Row-Major Order:

        [['attribute_a', 'attribute_b', 'attribute_c'],
         ['a',           'b',           3.0],
         ['a',           'b',           3.0],
         ['a',           'b',           3.0]]

##### Column-Major Order:

        {'attribute_a': array(['a', 'a', 'a'], dtype='<U1'),
         'attribute_b': array(['b', 'b', 'b'], dtype='<U1'),
         'attribute_c': array([3.,   3.,  3.], dtype=float64)}

In column-major order, values in a single column are usually all of the same datatype, which means they can be packed into
consecutive addresses in memory as an actual array and iterated extremely quickly. But this speed comes at a cost: re-organizing the
data as it's intuitively understood by humans, **where each row is some entity, and each column is a property of that row**,
is agonizingly slow. (DataFrame.iterrows() and DataFrame.apply() incur a huge performance penalty, and can be 1_000x times
slower to iterate than Python's built-in list.)

DataFrames are also intended to make heavy use of 'vectorization', where operations can be broadcast and applied to an entire set
of values in parallel, performed as SIMD instructions at the microprocessor level. But again, this performance optimization comes
at a cost: the restricted use of explicit loops over a DataFrame requires pandas to provide specialized API methods for almost
every operation and modification, which all must be memorized by the developer. This often leads to convoluted syntax
that's counter-inituitive to write, and effortful to read, especially when method-chaining is overused.

    # wait, what exactly does this do again?
    df['column'] = np.sign(df.column.diff().fillna(0)).shift(-1).fillna(0) \
                     .apply(lambda x: (x['column'].head(1),
                                       x.shape[0],
                                       x['start'].iloc[-1] - x['start'].iloc[0]))

###### (see also ['So You Wanna Be a Pandas Expert? - James Powell'](https://youtu.be/pjq3QOxl9Ok) for how impenetrable this syntax can really get, *espcially* by less experienced developers)

##### DataFrame Advantages:
* vectorized operations on contiguous arrays are memory-efficient and *very* fast

##### DataFrame Disadvantages:
* syntax doesnt always drive intuition or conceptual understanding
* iteration by rows is effectively out of the question \
  ([and makes working with JSON format notoriously difficult](https://medium.com/bhavaniravi/whats-wrong-with-python-pandas-32ba5bb2b658))
* vectorized operations are harder to debug / inspect when they encounter an error
* unexpected loss of precision on numerical data

##### But I mean, why are we working in Python to begin with?
* emphasis on code readability
* datatypes are abstracted away
* hyper-optimized execution times are less of a priority

##### [So does the DataFrame really reinforce what makes Python so great?](https://en.wikipedia.org/wiki/Zen_of_Python)
>"Explicit is better than implicit" \
"Sparse is better than dense" \
"Readability counts" \
"There should be one– and preferably only one –obvious way to do it"
>

## vengeance.flux_cls
* similar idea behind a pandas DataFrame, but is more closely aligned with Python's design philosophy
* when you're willing to trade for a little bit of speed for a lot simplicity
* a pure-python, row-major wrapper class for list of list data
* applies named attributes to rows -- attribute values are mutable during iteration
* provides convenience aggregate operations (sort, filter, groupby, etc)
* excellent for extremely fast prototyping and data subjugation

###### row-major iteration

    # organized like csv data, attribute names are provided in first row
    matrix = [['attribute_a', 'attribute_b', 'attribute_c'],
              ['a',           'b',           3.0],
              ['a',           'b',           3.0],
              ['a',           'b',           3.0]]
    flux = vengeance.flux_cls(matrix)

    # row attributes can be accessed by name or by sequential index
    for row in flux:
        a = row.attribute_a
        a = row['attribute_a']
        a = row[-1]
        a = row.values[:-2]

        row.attribute_a    = None
        row['attribute_a'] = None
        row[-1]            = None
        row.values[:2]     = [None, None]

    # transformations are compositional and self-documenting
    for row in flux:
        row.hypotenuse = math.sqrt(row.side_a**2 +,
                                   row.side_b**2)

    matrix = list(flux.values())

###### columns
    column = flux['attribute_a']

    flux.rename_columns({'attribute_a': 'renamed_a',
                         'attribute_b': 'renamed_b'})
    flux.insert_columns((0, 'inserted_a'),
                        (2, 'inserted_b'))
    flux.delete_columns('inserted_a',
                        'inserted_b')

###### rows
    rows = [['c', 'd', 4.0],
            ['c', 'd', 4.0],
            ['c', 'd', 4.0]]

    flux.append_rows(rows)
    flux.insert_rows(5, rows)

    flux_c = flux_a + flux_b

###### sort / filter / apply
    flux.sort('attribute_c')
    flux.filter(lambda row: row.attribute_b != 'c')
    u = flux.unique('attribute_a', 'attribute_b')

    # apply functions like you'd normally do in Python: with comprehensions
    flux['attribute_new'] = [some_function(v) for v in flux['attribute_a']]

###### group / map rows
    matrix = [['year', 'month', 'random_float'],
              ['2000', '01',     random.uniform(0, 9)],
              ['2000', '02',     random.uniform(0, 9)],
              ['2001', '01',     random.uniform(0, 9)],
              ['2001', '01',     random.uniform(0, 9)],
              ['2001', '01',     random.uniform(0, 9)],
              ['2002', '01',     random.uniform(0, 9)]]
    flux = vengeance.flux_cls(matrix)

    dict_1   = flux.map_rows_append('year', 'month')
    countifs = {k: len(rows) for k, rows in dict_1.items()}
    sumifs   = {k: sum(row.random_float for row in rows)
                                        for k, rows in dict_1.items()}

    dict_2 = flux.map_rows_nested('year', 'month')
    rows_1 = dict_1[('2001', '01')]
    rows_2 = dict_2['2001']['01']

###### read / write files
    flux.to_csv('file.csv')
    flux = flux_cls.from_csv('file.csv')

    flux.to_json('file.json')
    flux = flux_cls.from_json('file.json')

    flux.to_file('file.pickle')
    flux = flux_cls.from_file('file.pickle')

## vengeance.lev_cls
* (description coming soon...)

repository: michael-ross-ven/vengeance

repo_name: michael-ross-ven/vengeance