text:
# [garmintools](https://github.com/ironcitysoftware/garmintools)

garmintools are a set of tools to read and write aviation navigation
information in the format used by popular Garmin general aviation GPS
units, including the GNS 430, GNS 530, GTN 750, and G1000.

See [README.html](https://rawgit.com/ironcitysoftware/garmintools/master/README.html).

repository: ironcitysoftware/garmintools

gha_language: Java

repo_name: ironcitysoftware/garmintools


text:
# ActiverecordI18n
This gem was created to use db additionaly to the existing I18n.t
This gems didn't replace the standard.

I use this code for few year on all my project, It's simple and easy to support. I'm finally decide to share this code.

If you want to replace, the exsiting I18n.t, I recommand you this gem : https://github.com/svenfuchs/i18n-active_record

## Usage
Use from view
```
ot('mykey')   # will create a key name  mykey
ot('.mykey')   # will create a key name  <view-path>.mykey
```

Using elsewhere from a view
```
ActiverecordI18n::Helper.ot('mykey')
```

## Getting started
Add this line to your application's Gemfile:

```ruby
gem 'activerecord_i18n'
```

And then execute:
```bash
$ bundle install
```

Or install it yourself as:
```bash
$ gem install activerecord_i18n
```

To install model and migration
```bash
$ rails generate activerecord_i18n:install
```

## Contributor
You want to contribute ? I need to finish the test

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

license: MIT

branch_name: refs/heads/master

extension: md

license_type: permissive


text:
# How To Distract Your Colleagues With Tracery

This repo has some simple example code for a procedural text generator
that you can plug into a screensaver to distract your team-mates while
you are away from your machine.

## Components

The generator has a few sub-generators, all made in `tracery`, the
Python Tracery module. These are:

   * Coffee order generator
   * A food ontology puzzler
   * Random quotes
   * Fancy delimiters

## Example

![Demo](screensaver.png)

repository: BrettWitty/procgen-screensaver

branch_name: refs/heads/main

repo_name: BrettWitty/procgen-screensaver


text:
- infos = Information about the regexdispatcher plugin is in keys below
- infos/author = Armin Wurzinger<EMAIL_ADDRESS>- infos/licence = BSD
- infos/needs =
- infos/provides =
- infos/recommends =
- infos/placements = presetstorage
- infos/ordering = typechecker
- infos/status = maintained experimental
- infos/metadata = check/enum/# check/enum/multi check/range check/validation
- infos/description = a plugin which generates regex-representations of specification keywords

## Introduction

A plugin which generates regex representations of specification keywords for the
typechecker plugin before saving a configuration specification. For instance the
regex for the metakey `check/enum/#` depends on the metakey's values, as the two
definitions `check/enum/#1=A` and `check/enum/#2=B` would result in the regex
`A|B` stored in the `elektra/spec/regex/check/enum` metakey that can be treated
by the typechecker as a regex directly.

## Usage

In order to generate regex representations for different specification keywords, mount a configuration specification along with this plugin.

`kdb mount <specification> spec/<path> <storage plugin to read the specification> regexdispatcher typechecker`

## Dependencies

- ghc >= 8.0.1 < 8.4
- ghc-pkg, usually bundled with ghc
- cabal, the haskell build system, usually bundled with ghc
- augeas, which provides libfa utilized by this plugin

## Supported Metakeys

The following specification keywords are supported:

- check/enum/# and check/enum/multi
- check/range

repository: hesirui/libelektra

repo_name: hesirui/libelektra


text:
### [CVE-2020-11107](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-11107)
![](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 XAMPP before 7.2.29, 7.3.x before 7.3.16 , and 7.4.x before 7.4.4 on Windows. An unprivileged user can change a .exe configuration in xampp-contol.ini for all users (including admins) to enable arbitrary command execution.

### POC

#### Reference
- http://packetstormsecurity.com/files/164292/XAMPP-7.4.3-Privilege-Escalation.html

#### Github
- https://github.com/0xT11/CVE-POC
- https://github.com/ARPSyndicate/cvemon
- https://github.com/S1lkys/CVE-2020-11107
- https://github.com/SexyBeast233/SecBooks
- https://github.com/andripwn/CVE-2020-11107
- https://github.com/developer3000S/PoC-in-GitHub
- https://github.com/eastmountyxz/CSDNBlog-Security-Based
- https://github.com/eastmountyxz/NetworkSecuritySelf-study
- https://github.com/githuberxu/Safety-Books
- https://github.com/hectorgie/PoC-in-GitHub
- https://github.com/nomi-sec/PoC-in-GitHub
- https://github.com/shengshengli/NetworkSecuritySelf-study
- https://github.com/soosmile/POC

repository: trickest/cve

gha_language: HTML

gha_license_id: MIT

repo_name: trickest/cve


text:
---
title: "Weight Initialization"
draft: false
weight: 18
katex: true
---

### Motivating Effective Weight Initialization
- As stated previously, the choice of activation function can help reduce the problem with vanishing gradients
- However, sometimes the choice of activation function can only go so far (and it sometimes necessary)
- Another approach for reducing the problem with vanishing gradients involves weight initialization

### Importance of Effective Initialization
- The goal of model training is to predict a new data point
- The common training process for neural networks is the following:
	1. Initialize the parameters
	2. Choose an optimization algorithm (e.g. gradient descent)
	3. Repeat these steps:
		1. Forward propagate an input
		2. Compute the cost function
		3. Compute the gradients of the cost with respect to parameters using backpropagation
		4. Update each parameter using the gradients, according to the optimization algorithm
- The initialization step is critical to the performance of the model

### Initializing Weights with Zeroes
- Initializing all the weights with values too small leads to slow learning
- Initializing all the weights with values too large leads to divergence
- Initializing all the weights with $0$ leads the neurons to learn the same features during training
- In fact, any constant initialization scheme will perform poorly
- For example, assigning all the weights to be $100$ or all the weights to be $2$
- Consider a neural network with two hidden units
- Assume we initialize all the biases to $0$ an weights to some constant $\alpha$
- If we forward propagate an input $(x_{1}, x_{2})$, then the output of both hidden units will be $relu(\alpha x_{1}, \alpha x_{2})$
- Therefore, both hidden units will have identical influence on the cost function
- This will lead to identical gradients
- Thus, both neurons will evolve symmetrically throughout training, effectively preventing different neurons from learning different patterns

### Setup for Cases of Unstable Gradient Problem
- Let's say we have a $9$-layer neural network
- Assume all the activation functions are linear
- Then the output activation is the following:

$$
\hat{y} = a^{[10]} = W^{[10]}W^{[9]}W^{[8]}W^{[7]}W^{[6]}W^{[5]}W^{[4]}W^{[3]}W^{[2]}W^{[1]}x
$$

- If we assume the weights are the same:

$$
W^{[1]} = W^{[2]} = ... = W^{[9]} = W^{[10]}
$$

- Then the output prediction is the following:

$$
\hat{y} = W^{[10]}W^{9}x
$$

- Here, $W^{9}$ take the matrix $W$ to the power of $9$, while $W^{[10]}$ just denotes the $10^{\text{th}}$ matrix

### Example: Huge Initialization Causes Exploding Gradients
- If every weight is initialized slightly larger than the identity matrix:

$$
W^{[1]} = W^{[2]} = ... = W^{[9]} = \begin{bmatrix} 1.5 & 0 \cr 0 & 1.5 \end{bmatrix}
$$

- This simplifies to the following:

$$
\hat{y} = W^{[10]}1.5^{[9]}x
$$

- The values of the activation $a^{[l]}$ increase exponentially with $l$
- When these activations are used in backward propagation, this leads to the exploding gradient problem
- In other words, the gradients of the cost with respect to the parameters become too big
- This causes the cost to oscillate around its minimum value

### Example: Tiny Initialization Causes Vanishing Gradients
- If every weight is initialized slightly larger than the identity matrix:

$$
W^{[1]} = W^{[2]} = ... = W^{[9]} = \begin{bmatrix} 0.5 & 0 \cr 0 & 0.5 \end{bmatrix}
$$

- This simplifies to the following:

$$
\hat{y} = W^{[10]}0.5^{[9]}x
$$

- The values of the activation $a^{[l]}$ decrease exponentially with $l$
- When these activations are used in backward propagation, this leads to the vanishing gradient problem
- In other words, the gradients of the cost with respect to the parameters become too small
- This causes the cost to converge to some value before reaching the minimum

### Finding Appropriate Initialization Values
- To prevent the gradients of neurons from vanishing or exploding, we will do the following:
	1. The mean of the activations should be $0$
	2. The variance of the activations should remain constant across each layer
- Under these two assumptions, we should never observe the vanishing or exploding gradient problem
- In other words, the backpropagated gradient should not be multiplied by values too small or too large in any layer
- However, sometimes we can't always guarantee these assumptions

### Motivating Xavier Initialization
- Consider a layer $l$, where its forward propagation is the following:

$$
a^{[l-1]} = g^{[l-1]}(z^{[l-1]})
$$

$$
z^{[l]} = W^{[l]}a^{[l-1]} + b^{[l]}
$$

$$
a^{[l]} = g^{[l]}(z^{[l]})
$$

- We want the two assumptions to hold:

$$
E[a^{[l-1]}] = E[a^{[l]}]
$$

$$
Var(a^{[l-1]}) = Var(a^{[l]})
$$

- These assumptions are enforced for both forward and backward propagation
- Specifically, these assumptions hold true for both the activations and gradients of the cost function with respect to the activations
- The recommended initialization of these two assumptions is Xavier initialization for ever layer $l$

### Defining Xavier Initialization
- Xaviar initialization is defined as the following:

$$
W^{[l]} \sim N(\mu = 0, \sigma^{2} = \frac{1}{n^{[l-1]}})
$$

$$
b^{[l]} = 0
$$

- In other words, all the weights of layer $l$ are picked randomly from a normal distribution with a mean of $0$ and variance of $\frac{1}{n^{[l-1]}}$
- Here, $n^{[l-1]}$ is the number of neurons in layer $l-1$
- Biases are initialized to be $0$

### Justification for Xavier Initialization
- We will see that Xavier initialization matains a constance variance across each layer if the activation of each layer has a mean of $0$
- Let's assume we're using a tanh activation function
- Our forward propagation would look like:

$$
z^{[l]} = W^{[l]}a^{[l-1]} + b^{[l]}
$$

$$
a^{[l]} = tanh(z^{[l]})
$$

- Assume we initialized our network with appropriate values and the input is normalized
- Early on in training, we are in the *linear regime* of the tanh function
- Meaning, the inputs around $0$ essentially become a linear transformation of our input
- In other words, values are small enough where $tanh(z^{[l]}) \approx z^{[l]}$
- As a result, the following holds true:

$$
Var(a^{[l]}) = Var(z^{[l]})
$$

- Causing the following to hold true:

$$
n^{[l-1]}Var(W^{[l]}) \begin{cases} < 1 & \implies \text{Vanishing Signal} \cr = 1 & \implies Var(a^{[L]}) = Var(x) \cr > 1 & \implies \text{Exploding Signal} \end{cases}
$$

- Therefore, we must set $n^{[l]}Var(W^{[l]}) = 1$ by initializing $Var(W^{[l]}) = \frac{1}{n^{[l]}}$
- By doing this, we can avoid the vanishing or exploding gradient problem

---

### tldr
- The initialization step is critical to the performance of the model
- Initializing all the weights with values too small leads to slow learning
- Initializing all the weights with values too large leads to divergence
- Initializing weights to the same constant leads to neurons evolving symmetrically throughout training
- Meaning, each neuron will have an identical influence on the cost function, since parameters will have identical gradients
- Initializing weights with inappropriate values will lead to divergence or a slow-down in training speed
- To prevent the gradients of neurons from vanishing or exploding, we will do the following:
	1. The mean of the activations should be $0$
	2. The variance of the activations should remain constant across each layer
- Under these two assumptions, we should never observe the vanishing or exploding gradient problem
- These assumptions are enforced for both forward and backward propagation
- The recommended initialization of these two assumptions is Xavier initialization for ever layer $l$
- Xavier initialization ensures that all the weights of layer $l$ are picked randomly from a normal distribution with a mean of $0$ and variance of $\frac{1}{n^{[l-1]}}$

---

### References
- [Weight Initialization](https://www.youtube.com/watch?v=s2coXdufOzE&list=PLkDaE6sCZn6Hn0vK8co82zjQtt3T2Nkqc&index=11)
- [Initializing Neural Networks](https://www.deeplearning.ai/ai-notes/initialization/)


text:
# mid2chart
Rock Band/Phase Shift .mid to GH3PC/FeedBack .chart file converter

## Description
This is a tool made to convert Rock Band / Phase Shift .mid files to .chart, so they can be imported into GH3PC using GHTCP.

If the midi file has tap notes - such as the Phase Shift version of GH:WT> songs - it'll output 2 charts: a (Dummy).chart one, and the actual .chart. To properly import those, please refer to [this tutorial](https://youtu.be/We0E4iyKJ1M?t=13m53s) by Plumato.

To make sure tap notes work, you should use ExileLord's [GH3+](https://youtu.be/EbapUSs5fsg) hack.

You can find the changelog and pre-GitHub versions [here](CHANGELOG.md).

## Usage
Drag and drop the mid file into "mid2chart.exe" or the .bat included. (The .mid file must be in the same folder of the .bat if you're using it.)

If there is a song.ini file in the same folder as the mid, the converter will use its metadata to set the song name, artist, year, charter and offset attributes in the converted chart file.

If the song.ini specifies a 1/8 HO/PO threshold, the converter will force HO/POs accordingly so the converted chart file matches that.

PART KEYS is also converted, placed in the Enhanced Guitar part. It is ignored by GHTCP, but can be found by opening the chart in FeedBack and pressing F4.

## Parameters
* Use the -e parameter to output editable FeedBack files (since forced HO/POs, forced strums and tap notes aren't supported and dB crashes when it reads one of those). In this case, forced hopo/strums will become a * track event, and tap notes, a T track event.
* Use the -r parameter to use Rock Band/Harmonix's HO/PO logic, which is slightly different from the regular (a single note after a chord will be a strum if the previous chord contains such note).
* Use the -b parameter to bypass broken chord adaptation and leave them as they are (if there are any).
* Use the -f parameter if some notes aren't being properly forced. Be aware, though, that this might force some notes unproperly.").
* Use the -s parameter if some notes aren't in their proper star power sections. Be aware, though, that this might put some notes unproperly in star power sections.").
* Use the -u parameter to unforce NAudio's strict midi checking. This might help if NAudio throws an error when trying to open a midi file, but might cause inaccuracies in the conversion.
* Use the -d parameter to remove double HO/POs.
* Use the -c parameter to avoid forcing chords (useful for non-GH3+ users or console players).
* Use the -t parameter to convert tap notes as forced HO/POs instead (useful for non-GH3+ users or console players).
* Use the -o parameter to clip sustains and/or fix overlapping notes.
* Use the -8 parameter to set 1/8 notes as HO/POs, OR to set it back to default if the .ini file already specifies such condition.
* Use the -16 parameter to set 1/16 notes as strums, OR to set it back to default if the .ini file already specifies such condition.
* Use the -1 parameter to check midi note 103 for star power, instead of 116.
* Use the -m parameter to NOT create a (Dummy).chart file.
* Use the -k parameter to close the program after the conversion, instead of waiting for a keystroke.
* Use the -p parameter to read and write open notes (as N 7 0 or E O).
* Use the -os parameter to force open notes as strum by default, unless forced otherwise. (useless without -p).
* Use the -kb parameter to swap keys and bass when converting the midi.
* Use the -kg parameter to swap keys and guitar when converting the midi.
* Use the -gb parameter to swap guitar and bass when converting the midi.

Be aware that you can only use ONE of the track swapping parameters. If you use more than one, only the first one entered will be considered.
To easily add those parameters, edit the .bat file and drag/drop the .mid file into it.

## Troubleshooting
If you're having problems with notes not being properly forced and the -f/-s parameters don't help, try opening the .mid in EoF, going into Settings and setting Min. note length (ms) as 18, resaving the project and converting the resaved .mid (thanks ScoreHero user "Notyu1459" for this solution).

If the converter doesn't read the midi properly (it gives an error after the Program Started! line), try using the -u parameter. If that doesn't work, try resaving it with a midi editing software (REAPER, Anvil Studio or Sekaiju, for instance).

If you have any other issues, just send a message to raphaelgoulart#1573 on Discord.

## License
This software is released under the [MIT license](LICENSE). You're free to use it and modify it as you will, as long as you read and agree with its license.

## Credits and Special Thanks
This software uses [NAudio](https://github.com/naudio/NAudio/), released under the Ms-PL license, and unphook's [Stopwatch.cs](https://github.com/unphook/rock-porra/blob/master/forfopacker/Stopwatch.cs), released under the MIT license.

Special thanks to Plumato and the579GH for the testing, suggestions, help and support provided.

license: MS-PL,MIT

detected_licenses: MS-PL MIT


text:
http://www.urionlinejudge.com.br/judge/problems/view/1143

# Squared and Cubic

Write a program that reads an integer $N$ ($1 < N < 1000$).
This $N$ is the number of output lines printed by this program.

## Input

The input file contains an integer N.

## Output

Print the output according to the given example.


text:
# SilkSpectre

**One goal**: watch item's sale for availability, specifically for **Playstation 5
availability** as configured by the application right now.

The application at this moment watches for Canadian websites of Amazon, BestBuy,
EBGames and Walmart. When availability is detected, a text notification is sent
to pre-configured number using Twilio REST API.

Configuration should be stored in the *app.config* file, as showed by the
example file *app.config.example*. Copy the latter, replace values and rename
the file.

The [prerender](https://github.com/prerender/prerender-node) node web
middleware should be ran as well. That is to render 100% websites that requires
Javascript to generate their HTML DOM. Install node and execute:

```
cd SilkSpectre
npm install
node .\prerender\prerender.js
```

The `continually.ps` script is provided as a replacement of the not-so-great
Microsoft Windows Scheduler. This thing is hard to configure, might not work,
and doesn't provide nice traces of the application's execution. All things
that are included in the provided script: it just works (with PowerShell,
 that is -- if you are on a \*nix platform, you can't complain with `cron`).

**Now we just need to get a PlayStation 5 using this program.**

# Known bugs

## Website timeout

A website timeout will result in a successful notification. I need to  learn
more Haskell, especially error management, before I can fix this. :X

# Specs

```
yyyyyy xxxxxx
 yyyyyy xxxxxx                 ------------------------------------------
  yyyyyy xxxxxx                Project: SilkSpectre (1 branch)
   yyyyyy xxxxxx               HEAD: 3847897 (main, origin/main)
    yyyyyy xxxxxx yyyyyyyyyy
     yyyyyy xxxxxx yyyyyyyyy   Languages: Haskell (98.3 %) JavaScript (1.7 %)
      yyyyyy xxxxxx            Dependencies: 1 (npm)
     yyyyyy xxxxxxxx yyyyyyy   Author: 100% Jimmy Royer 6
    yyyyyy xxxxxxxxxx yyyyyy
   yyyyyy xxxxxxxxxxxx         Repo: git@github.com:jimleroyer/SilkSpectre.git
  yyyyyy xxxxxx  xxxxxx        Commits: 6
 yyyyyy xxxxxx    xxxxxx       Lines of code: 181
yyyyyy xxxxxx      xxxxxx      Size: 2.66 KiB (23 files)
                               License: MIT

===============================================================================
 Language            Files        Lines         Code     Comments       Blanks
===============================================================================
 Cabal                   1           99           88            5            6
 Haskell                 8          262          178           36           48
 JavaScript              1            3            3            0            0
 JSON                    2         1028         1028            0            0
 Markdown                2           73            0           59           14
 PowerShell              1           88           65           11           12
 YAML                    3          157           70           66           21
===============================================================================
 Total                  18         1710         1432          177          101
===============================================================================
```

repository: jimleroyer/SilkSpectre

repo_name: jimleroyer/SilkSpectre


text:
## Baby Bot to Big Brain Machine Learning Research Program

The Baby Bot to Big Brain machine learning research program trains a neural network based AI for all 9 classes in Team Fortress 2. Help them play and help them learn! GLHF!

Our main repository is currently private due university requirements, but we hope that may be changed soon with approval!

See our website for live status: https://baby-bot-tf2.github.io/


text:
---
title: Lesson «jQuery»
description: Prepared for Epic Skills students
date: 2017-04-17
tags:
  - courses
  - epic-skills
---

The purpose of these lessons is to explain language concepts in person in an offline format.
s
Almost all the content and all the graphics in these two presentations were done by previous instructors. If you know the names, please email me to point out the authorship.

First part of lesson: https://fogrew.github.io/keynotes-jquery/
Second part of lesson: https://fogrew.github.io/keynotes-jquery/index2.html
Source slides: https://github.com/fogrew/keynotes-forms

[Epic Skills](https://epixx.ru/) are professionals with years of experience in various fields whose turbo engine is the desire to spread knowledge. I really wish they hadn't lost their offline base due to quarantine strain and could teach students there further. Right now they need financial support. [Help the guys?](https://donate.epixx.ru/)

gha_language: Nunjucks


text:
# GSheet to arb

Imports Application Resource Bundle (arb) from Google Sheets

## Import ARB files from the Google Sheet

To import arb files from Google Sheet run the `import` program.

```
pub run gsheet_to_arb:import
```

## Export ARB files to the Google Sheet

To import arb files from Google Sheet run the `import` program.

```
pub run gsheet_to_arb:export
```


text:
EmailsField
===========

EmailsField is a form field for entering more email addresses.

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

Just use the Composer:

    cd path/to/your/atk14/project/
    composer require atk14/emails-field

    ln -s ../../vendor/atk14/emails-field/src/app/fields/emails_field.php app/fields/emails_field.php

Testing
-------

    composer update --dev
    cd test
    ../vendor/bin/run_unit_tests

License
-------

EmailsField is free software distributed [under the terms of the MIT license](http://www.opensource.org/licenses/mit-license)

[//]: # ( vim: set ts=2 et: )


text:
# Single Series and Multi Series Bar Column Line and Area Charts

<PageHeader />

Bar, column, line and area chart widgets can be created as single-series charts, or multi-series charts. A single-series chart is defined by a single list of data points, each with a corresponding value. For example, a monthly sales chart for a single year contains one data point for each of the twelve months; the sales volume. A multi-series chart is defined by more than one list of related data points, each with a corresponding value. An example of a multi-series chart would be monthly sales by product category for a single year. In such a chart, multiple data points represent one value for each category.

Line charts are most useful for representing trends, while bar and column charts provide an effective way to present comparative information. Bar charts are identical to column charts from a data perspective; however a column chart’s vertical bars are better suited for presenting a progression toward a goal like sales, profit or margin. Bar charts present horizontal bars, which are useful in presenting information such as sales by geography or demographics in which goals may not be relevant.

A multi-series column cart may be represented as a "stacked column chart" in which the columns are represented in a vertical "stack" rather than a series of individual, adjacent vertical columns. Similarly, a multi-series line chart may be represented as an "area chart" in which each line’s value represents a portion of the whole. Therefore, an area chart is ideal for presenting multiseries trend information, and a stacked column chart is ideal for presenting comparative data.

Single-series bar, column, line and area charts are created using any of the following types:

1. FCAREA2D – 2-dimensional Area Chart
2. FCBAR2D – 2-dimensional Bar Chart
3. FCCOLUMN2D – 2-dimensional Column Chart
4. FCCOLUMN3D – 3-dimensional Column Chart
5. FCLINE – Line Chart

Multi-series bar, column, line and area charts are created using any of the following types:

1. FCMSAREA2D – 2-dimensional Area Chart
2. FCMSBAR2D – 2-dimensional Bar Chart
3. FCMSCOLUMN2D – 2-dimensional Column Chart
4. FCMSCOLUMN3D – 3-dimensional Column Chart
5. FCMSLINE – Line Chart
6. FCSTACKEDAREA2D – 2-dimensional Stacked Area Chart
7. FCSTACKEDBAR2D – 2-dimensional Stacked Bar Chart
8. FCSTACKEDCOLUMN2D – 2-dimensional Stacked Column Chart
9. FCSTACKEDCOLUMN3D – 3-dimensional Stacked Column Chart

These charts are very similar, and the methods used in creating these widgets are virtually identical. The following variables are used to define both single- and multi-series charts:

| <!----> | <!----> |
| --- | --- |
| W$BAR.LABELS | AM-Array of labels for each series of a multi-series chart. Single-series charts do not use this value. |
| W$BAR.VALUES | VM-Array of data point values for any series. For multi-series charts, the variable contains a two-dimensional array in which the attributes correspond with W$BAR.LABELS. |
| W$BAR.VALUE.OPTS | VM-Array of Optional Parameters associated with each value. |
| W$BAR.CAPTION | Text caption for the chart itself. |
| W$BAR.COLORS | VM-Array of color choices to override default colors. |
| W$BAR.XLABELS | VM-Array of labels for each value on the X-axis. For multi-series charts, the variable contains a two-dimensional array in which the attributes correspond with W$BAR.LABELS. |
| W$BAR.XMEMO | The text to appear beneath the X-axis of the chart. |
| W$BAR.TMEMO |  The text to appear alongside the Y-axis of the chart. |
| W$BAR.LABEL.OPTS | AM-Array of optional parameters associated with the W$BAR.LABELS values. |
| W$BAR.XLABELS.OPTS | VM-Array of optional parameters associated with the W$BAR.XLABELS values. |
| W$BAR.TREND.BEG | M-Array of beginning points of trendlines. |
| W$BAR.TREND.END | VM-Array of ending points of trendlines. |
| W$BAR.TREND.OPTS | VM-Array of optional parameters for each trendline. |

<PageFooter />

repository: josepheshaw/docs

repo_name: josepheshaw/docs


text:
# Metrics Reporting Helper

A thin wrapper around [go-metrics](github.com/rcrowley/go-metrics) that streamlines setup and a few common uses (tracking event rates and timings) and exports to graphite.

## Usage

```
  r := report.NewRecorder().ReportTo("graphite-collector:2170", "foobar.baz")
  r.Inc("request")
  r.Time("handler", 5*time.Second)
```
### Default Recorder
Alternately, rather than pass around a Recorder instance, you can also set a configured `Recorder` as the default during startup, then use helpers elsewhere that just report to the default recorder.

```
  report.NewRecorder().ReportTo("graphite-collector:2170", "foobar.baz").SetAsDefault()
  ...
  report.Inc("request")
  report.Time("handler", 5*time.Second)
```

# Authors
- [David Taylor](http://github.com/dt)

repository: foursquare/fsgo

gha_language: Go

repo_name: foursquare/fsgo


text:
# Python Serial logger on CVS file

## Python serial logger to CSV file output

### Usage:
#### Change the serial port according to the connected device/com port.

gha_language: Python


text:
# This project has been archived, see its successor, https://github.com/siraben/zkeme80

# ti84-forthos - a Forth-based OS for the TI-84+ calculator
**ti84-forthos** is an operating system that is designed from the
ground up to revolve around the *Forth* programming language.  See the
documentation at `docs/` for more information.  It is based on
**hiti**, the minimal core.

## Current Status
Nothing implemented yet.

## Dependencies
The build process depends on the following tools:

| Tool        | Link to Repository                      |
| :---:       | :---:                                   |
| kcc         | https://github.com/KnightOS/kcc         |
| scas        | https://github.com/KnightOS/scas        |
| mkrom       | https://github.com/KnightOS/mkrom       |
| mktiupgrade | https://github.com/KnightOS/mktiupgrade |

[z80e](https://github.com/KnightOS/z80e) is optional but having it
will allow you run it emulated.

## Compiling
Clone this repository and run `make`.

## Debugging
Use the `make z80e` target to run your OS in the z80e debugger.  You
should see a prompt waiting for you to enter debugger commands - use
"run" to start running the CPU.  You can pause execution again by
hitting Ctrl+C in the debugger console.  Use "?" for a list of
debugger commands.


text:
# Macron Logic
Intrinsics for Macron: these were chosen because most needed operations can be synthesized by stringing a few of these together. Since the stdlib will be pretty much completely abstracting away the intrinsics, the compiler devs (us) who are also writing the stdlib can take elements from the stdlib which do a certain task and hardcode that into the compiler to do the correct instruction.

Operand types:
- `imm`: Immediate/constant.
- `mem`: Equivalent to any other operand type than `mem`, but dereferenced. A constant size (1/2/4/8 bytes) is also provided.
- `var`: A constant opaque reference to a variable.
- `reg`: Refers to either of the two registers: `sp` and `bp`, the stack and base pointers respectively.

L = `var`/`mem`/`reg`, T/U = `var`/`mem`/`reg`/`imm`

Note: where it would be known at comptime, such as `bgt .., 5, 6`, that combination isn't allowed (bgt on imm and imm specifically here)

All IDs increment once used. For example
```
allocvars ffffffffffffffff
allocvars 0
...
```
is the correct way to write a frame contained in another.

```
# This intrinsic is equivalent to the following pseudocode:
#   (amt, var_ids) = internal_allocvars(var_sizes...)
#   sp -= amt
# i.e., it subtracts enough space to store the variables from sp, and generates a unique id. You should use the generated var_ids to access the variables. If you're currently inside an allocvars frame, you should pass its id as `prev_alloc` (otherwise pass -1u64) so that registers aren't reused or the like.
# Accessing variables will only work properly if you set `b` to `s` before calling allocvars as the variables will be based on the base pointer, not the stack pointer. This means that to exit a frame you must simply restore the old base pointer.
allocvars prev_alloc, var_sizes: imm64...

add     result: L, x: L, y: T
nand    result: L, x: L, y: T
shiftl  result: L, x: T, amt: U # shift left
shiftrz result: L, x: T, amt: U # shift right zero extend
shiftrs result: L, x: T, amt: U # shift right sign extend

# labels, 0 = last defined label, -1 = one before it, 1 = one after, etc.

blockaddr result: L, block_id: imm64
```

# Blocks and Functions
Logic in Macron is structured into blocks which are then added into functions. A block is similar to an LLVM basic block, in that it contains logic and at the end is a branch. In the expander, the following intriniscs can be used to end the current block with a branch and start a new one:

```
# Unconditional branch
b block_id

# Branch to address
baddr addr: T

# Branch if equal
beq true_id, false_id x: L, y: T

# Branch if greater than (unsigned)
bgt true_id, false_id, x: T, y: T

# Branch if greater than (signed)
bab true_id, false_id, x: T, y: T
```

repository: macron-lang/specification

repo_name: macron-lang/specification


text:
# **Github Flavored Markdown Beginners Cheatsheet**
##### `Last Edited: 1-17-2017`
###### Version: v.17.01.17
### **Markdown Editor Built into Atom**

Show rendered HTML markdown using `CTRL-SHIFT-m`.  ATOM enables HTML markdown for the following extensions:
* .markdown
* .md
* .mdown
* .mkd
* .mkdown
* .ron
* .txt

For these filetypes, Inline HTML is *mostly* allowed.

#### Install [ :dizzy: Atom](https://atom.io/) for Windows, Mac or Linux.

# **Comment**
(If anything besides this line is seen in this Comment area **then that specific comment command is not working!**)
[//]: # (Comment Type/Test #1)

# **Headers**
(Start line with the number of hashtags (#) as stated after the **H** to make the following headers.  Note: H1 & H2 tags have horizontal rules underneith them.)
# H1 tag
alternative H1 tag
==================
## H2 tag
alternative H2 tag
------------------
### H3 tag
#### H4 tag
##### H5 tag
###### H6 tag
(In Atom, only two -- or == is needed under the word to use the alternative header tag.  For readability of the text file, however, it's recommended to add the line across the entire title.)

# **Text Styling**
(italic - surround text with \* or \_ ): *italic text 1* or _italic text 2_

(bold - surround text with \*\* or \_\_ ): **bold text 1** or __bold text 2__

**You can encapsulate *italics* in bold**

or  *have __bold__ in italics.*

Strikethough by surrounding text with \~\~ can ~~redact~~.

# **Links**
(simple: enter the URL, it becomes a link) https://github.com/

(relative - \[link name\]\(url\) - example: [github](https://www.github.com/))

# **Quote**
(The first two can used to format code w/o code highlighting.)

this is an `inline` quote

```
A box of formated text
```

> This is a blockquote

> enjoy!

# **Code**
(Four ```` followed by code language. Supports code highlighting whenever possible.)
````javascript
alert('Hello World!')
````

````python
print("Hello World!")
````

````html

    <title>Hello World!</title>

Hello World!

````

```
three marks also works (no code formatting)
```

This is inline code ( surround text with \` ): `#!/bin/bash`

# **Tables**
(Use | for every column and - between header; Place | where  - meets.  Colons to set left, right, or center justification.)

Header 1 | Header2 | Header 3
:-------:|:--------|---------:
Center 1 | Left 2  | Right 3
Center 4 | Left 5  | Right 6

# **Unordered Lists**
(Use tabs for sub-items: + - or * can be used.)
* item
  * sub-item
    + sub-sub-item
      - sub-sub-sub-item
* item
* item

# **Ordered Lists**
(Add two tabs add unordered items - behavior can be strange and might change in future...)

1. item
  1. sub-item
    1. sub-sub-item
        * sub-sub-sub-item
2. item
3. item
* item

# **Task Lists**
(Add lists of marked and unmarked items with "- [ ]" unmarked or "- [x]" marked.)
- [x] one
- [ ] two
- [x] three

# **Images**
(Bracket holds alternative text of image, parens hold the URL of the image)
![8-bit octo](https://github.com/octo.png)

# **Emoji**
(display emojis on the screen by surrounding the word with ::)

:smile: :shit: :eggplant:

**Full list:** http://www.webpagefx.com/tools/emoji-cheat-sheet/

# **Ignore Markdown**
(add \ in front of markdown character to escape and display character, not always necessary)

\# I love hashtags \#

# **Inline HTML**
(most HTML works with GitHub Flavored Markdown - example in Notice Section)

# **Notice**
CC0 - Ron Cotton

  To the extent possible under law,

    Ron Cotton
  has waived all copyright and related or neighboring rights to
  github-markdown-cheatsheet.
This work is published from:

  United States.

repository: ronaldcotton/github-markdown-cheatsheet

repo_name: ronaldcotton/github-markdown-cheatsheet


text:
# [Find the nth Digit of a Number](https://www.codewars.com/kata/577b9960df78c19bca00007e)

Complete the function that takes two numbers as input, `num` and `nth` and return the `nth` digit of `num` (counting from right to left).

## Note

- If `num` is negative, ignore its sign and treat it as a positive value
- If `nth` is not positive, return `-1`
- Keep in mind that `42 = 00042`. This means that `findDigit(42, 5)` would return `0`

## Examples

```
findDigit(5673, 4)     returns 5
findDigit(129, 2)      returns 2
findDigit(-2825, 3)    returns 8
findDigit(-456, 4)     returns 0
findDigit(0, 20)       returns 0
findDigit(65, 0)       returns -1
findDigit(24, -8)      returns -1
```

---

## Tags

- Basic Language Features
- Fundamentals

repository: marcobiedermann/codewars

gha_language: TypeScript

repo_name: marcobiedermann/codewars


text:
### [CVE-2015-4495](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-4495)
![](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

The PDF reader in Mozilla Firefox before 39.0.3, Firefox ESR 38.x before 38.1.1, and Firefox OS before 2.2 allows remote attackers to bypass the Same Origin Policy, and read arbitrary files or gain privileges, via vectors involving crafted JavaScript code and a native setter, as exploited in the wild in August 2015.

### POC

#### Reference
- http://www.oracle.com/technetwork/topics/security/bulletinapr2016-2952098.html
- https://www.exploit-db.com/exploits/37772/

#### Github
- https://github.com/ARPSyndicate/cvemon
- https://github.com/vincd/CVE-2015-4495


text:
# ProjectPhosphorus

This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 1.5.5.
Current [Angular CLI](https://github.com/angular/angular-cli) version is 6.2.1

Pull event data from a third party that provides a back-end connection to a MS SQL Server database (CSV data format), convert to JSON, reform the data to better serve the app's purpose, and upload to a newly created database (MongoDB). Develop an Angular app to view reports on productivity.

----
## aws-serverless stack

* Angular SPA served statically via S3
* API Gateway
* DynamoDB (officers and reports tables only)
* Cognito
* Lambda
* Route 53

![Serverless Diagram](https://raw.githubusercontent.com/sfdeloach/project-phosphorus/master/project-phosphorus.png)

repository: sfdeloach/project-phosphorus

repo_name: sfdeloach/project-phosphorus


text:
House Cup
=====================

A very simple Potter-ish house cup points tracker. Someone with the password can add or remove points (negative #), and anyone can view point totals.

Build with react-transform-boilerplate and Firebase

Firebase Format
=====================

Your Firebase data should be formatted in the following way:

```
root
	houseId
		name:"",
		points:#,
		members:[
			name:"",
			name:""
		]
	house2Id
		name:""
		...
```

And so on.


text:
# Code Quiz

## What is the purpose of this project?

This is an online quiz with multiple-choice questions related to coding. This application will run in the browser, and will feature dynamically updated HTML and CSS powered by JavaScript code.

![Screenshot 1](assets/CQ.png)

## How to achieve my goal?

I created html and css files to build the look of the quiz while inputting different questions dynamically via the script file. Within the script file, I sorted the questions and answers into arrays with correct answers. I mainly used jQuery to run functions, including hide/reveal different div elements, and to call out different functions.

## Challenges

It was not easy to sort out the logic in each function that is necessary to pull in the correction questions, storing the answers, and determining the correctness of the user's input. Oftentimes the codes wouldn't run properly with my first attempt.

## Credits

The initial codes are provided by Trilogy Education Services, a 2U, Inc. brand.

## License

© Irene Asay. All Rights Reserved. Under the [MIT/](./LICENSE.txt) license.

repository: IreneAsay/code-quiz

repo_name: IreneAsay/code-quiz


text:
---
layout: default
---

# 1996-10-07 - Re: You can be forced to turn over your encryption keys?

## Header Data

From: "Timothy C. May"<EMAIL_ADDRESS>To: "Geoffrey C. Grabow"<EMAIL_ADDRESS>Message Hash: 050ca49203d41c9510af6fe97d14e765e4fbc83437b56f3f1d62b2eddefebee6

Message ID<EMAIL_ADDRESS>Reply To<EMAIL_ADDRESS>UTC Datetime: 1996-10-07 22:05:25 UTC

Raw Date: Tue, 8 Oct 1996 06:05:25 +0800

## Raw message

```
{% raw  %}From: "Timothy C. May"<EMAIL_ADDRESS>Date: Tue, 8 Oct 1996 06:05:25 +0800
To: "Geoffrey C. Grabow"<EMAIL_ADDRESS>Subject: Re: You can be forced to turn over your encryption keys?
In-Reply-To<EMAIL_ADDRESS>Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

At 10:33 AM -0400 10/7/96, Geoffrey C. Grabow wrote:
>I thought we had a 5th amendment.  Isn't turning over your key that may (or
>may not) expose encriminating evidence an extension of self-encrimination?
>Haven't there been dozens of famous witnesses (Patty Hurst, Oliver North,
>etc) that "take the 5th" dozens of times on the stand.  Why couldn't I
>"take the 5th" when asked for my encryption keys?  When asked for your key,
>can't you say: "I'm sorry your honor, but I respectfully refuse to answer
>that question on the grounds that it may incriminate me.".
>
>Any legal-eagles out there?

Though IANAL, I know of many, many discussions of this question. So far as
I know, it remains one of The Great Unresolved Questions.

Mike Godwin has written on this, so a Web search might turn up some
archived articles. It came up several times on the Cyberia list when I was
on it, but those archives are spotty (in terms of availabilty to Web
spiders).

My Cyphernomicon FAQ also has this to say: (presented in outline form)

 10.3.4. "Can authorities force the disclosure of a key?"
           + Mike Godwin, legal counsel for the EFF, has been asked this
              queston _many_ times:
             - "Note that a court could cite you for contempt for not
                complying with a subpoena duces tecum (a subpoena
                requiring you to produce objects or documents) if you
                fail to turn over subpoenaed backups....To be honest, I
                don't think *any* security measure is adequate against a
                government that's determined to overreach its authority
                and its citizens' rights, but crypto comes close." [Mike
                Godwin, 1993-06-14]
           + Torture is out (in many countries, but not all). Truth
              serum, etc., ditto.
             - "Rubber hose cryptography"
           + Constitutional issues
             - self-incrimination
           + on the "Yes" side:
             + is same, some say,  as forcing combination to a safe
                containing information or stolen goods
               - but some say-and a court may have ruled on this-that
                  the safe can always be cut open and so the issue is
                  mostly moot
               - while forcing key disclosure is compelled testimony
             - and one can always claim to have forgotten the key
             - i.e., what happens when a suspect simply clams up?
             - but authorities can routinely demand cooperation in
                investigations, can seize records, etc.
           + on the "No" side:
             - can't force a suspect to talk, whether about where he hid
                the loot or where his kidnap victim is hidden
             - practically speaking, someone under indictment cannot be
                forced to reveal Swiss bank accounts....this would seem
                to be directly analogous to a cryptographic key
             - thus, the key to open an account would seem to be the
                same thing
             - a memorized key cannot be forced, says someone with EFF
                or CPSR
           + "Safe" analogy
             + You have a safe, you won' tell the combination
               - you just refuse
               - you claim to have forgotten it
               - you really don't know it
             - cops can cut the safe open, so compelling a combination
                is not needed
             - "interefering with an investigation"
           - on balance, it seems clear that the disclosure of
              cryptographic keys cannot be forced (though the practical
              penalty for nondisclosure could be severe)
           + Courts
             + compelled testimony is certainly common
               - if one is not charged, one cannot take the 5th (may be
                  some wrinkles here)
               - contempt
           + What won't immunize disclosure:
             + clever jokes about "I am guilty of money laundering"
               - can it be used?
               - does judge declaring immunity apply in this case?
               - Eric Hughes has pointed out that the form of the
                  statement is key: "My key is: "I am a murderer."" is
                  not a legal admission of anything.
             - (There may be some subtleties where the key does contain
                important evidence--perhaps the location of a buried body-
                -but I think these issues are relatively minor.)
           - but this has not really been tested, so far as I know
           - and many people say that such cooperation can be
              demanded...
           - Contempt, claims of forgetting
   10.3.5. Forgetting passwords, and testimony
           + This is another area of intense speculation:
             - "I forgot. So sue me."
             - "I forgot. It was just a temporary file I was working on,
                and I just can't remember the password I picked." (A less
                in-your-face approach.)
             + "I refuse to give my password on the grounds that it may
                tend to incriminate me."
               + Canonical example: "My password is: 'I sell illegal
                  drugs.'"
                 - Eric Hughes has pointed out this is not a real
                    admission of guilt, just a syntactic form, so it is
                    nonsense to claim that it is incriminating. I agree.
                    I don't know if any court tests have confirmed this.
           + Sandy Sandfort theorizes that this example might work, or
              at least lead to an interesting legal dilemma:
             - "As an example, your passphrase could be:

                        I shot a cop in the back and buried his body
                under
                        the porch at 123 Main St., anywhere USA.  The gun
                is
                        wrapped in an oily cloth in my mother's attic.

                "I decline to answer on the grounds that my passphrase is
                a statement which may tend to incriminate me.  I will
                only give my passphrase if I am given immunity from
                prosecution for the actions to which it alludes."

                "Too cute, I know, but who knows, it might work." [S.S.,
                1994-0727]

"The government announcement is disastrous," said Jim Bidzos,.."We warned IBM
that the National Security Agency would try to twist their technology."
[NYT, 1996-10-02]
We got computers, we're tapping phone lines, I know that that ain't allowed.
---------:---------:---------:---------:---------:---------:---------:----
Timothy C. May              | Crypto Anarchy: encryption, digital money,
<EMAIL_ADDRESS>408-728-0152 | anonymous networks, digital pseudonyms, zero
W.A.S.T.E.: Corralitos, CA  | knowledge, reputations, information markets,
Higher Power: 2^1,257,787-1 | black markets, collapse of governments.
"National borders aren't even speed bumps on the information superhighway."

{% endraw %}
```

## Thread

+ Return to [October 1996](/archive/1996/10)

+ Return to "["Geoffrey C. Grabow" <gcg@pb.net>](/authors/geoffrey_c_grabow_gcg_at_pb_net_)"
+ Return to "["Timothy C. May" <tcmay@got.net>](/authors/timothy_c_may_tcmay_at_got_net_)"

+ 1996-10-07 (Tue, 8 Oct 1996 03:35:44 +0800) - [You can be forced to turn over your encryption keys?](/archive/1996/10/ae050698c9973559de53048b9ef4a7b91361ba23837bf5e106ea14688feb84fa) - _"Geoffrey C. Grabow"<EMAIL_ADDRESS>  + 1996-10-07 (Tue, 8 Oct 1996 06:05:25 +0800) - Re: You can be forced to turn over your encryption keys? - _"Timothy C. May"<EMAIL_ADDRESS>


text:
# MooSkin UI - Tags Component

___

### Usage

To start using the Tags Component first you have to Import it

```
Import {Tags} from '@moosend/mooskin';
```
or modular import
```
// JS
import Tags from '@moosend/mooskin/lib/Tags';

// CSS
import<EMAIL_ADDRESS>```

And then you can simply start using it by typing

```
<Tags />
```

Now this is a simple input, taggind data by submitting it. Submission by `enter` is default, this can be changed though.

We'll be looking at the following examples, to understand how to utilize this component.

### Examples

```
this.state = {
    cities: ['Prishtina', 'Athens']              // accepts and returns an array of strings
}

<Tags tags={this.state.cities} />
```

Now those cities will appear as tags in the component, further tags can be added of course by typing.

Pre defined data can be passed as props, so when typing has started on the component, suggestions will appear to select and tag them.

```
this.state = {
    cities: ['Prishtina', 'Athens']
}

const sources = ['London', 'Berlin', 'Beijing', 'New York';]

<Tags tags={this.state.cities} source={sources} />
```

Or you can pass a function that returns an array of strings, or a promise that resolves into an array of strings, if you have to get suggestions from an api call

```
this.state = {
    cities: ['Prishtina', 'Athens']
}

const promiseFunc = () => {
    return fetch('https://api.github.com/users?since=135') // fetch function returns a promise
                .then(rsp => rsp.json())
                .then(data => data.map(user => user.login));
}
<Tags tags={this.state.cities} source={promiseFunc} />
```

Now as far as submission goes, `Enter` is the default key to do it, but this can be changed via the `delimiters` prop, which accepts `keyCode` idendifier or `key` idendifier.

```
this.state = {
    cities: ['Prishtina', 'Athens']
}

<Tags tags={this.state.cities} delimiters=['Enter', 32, 188] />    // 32 and 188 are keyCodes for `space` and `,`
```

### Callback

The Tags Component Callback will always return an array of strings, which reflects the added or removed tags. Callbacks are seperated into two different functions, `onAdd` and `onRemove`. `onAdd` return an array of the newly added tag/tags which then can be used to change the state of the parent component. `onRemove` returns an array of the removed tag/tags and the index of the removed tag.

Playing with data
```
this.state = {
    cities: ['Prishtina', 'Athens']
}

onAdd = (e, data) => {            // data is the callback object, which consists of value and a dataLabel(not required)
    console.log(data.value);      // in the case of adding `London` to the tags, `data.value` will equal `London`
};

onRemove = (e, data, index) => {     // data is the callback object, which consists of value and a dataLabel(not required)
    console.log(data.value);         // in the case of pressing `Backspace`, `data.value` will equal `Athens`, and index is `1`
};

<Tags tags={this.state.cities} onAdd={this.onAdd} onRemove={this.onremove} />
```

This can be used in various situations and combinations, for an enhanced development experience.

### Validation

The Tags Component can be validated using the `status` and `validate` props. The `status` prop will accept an 'error' or 'success' string to apply the appropriate classes to the tags, or none for that matter. The `validate` prop is the validation function which accepts a arg of an object containing `value`, `dataLabel` and `required` props of the component as properties, and depending on the received value, you can use any kind of validation you like. The `description` prop can also be used in the process to inform the user about validation errors. The validation will fire the first time onBlur, and every other time onChange.

#### Example

```
this.state = {
    status: '',
    message: '',
    tags: []
}

<Tags
    validate={this.validate}
    delimiters={['Enter', 'space', ',']}
    status={this.state.status}
    description={this.state.message}
    validateTag="email"
    label="Email only tags"
    tags={this.state.tags4}
    onAdd={this.onAdd}
    onRemove={this.onRemove}
/>

onChange(e, data) {
    this.setState({value: data.value})
}

validate(data){
    if (data.value.length < 2){
        this.setState({status: 'error', message: 'At least 2 emails are required'});
        return false;
    } else {
        this.setState({status: '', message: ''});
        return true;
    }
}
```

Now `validate` is the function for validation the whole component (eg. field is required and empty, throw error). `validateTag` on the other hand is for validating single tag inputs (eg. accept only email tags).

<div class="playground-doc">

## Supported attributes for Tags

* `id` - id of the element
* `className` - css class
* `validation` - validate input, can be either 'email' or a custom validation function that acceps a string arg
* `errorMessage` - message to appear when the tag has been rejected due to invalid type.
* `style` - extra styles for the main container
* `tagStyles` - styles for individual tags
* `tagClasses` - classes for individual tags
* `delimiters` - an array of keys (string) or keyCodes (number) which will trigger a submission
* `preventSubmit` - prevents submission on input blur
* `deletable` - wether tags should be deletable by backspace, still can be deleted by clicking on X
* `label` - tags label
* `placeholder` - placeholder on the input
* `source` - source of the searchable and selectable typeahead data, can be an array of strings or a function that returns either an array of strings or a promise that resolves into an array of strings
* `sourceLimit` - number of max results for source
* `tags` - data to appear as already tagged (array of strings)
* `onAdd` - callback func which returns a newly created tag, can be added to the component with unidirectional flow, should return the value if validation is used.
* `onRemove` - callback func which returns the tag to be removed and the index of the tag within an array, should return the value if validation is used.
* `validateTag` - validate single tag input function
* `validate` - validate function to validate the whole tags component
* `status` - to be used with validate, to apply classes based on error or success
* `labelLeft` - positions the label to the left of the input
* `alternate` - renders with different styles
* `maxLength` - maximum number of characters allowed
* `onTagClick` - called when a tag is clicked, returning event, data, and index of the tag

</div>

Allthough these attributes are supported, all of them are optional.

___

#### For more

[MooSkin-UI](https://github.com/moosend/mooskin-ui)

repository: theonastos/mooskin-ui

repo_name: theonastos/mooskin-ui


text:
## To Run the Application

When developing locally, you can start the app by running:

```
npm run dev
```

If you are interested running the completed application, you can run:

```
npm run final
```

repository: abazudosen/notedlys-FRONTEND

repo_name: abazudosen/notedlys-FRONTEND


text:
How to add a new changelog entry to the pending changelog?
==========================================================

This will get copied to dlang.org and cleared when master gets
merged into stable prior to a new release.

```
My fancy new feature X

A long description of the new feature.
-------
import std.range;
import std.algorithm.comparison;

assert([1, 2, 3, 4, 5].padLeft(0, 7).equal([0, 0, 1, 2, 3, 4, 5]));

assert("Hello World!".padRight('!', 15).equal("Hello World!!!!"));
-------
```

The title can't contain links (it's already one).
For more infos, see the [Ddoc spec](https://dlang.org/spec/ddoc.html).

Preview changes
---------------

If you have cloned the [tools](https://github.com/dlang/tools) and [dlang.org](https://github.com/dlang/dlang.org) repo),
you can preview the changelog with:

```
make -C ../dlang.org -f posix.mak pending_changelog
```


text:
# Chapter 27 : Preprocessor

<dialog character="mechanics">Our ship is made of modules, you can easily attach or remove external modules, check it out.</dialog>

Instead of writing the LIGO code in a single file, it is possible to split the code into different files or include some external code into our file. The pre-processor is responsible for handling code inclusion. While working with multiple files we may encounter a problem of cyclic inclusion. To prevent such situation some pre-processor commands are available.

- #if
- #define
- #include

⚠ Notice all pre-processor command names start with a _#_.

## Include

Pre-processor command _#include_ permits code inclusion. It allows to merge some code into your file. Command _#include_ requires a path to a ligo file.

```
#include "tzip-12/fa2_interface.mligo"
```

## Define

Pre-processor command _#define_ allows to introduce tags.

```
#define FA2_NFT_TOKEN
```

Such tags can be used with a conditionnal command.

## Conditionnal

Pre-processor commands _#if_, _#else_ and _#endif_ allows to consider / ignore some part of the file depending on tags. Tags are defined with the _#define_ command.

```
#if !FA2_NFT_TOKEN

#define FA2_NFT_TOKEN
#include "tzip-12/fa2_interface.mligo"

let substr_special (s: string) : string =
  String.sub 0n 4n s

#else
#include "test/fa2_int.mligo"

let substr_special (s: string) : string =
  String.sub 0n 3n s

#endif
```

⚠ Notice that the conditionnal _#if_ can be used to customize your includes.

⚠ Notice that this pattern prevents variable or type redefinition in case of cyclic inclusion.

```
#if !X
#define X
```

## Your mission

We are implementing a smart contract with a modular approach.

As you can see in our exercise, when the WITH*EXTRA tag is defined then the code in extra.mligo file is included.
The module \_extra* defines the tag EXTRA and implements a function _doSomethingExtra_.

We want you to make the code responsive to the tag EXTRA.

<!-- prettier-ignore -->1- Modify the function *doSomethingInventory* in the inventory contract *inventory* so as to execute *doSomethingExtra* on the given parameter if the EXTRA tag is defined. Otherwise execute *removeFirst* on the given parameter.

repository: octo-technology/tezos-academy

repo_name: octo-technology/tezos-academy


text:
# Clean and Green

  ![Made With JavaScript](https://img.shields.io/badge/Made%20With-JavaScript-brightgreen.svg)
  ![Made With Node.js](https://img.shields.io/badge/Made%20With-Node.js-green.svg)

---

> A website that aims at keeping the citizens updated about the upcoming cleaning drives, tree plantation drives and similar campaigns and thus promotes a way to keep the surroundings clean.
---

## Features

- Drives - to organize campaigns
- Maps - location of the drive, also gives location of garbage collection centers
- Blog - featuring articles as to how one can contribute towards a healthy environment
- "Think Green" feature
- Email upon registration as Volunteer for the campaign

---

## Requirements

- Node.js and Node package manager (npm)
- MongoDB (with path set correctly)

---

## Installation & Setup

```sh
$ git clone https://github.com/ashna111/clean-and-green.git

$ npm install

$ mongod

$ node app.js
```

---

## Contributors

- [Neha Patil](https://github.com/Nehaa-Patil)
- [Rebecca Biju](https://github.com/beccaboo-31)
- [Ashna Shah](https://github.com/ashna111)

repository: beccccaboo/clean-and-green

repo_name: beccccaboo/clean-and-green


text:
# Advanced Topics for the Smartsheet SDK for C#

## Logging
The Smartsheet C# SDK references the [NLog project](http://nlog-project.org) for SDK logging. NLog is highly configurable for console
and file logging. The root folder contains an `NLog.config` file which specifies the logging configuration of the SDK. Targets for File and ColorConsole logging are used by the SDK.

Using NLog, the Smartsheet C# SDK logs all API queries including HTTP method, URI, HTTP status, and response time
to `INFO`. API Request and Response details are logged to `DEBUG`.

## Passthrough Option

If there is an API feature that is not yet supported by the C# SDK, there is a passthrough option that allows you to
pass and receive raw JSON objects.

To invoke the passthrough, your code can call one of the following four methods:

`string jsonResponse = smartsheet.PassthroughResources().PostRequest(endpoint, payload, parameters);`

`string jsonResponse = smartsheet.PassthroughResources().GetRequest(endpoint, parameters);`

`string jsonResponse = smartsheet.PassthroughResources().PutRequest(endpoint, payload, parameters);`

`string jsonResponse = smartsheet.PassthroughResources().DeleteRequest(endpoint);`

* `endpoint (string)`: The specific API endpoint you wish to invoke. The client object base URL gets prepended to the caller’s
endpoint URL argument, e.g., if endpoint is 'sheets' an HTTP GET is requested from the URL https://api.smartsheet.com/2.0/sheets
* `payload (string)`: The data to be passed through in the request payload as a string.
* `query_params (Dictionary<string,string>)`: An optional list of query parameters.

All calls to passthrough methods return a JSON string result.

### Passthrough Example

The following example shows how to POST data to https://api.smartsheet.com/2.0/sheets using the passthrough method and
a JSON string payload:
```csharp
SmartsheetClient smartsheet = new SmartsheetBuilder().SetMaxRetryTimeout(30000).Build();

string payload =
  "{\"name\": \"my new sheet\"," +
    "\"columns\": [" +
      "{\"title\": \"Favorite\", \"type\": \"CHECKBOX\", \"symbol\": \"STAR\"}," +
      "{\"title\": \"Primary Column\", \"primary\": true, \"type\": \"TEXT_NUMBER\"}" +
    "]" +
  "}";

string jsonResponse = smartsheet.PassthroughResources.PostRequest("sheets", payload, null);

long id = 0;
JsonReader reader = new JsonTextReader(new StringReader(jsonResponse));
while(id == 0 && reader.Read()) {
  switch (reader.TokenType)
  {
    case JsonToken.StartObject:
      break;
    case JsonToken.PropertyName:
      if(reader.Value.ToString().Contains("message"))
      {
        string message = reader.ReadAsString();
        Assert.AreEqual(message, "SUCCESS");
      }
      else if(reader.Value.ToString().Contains("id"))
      {
        reader.Read();
        id = (long)reader.Value;
      }
      else
      {
        reader.Read();
      }
      break;
    default:
      reader.Read();
      break;
  }
}
```
A more complete example can be found in the Integration test file, `PassthroughResourcesTest.cs`.

## Testing
Integration tests:
1. Your environment must contain a variable named SMARTSHEET_ACCESS_TOKEN containing an api access token in order to proceed with the tests.
2. Run the tests within the from within Visual Studio.

Mock API tests:
1. Clone the [Smartsheet sdk tests](https://github.com/smartsheet-platform/smartsheet-sdk-tests) repo and follow the instructions from the readme to start the mock server.
2. Run the tests within the `TestSDKMockAPI` project from within Visual Studio.

## Overriding HTTP Client Behavior
You can provide a number of customizations to the default HTTP behavior by extending the DefaultHttpClient class and
overriding one or more methods (examples below).

Common customizations may include:
- implementing an HTTP proxy
- injecting additional HTTP headers
- overriding default timeout or retry behavior

### Sample ProxyHttpClient
The following example shows how to enable a proxy by providing the SmartsheetBuilder with an HttpClient that extends
DefaultHttpClient.

Invoke the SmartsheetBuilder with a custom HttpClient:

```csharp
// Initialize client
SmartsheetClient smartsheet = new SmartsheetBuilder()
    .SetHttpClient(new ProxyHttpClient("localhost", 8888))
    .Build();
```

```csharp
using Smartsheet.Api.Internal.Http;
using System.Net;

namespace sdk_csharp_sample
{
    class ProxyHttpClient : DefaultHttpClient
    {
        public ProxyHttpClient(string host, int port)
            : base()
        {
            // create a WebProxy on the RestSharp client
            this.httpClient.Proxy = new WebProxy(host, port);
        }
    }
}
```
### Sample RetryHttpClient
The following example shows how to override the default retry/timeout logic.

Invoke the SmartsheetBuilder with a custom HttpClient:
```csharp
// Initialize client
SmartsheetClient smartsheet = new SmartsheetBuilder()
    .SetHttpClient(new RetryHttpClient())
    .Build();
```

```csharp
using System;
using System.IO;
using System.Threading;
using Smartsheet.Api;
using Smartsheet.Api.Models;
using Smartsheet.Api.Internal.Http;
using Newtonsoft.Json;

namespace sdk_csharp_sample
{
    class RetryHttpClient : DefaultHttpClient
    {
        /// <summary>
        /// Override this method to perform API requests for special cases
        /// </summary>
        /// <param name="previousAttempts"> number of previous attempts </param>
        /// <param name="totalElapsedTime"> the total elapsed time for the API request </param>
        /// <param name="response"> the last response from the API </param>
        /// <returns> true to retry, false to exit and return error to the caller </returns>
        public override bool ShouldRetry(int previousAttempts, long totalElapsedTime, HttpResponse response)
        {
            string contentType = response.Entity.ContentType;
            if (contentType != null && !contentType.StartsWith("application/json"))
            {
                // it's not JSON; don't try to parse it
                return false;
            }

            Error error;
            try
            {
                // Details about the Smartsheet API error condition
                error = jsonSerializer.deserialize<Error>(
                    response.Entity.GetContent());
            }
            catch (JsonSerializationException ex)
            {
                throw new SmartsheetException(ex);
            }
            catch (Newtonsoft.Json.JsonException ex)
            {
                throw new SmartsheetException(ex);
            }
            catch (IOException ex)
            {
                throw new SmartsheetException(ex);
            }

            switch (error.ErrorCode)
            {
                // The default shouldRetry, retries 4001, 4002, 4003, 4004 codes
                case 4001:
                case 4002:
                case 4003:
                case 4004:
                case 9999: // adding my fictional error code to the retry list
                    break;
                default:
                    return false;
            }

            // The default calcBackoff uses exponential backoff, add custom behavior by overriding calcBackoff
            long backoff = CalcBackoff(previousAttempts, totalElapsedTime, error);
            if (backoff < 0)
                return false;

            logger.Info(string.Format("HttpError StatusCode={0}: Retrying in {1} milliseconds", response.StatusCode, backoff));
            Thread.Sleep(TimeSpan.FromMilliseconds(backoff));
            return true;
        }
    }
}
```

## Event Reporting
The following sample demonstrates best practices for consuming the event stream from the Smartsheet Event Reporting
feature.

The sample uses the `smartsheet.EventResources.ListEvents` method to request a list of events from the stream. The
first request sets the `since` parameter with the point in time (i.e. event occurrence datetime) in the stream from
which to start consuming events. The `since` parameter can be set with a datetime value that is either formatted as
ISO 8601 (e.g. 2010-01-01T00:00:00Z) or as UNIX epoch (in which case the `numericDates` parameter must also be set to
`true`. By default the `numericDates` parameter is set to `false`).

To consume the next list of events after the initial list of events is returned, set the `streamPosition` parameter
with the `NextStreamPosition` property obtained from the previous request and don't set the `since` parameter with
any values. This is because when using the `ListEvents` method, either the `since` parameter or the `streamPosition`
parameter should be set, but never both.

Note that the `MoreAvailable` property in a response indicates whether more events are immediately available for
consumption. If events are not immediately available, they may still be generating so subsequent requests should keep
using the same `NextStreamPosition` value until the next list of events is retrieved.

Many events have additional information available as part of the event. That information can be accessed using the
Dictionary stored in the `AdditionalDetails` property. Information about the additional details provided can be found
[here.](https://smartsheet.redoc.ly/tag/eventsDescription)

```csharp
class Program
{
    // this example is looking specifically for new sheet events
    private static void PrintNewSheetEventsInList(IList<Event> events)
    {
        //  enumerate all events in the list of returned events
        foreach (Event _event in events)
        {
            // find all created sheets
            if (_event.ObjectType == EventObjectType.SHEET && _event.Action == EventAction.CREATE)
            {
                // additional details are available for some events, they can be accessed as a Dictionary
                // in the AdditionalDetails property
                if (_event.AdditionalDetails.ContainsKey("sheetName"))
                {
                    Console.WriteLine(_event.AdditionalDetails["sheetName"]);
                }
            }
        }
    }

    static void Main(string[] args)
    {
        // Initialize client
        SmartsheetClient smartsheet = new SmartsheetBuilder().Build();

        // begin listing events in the stream starting with the `since` parameter
        DateTime lastWeek = DateTime.Today.AddDays(-7);
        // this example looks at the previous 7 days of events by providing a since argument set to last week's date
        EventResult eventResult = smartsheet.EventResources.ListEvents(lastWeek, null, 1000, false);
        PrintNewSheetEventsInList(eventResult.Data);

        // continue listing events in the stream by using the `StreamPosition`, if the previous response indicates
        // that more data is available.
        while(eventResult.MoreAvailable == true)
        {
            eventResult = smartsheet.EventResources.ListEvents(null, eventResult.NextStreamPosition, 10000, true);
            PrintNewSheetEventsInList(eventResult.Data);
        }
    }
}
```

## Working With Smartsheetgov.com Accounts

If you need to access Smartsheetgov you will need to specify the Smartsheetgov API URI as the base URI during creation of the Smartsheet client object. SmartsheetGov uses a base URI of https://api.smartsheetgov.com/2.0/. The base URI is defined as a constant in the SmartsheetBuilder class (i.e. `SmartsheetBuilder.GOV_BASE_URI`).

Invoke the SmartsheetBuilder with the base URI pointing to Smartsheetgov:

```csharp
using Smartsheet.Api;
using Smartsheet.Api.Models;

static void Sample()
{
    // Initialize client
    SmartsheetClient smartsheet = new SmartsheetBuilder()
        .SetBaseURI(SmartsheetBuilder.GOV_BASE_URI)
        // TODO: Set your API access in environment variable SMARTSHEET_ACCESS_TOKEN or else here
        // .SetAccessToken("ll352u9jujauoqz4gstvsae05")
        .Build();

    // List all sheets
    PaginatedResult<Sheet> sheets = smartsheet.SheetResources.ListSheets(
        null,               // IEnumerable<SheetInclusion> includes
        null,               // PaginationParameters
        null                // Nullable<DateTime> modifiedSince = null
    );
    Console.WriteLine("Found " + sheets.TotalCount + " sheets");

    long sheetId = (long) sheets.Data[0].Id;                // Default to first sheet

    // sheetId =<PHONE_NUMBER>38842;                         // TODO: Uncomment if you wish to read a specific sheet

    Console.WriteLine("Loading sheet id: " + sheetId);

    // Load the entire sheet
    var sheet = smartsheet.SheetResources.GetSheet(
<PHONE_NUMBER>388420,           // long sheetId
        null,                       // IEnumerable<SheetLevelInclusion> includes
        null,                       // IEnumerable<SheetLevelExclusion> excludes
        null,                       // IEnumerable<long> rowIds
        null,                       // IEnumerable<int> rowNumbers
        null,                       // IEnumerable<long> columnIds
        null,                       // Nullable<long> pageSize
        null                        // Nullable<long> page
    );
    Console.WriteLine("Loaded " + sheet.Rows.Count + " rows from sheet: " + sheet.Name);
}

```

## Working With Smartsheet Regions Europe Accounts

If you need to access Smartsheet Regions Europe you will need to specify the Smartsheet.eu API URI as the base URI during creation of the Smartsheet client object. Smartsheet.eu uses a base URI of https://api.smartsheet.eu/2.0/. The base URI is defined as a constant in the SmartsheetBuilder class (i.e. `SmartsheetBuilder.EU_BASE_URI`).

Invoke the SmartsheetBuilder with the base URI pointing to Smartsheet.eu:

```csharp
using Smartsheet.Api;
using Smartsheet.Api.Models;

static void Sample()
{
    // Initialize client
    SmartsheetClient smartsheet = new SmartsheetBuilder()
        .SetBaseURI(SmartsheetBuilder.EU_BASE_URI)
        // TODO: Set your API access in environment variable SMARTSHEET_ACCESS_TOKEN or else here
        // .SetAccessToken("ll352u9jujauoqz4gstvsae05")
        .Build();
}
```

gha_language: C#


text:
# AutoSwagger

> AutoSwagger is a [swagger(openAPI)](https://swagger.io) tool running in [Electron](https://electronjs.org/), it can import a swagger(openAPI) document then send request and receive response in a convenience way.

#### Build Setup

```bash
# install dependencies
npm install

# serve with hot reload at localhost:9080
npm run dev

# build electron application for production
npm run build
```
#### ScreenShot
![screenshot](./screenshot.gif?raw=true)

#### NPM Packages

|Name	|Desc	|
|--------	|--------	|
|vue	|[🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.](https://vuejs.org)	|
|vue-electron	|[The vue plugin that wraps electron APIs to the Vue object.](https://github.com/SimulatedGREG/vue-electron)	|
|lowdb	|[⚡ lowdb is a small local JSON database powered by Lodash (supports Node, Electron and the browser)](https://github.com/typicode/lowdb)	|
|got	|[Simplified HTTP requests.](https://github.com/axios/axios)  like [axios](https://github.com/axios/axios)	|
|element-ui	|[A Vue.js 2.0 UI Toolkit for Web](https://github.com/ElemeFE/element)	|
|iview	|[A high quality UI Toolkit built on Vue.js 2.0](https://github.com/iview/iview)	|
|jsoneditor	|[A web-based tool to view, edit, format, and validate JSON](https://github.com/josdejong/jsoneditor)	|
|mavon-editor	|[A markdown editor based on Vue that supports a variety of personalized features](https://github.com/hinesboy/mavonEditor)	|
|fs-extra	|[Node.js: extra methods for the fs object like copy(), remove(), mkdirs()](https://github.com/jprichardson/node-fs-extra)	|
|lodash	|[A modern JavaScript utility library delivering modularity, performance, & extras.](https://github.com/lodash/lodash)	|
|lodash-id	|[Makes it easy to manipulate id-based resources with lodash or lowdb](https://github.com/typicode/lodash-id)	|
|countup.js	|[Animates a numerical value by counting to it](https://github.com/inorganik/countUp.js)	|
|vue-moment	|[Handy Moment.js filters for your Vue.js project.](https://github.com/brockpetrie/vue-moment)	|
|vue-smooth-dnd	|[Vue wrappers components for smooth-dnd](https://github.com/kutlugsahin/vue-smooth-dnd)	|
|vue-splitpane	|[Split-Pane component built with vue2.0, can be split vertically or horizontally.](https://www.npmjs.com/package/vue-splitpane)	|

#### DataBase Objects
these objects initialized in `src/renderer/datastore/index.js'

* workspace `represnt for one swagger json document`
```
{
	"id":0,
	"name":"default-workspace",
	"desc":""
}
```
* folder `corresonding tags in swagger json document`
```
{
	"id":0,
	"workspaceId":0,
	"name":"default-folder"
}
```
* request
```
{
	"id":0,
	"workspaceId":0,
	"folderId":null,
	"name":"new-request-01",
	"method":"GET",
	"url":"",
	"data":null,
	"sort":0
}
```
* response
```
{
    "id":null,
    "requestId":null,
    "header":null,
    "data":null
}
```
* lastState `app state, would restore everytime`
```
{
	id: 0,
    lastWorkspaceId: 0,
    lastFolderId: 0,
    lastRequestId: 0,
    openedSubmenuList:[]
}
```

---

This project was generated with [electron-vue](https://github.com/SimulatedGREG/electron-vue) using [vue-cli](https://github.com/vuejs/vue-cli),[lowdb](). Documentation about the original structure can be found [here](https://simulatedgreg.gitbooks.io/electron-vue/content/index.html).


text:
# Filter bar {#concept_rtm_qwb_dhb .concept}

You can use a **filter bar** to search data in one or more charts.

1.  Click a **filter bar**.
2.  Select a dataset, and select the fields to be added to the filter bar, as shown in the following figure.

    ![](http://static-aliyun-doc.oss-cn-hangzhou.aliyuncs.com/assets/img/140555/155833889947578_en-US.png)

Currently, a filter bar supports filter interactions between charts of the current dataset or charts of different datasets.

**Filter interaction example for the current dataset**

1.  Select **Current Dataset**. In the current dataset field list, select the charts by the field type.
2.  Click **Style** to edit the display name of the filter bar.
3.  Click **Search** to filter the associated charts.

**Filter interaction example for different datasets**

Filter bars can also filter data from different datasets. However, in the associated items, the data members must have the same fields. Otherwise, the interaction does not work.

1.  Select a chart, such as a table.
2.  Select the required fields, and then click **Update**.
3.  Click the **Style** tab, and then change the display name and layout of the table. For example, set the display name of the table to **overseas data**.
4.  Click the icon that switches datasets to change to another dataset.
5.  Select a chart, such as Table.
6.  Select the required fields, and then click **Update**.
7.  Click the Style tab, and then change the display name and layout of the table. For example, set the display name of the table to **domestic data**.
8.  Click the **Filter Bar** icon, and then select the dataset and add filter fields to the filter bar.
9.  Select **Other Dataset**. In the Other Dataset list, select the associated items based on the field type.
10. Click the **Style** tab to specify the display name of the widget.
11. Click **Search** to update the charts filtered by the fields.

**Cascade filter example**

The filter bar supports cascade filter, which simplifies the steps of setting multiple filters.

1.  Create line charts on the dashboard editing page, as shown in the following figure.

    ![](http://static-aliyun-doc.oss-cn-hangzhou.aliyuncs.com/assets/img/140555/155833889947586_en-US.png)

2.  Click the **filter bar** widget and then select the dataset and the fields to be filtered. In this example, we select the **province** field as the filter, as shown in the following figure.

    ![](http://static-aliyun-doc.oss-cn-hangzhou.aliyuncs.com/assets/img/140555/155833889947587_en-US.png)

3.  Click the cascade icon. On the **Configure Field Cascade** page, click **+ Add cascading relationship** to add the fields to be cascaded, and then click **OK**. In this example, we select the **city** field and the **product type** field.

    **Note:**

    -   The cascade filter supports three-level cascades, with lines connected between the parent nodes and child nodes.
    -   The cascade filter supports renaming the cascade fields.
    ![](http://static-aliyun-doc.oss-cn-hangzhou.aliyuncs.com/assets/img/140555/155833889947588_en-US.png)

4.  Click **Set Filter** to set the filters and then click **OK**. In this example, we select Tile cascade display and Multiple Select, as shown in the following figure.

    ![](http://static-aliyun-doc.oss-cn-hangzhou.aliyuncs.com/assets/img/140555/155833889947589_en-US.png)

    **Note:** The cascade display supports Tree cascade display and Tile cascade display. You can select Cognate inheritance.

5.  In the search widget, click **Search**. The result is shown in the following figure.

    ![](http://static-aliyun-doc.oss-cn-hangzhou.aliyuncs.com/assets/img/140555/155833889947590_en-US.png)

    **Note:** To view the detailed information of the cascade, you can hover over the cascade icon in the upper-right corner.

**Filter data in a date range**

When you filter data in date type, you can select the date range of the filter, manually set default values, and customize shortcuts.

1.  In the Data tab, select the dataset and the fields to be filtered, such as order date \(month\).
2.  Select a chart that needs to be filtered, and then click **Set Time Range**.
3.  In the **Set Time Range** dialog box, enable Set Time Range, specify the time range, and then click **OK**
4.  Select **Manually set default values** or **Customize shortcuts** to select a date range, and then click **OK**.

    **Note:** The date currently supports types of month and day for you to customize the date range.

5.  Click **Search**. All the charts that are filtered by the widget are updated.

**Filter text data**

When you filter data in text type, you can set the enumeration range. as shown in the following figure:

![](http://static-aliyun-doc.oss-cn-hangzhou.aliyuncs.com/assets/img/140555/155833889947594_en-US.png)

1.  In the Data tab, select the dataset and fields to be filtered, such as product package.
2.  Select a chart that needs to be used, and then click **Set Value Range**.
3.  In the **Set Value Range** dialog box, enable Set Enumeration Range, click Manually set values or add available values such as **Medium ox**, **Large Box**, **Small bag**, and **Small Box**, and then click **OK**, as shown in the following figure.

    ![](http://static-aliyun-doc.oss-cn-hangzhou.aliyuncs.com/assets/img/140555/155833889947595_en-US.png)

4.  Select **Filter by Enumeration** and **Multiple Select**, and then click the drop-down menu. The system automatically adds the available values of this field to the filter bar, as shown in the following figure.

    ![](http://static-aliyun-doc.oss-cn-hangzhou.aliyuncs.com/assets/img/140555/155833889947596_en-US.png)

    **Note:** If you select **Sort by fixed value**, the selected values of the filter field are displayed in default order in relevant charts.

5.  Manually specify the value or select the available values for the field to be filtered, and then click **OK** \> **OK**.
6.  Click **Search**. The charts that are filtered by the filter bar are updated.

**Numeric query**

1.  On the Data tab, select a dataset and a query field, for example, order\_amt.
2.  Select a chart that needs to be filtered, set filter conditions, and click **OK**, as shown in the following figure:

    ![](http://static-aliyun-doc.oss-cn-hangzhou.aliyuncs.com/assets/img/140555/155833890047597_en-US.png)

3.  Click **Search**. The charts that are filtered by the filter bar are updated.

path: /intl.en-US/User Guide/Create dashboards/Common widgets/Filter bar.md

filename: Filter bar.md


text:
Result update:

config: librispeech/configs/mtl_transformer_sp.json

dataset:test-clean

Model|WER
-|:-:|
[Transformer (ESPNET)](https://arxiv.org/abs/1909.06317)| 2.6
[SEMI-SUPERVISED LEARNING](https://arxiv.org/pdf/1911.08460.pdf)|2.03
Transformer (Ours without pre-training) | 4.4
Transformer (Ours with self pre-training) |

repository: Joefi/athena

repo_name: Joefi/athena


text:
---
title: Wanderer a 124-foot steamer sinks
tags:
  - Oct 1906
---

Wanderer, a 124-foot steamer, sinks in Jewfish Creek.

Newspapers: **Daily Miami Metropolis, The Miami Metropolis (daily), The Daily Metropolis or Miami Daily Metropolis**

Page: **1**, Section: **N/A**


text:
# CIDC Software team ingestion script how-to

By Len Taing 2020-05-18
ref: https://stagingportal.cimac-network.org/analyses//cli-instructions

### Create a conda environment for the cidc-cli script:
   NOTE: `wes images >= wes-ver1-99c` already have the cidc-cli conda env
   located at: `/home/taing/miniconda3/envs/cidc-cli`
   so there's no need to build a new one for wes google images

a. write a file called `cidc-cli.env.yml` with the following content:

```
name: cidc-cli
channels:
- bioconda
- defaults
dependencies:
- python=3
- pip:
  - cidc-cli
```

b. create the conda env:
      `conda env create -f cidc-cli.env.yml -n cidc-cli`
c. When done, save a new google image, e.g. for WES I created `wes-ver1-99c`
d. start a new google image with the image you just created

FROM this point on in the how-to, it is assumed that the cidc-cli conda env
and scripts are installed correctly.

The workflow from the software team is:
1. the software team will generate a automator config file (e.g. wes_automator
   config file) and a corresponding .xslx sheet for a patient/batch of samples
   to RUN and ingest
2. The bioinformatics team (that's us) will run the automator config file
   given in step 1.  This how to ALSO assumes that the pipeline run from
   the automator ran successfully and it is now time to ingest results
   into the cidc software team's db

### AFTER the wes/rnaseq automator run is complete (without errors)

a. activate the cidc-cli conda env:
   `source activate cidc-cli`
b. UPLOAD the .xlsx sheet associated with the automator config (given by the software team) to the instance:
   NOTE: in this example, the .xlsx sheet is called  "wes_analysis_CTTTP02N1.00_20200129.xlsx"
   EXAMPLE:
   `scp -i ~/.ssh/google_compute_engine wes_analysis_CTTTP02N1.00_20200129.xlsx taing@<IP_ADDRESS>:/mnt/ssd/wes`
   c. LOG in:
   1. goto:
      	 https://stagingportal.cimac-network.org/analyses//cli-instructions
   2. scroll to the bottom of page and copy login cmd (i.e. last line):
      	 `cidc login ...[long key string]...`
   3. paste cmd into ssh shell
   d. RUN ingestion script:
      `cidc analyses upload --analysis wes_analysis --xlsx ./wes_analysis_CTTTP01N1.00_20200129.xlsx`

**NOTE:** the script my prompt you with questions-
answer "Yes" to all of them; for the google auth step, copy and paste the
URL given and complete the authentication process.

**NOTE:** the parameter --analysis may be different depending on your pipeline

**NOTE:** the ingestion script will now try to upload the files and it may take some time


text:
## How long diarrhoea lasts

Diarrhoea often lasts 2 to 4 days in adults and 5 to 7 days in babies or children.

Diarrhoea can be infectious. To avoid giving it to other people you should:

- stay off work for 2 days
- keep children at home for 2 days
- avoid swimming pools for 2 weeks

## Check if you have diarrhoea

Symptoms for adults and children include:

- watery or loose poo
- stomach cramps
- feeling sick and vomiting
- headache
- no appetite

## What causes diarrhoea

Diarrhoea is usually caused by a bowel infection. Other causes can be things like a food allergy, alcohol or appendicitis.

If you’re taking any medicine, check the side effects. Diarrhoea might be one of them.

repository: nhsuk/betahealth

branch_name: refs/heads/develop

gha_language: JavaScript

repo_name: nhsuk/betahealth


text:
---
title: ""
permalink: /sds/1/6/db/studentProjects/04_XinZhao/049_Introduction_HighOrderSpectralClustering/
sidebar:
  nav: "lMenu-SDS-1.6"
---

// Databricks notebook source exported at Tue, 28 Jun 2016 10:36:27 UTC

# [Scalable Data Science](http://www.math.canterbury.ac.nz/~r.sainudiin/courses/ScalableDataScience/)

## Course Project - High Order Spectral Clustering
### by Xin Zhao

*supported by* [![](https://raw.githubusercontent.com/raazesh-sainudiin/scalable-data-science/master/images/databricks_logoTM_200px.png)](https://databricks.com/)
and
[![](https://raw.githubusercontent.com/raazesh-sainudiin/scalable-data-science/master/images/AWS_logoTM_200px.png)](https://www.awseducate.com/microsite/CommunitiesEngageHome)

The [html source url](https://raw.githubusercontent.com/raazesh-sainudiin/scalable-data-science/master/db/studentProjects/04_XinZhao/049_Introduction_HighOrderSpectralClustering.html) of this databricks notebook and its recorded Uji ![Image of Uji, Dogen's Time-Being](https://raw.githubusercontent.com/raazesh-sainudiin/scalable-data-science/master/images/UjiTimeBeingDogen.png "uji"):

[![sds/uji/studentProjects/04_XinZhao/049_Introduction_HighOrderSpectralClustering](http://img.youtube.com/vi/zJirlHAV6YU/0.jpg)](https://www.youtube.com/v/zJirlHAV6YU?rel=0&autoplay=1&modestbranding=1&start=3113&end=4018)

### 1. Spectral clustering
#### 1.1 What is spectral clustering
In multivariate statistics and the clustering of data, spectral clustering techniques make use of the spectrum (eigenvalues) of the **similarity matrix** of the data to perform dimensionality reduction before clustering in fewer dimensions.

The similarity matrix is provided as an input and consists of a quantitative assessment of the relative similarity of each pair of points in the dataset. Such measure is used to transform data to overcome difficulties related to lack of convexity in the shape of the data distribution. The measure gives rise to an (n, n)-sized similarity matrix for a set of (n,d) points, where the entry (i,j) in the matrix can be simply the Euclidean distance between i and j, or it can be a more complex measure of distance such as the **Gaussian**. Further modifying this result with network analysis techniques is also common.

In mathematics, spectral graph theory is the study of properties of a graph in relationship to the characteristic polynomial, **eigenvalues, and eigenvectors** of matrices associated to the graph, such as its adjacency matrix or **Laplacian** matrix.

#### 1.2 Spectral clustering with different clustering method
The following two examples show two different Spectral clustering method as they uses different clustering algorithm:

![](http://scikit-learn.org/stable/_images/plot_face_segmentation_001.png)   ![](http://scikit-learn.org/stable/_images/plot_face_segmentation_002.png)

#### 1.3 Compare variaty clustering methods

### 2. High Order Spectral Clustering

#### 2.1 Why high order
>- kernel principal component analysis (kernel PCA) in not enough in multivariate analysis

>- linkage to the original feature

#### 2.2 How
>- high order spectral cluster diagrams

>- **Data --> Graph/Similarity Tensor --> Compute leading K (vector) svd and core tensor --> Clustering on the new latent tensor --> Project clusters back to original data**

#### 2.3 Tensor
>- What is tensor

>- High order SVD

>- Tensor unfolding

Please refer to [De Lathauwer, L., De Moor, B. and Vandewalle, J. (2000)](http://www.sandia.gov/~tgkolda/tdw2004/ldl-94-31.pdf) for details in high order singular decomposition.

#### Disadvantage
>- The size of (n,d) increase to (n,n,d), which means very expensive in memory and computation performance. E.g, (100k,100k) double requires about 80G
>- Not suitble for large number of clusters
>- Difficult to do out of sample embedding.

### High Order Spectral Clustering Package
In this project, a high order spectral clustering package is developed as attached spectralclustering_01.jar. The package is implemented as:
>- Implement in Scala with Apache Spark
>- Tensor implemented as both distributed and non-distributed frame
>- The clustering method is K-means
>- The current implementation can handle continuous and discrete features but not catergorical features

#### Sample code
>- The following is just some sample source code of the library "high order spectral clustering"

```
package tensorSVD

import org.apache.spark.SparkContext
import org.apache.spark.mllib.linalg.distributed.IndexedRowMatrix
import org.apache.spark.rdd.RDD

/**
  * Define RDD Tensor Class
  * @constructor create rdd tensor class which contains dimension, values in Rdd and others
  * @param dim1 first dimension
  * @param dim2 second dimension
  * @param dim3 third dimension, keep the smallest dimension as the third
  */
class RddTensor(dim1: Int, dim2: Int, dim3: Int){
  //tensor vale is defined as a RDD of Tuple3(dim3Index: Int, rowIndex: Int, rowValue: Array[Double])
  //Note: Keep dim3 as the smallest dimension
  //      Keep dim1 as the most important dimension such as along sample point

  //Second constructor
  def this(dims: Array[Int])=this(dims(0),dims(1),dims(2))

  val dim=Array(dim1,dim2,dim3)
  //class field
  //val dim=(dim1,dim2,dim3) //dimension of tensor
  var nonemptyDim3 = 0
  var values: RDD[(Int,Int,Array[Double])]=null
  var isSymmetric=true //if every matrix along dim3 A(:,:,i) is symetrix

  /**
    * The method add value into the rdd Tensor. The input must be dim1*dim2 values (as RddMatrix)
    * @param newRddmat the new value matrix to be added in
    * @param dim3Index the third dimension index
    */

  def addDim3(newRddmat: RddMatrix, dim3Index: Int) {
    if(dim3Index>=this.dim(2)){
      throw new IllegalArgumentException("arg 2 need be in range of 0 to dim3 of the tensor class")
    }
    if(newRddmat.cols!=this.dim(1) || newRddmat.rows!=this.dim(0)){
      throw new IllegalArgumentException("the adding matrix dimension is not match the tensor")
    }
    if(this.nonemptyDim3==0){
      this.values=newRddmat.values.map(v=>(dim3Index,v._1,v._2))
    }else{
      this.values=this.values.union(newRddmat.values.map(v=>(dim3Index,v._1,v._2)))
    }
    this.nonemptyDim3 +=1
  }

  /**
    * The method unfold the rdd tensor along the required order (0,1 or 2)
    * @param dimi the unfold direction/order (0,1 or 2)
    * @param sc the spark context
    * @return the result matrix (RddMatrix)
    */
  def unfoldTensor(dimi: Int, sc: SparkContext): RddMatrix = {
    val dims=this.dim
    var outmat:RddMatrix = null

    if(dimi==0){
      val rmat:RddMatrix = new RddMatrix(this.dim(dimi),0)
      rmat.setValues(this.values.map(v=>(v._2,(v._1,v._3))).groupByKey()
        .map(x=>(x._1,x._2.toArray.sortBy(_._1))).map(b=>(b._1,b._2.flatMap(bi=>bi._2))))
      outmat=rmat
    }
    if(dimi==1){
      val rmat:RddMatrix = new RddMatrix(this.dim(dimi),0)
      if(this.isSymmetric){
        val dd=2
        val temp1=Range(0,2).toArray
        val temp2=Range(0,3).toArray
        val indx: IndexedSeq[Int]=temp1.map(v=>(v,temp2)).flatMap(v=>v._2.map(_*dd+v._1))
        rmat.setValues(this.values.map(v=>(v._2,(v._1,v._3))).groupByKey()
          .map(x=>(x._1,x._2.toArray.sortBy(_._1)))
          .map(b=>(b._1,b._2.flatMap(bi=>bi._2.zipWithIndex)))
          .map(v=>(v._1,v._2.sortBy(_._2).map(vi=>vi._1))))
        outmat=rmat
      }else{
        throw new Exception("Folding for dim2 not apply to asymmetric tensor in dim1 by dim2")
      }
    }
    if(dimi==2){
      val rmat:RddMatrix = new RddMatrix(this.dim(0)*this.dim(1),this.dim(dimi))
      //Note: as dim(2) is small, this returns the transpose of the unfold matrix
      val cc=this.dim(1)
      rmat.setValues(this.values.flatMap(v=>v._3.zipWithIndex.map(vi=>(v._1,v._2,vi._2,vi._1)))
        .map(b=>((b._2,b._3),(b._1,b._4))).groupByKey()
        .map(x=>(x._1._1*cc+x._1._2,x._2.toArray.sortBy(_._1).map(b=>b._2))))
      outmat=rmat

    }
    outmat
  }

  /**
    * The method fold a matrix back to rdd tensor for along the required order/dim
    * @param rddMat the input rdd matrix to be folded
    * @param dimi the folding order
    * @return the folded rdd tensor
    */
  def foldTensorDimOne(rddMat:IndexedRowMatrix, dimi:Int) :RddTensor = {
    if(dimi!=1){
      throw new IllegalArgumentException("The fold method of rddTensor only available along the first dimension")
    }
    val ndim=this.dim.length
    val size=this.dim
    //val tempMat=rddMat.rows.map
    val result: RddTensor = null
    result
  }

}

...

```

# [Scalable Data Science](http://www.math.canterbury.ac.nz/~r.sainudiin/courses/ScalableDataScience/)

## Course Project - High Order Spectral Clustering
### by Xin Zhao

*supported by* [![](https://raw.githubusercontent.com/raazesh-sainudiin/scalable-data-science/master/images/databricks_logoTM_200px.png)](https://databricks.com/)
and
[![](https://raw.githubusercontent.com/raazesh-sainudiin/scalable-data-science/master/images/AWS_logoTM_200px.png)](https://www.awseducate.com/microsite/CommunitiesEngageHome)

license: Unlicense

repository: SheperoMah/scalable-data-science

gha_license_id: Unlicense

repo_name: SheperoMah/scalable-data-science