text:
# MedVista: Web Application Portal

![NodeJS](https://img.shields.io/badge/nodejs-v10.6+-blue.svg) [![Build Status](https://travis-ci.org/anfederico/Clairvoyant.svg?branch=master)](https://travis-ci.org/anfederico/Clairvoyant) ![Contributions welcome](https://img.shields.io/badge/contributions-welcome-orange.svg) [![Live Demo](https://img.shields.io/badge/Live-Heroku-purple.svg)](https://medvista.herokuapp.com) [![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT)

MedVista is an Integrated Medical Platform tailored for the specific needs of the Doctors. Through this platform, they can efficiently access their patient information in real-time. Easy to track Appointments, Payments and Review Reports. Thus, Doctors can focus more on their job.

------

![Admin Preview](https://raw.githubusercontent.com/Lucifergene/MedVista/main/assets/medvista.png)

## Requirements

For development, you will only need Node.js installed in your environment.

### Node
- #### Node installation on Windows

  Just go on [official Node.js website](https://nodejs.org/) and download the installer.
Also, be sure to have `git` available in your PATH, `npm` might need it (You can find git [here](https://git-scm.com/)).

- #### Node installation on Ubuntu

  You can install nodejs and npm easily with apt install, just run the following commands.

      $ sudo apt install nodejs
      $ sudo apt install npm

- #### Other Operating Systems
  You can find more information about the installation on the [official Node.js website](https://nodejs.org/) and the [official NPM website](https://npmjs.org/).

If the installation was successful, you should be able to run the following command.

    $ node --version
    v8.11.3

    $ npm --version
    6.1.0

---

## Install

    $ git clone https://github.com/Lucifergene/MedVista
    $ cd MedVista
    $ npm install

## Running the project

    $ node app

Your app should now be running on [localhost:5000](http://localhost:5000/).

## Deploying to Heroku

```
heroku create
git push heroku main
heroku open
```

Alternatively, you can deploy your own copy of the app using the web-based flow:

[![Deploy to Heroku](https://www.herokucdn.com/deploy/button.png)](https://heroku.com/deploy)

---

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

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

repository: Lucifergene/MedVista

repo_name: Lucifergene/MedVista


text:
---
title: Robonomics DApp Overview
contributors: [Vourhey]
translated: false
---

You can operate with Robonomics Network using the interface of [Robonomics Network Dapp (decentralized application)](https://dapp.robonomics.network/#/). It is available in browsers with [Metamask extension](https://metamask.io). On the first page you will see the statistics of the network:

![Robonomics DApp's first page](../images/robonomics_dapp_first_page.jpg "Robonomics DApp's first page")

Let's have a look at the bottom table "Robonomics Telemetry".

Every time an instance of AIRA is launched it broadcasts a piece of information about itself. Usually it takes some time for the Dapp to receive data from an instance of AIRA.

Have a brief look at the page ["AIRA installation"](/docs/aira-installation) to understand where `IPNS` and `Address Eth` came from.

## IPNS

You can treat it as a unique identifier of your instance in IPFS network. Under that name AIRA publishes metadata about itself.

## Address Eth

By default AIRA generates new Ethereum address for you (it's [possible](/docs/aira-faq#how-to-change-ethereum-address-of-aira) to generate new one).

It's mainly used to sign all the outcoming messages.

## Lighthouse

In Robonomics Network an agent must choose a lighthouse to work on. By default it's `airalab.lighthouse.5.robonomics.eth`.

You can choose existing one or create your own on [Lighthouses](https://dapp.robonomics.network/#/lighthouse) page.

## Peers

The amount of IPFS pubsub [peers](/docs/aira-faq#how-to-check-the-quantity-of-ipfs-peers).

## Date

The date and time of last update

## Network

Robonomics Network officially works in Ethereum Mainnet.
There is also [Sidechain](https://github.com/airalab/airalab-sidechain) which is mostly for testing purpose.

repository: ValanisZz/robonomics-wiki

branch_name: refs/heads/master

extension: md

gha_language: Vue

license_type: permissive

repo_name: ValanisZz/robonomics-wiki


text:
# C# specific docs

## Student-facing docs

Student-facing documents are written to help explain a particular C# concept to a student when no appropriate online document can be found. They will be used when creating exercises and as references in exercise documentation.

The following student-facing documents have been written:

- [Assemblies][assemblies]
- [Code style][code_style]
- [Memory allocation][memory_allocation]

The following student-facing documents should be written:

- Difference between `static readonly` and `const`
- Naming conventions

[assemblies]: ../../../reference/tooling/dotnet-assemblies.md
[code_style]: ./code_style.md
[memory_allocation]: ./memory_allocation.md

license: MIT

gha_license_id: MIT


text:
# RxJS Playground

Simple RxJS playground for candidates assessment used by Roonyx.

Provides TypeScript, Jasmine and RxJS ready for development.

## Installation

Use the package manager [npm](https://www.npmjs.com/) to install dependencies:

```bash
npm install
```

## Usage

Put your own code into [playgound.ts](src/playground.ts) and tests into [playground.spec.ts](src/playground.spec.ts) files.

Modify these files as you want to.

To run tests use the following command:

```bash
npm run test:dev
```

After first run, tests will be launched again automatically when files changed.

## License
[MIT](LICENSE)

repository: roonyx-tech/rxjs-playground

repo_name: roonyx-tech/rxjs-playground


text:
# errors
Replacement for the official errors package in Go.
The official errors package does not allow for the error values to be defined as constants. This package fixes the problem while maintaining the API of the original package.

Inspiration: http://dave.cheney.net/2016/04/07/constant-errors

repository: noxer/errors

repo_name: noxer/errors


text:
#### Docker builder
* [![Docker Repository on Quay.io](https://quay.io/repository/rimusz/dbuilder/status "Docker Repository on Quay.io")](https://quay.io/repository/rimusz/dbuilder)

* Docker builder image based on phusion/baseimage:latest with built in SSH server to access via ssh and rsync to sync files.

* It uses host's docker.

* Check CoreOS fleet unit dbuldder.service to see how it works.

repository: rimusz/dockerfiles

repo_name: rimusz/dockerfiles


text:
# Google Route Map

## Features

* Custom code to find the route between source to destination in google map.

## License

The code is available under the [MIT license](LICENSE.txt).


text:
---
layout: post
title: Jenkins Automated Backup To AWS S3
description: Creating a Jenkins job to AWS S3
modified: 2016-08-08
category: articles
tags: [Jenkins, Automation, Cloud]
comments: true
share: true
featured: true
---

# Why backup build jobs?

I'm running a containerized Jenkins instance for my CI jobs and wanted an easy
way to ensure my build configs would persist even if something happened to my
Jenkins container.

## My options

I could have used a Docker volume, or created a custom AMI,
or even created an AWS volume from my AMI that could be mounted on any other AMI.

## Why didn't I do these things?

None of the above options made sense.  Had I used a Docker volume I would have had
to persist that volume somewhere, creating additional overhead.

If I chose to create a custom AMI that contained my configs then anytime I
updated my CI configurations I would have had to build a new AMI...doesn't
help me move faster.

What about creating a Volume in EC2?  Same problem, any time I update something
in Jenkins I would have to create a new volume.

# The Solution

I created a Jenkins job that runs daily.  This job tar's and gzip's my configs
and uploads it to an S3 bucket (The job requires the Jenkins S3 plugin).  Builds
are versioned and maintained in a persisted state.

## Build Job (shell)

<script src="https://gist.github.com/jamesbyars/31266615b9560399bbb54014c67b75c6.js"></script>

Please note: I referenced http://www.clausconrad.com/blog/backup-jenkins-configuration-to-s3
while creating this script.

gha_language: SCSS


text:
---

copyright:
  years: 2016
lastupdated: "2016-12-02"

---
{:new_window: target="_blank"}
{:shortdesc: .shortdesc}
{:screen: .screen}
{:codeblock: .codeblock}
{:pre: .pre}

# End-to-end tutorial of the Cloudant Sync Code Starter
{: #tutorial}

The following end-to-end tutorial walks through the steps to create a project from the Cloudant Sync Code Starter, including the tools that you must have installed, and subsequently, the steps to run the starter in Android Studio.

### Installing developer tools
{: #dev_tools}

Ensure that you have installed the [prerequisite developer tools](get_code.html#prereq-dev-tools){: new_window}.

### Creating a project from the Cloudant Sync Code Starter
{: #create_project}

1. Create a Mobile dashboard project in {{site.data.keyword.Bluemix}}.

   1. From the **Getting Started** page in the Mobile dashboard, click **Create Project**.

      You can alternatively click **Create Project** from the **Projects** page.

   2. Click **Code Starters**.

   3. Select **Cloudant Sync** and click **Create Project**.

   4. Enter your project name. For this tutorial, use `CloudantSyncProject`.

   5. Click **Create**.

2. Add the Data capability. You can create a new {{site.data.keyword.cloudant}} service instance or add an existing service instance.

   1. Click **View** on the **Data** tile on the **Project Overview** page.

      You can alternatively click **Create** or **Add Existing**, and then **Cloudant NoSQL DB** on the **Data** page.

   2. Optional: If you chose to create a new service instance, enter your service name and click **Create**.

   3. Optional: If you chose to add an existing service instance, select your service instance from the list and click **Add Existing**.

   4. Click the **Menu** icon in your service tile and select **Launch...** to launch your service instance.

      1. Click **LAUNCH** to launch your {{site.data.keyword.cloudant}} console.

      2. Click **Create Database**, enter your database name, and click **Create**.

      3. Click the **+** icon next to **All Documents** to add documents.

3. Optional: Add the {{site.data.keyword.mobilepushshort}} capability.

   1. Click **Add** for **{{site.data.keyword.mobilepushshort}}** in the **Project Overview** page.

      You can alternatively click **Create** from the **{{site.data.keyword.mobilepushshort}}** page.

   2. Enter your service name and click **Create**.

   3. For Android, [configure Firebase Cloud Messaging](/docs/services/mobilepush/t_push_provider_android.html){: new_window}.

4. Optional: Add the Analytics capability.

   1. Click **Add** for **Analytics** in the **Project Overview** page.

      You can alternatively click **Create** from the **Analytics** page.

   2. Enter your service name and click **Create**.

   3.  See [Getting started with {{site.data.keyword.mobileanalytics_short}}](/docs/services/mobileanalytics/index.html){: new_window} for more information about configuring Analytics.

5. Optional: Add the Authentication capability.

   1. Click **Add** for **Authentication** on the **Project Overview** page.

      You can alternatively select **Create** on the **Authentication** page.

   2. Enter your service name and click **Create**.

   3. Toggle on **Authentication**.

   4. Select your identity provider and enter the required information to configure it. You can enable only one identity provider.

   5. See [Getting started with {{site.data.keyword.amashort}}](/docs/services/mobileaccess/index.html){: new_window} for more information about configuring Authentication.

6. Generate your project code.

   1. Click **Get Code** on the **Project Overview** page to select your platform and language.

      You can alternatively click on the **Code** page.

   2. For Android, click **Android**.

   3. When the project code is finished generating, click **Download Code** to download your project archive.

### Running your Android project in Android Studio
{: #run_android}

1. Extract the `CloudantSyncProject-Android.zip` file.

2. Open the `README.md` file in a Markdown viewer to configure your project.

   1. Open your `CloudantSyncProject-Android` project in Android Studio.

   2. Add your Cloudant credentials.

      1. From the **Data** page, click the **Menu** icon in your service tile and select **Launch...** to launch your service instance.

         1. Click **LAUNCH** to launch your {{site.data.keyword.cloudant}} console.

         2. Click your database name, and click **Permissions**.

         3. Enter your database name in the `cloudant_dbname` string in the `res/values/cloudant_credentials.xml` file.

         4. Click **Generate API Key**.

             1. Copy the **Key** value and paste the value into the `cloudant_api_key` string in the `res/values/cloudant_credentials.xml` file.

             2. Copy the **Password** value and paste the value into the `cloudant_api_password` string in the `res/values/cloudant_credentials.xml` file.

             3. Select the **_admin** permission.

3. Run your app.

## What to do next
{: #what_next}

View other tutorials.

### UI Starter tutorials
{: #tutorials_UI}

* [Tutorial - Store Catalog](tutorial_store_catalog.html)

### Code Starter tutorials
{: #tutorials_Code}

* [Tutorial - Basic](tutorial.html)
* [Tutorial - {{site.data.keyword.openwhisk_short}}](tutorial_openwhisk.html)
* [Tutorial - {{site.data.keyword.visualrecognitionshort}}](tutorial_visual_recognition.html)
* [Tutorial - Watson Language](tutorial_watson_language.html)
* [Tutorial - Weather](tutorial_weather.html)

repository: hrhrprasath/docs

repo_name: hrhrprasath/docs


text:
### DNA extraction and sequencing data pre-processing

Genomic DNA extractions were performed on a KingFisher Flex magnetic particle processor robot (Thermo Scientific) using
a NucleoMag® 96 Plant kit (Macherey-Nagel Gmbh & Co.). A volume of 150 μl was used for elution. DNA concentrations were
measured on a Dropsense (TRINEAN NV) using a DropPlate 96-S. Based on these measurements, the DNA’s of the same
phenotype (_EF_, _IF_, _LF_ and _NF_) were equimolarly pooled to create four DNA samples for HiSeq sequencing.
<!-- add group-4 high coverage genome? -->
The bulks were sequenced on the Illumina HiSeq X platform resulting in a raw coverage, calculated as
the total number of read bases divided by the size of the reference genome [approx. 488Mbp; @Parkin:2014], in the
range of 111x-123x per bulk, i.e. approximately 10x per individual. We used the BWA-MEM [@Li:2013] and SAMtools
[@Li:2009] toolchain to map the reads for each bulk against the _Brassica oleracea_ TO1000 reference genome v2.1 of
EnsemblPlants release 39, which we had filtered so that we mapped against chromosomes only. We retained most of the
estimated raw coverage in the assemblies, yielding an average mapped coverage in the range of 99x-108x. We then
used GATK HaplotypeCaller [@McKenna:2010; @Depristo:2011] for variant (i.e. SNP and indel) calling, yielding the
results summarized in Table 1.

| Phenotype | Bulk size | Total read bases (bp) | Total reads | GC(%) | Q20(%) | Q30(%) | Coverage a, b | Variants   |
|-----------|-----------|-----------------------|-------------|-------|--------|--------|---------------|------------|
| _EF_      | 11        | 60,303,831,724        | 399,363,124 | 36.93 | 95.02  | 89.25  | 123, 108      | 40,224,519 |
| _IF_      | 8         | 56,804,209,216        | 376,186,816 | 36.92 | 94.84  | 88.94  | 116, 103      | 43,785,856 |
| _LF_      | 11        | 54,587,863,530        | 361,509,030 | 37.14 | 96.00  | 91.34  | 112, 100      | 42,852,937 |
| _NF_      | 9         | 54,296,890,456        | 359,582,056 | 37.13 | 96.84  | 92.81  | 111, 99       | 42,213,427 |

_Table 1. Summary results of the sequencing of bulks of early (_EF_), intermediate (_IF_), late (_LF_) and
"non" flowering (_NF_, actually not flowering at time of DNA extraction) phenotypes. Bulk size refers to the
number of individuals pooled for that phenotype. Coverage is given as a) total read bases divided by reference
genome size; and b) average mapped coverage._

> #### Supplementary info
> **Reference data** - The processed reference genome (sans scaffolds; chromosomes only) is available from the main
> data submission of this study, deposited at Zenodo as [10.5281/zenodo.3402201](http://doi.org/10.5281/zenodo.3402201).
> The processed FASTA file, and the annotation (in GFF3 format), are contained within the [reference.zip](reference.zip)
> archive, and should be stored locally as:
> - `${DATA}/reference/Brassica_oleracea.v2.1.dna.toplevel.chromosomes.fa` - FASTA
> - `${DATA}/reference/Brassica_oleracea.v2.1.39.chr.gff3.gz` - GFF3
>
> **Short read data mapping** - Reference mapping was automated with [bwa.sh](../script/bwa.sh). Input files are
> deposited at the SRA as project [PRJNA564368](https://www.ncbi.nlm.nih.gov/bioproject/PRJNA564368),
> containing the BioSamples `group-1-EF`, `group-2-IF`, `group-3-LF`, and `group-5-NF`. These should be placed in a
> local folder structure as follows:
> - `${DATA}/BSA/${SAMPLE}/${SAMPLE}_R1.fastq.gz` - Paired end 1, FASTQ
> - `${DATA}/BSA/${SAMPLE}/${SAMPLE}_R2.fastq.gz` - Paired end 2, FASTQ
>
> **[Genome alignments and variant calls]** SNP calling was automated with [snp.sh](../script/snp.sh). The resulting
> alignments (sorted BAM files) and variants (compressed VCF files) are  available from Zenodo under the following
> locations:
> - EF [10.5281/zenodo.3401590](http://doi.org/10.5281/zenodo.3401590)
> - IF [10.5281/zenodo.3401703](http://doi.org/10.5281/zenodo.3401703)
> - LF [10.5281/zenodo.3401731](http://doi.org/10.5281/zenodo.3401731)
> - NF [10.5281/zenodo.3402013](http://doi.org/10.5281/zenodo.3402013)
>
> In each case, the files in these Zenodo submissions should be organized locally as:
> - `${DATA}/BSA/${SAMPLE}/${SAMPLE}_pe.sorted.bam` - Genome alignment, BAM
> - `${DATA}/BSA/${SAMPLE}/${SAMPLE}_pe.sorted.bam.RG.vcf.gz` - Variant call file, VCF

url: https://raw.githubusercontent.com/Manigben/brassica-snps/4e0096fba4358794fa8c9d2034ec4afa43a33b75/doc/4.2 Methods - DNA extraction and sequencing.md

repository: Manigben/brassica-snps

repo_name: Manigben/brassica-snps


text:
ttt
===

This project functions both as a way to familiarize myself with git and as a fast solver for the following problem:

> How many unique tic tac toe games exist, excluding rotations and symmetries?

A more detailed look at this problem may be found [here][1]

Compiling currently requires support for c++11 and POSIX threads (Linux).

```bash
git clone https://github.com/rfordyce/ttt.git
cd ./ttt
make
./m_ttt
```

Stage 1 - Initial Program
---

Initially the program used no threading and simply solved the problem.

Stage 2 - OpenMP Multithreading
---

Next I added OpenMP's parallel for pragma (simply insert prior to for loops!)

```c++
#pragma omp parallel for
```

```bash
g++ ttt.cpp -fopemp -o omp_ttt
```

While this greatly improved runtime, it did not equally balance the load.  A new thread would be created for each processor of the computer and the 255168 games divided evenly amongst the threads.

If 6 threads are created, they split as follows:

1. Games 0 through 42527
2. Games 42528 through 85055
3. Games 85056 through 127583
4. Games 127584 through 170111
5. Games 170112 through 212639
6. Games 212640 through 255167

Due to the nature of my solution, each game is checked against each game preceding it - therefore the higher the game index, the more games to be checked.

Stage 3 - Threading
---

CURRENT STAGE!

The program should evenly divide the reduction between the threads by starting each for loop at one-off the next and changing the increment to the number of threads.

Stage 4 - Cleanup/Final
---

I intend to

1. Make threading optional such that it can be compiled with different standards.
2. Make the program compile under different operating systems.
3. Test the difference in runtimes between versions and provide the results here.

[1]: http://www.se16.info/hgb/tictactoe.htm

repository: rfordyce/ttt

repo_name: rfordyce/ttt


text:
---
title: NBC,  a not-so-naive Bayes Classifier
published: true
---

## Historical Note

Update: this code was wrtitten in 2004 and since then much has changed. Support Vector Machines, Tensor Flow, Hadoop, Spark, massive
text mining, etc etc.
But some conclusions stay. Even though the following conclusions seem olde worlde, Naive Bayes continues to have a niche. See

- Rennie, Jason D., et al. [Tackling the poor assumptions of naive bayes text classifiers](http://www.aaai.org/Papers/ICML/2003/ICML03-081.pdf)
  Proceedings of the 20th International Conference on Machine Learning (ICML-03). 2003.
- And all its [citations](https://goo.gl/Um1SAs)

## Synopsis

     ./nbc -[hlx] train test

## Description

Is less more? Can a few lines of gawk developed in a day or two stand in
for a sophisticated state-of-the-art JAVA package? In the general case
there may be software engineering advantages to working with rich
languages like JAVA. However, in the specific case of a Naive Bayes
classifier for discrete data, it is interesting to test if less is
indeed more.

A Naive Bayes classifier collects frequency counts of old events,
grouped into "classes". Then, if a new event arrives without a
classification, it checks through the old list of classes looking for
the one with the highest frequency counts for this new event.

The method is called "naive" This assumption allows us to collect
frequency counts just on each attribute value (and not pairs, or
triples, or quads of values).

In practice, this "naive" strategy works remarkably well- often performs
as well as other schemes that try to model interactions between
frequencies.

Hence, we call this system a not-so-naive Bayes Classifier.

### Summary of Results

In summary, the performance on this simple gawk-based Naive Bayes
classifier is quite remarkable.

-   Not surprisingly, nbc.awk's accuracy are very similar to a standard
    bayes classifier (from the WEKA system). That is, this
    implementation is *adequate*.
-   Quite surprisingly, the awk version does not run much slower than
    java. In fact, for under 1000 instances, this implementation is
    comparatively *fast or faster* than a much more mature JAVA-based
    tool.

### Details: Accuracy

The following table compares classification accuracies between nbc.awk
and WEKA's weka.classifiers.NaiveBayes.

All the data sets were discrete so no kernel estimation was used.

Results come from a 10-way cross-val (but no initial randomization of
data set order).

The table is sorted by increase mean difference. Nbc.awk does better
than WEKA Bayes on the datasets shown at the bottom of the table.

                    mean                significant
                    difference   std.   difference?
          data      in accuracy  dev.   (alpha=0.01)
     -----------------------------------------------
            soybean | -3.02 |   2.02 |  y
               iris | -2.14 |   4.51 |  n
                zoo | -0.38 |   6.54 |  n
      primary-tumor | -0.30 |   3.28 |  n
          audiology | -0.27 |   2.67 |  n
           mushroom | -0.25 |   0.23 |  n
             splice |  0.00 |   0.00 |  n
           kr-vs-kp |  0.00 |   0.00 |  n
      breast-cancer |  0.00 |   0.00 |  n
     contact-lenses |  0.00 |   0.00 |  n
               vote |  0.27 |   1.47 |  n
              lymph |  0.73 |   5.01 |  n
           breast-w |  1.63 |   1.32 |  y
           credit-a |  7.40 |   5.60 |  y
             letter |  9.44 |   1.40 |  y

On the whole, nbc.awk works as well as WEKA Bayes.

### Details: Runtimes

The following table compares the runtimes of nbc.awk (awk) vs WEKA BAYES
(java) measured in seconds.

Each lines show total times for ten training+test runs (one for each
item in the cross val). E.g. letter actually ran in time 4.92 seconds
(on average) and this was called 10 times.

Note: the time for dividing files for the x-val is not shown.

The table is sorted on the ratio of awk vs java runtimes. Ratios less
than one mean awk ran faster than java. Sampler.awk does better than
Weka Bayes on the datasets shown at the bottom of the table (below the
middle line).

                     runtimes (secs) |
                    -----------------|---------------------
               data  awk   java ratio| insts  attrs classes
     --------------------------------|---------------------
             letter  49.2  17.6  2.8  20,000   17      27
           mushroom  10.1   5.9  1.7   8,124   23       3
           kr-vs-kp   8.1   5.1  1.6   3,916   37       3
             splice  11.3   7.8  1.4   3,190   62       4
            soybean   4.2   3.4  1.2     683   36      20
     ------------------------------------------------------
          audiology   2.9   3.4  0.9     226   70      25
      primary-tumor   1.3   2.8  0.5     339   18      23
               vote   1.0   2.4  0.4     435   17       3
     contact-lenses   0.6   2.0  0.3      24    5       4
      breast-cancer   0.7   2.4  0.3     286   10       3
           credit-a   1.1   3.3  0.3     690   16       3
           breast-w   1.0   3.5  0.3     699   10       3
              lymph   0.6   2.4  0.2     148   19       5
               iris   0.5   2.5  0.2     150    5       4
                zoo   0.6   2.4  0.2     101   18       8
     ------------------------------------------------------
              total  93.1  66.8  1.4

All up, the awk-based learner was 40% slower than the JAVA. For larger
data sets, JAVA was always faster. However, for smaller datasets (under
1000 instances) the awk version was nearly as fast or faster. []{#7}

### Details: Memory

We have run this small Awk script on 100s of megabytes of data, without
crashes or core dumps. The code is very memory effecient- unlike the
WEKA which loads all the data into RAM. []{#8}

### Discussion

It is hardly surprising that a state-of-the-art tool kit built and
optimized by JAVA gurus can out-perform awk code on large examples.
However, what is surprising is that an 32 line AWK script built and
debugged in a weekend often works nearly as well, or better.

Perhaps "nbc" is not-so-naive after all. []{#9}

Options
-------

 -x
:   run an example

 -h
:   print help text

 -l
:   print legal notice

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

To check the download, unzip the contents.zip then

     chmod +x nbc
     ./nbc nbceg.train nbceg.test  |
     gawk -F, '{print $0  "\t " ($1 !=$2 ? " <== bad" : "")}'

This should print:

     malign_lymph,  malign_lymph
     metastases,    metastases
     malign_lymph,  malign_lymph
     metastases,    metastases
     malign_lymph,  metastases   <== bad
     malign_lymph,  malign_lymph
     malign_lymph,  malign_lymph
     metastases,    metastases
     metastases,    metastases
     metastases,    metastases
     malign_lymph,  malign_lymph
     metastases,    metastases
     malign_lymph,  malign_lymph

The accuracy of the above outputis correct/total = 11/12 = 92%

## Awk code

Here is the nbc.awk code called by the Bash script (shown below).

     BEGIN {
      #Internal globals:
         Total=0    # count of all instances
       # Classes    # table of class names/frequencies
       # Freg       # table of counters for values in attributes in classes
       # Seen       # table of counters for values in attributes
       # Attributes # table of number of values per attribute
       }

     Pass==1 {train()}
     Pass==2 {print $NF "," classify()}

Note this code be fully incremental, as follows

- wait for at least 20 instances before classifying
- meanwhile, train on all incoming data
- and always update training data AFTER classification

     # NR > 20  {print $NF "," classify()}
     #          {train()}

Enoguh fun. Back to the real work.

     function train(    i,c) {
       Total++;
       c=$NF;
       Classes[c]++;
       for(i=1;i<=NF;i++) {
         if ($i=="?") continue;
         Freq[c,i,$i]++
         if (++Seen[i,$i]==1) Attributes[i]++}
     }

     function classify(         i,temp,what,like,c) {
       like = -100000; # smaller than any log
       for(c in Classes) {
         temp=log(Classes[c]/Total); #uses logs to stop numeric errors
         for(i=1;i<NF;i++) {
           if ( $i=="?" ) continue;
           temp += log((Freq[c,i,$i]+1)/(Classes[c]+Attributes[i]));
         };
         if ( temp >= like ) {like = temp; what=c}
       };
       return what;
     }

In the above, there are some `magic numbers` added in to handle low frequency cases

- `1` used in `temp +=`
- Added `Classes[c]` in the denominator

For more nuances magic numbers, see lines 120 and 125 of [this code](https://github.com/timm/lawker/blob/master/block/timm/evil/write/lib/app/nb/nb.awk)

## Bash Code

### Copyright

    copyleft() { cat<<EOF
    nbc: a naive bayes classifier
    Copyright (C) 2004 Tim Menzies

    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
    as published by the Free Software Foundation, version 2.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
    EOF
    }

### Usage

     usage() { cat<<-EOF
        Usage: nbc  [FLAGs] TRAIN TEST
        Naive bayes classifier.

        TRAIN and TEST are comma-separated data files with the same
        number of columns. The last column of each is the class
        symbol. This classifier learns from TRAIN and then tries
        to classify the examples in TEST.

        Flags:
          -h        print this help text
          -l        copyright notice
          -x        run an example
        EOF
        exit
     }

### Demo code

     nbcDemo() {
        main nbceg.train nbceg.test
     }

## Main

     main() {
        gawk -F, -f nbc.awk Pass=1 $1 Pass=2 $2
     }

### Command-line Processing

     demo=""
     while getopts "hlx" flag
     do case "$flag" in
            l)  copyleft; exit;;
            h)  usage; exit ;;
            x)  demo="nbcDemo";;
        esac
     done
     shift $(($OPTIND - 1))
     if [ -n "$demo" ]
     then $demo
          exit
     else  main $1 $2
     fi

## Author

Tim Menzies


text:
# aaronwest.github.io

A simple website using [Jekyll](http://jekyllrb.com) + [GitHub Pages](https://pages.github.com). Designed to function as a basic engineering notebook to jot down thoughts and ideas.

To view the website visit [notebook.aaronwest.net](http://notebook.aaronwest.net).

gha_language: CSS


text:
# Infrared beacon

```cards
sensors.remoteButtonCenter.onEvent(ButtonEvent.Pressed, function () {})
sensors.remoteButtonCenter.pauseUntil(ButtonEvent.Pressed);
sensors.remoteButtonCenter.isPressed()
sensors.remoteButtonCenter.wasPressed()
sensors.infrared1.setRemoteChannel(null)
```

## See also

[on event](/reference/sensors/beacon/on-event),
[pause until](/reference/sensors/beacon/pause-until),
[is pressed](/reference/sensors/beacon/is-pressed)
[was pressed](/reference/sensors/beacon/was-pressed)
[set remote channel](/reference/sensors/beacon/set-remote-channel)

gha_license_id: NOASSERTION


text:
# White-box and black-box models

Explainer algorithms can be categorised in many ways (see [this
table](algorithms.md#model-explanations)), but perhaps the most
fundamental one is whether they work with **white-box** or **black-box**
models.

**White-box** is a term used for any model that the explainer method can
“look inside” and manipulate arbitrarily. In the context of `alibi`
this category of models corresponds to Python objects that represent
models, for example instances of `sklearn.base.BaseEstimator`,
`tensorflow.keras.Model`, `torch.nn.Module` etc. The exact type of
the white-box model in question enables different white-box explainer
methods. For example, `tensorflow` and `torch` models are
*gradient-based* which enables *gradient-based* explainer methods such
as [Integrated Gradients](../methods/IntegratedGradients.ipynb)  [^id4]
whilst various types of tree-based models are supported by
[TreeShap](../methods/TreeSHAP.ipynb).

On the other hand, a **black-box** model describes any model that the
explainer method may not inspect and modify arbitrarily. The only
interaction with the model is via calling its `predict` function (or
similar) on data and receiving predictions back. In the context of
`alibi` black-box models have a concrete definition—they are functions
that take in a `numpy` array representing data and return a `numpy`
array representing a prediction. Using [type
hints](https://docs.python.org/3/library/typing.html) we can define a
general black-box model (also referred to as a *prediction function*) to
be of type `Callable[[np.ndarray], np.ndarray]` [^id5]. Explainers
that expect black-box models as input are very flexible as *any* type of
function that conforms to the expected type can be explained by
black-box explainers.

```{note}
In addition to the expected type, black-box models **must** be
compatible with batch prediction. I.e. `alibi` explainers assume
that the first dimension of the input array is always batch.
```

```{warning}
There is currently one exception to the black-box interface: the
`AnchorText` explainer expects the prediction function to be of
type `Callable[[List[str], np.ndarray]`, i.e. the model is expected
to work on batches of raw text (here `List[str]` indicates a batch
of text strings). See [this
example](../examples/anchor_text_movie.ipynb) for more
information.
```

## Wrapping white-box models into black-box models

Models in Python all start out as white-box models (i.e. custom Python
objects from some modelling library like `sklearn` or `tensorflow`).
However, to be used with explainers that expect a black-box prediction
function, the user has to define a prediction function that conforms to
the black-box definition given above. Here we give a few common examples
and some pointers about creating a black-box prediction function from a
white-box model. In what follows we distinguish between the original
white-box `model` and the wrapped black-box `predictor` function.

### Scikit-learn models

All `sklearn` models expose a `predict` method that already conforms
to the black-box function interface defined above which makes it easy to
create black-box predictors:

```python
predictor = model.predict
explainer = SomeExplainer(predictor, **kwargs)
```

In some cases for classifiers it may be more appropriate to expose the
`predict_proba` or `decision_function` method instead of
`predict`, see an example on [ALE for
classifiers](../examples/ale_classification.ipynb).

### Tensorflow models

Tensorflow models (specifically instances of `tensorflow.keras.Model`)
expose a `predict` method that takes in `numpy` arrays and returns
predictions as `numpy` arrays [^id6]:

```python
predictor = model.predict
explainer = SomeExplainer(predictor), **kwargs)
```

### Pytorch models

Pytorch models (specifically instances of `torch.nn.Module`) expect
and return instances of `torch.Tensor` from the `forward` method,
thus we need to do a bit more work to define the `predictor` black-box
function:

```python
model.eval()

@torch.no_grad()
def predictor(X: np.ndarray) -> np.ndarray:
    X = torch.as_tensor(X, dtype=dtype, device=device)
    return model.forward(X).cpu().numpy()
```

Note that there are a few differences with `tensorflow` models:

- Ensure the model is in the evaluation mode (i.e., `model.eval()`) and that the mode does not change to training (i.e., `model.train()`) between consecutive calls to the explainer. Otherwise consider including `model.eval()` inside the `predictor` function.
- Decorate the `predictor` with `@torch.no_grad()` to avoid the computation and storage of the gradients which are not needed.
- Explicit conversion to a tensor with a specific `dtype`. Whilst
`tensorflow` handles this internally when `predict` is called, for
`torch` we need to do this manually.
- Explicit device selection for the tensor. This is an important step as `numpy` arrays are limited to
cpu and if your model is on a gpu it will expect its input tensors to be
on a gpu.
- Explicit conversion of prediction tensor to `numpy`. We first send the output to the cpu and then transform into `numpy` array.

If you are using [Pytorch Lightning](https://www.pytorchlightning.ai)
to create `torch` models, then the `dtype` and `device` can be
retrieved as attributes of your `LightningModule`, see
[here](https://pytorch-lightning.readthedocs.io/en/stable/common/lightning_module.html).

### General models

Given the above examples, the pattern for defining a black-box predictor
from a white-box model is clear: define a `predictor` function that
manipulates the inputs to and outputs from the underlying model in a way
that conforms to the black-box model interface `alibi` expects:

```python
def predictor(X: np.ndarray) -> np.ndarray:
    inp = transform_input(X)
    output = model(inp) # or call the model-specific prediction method
    output = transform_output(output)
    return output

explainer = SomeExplainer(predictor, **kwargs)
```

Here `transform_input` and `transform_output` are general
user-defined functions that appropriately transform the input `numpy`
arrays in a format that the model expects and transform the output
predictions into a `numpy` array so that `predictor` is an `alibi`
compatible black-box function.

[^id4]: At the time of writing `IntegratedGradients` only supports
    `tensorflow` models.

[^id5]: Note that this definition limits black-box models to be
    *single-input* and *single-output* which are what most black-box
    `alibi` explainers can handle. In the general case the definition
    can be extended to *multi-input* and *multi-output* models,
    i.e. taking in and/or returning multiple arrays.

[^id6]: This is in contrast to the `__call__` and `call` methods which
    expect and return `tensorflow.Tensor` objects. However, using
    `__call__` may be preferable for performance in [some
    cases](https://www.tensorflow.org/api_docs/python/tf/keras/Model#predict)
    (this would require transforming inputs and outputs similar to the
    `torch` example).

repository: SeldonIO/alibi

gha_language: Python

repo_name: SeldonIO/alibi


text:
# xilinx-reports Jenkins plugin

Jenkins Plugin for various reporting that would be useful for an FPGA project.

Vivado Infos are reported separately from Warnings/Errors to reduce noise in the warnings plot.
Info parsing is provided to see extreme trends that indicate a problem (often a sudden decrease
in the number of messages).

Example for plotting BRAM, Slice and DSP utilization in a pipeline:
```
node {
    stage('Publish'){
        xilinxUtilization([
            xilinxParser(
                report: 'utilization.rpt', parserTitle: 'Utilization', parserUniqueName: 'xilinx-utilization',
                graphConfiguration: [
                    [graphCaption: 'BRAMs', graphDataList: 'Block_RAM_Tile'],
                    [graphCaption: 'Slices', graphDataList: 'Slice_LUTs,Slice_Registers,LUT_Flip_Flop_Pairs'],
                    [graphCaption: 'DSPs', graphDataList: 'DSPs']]
            )
        ])
    }
}
```

Same Example in JobDSL:
```
publishers {
  xilinxUtilization {
    reportName '**/utilization.rpt'
    graph {
      graphCaption  'DSPs'
      graphDataList 'DSPs'
    }
    graph {
      graphCaption  'BRAM'
      graphDataList 'Block_RAM_Tile'
    }
    graph {
      graphCaption  'Slices'
      graphDataList 'Slice_LUTs,Slice_Registers,LUT_Flip_Flop_Pairs'
    }
  }
}
```

Example for reporting vivado warnings:
```
node
{
    stage('publish')
    {
        recordIssues tools: [[$class: 'VivadoWarningsTool', pattern: 'vivado.log']],
            filters: [
                excludeFile('.*/prj/vivado/.*\.srcs/sources_1/ip/.*'),
                excludeType('Synth 8-6014')
            ]
    }
}
```

repository: derrickgw/xilinx-reports-plugin

gha_language: Java

repo_name: derrickgw/xilinx-reports-plugin


text:
#### Task

You draw **2** cards from a standard **52**-card deck without replacing them. What is the probability that both cards
are of the same suit?

___

#### Answer: _12/51_

---

> (1) Initially you have 52 cards, 13 * 4 (4 suites). There are 13 ways to select a color card out of 52.
>
> (2) Then again if you pick one more card, there are 12 remaining of the same color, out of total 51 remaining cards.
>
> No. of ways to select 2 cards = (1) * (2) = 13/52 * 12/51 = 3/51.
>
> This is for 1 color, as there are 4 colors, total = 4 * 3/51 = **12/51**.
>
> ---  _by **dextraso**_

url: https://raw.githubusercontent.com/HBinhCT/Q-project/19923cbaa3c83c670527899ece5c3ad31bcebe65/hackerrank/10 Days of Statistics/Day 3 - Cards of the Same Suit/solution.md

repository: HBinhCT/Q-project

repo_name: HBinhCT/Q-project


text:
---
layout: default
---

# 1995-09-10 - Dishonest banks & ecash

## Header Data

From: Michael Froomkin<EMAIL_ADDRESS>To: list ecash<EMAIL_ADDRESS>Message Hash: 404dcf18f479c086cea95e7a55bf19450b9516b024f0c8793fbdff78f426c184

Message ID<EMAIL_ADDRESS>Reply To: _N/A_

UTC Datetime: 1995-09-10 05:33:22 UTC

Raw Date: Sat, 9 Sep 95 22:33:22 PDT

## Raw message

```
{% raw  %}From: Michael Froomkin<EMAIL_ADDRESS>Date: Sat, 9 Sep 95 22:33:22 PDT
To: list ecash<EMAIL_ADDRESS>Subject: Dishonest banks & ecash
Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

I've been doing some ecash reading.  The threat model is the dishonest
user or 3rd party who tries to mint the stuff.  Any work been done on the
problem of the dishonest bank (a la Bcci) that tries to mint the stuff?

A. Michael Froomkin        | +1<PHONE_NUMBER>; +1<PHONE_NUMBER> (fax)
Associate Professor of Law |<EMAIL_ADDRESS>U. Miami School of Law     |
P.O. Box 248087            | It's hot here.  And humid.
Coral Gables, FL 33124 USA |
See (soon to move to its real home): http://www.law.miami.edu/~mfroomki

{% endraw %}
```

## Thread

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

+ Return to "[Michael Froomkin <mfroomki@umiami.ir.miami.edu>](/authors/michael_froomkin_mfroomki_at_umiami_ir_miami_edu_)"

+ 1995-09-10 (Sat, 9 Sep 95 22:33:22 PDT) - Dishonest banks & ecash - _Michael Froomkin<EMAIL_ADDRESS>


text:
# StartHexo
建立第一個Hexo框下的Blog

## Build Setup
### Installing
```
# install dependencies
npm install

# change dev folder
cd blog

# serve start at localhost:4000
hexo server
```

## Publish
```
hexo g
```
and upload to github

## License
This project is licensed under the MIT License - see the LICENSE.md file for details

repository: LaroYeh/StartHexo

repo_name: LaroYeh/StartHexo


text:
---
date: "2019-07-26T13:54"
title: "Mausritter: Locations"
tags: ["random tables", "mausritter", "setting", "rules"]
published: "true"
---

This is part two of the Mausritter series — a generator for location hex details, designed for quickly filling out a hex map with interesting locations. Hexcrawls in Mausritter are at a scale of 1 mile per hex. Each hex should contain one obvious landmark with an interesting detail.

<table-roller table="landmarks,twists" buttons='[
["Random hex:", {
    "~~buttonType": "label"
}],
["Countryside", {
    "Hex type": "Countryside ",
    "Landmark": "Countryside",
    "Detail": "Location detail"
}],
["Forest", {
    "Hex type": "Forest ",
    "Landmark": "Forest",
    "Detail": "Location detail"
}],
["River", {
    "Hex type": "River ",
    "Landmark": "River",
    "Detail": "Location detail"
}],
["Human", {
    "Hex type": "Human town ",
    "Landmark": "Human town",
    "Detail": "Location detail"
}]
]' data='{
    "Type": ["Countryside", "Countryside", "Forest", "Forest", "River", "Human town"]
}'>

### Landmarks

|d20|Countryside            |Forest                            |River                                  |Human town          |
|---|-----------------------|----------------------------------|---------------------------------------|--------------------|
|1  |Anthill                |Abandoned shack                   |Canal lock                             |Abandoned car       |
|2  |Beech, lightning split |Bright clearing                   |Converging tributaries                 |Apartment balcony   |
|3  |Bone-white tree        |Cascading waterfalls              |Draping willow                         |Blackberry hedge    |
|4  |Cow skeleton           |Cliff face                        |Eroded riverbank                       |Busy road           |
|5  |Field of flowers       |Cold, fresh spring                |Fallen tree crossing                   |Drainpipe outlet    |
|6  |Field of wheat         |Dense underbrush                  |High waterfall                         |Dumped furniture    |
|7  |Hedge row              |Face in ancient oak               |Huge boulder                           |Greenhouse          |
|8  |Hollow tree stump      |Fox hole                          |Huge concrete dam                      |Mouse ruins         |
|9  |Huge flat rock         |Grove of ferns                    |Isolated island                        |Newly built house   |
|10 |Lily-lined pond        |Hollow tree stump                 |Muddy flats                            |Overgrown garden bed|
|11 |Massive fallen tree    |Huge pine tree                    |Rocky rapids                           |Pigeon nest         |
|12 |Old craggy oak         |Human walking track               |Row of dead trees                      |Pile of trash       |
|13 |Old farmhouse          |Human-made clearing               |Silty dam                              |Rocky riverbed      |
|14 |Quiet dirt road        |Meandering brook                  |Stepping-stones                        |Shopping trolley    |
|15 |Rabbit warren          |Overgrown ruins                   |Stone bridge                           |Stagnant pond       |
|16 |Sparrow nest           |Ring of stones                    |Stoney shallows                        |Steel bridge        |
|17 |Stand of pine trees    |Rocky outcropping                 |Submerged trash                        |Trash-filled skip   |
|18 |Steep hill             |Sunken hollow                     |Sunken barge                           |Tree-lined footpath |
|19 |Stone wall             |Tangle of roots                   |Twisted roots                          |Underground car park|
|20 |Tangle of fig roots    |Termite-riddled tree              |Wooden bridge                          |Woodshed            |

### Location details

|d20|Location detail         |
|---|-----------------------|
|1  |Ancient bat cult temple (What was summoned?)|
|2  |Bandit hideout (Who do they prey on?)|
|3  |Mouse wizard's tower (What creation is almost finished?)|
|4  |Completely lifeless (What disaster has occurred?)|
|5  |Regularly used by humans (What do they do here?)|
|6  |Friendly mouse roadhouse (What is in the basement?)|
|7  |Mining outpost (Why was it abandoned?)|
|8  |Faerie ring (What business do the faeries have here?)|
|9  |Beetle graveyard (What do the ghosts want?)|
|10 |Natural feature, dangerous (How can it be avoided?)|
|11 |Natural feature, out of place (How did it form?)|
|12 |Strange magical anomaly (Why is it spreading?)|
|13 |A mouse hermit's hut (Why do they shun society?)|
|14 |Ancient ruins of a past civilisation (Who built this?)|
|15 |Natural caves (What is living here?) |
|16 |Lonely shrine (Who maintains it? What do they worship?)|
|17 |Repurposed human construction (How is it used?)|
|18 |Noblemouse's castle (What does it defend against?)|
|19 |Abandoned settlement... (What clues did they leave?)|
|20 |Settlement... [(Create the details)](/2019-07-30-mausritter-settlements/) |

repository: isaacwilliams/losing-games-blog

gha_language: JavaScript

repo_name: isaacwilliams/losing-games-blog


text:
Signal Detector - LTE and ESMR base station tracking for Sprint phones
=============

Copyright (C) 2013 Chris Lawrence

Based on Signal Strength Detector
Copyright (C) 2011 Thomas James Barrasso

Author: Chris Lawrence
Name: Signal Detector
Version: 2
License: Apache License, Version 2.0

Description:
-------

This application tracks the base station IDs and signal strengths for
LTE (Sprint 1900 MHz "G" block, and possibly other bands on other
carriers) and 1xRTT base stations (on the ESMR band used by Sprint).
The data may be useful for mapping out base station locations and
coverage.

Developed for the S4GRU community at http://s4gru.com

This code may also work on non-Sprint LTE devices, but there are no
guarantees.  LTE base stations' IDs are only available currently with
HTC devices (only tested on HTC Evo 4G LTE) and Sprint's Galaxy Nexus
(with Android 4.2.1); they may also be available on devices running
custom ROMs based on Android 4.1 and later that implement the
CellIdentityLte API.  Other features should work with any CDMA Android
4.1+ phone.

Other Tools:
-----------

cellfinder - https://github.com/lordsutch/cellfinder

This Python code will take the cellinfolte.csv files produced by
SignalDetector and use them to try to geolocate base
stations.

Generally speaking it works pretty well (in my experience, it gets
"ground truth" about 90% of the time), but if you only have
observations passing a tower in a straight line at a substantial
distance, there may not be a single mathematical solution and it will
converge on the wrong one. For example, if you are on a straight road
that passes east of a tower (i.e. it goes past you to the west), the
tower may be geolocated east of the road rather than west of it.

License:
-------

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

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

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

Also includes Leaflet.js:

Copyright (c) 2010-2013, Vladimir Agafonkin
Copyright (c) 2010-2011, CloudMade
All rights reserved.

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

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

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

Also includes Marker.Rotate.js:

Copyright (c) 2011-2012, Pavel Shramov
All rights reserved.

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

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

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

repository: lordsutch/Signal-Strength-Detector

repo_name: lordsutch/Signal-Strength-Detector


text:
### [CVE-2018-14875](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-14875)
![](https://img.shields.io/static/v1?label=Product&message=n%2Fa&color=blue)
![](https://img.shields.io/static/v1?label=Version&message=n%2Fa&color=blue)
![](https://img.shields.io/static/v1?label=Vulnerability&message=n%2Fa&color=brighgreen)

### Description

An issue was discovered in the Core and Portal modules in Polaris FT Intellect Core Banking 9.7.1. Reflected XSS exists with an authenticated session via the Customerid, formName, FrameId, or MODE parameter.

### POC

#### Reference
- https://neetech18.blogspot.com/2019/03/reflected-xss-vulnerability-in-polaris.html

#### Github
No PoCs found on GitHub currently.

repository: trickest/cve

branch_name: refs/heads/main

gha_language: HTML

repo_name: trickest/cve


text:
# Modsman

A mod manager for Minecraft.

GUI releases are built on Azure DevOps. [Click here for a list of recent builds.](https://buildartifactbrowser.azurewebsites.net/api/builds?org=sargunvohra&project=modsman&count=10)

CLI releases are available on [Brew for macOS and Linux](https://brew.sh/), or [Scoop for Windows](https://scoop.sh/).

```bash
# Install with Brew
brew tap sargunv/sargunv
brew install modsman
modsman-cli --help
```

```powershell
# Install with Scoop
scoop bucket add sargunv https://github.com/sargunv/scoop-sargunv.git
scoop install modsman
modsman-cli --help
```

repository: shedaniel/modsman

repo_name: shedaniel/modsman


text:
# Capistrano 3.x Changelog

Reverse Chronological Order:

## master

https://github.com/capistrano/capistrano/compare/v3.4.0...HEAD

* Removed the post-install message (@Kriechi)

* Minor changes
  * Fix filtering behaviour when using literal hostnames in on() block (@townsen)
  * Added options to set username and password when using Subversion as SCM (@dsthode)
  * Allow after() to refer to tasks that have not been loaded yet (@jcoglan)
  * Ensure scm fetch_revision methods strip trailing whitespace (@mattbrictson)
  * Allow use "all" as string for server filtering (@theist)

## `3.4.0`

https://github.com/capistrano/capistrano/compare/v3.3.5...v3.4.0

* Fixed fetch revision for annotated git tags. (@igorsokolov)
* Fixed updating roles when custom user or port is specified. (@ayastreb)
* Disables statistics collection.

* `bin/` is not suggested to be in `linked_dirs` anymore (@kirs)
  * bin/ is often checked out into repo
  * https://github.com/capistrano/bundler/issues/45#issuecomment-69349237

* Bugfix:
  * release_roles did not honour additional property filtering (@townsen)
  * Refactored and simplified property filtering code (@townsen)

* Breaking Changes
  * Hosts with the same name are now consolidated into one irrespective of the
    user and port. This allows multiple declarations of a server to be made safely.
    The last declared properties will win. See capistranorb.com Properties documentation
    for details.
  * Inside the on() block the host variable is now a copy of the host, so changes can be
    made within the block (such as dynamically overriding the user) that will not persist.
    This is very convenient for switching the SSH user temporarily to 'root' for example.

* Minor changes
  * Add role_properties() method (see capistrano.github.io PR for doc) (@townsen)
  * Add equality syntax ( eg. port: 1234) for property filtering (@townsen)
  * Add documentation regarding property filtering (@townsen)
  * Clarify wording and recommendation in stage template. (@Kriechi)
    * Both available syntaxes provide similar functionality, do not use both for the same server+role combination.
  * Allow specification of repo_path using stage variable
    default is as before (@townsen)

## `3.3.5`

https://github.com/capistrano/capistrano/compare/v3.3.4...v3.3.5

* Fixed setting properties twice when creating new server. See [issue
  #1214](https://github.com/capistrano/capistrano/issues/1214) (@ayastreb)

## `3.3.4`

https://github.com/capistrano/capistrano/compare/v3.3.3...v3.3.4

* Minor changes:
  * Rely on a newer version of capistrano-stats with better privacy (@leehambley)
  * Fix cucumber spec for loading tasks from stage configs (@sponomarev)
  * Minor documentation fixes (@deeeki, @seuros, @andresilveira)
  * Spec improvements (@dimitrid, @sponomarev)
  * Fix to CLI flags for git-ls-remote (@dimitrid)

## `3.3.3`

https://github.com/capistrano/capistrano/compare/v3.2.1...v3.3.3

* Enhancement (@townsen)
  * Added the variable `:repo_tree` which allows the specification of a sub-tree that
    will be extracted from the repository. This is useful when deploying a project
    that lives in a subdirectory of a larger repository.
    Implemented only for git and hg.
    If not defined then the behaviour is as previously and the whole repository is
    extracted (subject to git-archive `.gitattributes` of course).

* Enhancement (@townsen): Remove unnecessary entries from default backtrace

    When the `--backtrace` (or `--trace`) command line option is not supplied
    Rake lowers the noise level in exception backtraces by building
    a regular expression containing all the system library paths and
    using it to exclude backtrace entries that match.

    This does not always go far enough, particularly in RVM environments when
    many gem paths are added. This commit reverses that approach and _only_
    include backtrace entries that fall within the Capfile and list of tasks
    imported thereafter. This makes reading exceptions much easier on the eye.

    If the full unexpurgated backtrace is required then the --backtrace
    and --trace options supply it as before.

* Disable loading stages configs on `cap -T` (@sponomarev)

* Enhancements (@townsen)
  * Fix matching on hosts with custom ports or users set
  * Previously filtering would affect any generated configuration files so that
    files newly deployed would not be the same as those on the hosts previously
    deployed (and now excluded by filters). This is almost certainly not what is
    wanted: the filters should apply only to the on() method and thus any
    configuration files deployed will be identical across the set of servers
    making up the stage.
  * Host and Role filtering now affects only `on()` commands
    and not the `roles()`, `release_roles()` and `primary()` methods.
  * This applies to filters defined via the command line, the environment
    and the :filter variable.
  * Filtering now supports Regular expressions
  * This change _could_ cause existing scripts that use filtering and depend on
    the old behaviour to fail, though it is unlikely. Users who rely on
    filtering should check that generated configuration files are correct, and
    where not introduce server properties to do the filtering. For example, if a
    filter was used to specify an active subset of servers (by hostname), it should
    be removed and replaced with an 'active' property (set to true or false) on the
    server definitions. This keeps the stage file as the canonical model of the
    deployment environment.

  * See the documentation in the README.md file

* Enhancements (@townsen)
  * Added set_if_empty method to DSL to allow conditional setting
  * Altered standard Capistrano defaults so that they are not set
    at the start of a stage if they have been previously set. This
    allows variables like :default_env to be set in deploy.rb.
  * Deep copy properties added using the 'roles' keyword
  * If a property exists on a server when another definition is
    encountered and is an Array, Set or Hash then add the new values

    This allows roles to specify properties common to all servers and
    then for individual servers to modify them, keeping things DRY

Breaking Changes:
  * By using Ruby's noecho method introduced in Ruby version 1.9.3, we dropped support for Ruby versions prior to 1.9.3. See [issue #878](https://github.com/capistrano/capistrano/issues/878) and [PR #1112](https://github.com/capistrano/capistrano/pull/1112) for more information. (@kaikuchn)
  * Track (anonymous) statistics, see https://github.com/capistrano/stats. This breaks automated deployment on continuous integration servers until the `.capistrano/metrics` file is created (with content `full` to simulate a "yes") via the interactive prompt or manually.

* Bug Fixes:
  * Fixed compatibility with FreeBSD tar (@robbertkl)
  * remote_file can be used inside a namespace (@mikz)

* Minor Changes
  * Remove -v flag from mkdir call. (@caligo-mentis)
  * Capistrano now allows to customize `local_user` for revision log. (@sauliusgrigaitis)
  * Added tests for after/before hooks features (@juanibiapina, @miry)
  * Added `--force` flag to `svn export` command to fix errors when the release directory already exists.
  * Improved the output of `cap --help`. (@mbrictson)
  * Cucumber suite now runs on the latest version of Vagrant (@tpett)
  * The `ask` method now supports the `echo: false` option. (@mbrictson, @kaikuchn)
  * Cucumber scenario improvements (@bruno-)
  * Added suggestion to Capfile to use 'capistrano-passenger' gem, replacing suggestion in config/deploy.rb to re-implement 'deploy:restart' (@betesh)
  * Updated svn fetch_revision method to use `svnversion`
  * `cap install` no longer overwrites existing files. (@dmarkow)

## `3.2.1`

https://github.com/capistrano/capistrano/compare/v3.2.0...v3.2.1

* Bug Fixes:
  * 3.2.0 introduced some behaviour to modify the way before/after hooks were called, to allow the optional
    preservation of arguments to be passed to tasks. This release reverts that commit in order to restore
    original functionality, and fix (fairly serious) bugs introduced by the refactoring.

* Minor changes:
  * Update dsl#local_user method and add test for it. (@bruno-)
  * Revert short sha1 revision with git. (@blaugueux)
  * Changed asking question to more standard format (like common unix commandline tools) (@sponomarev)
  * Fixed typos in the README. (@sponomarev)
  * Added `keys` method to Configuration to allow introspection of configuration options. (@juanibiapina)
  * Improve error message when git:check fails (raise instead of silently `exit 1`) (@mbrictson)

## `3.2.0`

The changelog entries here are incomplete, because many authors choose not to
be credited for their work, check the tag comparison link for Github.

https://github.com/capistrano/capistrano/compare/v3.1.0...v3.2.0

* Minor changes:
  * Added `keys` method to Server properties to allow introspection of automatically added
    properties.
  * Compatibility with Rake 10.2.0 - `ensure_task` is now added to `@top_level_tasks` as a string. (@dmarkow)
  * Amended the git check command, "ls-remote", to use "-h", limiting the list to refs/heads

## `3.1.0`

https://github.com/capistrano/capistrano/compare/v3.0.1...v3.1.0

Breaking changes:

  * `deploy:restart` task **is no longer run by default**.
    From this version, developers who restart the app on each deploy need to declare it in their deploy flow (eg `after 'deploy:publishing', 'deploy:restart'`)
    or, for passenger applications, use the capistrano-passenger gem.

    Please, check https://github.com/capistrano/capistrano/commit/4e6523e1f50707499cf75eb53dce37a89528a9b0 for more information. (@kirs)

* Minor changes
  * Tasks that used `linked_dirs` and `linked_files` now run on all roles, not just app roles (@mikespokefire)
  * Tasks `deploy:linked_dirs`, `deploy:make_linked_dirs`, `deploy:linked_files`, `deploy:cleanup_rollback`,
    `deploy:log_revision` and `deploy:revert_release` now use `release_roles()` not `roles()` meaning that they
    will only run on servers where the `no_release` property is not falsy. (@leehambley)
  * Fixed bug when `deploy:cleanup` was executed twice by default (@kirs)
  * Config location can now be changed with `deploy_config_path` and `stage_config_path` options (@seenmyfate)
  * `no_release` option is now available (@seenmyfate)
  * Raise an error if developer tries to define `:all` role, which is reserved (@kirs)
  * `deploy:failed` hook was added to add some custom behaviour on failed deploy (@seenmyfate)
  * Correctly infer namespace in task enhancements (@seenmyfate)
  * Add SHA to revision log (@blackxored)
  * Allow configuration of multiple servers with same hostname but different ports (@rsslldnphy)
  * Add command line option to control role filtering (@andytinycat)
  * Make use of recent changes in Rake to over-ride the application name (@shime)
  * Readme corrections (@nathanstitt)
  * Allow roles to be fetched with a variable containing an array (@seenmyfate)
  * Improve console (@jage)
  * Add ability to filter tasks to specific servers (host filtering). (@andytinycat)
  * Add a command line option to control role filter (`--roles`) (@andytinycat)
  * Use an SCM object with a pluggable strategy (@coffeeaddict)

Big thanks to @Kriechi for his help.

## `3.0.1`

https://github.com/capistrano/capistrano/compare/v3.0.0...v3.0.1

  * `capify` not listed as executable (@leehambley)
  * Confirm license as MIT (@leehambley)
  * Move the git ssh helper to application path (@mpapis)

## `3.0.0`

https://github.com/capistrano/capistrano/compare/2.15.5...v3.0.0

If you are coming here to wonder why your Capfile doesn't work anymore, please
vendor lock your Capistrano at 2.x, whichever version was working for you
until today.

Capistrano 3 is a ground-up rewrite with modularity, stability, speed and
future proofing in mind. It's a big change, but now the code is 10x smaller,
runs faster, is easier to read, and quicker to extend. In the reduction we've
come up with a great gem based modular system for plugins and we're really
proud of this release.

The 3.0.0 release contains 38 patches from the following amazing people:

  * Tom `seenmyfate` Clements: more than 28 patches including cucumber integration tests! Not to
    mention Rails asset pipeline code, and bundler integrations.
  * Lee Hambley: Small changes around compatibility and log formatting
  * Kir Shatrov: for improvements in the core to make it easier to write extensions, for
    improving documentation, and for effectively building the chruby, rvm and rbenv integrations.
  * Michael Nikitochkin: Fixing a bug around linked files and directories.
  * Jack Thorne: for improvements to the default `Capfile` to fix some bad example syntax.
  * Erik Hetzner: for (what looks like great) work on the Mercurial (Hg) support. The Hg and Git
    source control mechanisms do not work the same way, but rather lean on the strengths of the
    underlying tools.

    (If I missed anyone, I'm sorry, your contributions have been awesome)

The 2.x branch of code is now no longer maintained. Towards the end of it's
useful life there were an increasing number of features and pieces of code
which didn't make sense for certain groups of people, in certain situations,
leading a to a ping-pong tennis effect with pull requests every few weeks
"fixing" a use-case which had already been "fixed" shortly before. As many of
the use-cases are outside the scope of the testing environments I (and by
extension the trusted contributors and IRC regulars) were able to test for.

There's a more extensive post about my failure to be able to keep up with the
demands of maintaining v2 whilst trying to build something which is appropriate
for the current landscape. If you are affected by the unsupported 2 branch,
please contact me (Lee Hambley) to discuss how my company can help support you.
Otherwise, please try v3, we're sure you'll like it, and the code is designed
to be so simple that anyone can work on it.

## `3.0.0.pre14`

 * Thanks to numerous contributors, in particular (@teohm) for a series of improvements.

## `3.0.0.pre13`

 * Fixed typos in the Capfile. (@teohm)
 * Allow setting SSH options globally. (@korin)
 * Change the flow (and hooks) see http://www.capistranorb.com/documentation/getting-started/flow/ for more information. Requires min SSHKit 0.0.34 (@teohm)
 * Fix sorting releases in lexicographical order (@teohm)

## `3.0.0.pre12`

 * `capistrano/bundler` now runs bundle on all roles, this addresses the same
   issue as the related changes in `pre11`. (@leehambley)

## `3.0.0.pre11`

 * Some deploy.rake tasks now apply to all servers, not expecting a
   primary(:app) server which may not exist in all deploy environments.
   (@leehambley).

## `3.0.0.pre10`

 * Fixes pre9.

## `3.0.0.pre9`

 * Fixes a syntax error introduced with filtering (with tests) introduced in
   `pre8`. (@leehambley)

## `3.0.0.pre8`

 * Fixed a syntax where `roles(:foo, :bar)` was being mistaken as a filter
   (roles(:foo, :bar => nil). The correct syntax to use is: roles([:foo,:bar])
   (@leehambley)

## `3.0.0.pre7`

 * Fix Git https authentication. (@leehambley)
 * Capfile template fixes (repo/repo_url) (@teohm)
 * Readme Fixes (@ffmike, @kejadlen, @dwickwire)
 * Fix the positioning of the bundler hook, now immediately after finalize. (@teohm)

repository: mattbrictson/chandler

gha_language: Ruby

repo_name: mattbrictson/chandler


text:
---
hrs_structure:
  division: '1'
  volume: '1'
  title: '2'
  chapter: '11'
  section: 11-373
type: hrs_section
tags:
  - Government
menu:
  hrs:
    identifier: HRS_0011-0373
    parent: HRS0011
    name: 11-373 Noncandidate committee loan prohibited
weight: 20805
title: Noncandidate committee loan prohibited
full_title: 11-373 Noncandidate committee loan prohibited
---
**[§****11-373] Noncandidate committee loan prohibited.** A noncandidate committee shall not receive or make a loan. [L 2010, c 211, pt of §2]

repository: SamMade/BlueAndKrabby

repo_name: SamMade/BlueAndKrabby


text:
# Rinodina confragosula (Nyl.) Müll. Arg. SPECIES

#### Status
ACCEPTED

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

#### Published in
Revue mycol. , Toulouse 9: 79 (1887)

#### Original name
Lecanora confragosula Nyl.

### Remarks
null

repository: mdoering/backbone

repo_name: mdoering/backbone


text:
#
 Debugging and Troubleshooting Code - Lab

Problems for exercises and homework for the ["Programming Fundamentals" course @ SoftUni](https://softuni.bg/courses/programming-fundamentals).

You can check your solutions [here] (https://judge.softuni.bg/Contests/Practice/Index/419#0).

## 1.Multiply Evens by Odds

Create a program that reads an **integer number** and **multiplies the sum of all its even digits** by **the sum of all its odd digits** :

### Examples

| **Input** | **Output** | **Comments** |
| --- | --- | --- |
| 12345 | 54 | 12345 has **2 even digits** - 2 and 4. Even digits has **sum of 6**.Also it has **3 odd digits** - 1, 3 and 5. Odd digits has **sum of 9**. **Multiply 6 by 9** and you get **54**. |
| -12345 | 54 |   |

### Hints

Create a method with a **name describing its purpose** (like **GetMultipleOfEvensAndOdds** ). The method should have a **single integer parameter** and an **integer return value**. Also the method will call two other methods:

```C#
private static int GetMultipleOfEvensAndOdds(int n)
{
	int sumEvens = GetSumOfEvenDigits(n);
	int sumOdds = GetSumOfOddDigits(n);
	return sumEvens * sumOdds;
}
```
Create two other methods each of which will sum either even or odd digits
Implement the logic for summing odd digits:
```C#
private static int GetSumOfOddDigits(int n)
{
	int sum = 0;
	while (n > 0)
	{
		int lastDigit = n % 10;
		if(lastDigit % 2 != 0)
		{
			// TODO: add to sum
		}

		n /= 10;
	}

	return sum;
}
```
Do the same for the method that will sum even digits
As you test your solution you may notice that it doesn't work for negative numbers. Following the program execution line by line, find and fix the bug (**hint: you can use Math.Abs()**)

## 2.Debugging Exercise: Holidays Between Two Dates

You are assigned to **find and fix the bugs** in an existing piece of code, using the Visual Studio **debugger**. You should trace the program execution to find the lines of code that produce incorrect or unexpected results.

You are given a program (existing **source code** ) that aims to **count the non-working days between two dates** given in format **day.month.year** (e.g. between **1.05.2015** and **15.05.2015** there are **5** non-working days – Saturday and Sunday).

### Examples

| **Input** | **Output** | **Comments** |
| --- | --- | --- |
| 01.05.2016
 15.05.2016 | 5 | There are **5** non-working days (Saturday / Sunday) in this period: 1-May-2016, 7-May-2016, 8-May-2016, 14-May-2016, 15-May-2016 |
| 01.05.2016
 02.05.2016 | 1 | Only **1** non-working day in the specified period: 1.05.2016 (Sunday) |
| 15.05.2020
 10.05.2020 | 0 | The second date is before the first. No dates in the range. |
| 22.02.2020
 01.03.2020 | 4 | TwoSaturdays and Sundays:  02.2020 and 23.02.2020; 02.2020 and 1.03.2020 |

You can **find the broken code** in the judge system: [Broken Code for Refactoring](https://softuni.bg/downloads/svn/soft-tech/Jan-2017/Programming-Fundamentals-Extended-Jan-2017/05.%20Programming-Fundamentals-Debugging-and-Troubleshooting-Code/05.%20Programming-Fundamentals-Debugging-and-Troubleshooting-Code-Lab-Broken-Solutions.zip). It looks as follows:

```C#
using System;
using System.Globalization;

class HolidaysBetweenTwoDates
{
    static void Main()
    {
        var startDate = DateTime.ParseExact(Console.ReadLine(),
            "dd.m.yyyy", CultureInfo.InvariantCulture);
        var endDate = DateTime.ParseExact(Console.ReadLine(),
            "dd.m.yyyy", CultureInfo.InvariantCulture);
        var holidaysCount = 0;
        for (var date = startDate; date <= endDate; date.AddDays(1))
            if (date.DayOfWeek == DayOfWeek.Saturday &&
                date.DayOfWeek == DayOfWeek.Sunday) holidaysCount++;
        Console.WriteLine(holidaysCount);
    }
}
```

### Hints

There are **4**** mistakes **in the code. You've got to** use the debugger **to find them and fix them. After you do that, submit your** fixed code in the judge contest**: [https://judge.softuni.bg/Contests/419](https://judge.softuni.bg/Contests/419).

## 3.Debugging Exercise: Price Change Alert

You are assigned to **rework a given piece of code** which is working **without bugs** but is **not properly formatted**.

The given program **tracks stock prices** and **gives updates** about the **significance in each price change**. Based on the significance, there are **four kind of changes** : no change at all (price is equal to the previous), minor (difference is below the significance threshold), price up and price down.

You can **find the broken code** here: [Broken Code for Refactoring](https://softuni.bg/downloads/svn/soft-tech/Jan-2017/Programming-Fundamentals-Extended-Jan-2017/05.%20Programming-Fundamentals-Debugging-and-Troubleshooting-Code/05.%20Programming-Fundamentals-Debugging-and-Troubleshooting-Code-Lab-Broken-Solutions.zip).

### Input

- On the first line you are given **N** - the number of prices
- On the second line you are given the significance threshold
- On the next N lines, you are given prices

### Output

- Don't print anything for the first price
- If there is **no difference** from the previous price the output message is: "NO CHANGE: {current price}"
- In case of **minor change** : "MINOR CHANGE: {last price} to {current price} ({difference}%)"
- In case of **major change** : "PRICE UP: {last price} to {current price} ({difference}%)" or "PRICE DOWN: {last price} to {current price} ({difference}%)"

The percentage should be rounded to the second digit after the decimal point.

### Examples

| **Input** | **Output** |
| --- | --- |
| 3
 0.1
10
11
12 | PRICE UP: 10 to 11 (10.00%)
MINOR CHANGE: 11 to 12 (9.09%) |
| 3
0.1
10
10
12 | NO CHANGE: 10
PRICE UP: 10 to 12 (20.00%) |

### Hints

1. Download the source code and get familiar with it
2. Deal with poor code formatting - Remove unnecessary blank lines, indent the code properly
3. Fix method parameters naming
4. Give methods a proper name

repository: tmollov/SoftUni-Software-Engineering

path: /Programmin Fundamentals/Progr.Fund  Extended/DebuggingAndTroubleshootingCode-Lab/README.md

repo_name: tmollov/SoftUni-Software-Engineering


text:
# applications
Applications

This repository contains all files that form the applications subtree for the master repositories (e.g. core, mask, kick, chat, skin, bits, reap). It focuses on providing logic for the different applications each master server runs. (e.g. core server could run app).

By separating the application logic into this self-contained subtree, all changes to this code base can be centrally administrered. Master repositories get updated by pulling their subtrees from Github.

See also http://blogs.atlassian.com/2013/05/alternatives-to-git-submodule-git-subtree/

repository: vanHeemstraSystems/applications

repo_name: vanHeemstraSystems/applications


text:
# Testing the Dreamhost DNS API

Dreamhost API sandbox only permits read-only commands, so you'll need a Dreamhost
PS account for the testing and a dedicated domain.

See http://wiki.dreamhost.com/Application_programming_interface#Test_Account

## Create an API key

You'll need a Dreamhost (PS I think) account and a dedicated domain for testing.

1. Go to the Dreamhost web panel and create an API key to manage DNS records

   https://panel.dreamhost.com/index.cgi?tree=home.api

   Select 'All dns functions' for the new API key to be able to add/remove/list
records.

2. Create a .fog file in the tests/ directory with the following contents:

   ```yaml
   :default:
     :dreamhost_api_key: SDFASDFWQWASDFASDFAS
   ```
   Where dreamhost_api_key is the key you created in the previous step.

3. Update the test_domain helper in tests/dreamhost/helper.rb to use your own
   domain for testing. You will also need at least a record created via
   the Dreamhost Webpanel (you'll get a **no_such_zone** error otherwise).

   I usually create a do-not-delete.my-domain.com record. The tests skip that
   record when cleaning up (see the do_not_delete_record helper).

4. Run the tests

   ```
   shindo tests/dreamhost
   ```

## Notes

The API is rate limited, so do not smash the DH servers too often. Two
consecutive test runs will trigger the rate limit.
You'll see a **slow_down_bucko** error if the frequency is too high.

http://wiki.dreamhost.com/Application_programming_interface#Rate_Limit

## Resources

Dreamhost API:

http://wiki.dreamhost.com/Application_programming_interface

Dreamhost DNS API:

http://wiki.dreamhost.com/API/Dns_commands

repository: fog/fog

repo_name: fog/fog


text:
+++
title = "Prerequisites"
type = "docs"
[menu.docs]
identifier = "transformations_prerequisites"
parent = "transformations"
weight = 300
+++

# Prerequisites

Before you can configure and apply transformations:

- You must have entered a query and returned data from a data source. For more information on queries, refer to [Queries]({{< relref "../queries.md" >}}).

- You must have applied a visualization that supports queries. Examples are:
  - [Bar gauge]({{< relref "../visualizations/bar-gauge-panel.md" >}})
  - [Gauge]({{< relref "../visualizations/gauge-panel.md" >}})
  - [Graph]({{< relref "../visualizations/graph-panel.md" >}})
  - [Heatmap]({{< relref "../visualizations/heatmap.md" >}})
  - [Logs]({{< relref "../visualizations/logs-panel.md" >}})
  - [Stat]({{< relref "../visualizations/stat-panel.md" >}})
  - [Table]({{< relref "../visualizations/table-panel.md" >}})

repository: bisand/grafana

gha_language: TypeScript

repo_name: bisand/grafana


text:
# Token

This is an Ethereum project that enhances some of the popular implementations of token standards.

## IERC20Mintable

It is an interface that adds to the `IERC20` interface the `mint` function from the `ERC20Mintable` OpenZeppelin contract.

## IERC20Detailed

It is an interface that adds to the `IERC20` interface the `name`, `symbol` and `decimals` functions from the `ERC20Detailed` OpenZeppelin contract.

## IERC20MintableDetailed

It is an interface that adds to the `IERC20` interface the `mint`, `name`, `symbol` and `decimals` functions from the `ERC20Mintable` and `ERC20Detailed` OpenZeppelin contracts.

## ERC20MintableDetailed

It is a contract that implements the `IERC20MintableDetailed` interface.

## ERC20DividendableEth

It is a `ERC20` token contract that is endowed with some rather dividendable qualities.

1. Anyone can send `ether` to the contract at any time using `increasePool`. That amount of `ether` will be added to a dividend pool.

2. Any token holder can draw their fair share of `ether` from the dividend pool according to the amount of tokens they hold. To do this they must call the `updateAccount` function.

#### Notes
1. Changes in the token supply will affect any dividend distribution events. Any ongoing distribution events for which the contract has received the `ether` before the total supply change are unaffected.

2. In order to be useful in practice, the contract has to be customized by inheriting from a mintable standard implementation, for example, openzeppelin's `ERC20Mintable` contract, in this way:

```
contract MyERC20DividendableEth is ERC20DividendableEth, ERC20Mintable {
    // here goes your fantasy
}
```

repository: pooltogether/contracts

repo_name: pooltogether/contracts


text:
## Cluster Deletion
There are two steps required to create a cluster. First, you need to create all the AWS Resources required in your AWS Account. This includes creating IAM groups and attaching their relevant policies, IAM Users and generating keys. Then you will use this user created to create a new cluster.

### KOPS Cluster Setup
1. Run `sh kops-setup.sh`.
    - This will generate the KOPS Cluster

### AWS Account Setup
1. Run `sh aws-setup.sh`
    - This will generate additional keys so that your environment can access the cluster

repository: rahulbrahmal/kops-aws

repo_name: rahulbrahmal/kops-aws


text:
# Russula foetens var. subfoetens (W.G. Sm.) Massee, 1893 VARIETY

#### Status
SYNONYM

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

#### Published in
null

#### Original name
null

### Remarks
null

path: /life/Fungi/Basidiomycota/Agaricomycetes/Russulales/Russulaceae/Russula/Russula subfoetens/ Syn. Russula foetens subfoetens/README.md


text:
# Tenjin Redshift to BQ loader

This is a database copier designed for grabbing data from redshift and pushing it to bigquery without using s3.

The reason for this is that a customer on gcp that wants to consume data from a 3rd party redshift should not have to worry about getting an aws account just for s3.

The copier can handle 3 types of increment scenarios:
1. No increment (full load)
2. Increment on column last value + merge on PK columns
3. Take a custom query for increment (such as last 30d or even a complex select) and merge it on PK columns.

Ultimately, all methods run a query and retrieve data which is then saved as a table (and merged to a target)

Why the above scenarios?

1. The full load is not exposed to the config but you can call it directly from redshift_to_bq_loader.full_copy_schema
the use case is to copy the data once entirely for an ad hoc analysis or for incrementing on it later.

the data goes from Redshift via select -> Local file (json) -> to gogole storage -> Bigquery target table

2. The increment on column value checks the loaded table (if exists) and only takes the new rows.
It then merges them though an upsert-like transaction. This way we are economical about copy time and resources.

the data goes from Redshift via select -> Local file (json) -> to gogole storage -> Bigquery increment table -> (IDEMPOTENT MERGE) Bigquery target table

3. Because some tables are better loaded by custom rules (such as last 30d, or any other filters)
or because you might want to copy only some columns, or your own aggregated metric resulting from a query,
we can use this method that takes a query output and treats it as a table (as for point 2)

the data flow is the same as for point 3

# How it works
##For the last value based copy:
1. Last value is read from the table in BQ, if table does not exist, then we take the first (min) value from redshift for the table
2. An increment of configurable size ('rows_per_increment' = 1000000 ) is copied to bigquery into an increment table
- data is 'selected' into the python environment
- json file with data is written
- json file is sent to google storage bucket (`filename_on_bucket = '{}/{}/{}/{}'.format(schema_name, datetime.now().strftime("%Y/%m/%d"), table_name, local_filename)`)
- json file is read into BQ (autodetect schema) into an increment table (named z_increment_tablename so it sorts to the bottom)
3. The increment table is merged to the target BQ table on the merge columns (merge operation happens as explained by AWS, an "upsert" on PK. The BQ merge gives other options too).

##For the query based copy all things are the same except
1. An increment is selected based on a custom query passed into the config.`

##possible improvements:
- for the tables that are loaded based on a query from tenjin dv, first check the updated_at table to see if there is anything new to load.

#necessary resources:
1. Python environment to run the code. Since it copies large files, a small cloud function might not suffice. The job does not require significant compute, but needs ram and disk to fit the data slices. The only way to avoid transfer through the local environment is to use the specialised google service
https://cloud.google.com/storage-transfer/docs/create-manage-transfer-program

2. Google storage bucket (or multiple, a different one can be passed per table)

3. Google BQ to load to

##Credentials
For gcp:
https://cloud.google.com/docs/authentication/getting-started
you must make sure to give the following permissions in IAM
` BigQuery Admin,
Storage Admin,
Storage Object Admin`

You might be able to restrict them more if need be.

For Redshift:
Edit the `credential.py` file

## Configuring the copy
`table_load_config.py` contains the table config. If you wish to use a custom loading strategy or a query-based lookback,
you can edit this config according to the examples from the config file

This config is a list of parameter dictionaries based on which the copy is performed,
such as the query or tablename, increment columns, bucket to use, etc

##starting the load
Once credentials and config are finalised, start the load by simply running in your terminal
`python3 start_load.py`
in the folder with the script. (use the terminal command `pwd to confirm you are in the right folder)