text:
---
hrs_structure:
  division: '1'
  volume: '6'
  title: '19'
  chapter: 330C
  section: 330C-3
type: hrs_section
tags:
  - Government
menu:
  hrs:
    identifier: HRS_0330C-0003
    parent: HRS0330C
    name: 330C-3 Definitions
weight: 49015
title: Definitions
full_title: 330C-3 Definitions
---
**[§330C-3] Definitions.** For the purposes of this chapter:

(1) "Director" means the director of health.

(2) "Household substance" means any substance which is customarily produced or distributed for sale for consumption or use, or customarily stored, by individuals in or about the household and which is:

(A) A hazardous substance as defined by this section;

(B) A pesticide as defined by this section;

(C) A food, drug, or cosmetic as those terms are defined by section 328-1; or

(D) A substance intended for use as fuel when stored in a portable container and used in the heating, cooking, or refrigeration system of a house.

(3) "Hazardous substance" means:

(A) Any substance or mixture of substances which (i) is toxic, (ii) is corrosive, (iii) is an irritant, (iv) is a strong sensitizer, (v) is flammable or combustible, or (vi) generates pressure through decomposition, heat, or other means, if such substance or mixture of substances may cause substantial personal injury or substantial illness during or as a proximate result of any customary or reasonably foreseeable handling or use, including reasonably foreseeable ingestion by children.

(B) Any substances which the director by rule finds pursuant to section 330C-4(1), meet the requirements of subparagraph (A) of this paragraph.

(C) Any radioactive substances, if, with respect to such substances as used in a particular class of article or as packaged, the director determines by regulation that the substance is sufficiently hazardous to require labeling in accordance with this chapter in order to protect the public health.

(D) The term "hazardous substance" shall not apply to pesticides subject to the Federal Insecticide, Fungicide, and Rodenticide Act, nor to foods, drugs, and cosmetics subject to the Federal Food, Drug, and Cosmetic Act, nor to substances intended for use as fuels when stored in containers and used in the heating, cooking, or refrigeration system of a house, but such term shall apply to any article which is not itself an economic poison within the meaning of the Federal Insecticide, Fungicide, and Rodenticide Act but which is a hazardous substance within the meaning of subparagraph (A) of this paragraph by reason of bearing or containing such a pesticide.

(E) The term "hazardous substance" shall not include any source material, special nuclear material, or byproduct material as defined in the Atomic Energy Act of 1954, as amended, and regulations issued pursuant thereto by the Atomic Energy Commission.

(4) "Pesticide" means:

(A) Any substance or mixture of substances intended for preventing, destroying, repelling, or mitigating any insects, rodents, nematodes, fungi, weeds, and other forms of plant or animal life or viruses, except viruses on or in living persons or other animals, which the board of agriculture or the administrator of the Environmental Protection Agency shall declare to be a pest, and

(B) Any substance or mixture of substances intended for use as a plant regulator, defoliant, or desiccant.

(5) "Package" means the immediate container or wrapping in which any household substance is contained for consumption, use, or storage by individuals in or about the household, and, for purposes of section 330C-5(a)(2), also means any outer container or wrapping used in the retail display of any such substance to consumers. The term does not include:

(A) Any shipping container or wrapping used solely for the transportation of any household substance in bulk or in quantity to manufacturers, packers, or processors, or to wholesale or retail distributors thereof, or

(B) Any shipping container or outer wrapping used by retailers to ship or deliver any household substance to consumers unless it is the only such container or wrapping.

(6) "Special packaging" means packaging that is designed or constructed to be significantly difficult for children under five years of age to open or obtain a toxic or harmful amount of the substance contained therein within a reasonable time and not difficult for normal adults to use properly, but does not mean packaging which all such children cannot open or obtain a toxic or harmful amount within a reasonable time.

(7) "Labeling" means all labels and other written, printed, or graphic matter (A) upon any household substance or its package, or (B) accompanying such substance.

(8) "Federal Act" means the Poison Prevention Packaging Act of 1970 (Public Law 91-601). [L 1974, c 216, pt of §1; gen ch 1993]

Note

Reference to the Atomic Energy Commission should be to the Nuclear Regulatory Commission.

repository: SamMade/BlueAndKrabby

repo_name: SamMade/BlueAndKrabby


text:
responsive-cache-interface
==========================

A caching strategy allowing config files to be cached and updated by subsequent cache setting

Currently this just stores an object as a cache

keys can be retrieved like "get('a.b.c')"

keys can be set like "set({ a : { b: c}})"

TODO:
This will be updated to allow standard objects like above (will be the default cache type), and others, such as:

a type which reflects that the current cached keys have come from a file, and that should the keys be updated the file should also be updated.

license: MIT

repository: atcwells/flow

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: atcwells/flow


text:
![emb](assets/images/embeddings/header.png)

 > There is nothing magic about magic. The magician merely understands something simple which doesn’t appear to be simple or natural to the untrained audience. Once you learn how to hold a card while making your hand look empty, you only need practice before you, too, can “do magic.” – Jeffrey Friedl in the book Mastering Regular Expressions

**Note: Please raise an issue for any suggestions, corrections, and feedback.**

    Building Blocks of NLP

## Tokenization

### Day 1

The process of converting textual data to tokens, is one of the most important step in NLP. Tokenization using the following methods has been explored:

- [Spacy](https://spacy.io/usage/linguistic-features#tokenization)
- [Byte Pair Encoding (Sentencepiece)](https://github.com/google/sentencepiece)
- [Unigram Encoding (Sentencepiece)](https://github.com/google/sentencepiece)
- [Torchtext](https://pytorch.org/text/data_utils.html)
- [Tokenizers](https://github.com/huggingface/tokenizers)

Checkout the code in `tokenization` folder

## Word Embeddings

A word embedding is a learned representation for text where words that have the same meaning have a similar representation. It is this approach to representing words and documents that may be considered one of the key breakthroughs of deep learning on challenging natural language processing problems.

![emb](assets/images/embeddings/embeddings.png)

### Day 2: Word2Vec

Word2Vec is one of the most popular pretrained word embeddings developed by Google. Depending on the way the embeddings are learned, Word2Vec is classified into two approaches:

- Continuous Bag-of-Words (CBOW)
- Skip-gram model

![word2vec arch](assets/images/embeddings/word2vec.png)

### Day 3: GloVe

GloVe is another commonly used method of obtaining pre-trained embeddings. GloVe aims to achieve two goals:

- Create word vectors that capture meaning in vector space
- Takes advantage of global count statistics instead of only local information

### Day 4: ELMo

ELMo is a deep contextualized word representation that models:

- complex characteristics of word use (e.g., syntax and semantics)
- how these uses vary across linguistic contexts (i.e., to model polysemy).

These word vectors are learned functions of the internal states of a deep bidirectional language model (biLM), which is pre-trained on a large text corpus.

![elmo arch](assets/images/embeddings/elmo.png)

### Day 29: Sentence Embeddings

A new architecture called SBERT was explored. The siamese network architecture enables that fixed-sized vectors for input sentences can be derived. Using a similarity measure like cosinesimilarity or Manhatten / Euclidean distance, semantically similar sentences can be found.

![sentence emb](assets/images/embeddings/sentence_emb.png)

Checkout the code in `embeddings` folder

## Architectures & Techniques

There are several ways the input can be processed after tokenization. One can use different machine learning algorithms, statistical methods (or) deep learning architectures. Here I will try to cover some of the most prominent architectures & techniques used in NLP like RNN, Attention mechanism, ULMFit, Transformer, GPT-2, BERT, and others.

### Day 6: RNN

Recurrent networks - RNN, LSTM, GRU have proven to be one of the most important unit in NLP applications because of their architecture. There are many problems where the sequence nature needs to be remembered like in order to predict an emotion in the scene, previous scenes needs to be remembered.

![rnn gif](./assets/images/architectures/rnn.gif)

### Day 9: pack_padded_sequences

When training RNN (LSTM or GRU or vanilla-RNN), it is difficult to batch the variable-length sequences. Ideally we will pad all the sequences to a fixed length and end up doing un-necessary computations. How can we overcome this? PyTorch provides the `pack_padded_sequences` functionality.

![pack img](./assets/images/architectures/pack_padded_seq.jpg)

### Day 13: Luong Attention

The attention mechanism was born to help memorize long source sentences in neural machine translation (NMT). Rather than building a single context vector out of the encoder's last hidden state, attention is used to focus more on the relevant parts of the input while decoding a sentence. The context vector will be created by taking encoder outputs and the `current output` of the decoder rnn.

![pack img](./assets/images/architectures/luong_attention.png)

The attention score can be calculated in three ways. `dot`, `general` and `concat`.

![luong_fn](./assets/images/architectures/luong_fn.png)

### Day 14: Bahdanau Attention

The major difference between Bahdanau & Luong attention is the way the context vector is created. The context vector will be created by taking encoder outputs and the `previous hidden state` of the decoder rnn. Where is in Luong attention the context vector will be created by taking encoder outputs and the `current hidden state` of the decoder rnn.

Once the context is calculated it is combined with decoder input embedding and fed as input to decoder rnn.

![pack img](./assets/images/architectures/bahdanau_attention.png)

The Bahdanau attention is also called as `additive` attention.

![bahdanau_fn](./assets/images/architectures/bahdanau_fn.jpg)

### Day 18: Transformer

Attention mechanisms have become an integral part of compelling sequence modeling and transduction models in various tasks, allowing modeling of dependencies without regard to their distance in the input or output sequences. Such attention mechanisms are used in conjunction with a recurrent network.

The Transformer, a model architecture eschewing recurrence and instead relying entirely on an attention mechanism to draw global dependencies between input and output.

![transformer](./assets/images/architectures/transformer.png)

### Day 23: GPT-2

The GPT-2 paper states that:

> Natural language processing tasks, such as question answering, machine translation, reading comprehension, and summarization, are typically approached with supervised learning on taskspecific datasets. We demonstrate that language models begin to learn these tasks without any explicit supervision when trained on a new dataset of millions of webpages called WebText. Our largest model, GPT-2, is a 1.5B parameter Transformer that achieves state of the art results on 7 out of 8 tested language modeling datasets in a zero-shot setting but still underfits WebText. Samples from the model reflect these improvements and contain coherent paragraphs of text. These findings suggest a promising path towards building language processing systems which learn to perform tasks from their naturally occurring demonstrations.

![gpt2](./assets/images/architectures/gpt2_usecase.png)

The GPT-2 utilizes a 12-layer Decoder Only Transformer architecture.

![gpt2](./assets/images/architectures/gpt2.png)

### Day 24: BERT

Language modeling is an effective task for using unlabeled data to pretrain neural networks in NLP. Traditional language models take the previous n tokens and predict the next one. In contrast, BERT trains a language model that takes both the previous and next tokens into account when predicting. BERT is also trained on a next sentence prediction task to better handle tasks that require reasoning about the relationship between two sentences (e.g. similar questions or not)

![bert](./assets/images/architectures/bert.png)

BERT uses the Transformer architecture for encoding sentences.

![bert](./assets/images/architectures/bert_arch.png)

### Day 26: Pointer Network

Pointer networks are sequence-to-sequence models where the output is discrete tokens corresponding to positions in an input sequence. The main differences between pointer networks and standard seq2seq models are:

- The output of pointer networks is discrete and correspond to positions in the input sequence

- The number of target classes in each step of the output depends on the length of the input, which is variable.

It differs from the previous attention attempts in that, instead of using attention to blend hidden units of an encoder to a context vector at each decoder step, it uses attention as a pointer to select a member of the input sequence as the output.

![pointer](./assets/images/architectures/pointer_network.png)

Checkout the code in `architectures` folder

    Applications of NLP

There are many kinds of NLP problems like chatbots, sentiment classification, machine translation, document classification, named entity recognition, text summarization, natural language inference, information retrieval, image captioning, emotion recognition, recommendation systems, and many others. Here, I will try to work on some of the problems in NLP.

## Recommendation based Applications

### Day 5: Song Recommendation

By taking user’s listening queue as a sentence, with each word in that sentence being a song that the user has listened to, training the Word2vec model on those sentences essentially means that for each song the user has listened to in the past, we’re using the songs they have listened to before and after to teach our model that those songs somehow belong to the same context.

![song_recom](assets/images/embeddings/song_recommendation.png)

What’s interesting about those vectors is that similar songs will have weights that are closer together than songs that are unrelated.

Checkout the code in `applications/recommendations` folder

## Classification based Applications

### Day 7: Simple Sentiment Classification with RNN - IMDB

Sentiment analysis refers to the use of natural language processing, text analysis, computational linguistics, and biometrics to systematically identify, extract, quantify, and study affective states and subjective information.

As an example, IMDb dataset is used and simpleRNN is used for processing and identifying the sentiment.

![sentiment](assets/images/applications/sentiment/simple.gif)

### Day 8: Improved Sentiment Classification - IMDB

After trying the basic RNN which gives a test_accuracy less than 50%, following techniques have been experimented and a test_accuracy above 88% is achieved.

Techniques used:
- packed padded sequences
- pre-trained word embeddings
- different RNN architecture
- bidirectional RNN
- multi-layer RNN
- regularization
- a different optimizer

![sentiment](assets/images/applications/sentiment/improved.png)

### Day 17: Sentiment Analysis with Attention - IMDB

Attention helps in focusing on the relevant input when predicting the sentiment of the input. Bahdanau attention was used with taking the outputs of LSTM and concatenating the final forward & backward hidden state. Without using the pre-trained word embeddings, test accuracy of `88%` is achieved.

![sentiment](assets/images/applications/sentiment/sentiment_attention_ex.png)

### Day 25: Sentiment Analysis with BERT - IMDB

BERT obtains new state-of-the-art results on eleven natural language processing tasks. Transfer learning in NLP has triggered after the release of BERT model. Using BERT to do the sentiment analysis is explored.

![sentiment](assets/images/applications/sentiment/bert_senti.png)

### Day 21: Document Classification with Hierarchical Attention Network

A Hierarchical Attention Network (HAN) considers the hierarchical structure of documents (document - sentences - words) and includes an attention mechanism that is able to find the most important words and sentences in a document while taking the context into consideration.

![han](assets/images/applications/classification/han.png)

### Day 22: Improved HAN with regularization techniques

The basic HAN model is overfitting rapidly. In order to overcome this, techniques like `Embedding Dropout`, `Locked Dropout` are explored. There is one more other technique called `Weight Dropout` which is not implemented (Let me know if there are any good resources to implement this). Pre-trained word embeddings `Glove` are also used instead of random initialization. Since the attention can be done on sentence level and word level, we can visualize which words are important in a sentence and which sentences are important in a document.

![han](assets/images/applications/classification/han_visual.png)

![han](assets/images/applications/classification/han_visual2.png)

![han](assets/images/applications/classification/han_visual3.png)

### Day 27: QQP Classification with Siamese Network

QQP stands for Quora Question Pairs. The objective of the task is for a given pair of questions; we need to find whether those questions are semantically similar to each other or not.

The algorithm needs to take the pair of questions as input and should output their similarity.
A Siamese network is used. A `Siamese neural network` (sometimes called a twin neural network) is an artificial neural network that uses the `same weights` while working in tandem on two different input vectors to compute comparable output vectors.

![qqp](assets/images/applications/classification/qqp_siamese.png)

### Day 28: QQP Classification with BERT

After trying the siamese model, BERT was explored to do the Quora duplicate question pairs detection. BERT takes the question 1 and question 2 as input separated by `[SEP]` token and the classification was done using the final representation of `[CLS]` token.

![qqp](assets/images/applications/classification/qqp_bert.png)

### Day 31: POS Classification with BiLSTM

Part-of-Speech (PoS) tagging, is a task of labelling each word in a sentence with its appropriate part of speech. This code covers the basic workflow. We'll learn how to: load data, create train/test/validation splits, build a vocabulary, create data iterators, define a model and implement the train/evaluate/test loop and run time (inference) tagging.

The model used is a Multi Layer Bi-directional LSTM network

![pos](assets/images/applications/classification/pos_lstm.png)

### Day 32: POS tagging with Transformer

After trying the RNN approach, POS tagging with Transformer based architecture is explored. Since the Transformer contains both Encoder and Decoder and for the sequence labeling task only `Encoder` will be sufficient. As the data is small having 6 layers of Encoder will overfit the data. So a 3-layer Transformer Encoder model was used.

![pos](assets/images/applications/classification/pos_transformer.png)

### Day 33: POS tagging with BERT

After trying POS tagging with Transformer Encoder, POS Tagging with pre-trained BERT model is exploed. It achieved test accuracy of `91%`.

![pos](assets/images/applications/classification/pos_bert.png)

### Day 44: NLI with BiLSTM

The goal of natural language inference (NLI), a widely-studied natural language processing task, is to determine if one given statement (a premise) semantically entails another given statement (a hypothesis).

A basic model with Siamese BiLSTM network is implemeted

![nli](assets/images/applications/classification/nli_bilstm.png)

This can be treated as base-line setup. A test accuracy of `76.84%` was achieved.

### Day 45: NLI with Attention

In the previous notebook, the final hidden states of Premise and Hypothesis as the representations from LSTM. Now instead of taking the final hidden states, attention will be computed across all the input tokens and a final weighted vector is taken as the representation of Premise and Hypothesis.

![nli](assets/images/applications/classification/nli_attention.png)

The test accuracy increased from `76.84%` to `79.51%`.

### Day 46: NLI with Transformer

Transformer Encoder was used to encode the Premise and Hypothesis. Once the sentence is passed through the Encoder, summation of all the tokens is considered as the final representation (others variants can be explored). The model accuracy is less compared to RNN variants.

![nli](assets/images/applications/classification/nli_transformer.png)

### Day 47: NLI with BERT

NLI with Bert base model was explored. BERT takes the Premise and Hypothesis as inputs separated by `[SEP]` token and the classification was done using the final representation of `[CLS]` token.

![nli](assets/images/applications/classification/qqp_bert.png)

### Day 48: NLI with Distillation

**`Distillation`**: A technique you can use to compress a large model, called the `teacher`, into a smaller model, called the `student`. Following student, teacher models are used in order to perform distillation on NLI.

- Student Model: Logistic Regression
- Teacher Model: Bi-directional LSTM with Attention

![nli](assets/images/applications/classification/distillation.png)

### Day 49: Toxic Comment Classification with GRU

Discussing things you care about can be difficult. The threat of abuse and harassment online means that many people stop expressing themselves and give up on seeking different opinions. Platforms struggle to effectively facilitate conversations, leading many communities to limit or completely shut down user comments.

 The types of toxicity are:

- toxic
- severe_toxic
- obscene
- threat
- insult
- identity_hate

The model used is a Bi-directional GRU network.

![toxic](assets/images/applications/classification/toxic_gru.png)

A test accuracy of `99.42%` was achieved.

### Day 50: Toxic Comment Classification with GRU

With bi-directional GRU model, test-accuracy of 99.42% was achieved. Since 90% of the data is not labeled into any of the toxicity, simply predicting all the data as non-toxic gives a 90% accurate model. So accuracy is not a reliable metric. A different metric ROC AUC was implemented.

### Day 51: Improved Toxic Comment Classification

With `Categorical Cross Entropy` as the loss, roc_auc score of `0.5` is achieved. By changing the loss to `Binary Cross Entropy` and also modifying the model a bit by adding pooling layers (max, mean), the roc_auc score improved to `0.9873`.

![toxic](assets/images/applications/classification/improved_toxic.png)

### Day 52: Toxic Comment Classification using Streamlit

Converted the Toxic Comment Classification into an app using streamlit. The pre-trained model is available now.

![utt_gen](assets/images/applications/classification/toxic_app.png)

### Day 53: Grammatically Correct Sentence Classification with BERT

Can artificial neural networks have the ability to judge the grammatical acceptability of a sentence? In order to explore this task, the Corpus of Linguistic Acceptability (CoLA) dataset is used. CoLA is a set of sentences labeled as grammatically correct or incorrect.

BERT obtains new state-of-the-art results on eleven natural language processing tasks. Transfer learning in NLP has triggered after the release of BERT model. In this notebook, we will explore how to use BERT for classifying whether a sentence is grammatically correct or not using CoLA dataset.

![cola](assets/images/applications/classification/cola_bert.png)

An accuracy of `85%` and Matthews Correlation Coefficient (MCC) of `64.1` were achieved.

### Day 54: CoLA with DistilBERT

**`Distillation`**: A technique you can use to compress a large model, called the `teacher`, into a smaller model, called the `student`. Following student, teacher models are used in order to perform distillation on CoLA.

- Student Model: Distilbert base uncased
- Teacher Model: Bert base uncased

![cola](assets/images/applications/classification/distilbert.png)

Following experiments have been tried:
- Training using Bert Model (Teacher). Acc: `84.06`, MCC: `61.5`
- Training using Distilbert Model (without teacher forcing). Acc: `82.54`, MCC: `57`
- Training using Distilbert Model (with teacher forcing). Acc: `82.92`, MCC: `57.9`

Checkout the code in `applications/classification` folder

## Generation based Applications

### Day 10: Name Generation with LSTM

A character-level LSTM language model is used. That is, we’ll give the LSTM a huge chunk of names and ask it to model the probability distribution of the next character in the sequence given a sequence of previous characters. This will then allow us to generate new name one character at a time

![name_gen](assets/images/applications/generation/name_gen.png)

Checkout the code in `applications/generation` folder

### Day 11: Basic Machine Translation: German to English

The most common sequence-to-sequence (seq2seq) models are encoder-decoder models, which commonly use a recurrent neural network (RNN) to encode the source (input) sentence into a single vector. In this notebook, we'll refer to this single vector as a context vector. We can think of the context vector as being an abstract representation of the entire input sentence. This vector is then decoded by a second RNN which learns to output the target (output) sentence by generating it one word at a time.

![basic_mt](assets/images/applications/generation/basic_translation.png)

Checkout the code in `applications/generation` folder

### Day 12: Improved Machine Translation: German to English

After trying the basic machine translation which has text perplexity `36.68`, following techniques have been experimented and a test perplexity `7.041`.

- GRU is used instead of LSTM
- Single layer
- Context vector is sent to decoder rnn along with decoder input embedding
- Context vector is sent to classifier along with the decoder hidden state

![improved_mt](assets/images/applications/generation/improved_mt.png)

Checkout the code in `applications/generation` folder

### Day 15: Machine Translation with Bahdanau Attention: German to English

The attention mechanism was born to help memorize long source sentences in neural machine translation (NMT). Rather than building a single context vector out of the encoder's last hidden state, attention is used to focus more on the relevant parts of the input while decoding a sentence. The context vector will be created by taking encoder outputs and the `previous hidden state` of the decoder rnn.

![bahdanau_mt](assets/images/applications/generation/mt_bahdanau.png)

### Day 16: Masking, Packing padded inputs, Attention Visualization, BLEU on MT: German to English

Enhancements like masking (ignoring the attention over padded input), packing padded sequences (for better computation), attention visualization and BLEU metric on test data are implemented.

![mt_visual](assets/images/applications/generation/mt_attn_visual_1.png)

### Day 19: Machine Translation with Transformer: German to English

The Transformer, a model architecture eschewing recurrence and instead relying entirely on an attention mechanism to draw global dependencies between input and output is used to do Machine translation from German to English

![mt_visual](assets/images/applications/generation/transformer.gif)

### Day 20: Self Attention Visualization

Run time translation (Inference) and attention visualization are added for the transformer based machine translation model.

![mt_visual](assets/images/applications/generation/attn_visual.png)

### Day 34: Basic Utterance Generation

Utterance generation is an important problem in NLP, especially in question answering, information retrieval, information extraction, conversation systems, to name a few. It could also be used to create synthentic training data for many NLP problems.

The most common used model for this kind of application is sequence-to-sequence network. A basic 2 layer LSTM was used.

![utt_gen](assets/images/applications/generation/basic_utterance_gen.png)

### Day 35: Utterance Generation with Attention

The attention mechanism will help in memorizing long sentences. Rather than building a single context vector out of the encoder's last hidden state, attention is used to focus more on the relevant parts of the input while decoding a sentence. The context vector will be created by taking encoder outputs and the `hidden state` of the decoder rnn.

After trying the basic LSTM apporach, Utterance generation with attention mechanism was implemented. Inference (run time generation) was also implemented.

![utt_gen](assets/images/applications/generation/utterance_gen_attn.png)

### Day 36: Visualization of Attention

While generating the a word in the utterance, decoder will attend over encoder inputs to find the most relevant word. This process can be visualized.

![utt_gen](assets/images/applications/generation/utt_attn_visual_1.png)

### Day 37: Utterance Generation with Beam Search

One of the ways to mitigate the repetition in the generation of utterances is to use Beam Search. By choosing the top-scored word at each step (greedy) may lead to a sub-optimal solution but by choosing a lower scored word that may reach an optimal solution.

Instead of greedily choosing the most likely next step as the sequence is constructed, the beam search expands all possible next steps and keeps the k most likely, where k is a user-specified parameter and controls the number of beams or parallel searches through the sequence of probabilities.

![utt_gen](assets/images/applications/generation/beam_search.png)

### Day 38: Utterance Generation with Coverage

Repetition is a common problem for sequenceto-sequence models, and is especially pronounced when generating a multi-sentence text. In coverage model, we maintain a
coverage vector `c^t`, which is the sum of attention distributions over all previous decoder timesteps

![utt_gen](assets/images/applications/generation/coverage.png)

This ensures that the attention mechanism’s current decision (choosing where to attend next) is informed by a reminder of its previous decisions (summarized in c^t). This should make it easier for the attention mechanism to avoid repeatedly attending to the same locations, and thus avoid generating repetitive text.

### Day 39: Utterance Generation with Transformer

The Transformer, a model architecture eschewing recurrence and instead relying entirely on an attention mechanism to draw global dependencies between input and output is used to do generate utterance from a given sentence. The training time was also lot faster `4x` times compared to RNN based architecture.

![utt_gen](assets/images/applications/generation/utt_gen_transformer.png)

### Day 40: Beam Search in Utterance Generation with Transformer

Added beam search to utterance generation with transformers. With beam search, the generated utterances are more diverse and can be more than 1 (which is the case of the greedy approach). This implemented was better than naive one implemented previously.

![utt_gen](assets/images/applications/generation/utt_gen_beam.png)

### Day 41: Utterance Generation with BPE Tokenization

Utterance generation using BPE tokenization instead of Spacy is implemented.

Today, subword tokenization schemes inspired by BPE have become the norm in most advanced models including the very popular family of contextual language models like BERT, GPT-2,RoBERTa, etc.

BPE brings the perfect balance between character and word-level hybrid representations which makes it capable of managing large corpora. This behavior also enables the encoding of any rare words in the vocabulary with appropriate subword tokens without introducing any “unknown” tokens.

![utt_gen](assets/images/applications/generation/utt_gen_bpe.png)

### Day 42: Utterance Generation using Streamlit

Converted the Utterance Generation into an app using streamlit. The pre-trained model trained on the Quora dataset is available now.

![utt_gen](assets/images/applications/generation/utt_gen_app.png)

### Day 43: General Utterance Generation

Till now the Utterance Generation is trained using the `Quora Question Pairs` dataset, which contains sentences in the form of questions. When given a normal sentence (which is not in a question format) the generated utterances are very poor. This is due the `bias` induced by the dataset. Since the model is only trained on question type sentences, it fails to generate utterances in case of normal sentences. In order to generate utterances for a normal sentence, `COCO` dataset is used to train the model.
![utt_gen](assets/images/applications/generation/utt_gen_bias.png)

![utt_gen](assets/images/applications/generation/utt_gen_gen.png)

### Day 55-56 Basic Image Captioning

Image Captioning is the process of generating a textual description of an image. It uses both Natural Language Processing and Computer Vision techniques to generate the captions.

The encoder-decoder framework is widely used for this task. The image encoder is a convolutional neural network (CNN). The decoder is a recurrent neural network(RNN) which takes in the encoded image and generates the caption.

In this notebook, the resnet-152 model pretrained on the ILSVRC-2012-CLS image classification dataset is used as the encoder. The decoder is a long short-term memory (LSTM) network.

![img_cap](assets/images/applications/generation/basic_image_captioning.png)

## Day 57: Image Captioning with Attention

In this notebook, the resnet-101 model pretrained on the ILSVRC-2012-CLS image classification dataset is used as the encoder. The decoder is a long short-term memory (LSTM) network. Attention is implemented. Instead of the simple average, we use the weighted average across all pixels, with the weights of the important pixels being greater. This weighted representation of the image can be concatenated with the previously generated word at each step to generate the next word of the caption.

![img_cap](assets/images/applications/generation/img_cap_attn.png)

## Day 58-59: Image Captioning with Beam Search

Instead of greedily choosing the most likely next step as the caption is constructed, the beam search expands all possible next steps and keeps the k most likely, where k is a user-specified parameter and controls the number of beams or parallel searches through the sequence of probabilities.

![img_cap](assets/images/applications/generation/img_cap_beam.png)

Checkout the code in `applications/generation` folder

## Ranking Based Applications

### Day 30: Covid-19 Browser

There was a kaggle problem on [covid-19 research challenge](https://www.kaggle.com/allen-institute-for-ai/CORD-19-research-challenge) which has over `1,00,000 +` documents. This freely available dataset is provided to the global research community to apply recent advances in natural language processing and other AI techniques to generate new insights in support of the ongoing fight against this infectious disease. There is a growing urgency for these approaches because of the rapid acceleration in new coronavirus literature, making it difficult for the medical research community to keep up.

The procedure I have taken is to convert the `abstracts` into a embedding representation using [`sentence-transformers`](https://github.com/UKPLab/sentence-transformers/). When a query is asked, it will converted into an embedding and then ranked across the abstracts using `cosine` similarity.

![covid](assets/images/applications/ranking/covid.png)

repository: khadarvalli/complete-NLP

repo_name: khadarvalli/complete-NLP


text:
THIS PACKAGE IS NO LONGER MAINTAINED.

# LightDarkPOMDPs

![A trajectory of a good solution to a LightDark2DTarget problem](https://github.com/zsunberg/LightDarkPOMDPs.jl/raw/master/img/target_good_solution.gif)

[![Build Status](https://travis-ci.org/zsunberg/LightDarkPOMDPs.jl.svg?branch=master)](https://travis-ci.org/zsunberg/LightDarkPOMDPs.jl)

In the `LightDark2D` problem, cost is quadratic in the distance from the origin; In the `LightDark2DTarget` problem, there is a cost of -1 accrued for every step outside of the target region (a radius from the origin controlled by the `term_radius` field of `LightDark2DTarget`).

There is also a Kalman filter `LightDark2DKalman`, but Kalman filtering is rather ill-suited to this problem because the true beliefs are not similar to a Gaussian distribution. Instead, it is much better to use a particle filter from ParticleFilters.jl.

See [test/runtests.jl](test/runtests.jl) for usage examples.

<!--
[![Coverage Status](https://coveralls.io/repos/zsunberg/LightDarkPOMDPs.jl/badge.svg?branch=master&service=github)](https://coveralls.io/github/zsunberg/LightDarkPOMDPs.jl?branch=master)

[![codecov.io](http://codecov.io/github/zsunberg/LightDarkPOMDPs.jl/coverage.svg?branch=master)](http://codecov.io/github/zsunberg/LightDarkPOMDPs.jl?branch=master)
-->

gha_language: Julia


text:
[Back to README](../README.md)

## Installing Ruby

### on Mac OS
- You'll likely need `homebrew` before you can install Ruby.
- Both `rvm` and `rbenv` are good ways to install Ruby.
- If you run into errors during Ruby installation, run `brew doctor` and follow the advice given, if any.

### on Windows
- It's highly recommended to use WSL2 for your development environment. Verify that you have version 2 enabled. `rvm` or `rbenv` should work from there.

### on Linux
- Use `rvm` or `rbenv`.

## Other common setup issues

- **Most integration tests fail with an exception.** This is usually caused by an improperly installed/linked version of QT, particularly on OSX. [This wiki section](https://github.com/thoughtbot/capybara-webkit/wiki/Installing-Qt-and-compiling-capybara-webkit#video-playback-mp4-on-osx-requires-qt-5) should set you straight.

- **"Error: EACCES: permission denied, open '/home/username/.babel.json'"** This happen, when babel don't have acces to ~/. To fix this, use command: `BABEL_DISABLE_CACHE=1 yarn start`

- **"sh: 1: node: not found"** This usually happen on Ubuntu 16.04, when nodejs is not linked as 'node'. To fix this, use command: `sudo ln -s /usr/bin/nodejs /usr/bin/node`

- **"Gem::Ext::BuildError: ERROR: Failed to build gem native extension. *.rb can't find header files on running `bundle install`"** This happens when header files required are not installed in the system. To fix this install a package, using command:  `sudo apt-get install ruby2.3-dev`

- **My sql setup should come before installing bundler.**

- **"Sorry you can't use Pry without Readline or a compatible library". add  `rb-readline`** to the Gemfile in the development group.

- **For Debian users, if you could not start the mysql command line using**`sudo mysql`. Your default password is blank. Go to database.yml and type in your password in the password field.
    - In database.yml: `password: "mypassword"`
Then start the command line:
    - Debian: `mysql -u root -p`
    - `SET PASSWORD FOR 'root'@'localhost' = PASSWORD('mypassword')`
    - `CREATE DATABASE dashboard DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;`
    - `CREATE DATABASE dashboard_testing DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;`
    - `exit`

- **When running yarn : ** `ERROR: There are no scenarios; must have at least one`.
Your system has cmdtest installed, which provides a different program as yarn. Uninstall it `sudo apt remove cmdtest`, then re-install yarn `sudo npg -g install yarn` and try again.

- **To check if redis is running as a daemon in Linux** `ps aux | grep redis-server`

- Use node v10 or lower to avoid any errors.
- **For WSL users , if rspec tests are taking too long to run** make sure to fork the repo in the linux file system and not in the windows partition. Use command `pwd` to know the exact path of your repo. If the path starts with `/mnt/`, the repo is in windows partition. Follow the documentation availible at link: https://learn.microsoft.com/en-us/windows/wsl/filesystems to know more about storing and moving files in the linux file system.

	If you have received error related to dependencies(`sudo apt-get install -y redis-server mariadb-server libmariadb-dev rvm nodejs npm pandoc`), try to install packages one by one and figure out which packages are creating problems).

**Solution to some of the errors for WSL users:**

- **mariaDB Package error** (`The following packages have unmet dependencies: mariadb-server : Depends: mariadb-server-10.4 (>= 1:10.4.8+maria~disco) but it is not going to be installed`):
   	Try `sudo aptitude install mariadb-server`: you will get suggestions of the packages not installed. When prompted for accepting the solution - write 'n', then it will fix itself and will again prompt for reinstalling mariadb packages - this time write 'y'. Reopen the terminal and check if you can start mariadb server.
- **npm error**(`unmet dependencies`): Try using `aptitude`.
   	`sudo apt-get install aptitude`
   	`sudo aptitude install npm`
- **rvm install 3.1.2' command error** (`cannot create directory...: Permission denied`): Try using `rvm fix-permissions system; rvm fix-permissions user`

- **error: `usermod: group 'rvm' does not exist:`** Try `sudo groupadd rvm`

gha_language: Ruby

gha_license_id: MIT


text:
<img src="https://avatars3.githubusercontent.com/u/12783832?s=200&v=4" height="100" width="100" />

# Aqua Enterprise Product Deployment

## Overview

[Aqua Platform](https://www.aquasec.com/aqua-cloud-native-security-platform/) is a layered, full-lifecycle cloud native security platform that secures containerized, serverless, and VM-based applications, from application build, infrastructure through production runtime environments. Aqua Enterprise runs either in SaaS or Self-Hosted edition, at any scale.

 This repository explains different methods to deploy each Aqua component. It also provides a [quick_start](./quick_start) deployment suited for proofs-of-concept (POCs), training, and test environemnts.

 Aqua components can be deployed on multiple platforms such as Kubernetes, AWS ECS, OpenShift, no-orchestrator, and more, using different deployment methods such as manifests, Helm, Operator, proprietary CLI tools, RPM, and scripts. Deployment resources for each Aqua component is listed in the respective directory.

### Aqua Enterprise SaaS edition deployment

Users working with Aqua Enterprise SaaS edition do not need to deploy Aqua server in their datacenter but only the relevant Enforcers to enable runtime protection. Following are the components that are available for Aqua SaaS users:
* [Enforcers](./enforcers):
  * **Aqua Enforcer**: containers and host protection
  * **KubeEnforcer**: full stack Kubernetes cluster protection
  * **VM Enforcer**: VM workloads protection
  * **MicroEnforcer**: runtime security for containers running in Containers-as-a-Service (CaaS) environments
  * **NanoEnforcer**: runtime protection of serverless functions
* [Scanner](./scanner): Used to scan images, VMWare Tanzu applications, and serverless functions locally or stored in a registry
* [Cloud Connector](./cloud_connector): the Aqua Cloud Connector establishes a secure connection to the Aqua Platform console, giving Aqua Platform remote access to resources on the local clusters.

### Aqua Enterprise Self-Hosted edition deployment

Aqua Enterprise Self-Hosted edition requires deploying Aqua server and other components in your datacenter. Following are the server components available for deployment:
*  [Server](./server): core server components – Console, Gateway, and Database. This deployment is mandatory for Aqua Self-Hosted edition.
*  [Tenant Manager](./tenant_manager) *(Optional)*: manage multiple segregated Aqua deployments from a single console
*  [CyberCenter](./cyber_center): required for air-gap environments

After deploying Server components, you can deploy Enforcers and Scanners similar to SaaS users.

### Quick-start deployment

A quick-start option is available for small non-production deployments and quick evaluations. It deploys Aqua Server and all Enforcers, in a single Kubernetes cluster.

# Deployment methods

You can deploy the mentioned Aqua components using one of the following methods:
* Manifests
* Helm
* Operator
* AWS Cloudformation
* Aquactl (Aqua CLI)
* RPM (for no-orchestrator environments)
* Scripts

Each Aqua component can be deployed through a selection of the methods above, as listed in component's directory itself.

Before you start using the deployment methods in this repository, Aqua strongly recommends you to refer the [Product documentation on Deployments](https://docs.aquasec.com/docs/deployment-overview).

repository: aquasecurity/deployments

gha_language: Shell

repo_name: aquasecurity/deployments


text:
# ng2-webpack
A production ready Angular 2, TypeScript, Webpack, and SASS starter app **without** the complexity.

## Quick start
```bash
# clone the repo
git clone --depth 1 https://github.com/seansean11/ng2-webpack.git

# install the repo with npm
npm install

# start the dev server
npm start
```

## Other Commands
```bash
# run unit tests
npm test

# run e2e tests
npm run e2e

# build for deveolopment or production environment
npm run build
```

gha_language: JavaScript


text:
## What is PyQt?

It is a free software originally designed by Riverbank Computing, it is accessible via similar terms to Qt versions older than 4.5, signifying that a wide array of licenses such as `General Public License` are supported, yet unlike Qt, PyQt cannot be used with `LGPL`.

- **`PyQt` can be used with**:
  - Microsoft Windows
  - Linux
  - MacOs

- **`PyQt` aids in implementing more than 440 classes and 6,000 settings and methods, like**:
  - An impressive GUI widget pack
  - Distinct classes for reaching SQL databases, including `ODBC`, `MySQL`, `PostgreSQL`, `Oracle` or `SQLite`;
  - A Scintilla friendly text editor widget;
  - `XML` parser;
  - `SVG` aid;

## What is PyQt used for?

It is used for creating a (Python) GUI, developing desktop applications with Python.

- **Some examples of `PyQt / Qt` software is**:
  - The Dropbox Desktop Client
  - R Studio / Spyder
  - KDE desktop (made with Qt)

**_The latest version is PyQt6._**

## Why PyQt?

PyQt provides many classes, methods and widgets. That allows you to make a rich desktop app.

You can add many types of buttons (push, radio, check), images, interact with databases and a lot more.

Unlike tkinter which is rather limited in number of widget, Pyqt comes with a large set of widgets included.

---

| Previous Page | Next Page |
| :---: | ---: |
| [![previous-page](../img/previous.png "previous")](/) | [![next-page](../img/next.png "next")](/) |

---

© 2021 Nurul Carvalho

repository: Nurul-GC/pyqt-tutorial

branch_name: refs/heads/main

repo_name: Nurul-GC/pyqt-tutorial


text:
# Predicting Forest Cover Type: Multi-class classification

This project is a Kaggle competition https://www.kaggle.com/c/forest-cover-type-prediction/

**Description:** A dataset of forest cover type for a given 30 x 30-meter cell determined from US Forest Service (USFS) Region 2 Resource Information System data with independent variables were then derived from data obtained from the US Geological Survey, and USFS is provided. The objective is to use the above dataset to train a machine-learning model to predict the forest cover type from unknown cartographic variables using machine learning.

**Files:** Dataset data description in the Data folder
  Forest_Cover_EDA.ipynb - Exploratory Data analysis and visualization
 Forest_Cover_Prediction.ipynb - Data preprocessing, Modeling, Analysis and Prediction

Final submission in Submissions folder
.

**Modeling** using  Random Forest Classification. Extensive study into feature analysis and inference including Shapley values.

  **Kaggle Score = 0.76142**.

repository: budhochat/Forest-Cover-Prediction

repo_name: budhochat/Forest-Cover-Prediction


text:
# Graql Syntax

Graql Syntax Highlighting for Sublime 3

## Installation

### With Package Control:

1. Run the `Package Control: Install Package` command, find and install the Graql Syntax package.
1. Restart Sublime Text (if required)

### Manually:

1. Clone or download the git repo into your packages folder (in Sublime Text, find Browse Packages… menu item to open this folder)
1. Restart Sublime Text editor (if required)


text:
---
title: How to cite geospatial standards and other GIS things
excerpt: "I found a template for manging ISO and OGC standards as Bibtex entries. This may be useful for citing documents that are not indexed by Google Scholar or if Mendeley can't find a DOI for the PDF document."
categories: [Analysis]
tags: [bibliography,bibtex,standards,iso/iec,ogc,gis,geospatial]
---

Nowadays, there are tons of tools for managing and formating your references, some of the most useful options are to use Google Scholar for **reference management** and Mendeley (desktop+web) for **document management** (mostly for PDFs). I use the GS for getting Bibtex or APA7 formated references when I don't need to reread the document or Mendeley when it's a document I would like to keep.

These tools were practical enough since this year I started using Zotero and Cablibre for managing my collections of papers and digital books. I will share a few toughts of this in a future post.

Right now, I'm mostly interested in having a complete Bibtex database for my references and this can be done by using any of the previous solutions (FOSS or not). However, there are certain specific ocasions where you can't find an already formated reference in GS or there is no DOI code that can be used by Mendeley or Zotero to compile the Bibtex entry. In those ocasions you need to do it the old way...

## Can't found a Bibtex entry in the previous options?

This was the case when I was trying to cite ISO and OGC standards for a paper (these don't have DOI or ISBN). As usual in life, many people share the same problem you have. Ismael Olea shares a solution in [this post](https://olea.org/diario/2018/10/19/how_to_cite_ISO_standards.html). This is how the SQL standard looks like following his suggestions:

```tex
@techreport{iso_sql_2016,
  address = {Geneva, CH},
  type = {Standard},
  title = {Information technology -- {Database} languages -- SQL -- {Part} 1: {Framework}},
  shorttitle = ISO/IEC 9075-1:2016,
  url = {https://www.iso.org/standard/63555.html},
  language = {en},
  number = ISO/IEC TR 9075-1:2016,
  institution = {International Organization for Standardization},
  author = {ISO Central Secretary},
  year = {2016}
}
```

I think it would be useful to keep a repository of those documents and items that are not usually cited. I appreciate VERY MUCH the way GS, Mendeley, Calibre and Zotero help us with these arduous tasks.

{: .notice--info}
**A small tip:** Did you know that Calibre helps you in finding metadata for PDF books? It even downloads the covers from Amazon!!! You should try it ;)

branch_name: refs/heads/source

gha_language: HTML


text:
# Alert Types

By default WSO2 IS is capable of triggering alerts for the following
situations.

### Suspicious Login

-   **Reason for Triggering** : A successful login after a particular
    number of failed login attempts during a given time interval.
-   **Indication** : A sudden change in the level of access granted to a
    specific user Id that indicates the need for further investigation.
-   **Alerting Logic** : An alert is sent if a user successfully logs in
    after a specific number of failures. These failures can be due
    repeatedly entering the following:
    -   Same incorrect username

    -   Same incorrect user store

    -   Same incorrect tenant domain

### Long Sessions

-   **Reason for Triggering** : The session duration of a specific user
    exceeds a predefined time duration.
-   **Indication** : The user is engaged in unauthorized activity.
-   **Alerting Logic** : An alert is sent if,
    -   The duration of a session exceeds the predefined session
        duration

    -   The duration of a session exceeds the average session duration
        calculated for a predefined time interval. This time interval is
        specified as the last n days, e.g., last 7 days.

repository: NipuniBhagya/docs-is

repo_name: NipuniBhagya/docs-is


text:
---
title: Biography — Wong Mun Summ
image: /images/jury/wong-mun-summ.png
permalink: /wong-mun-summ/
---

##### **Mr Wong Mun Summ**
 Member, Lee Kuan Yew World City Prize Nominating Committee
 Founding Director, WOHA Architects
 Singapore

---

**Mr Wong Mun Summ** is the joint founding director of WOHA, one of Southeast Asia’s best known and most awarded architectural practices based in Singapore. Wong Mun Summ graduated with Honours from the National University of Singapore in 1989 and is a member of various Design Advisory Panels in Singapore.

Wong Mun Summ formed WOHA as a partnership with Richard Hassell in 1994. WOHA’s architecture is notable for its constant evolution: no two buildings adopt the same ‘style’, as each project constitutes a specific response to the potential of the programme and the site. Environmental principles have always been fundamental to WOHA’s designs.

Since inception, the partnership has won a large number of local awards and international awards such as the 2007 Aga Khan Award for Architecture for their first tropical high-rise tower, 1 Moulmein Rise in Singapore. The Met, a high-rise residential tower in Bangkok, Thailand, was awarded the 2010 International Highrise Award and 2011 Lubetkin Prize from the Royal Institute of British Architects. A travelling exhibition devoted exclusively to their works opened at the Deutsches Architekturmuseum, Germany, in December 2011, and two substantial monographs – WOHA: The Architecture of WOHA and WOHA: Selected Projects Vol. 1 – have already been published.

Together with Richard Hassell, WOHA conducted a Design Studio at the Singapore University of Technology and Design in 2016. WOHA exhibited an invited, solo exhibition at The Skyscraper Museum in New York in 2016. They have also participated at the 2016 Venice Architectural Biennale. In conjunction with their installation in Venice, WOHA launched a new book, titled "Garden City Mega City", which shares strategies for the burgeoning mega cities of the tropical belt. **O**

---

[Back to Nominating Committee](/nominating-committee/)

repository: isomerpages/ura-lkywcp

branch_name: refs/heads/staging

gha_language: SCSS

gha_license_id: NOASSERTION

repo_name: isomerpages/ura-lkywcp


text:
# Forest Scenario Planner
## An Online Tool for Forest Management Scenario Planning

Ecotrust has created the Forest Planner to give forest management scenario planning capacity to all Oregon and Washington land managers. Users will be able to visualize alternative management scenarios on their lands and receive immediate feedback on how their decisions might pay off in terms of timber harvests and financial returns, as well as public benefits like carbon storage and ecosystem services.

### Using the Scenario Planning Tool
* Find and map your property with helpful map layers such as tax lots
* Use preloaded Forest Inventory Analysis data (FIA) or upload their own cruise data
* Designate forest management areas or stands with riparian buffers and steep slopes
* Define management prescriptions
* Specify timber and carbon market prices

### Scenario Planning Tool Outputs:
* Graphs of timber volume and financial returns generated over time
* Optimized harvest schedule
* Choose from a spectrum of harvest practices and apply them to the management units you want
* Maps of standing timber volume, species and age class over time
* Visualize potential to realize carbon credits and ecosystem-based incentives over time

### Additional Features
* Secure and confidentially store and manage data and scenario runs
* Share scenarios between collaborators to explore collaborative decision making among forest landowners and managers

### Software
* OpenLayers
* GeoDjango
* PostGIS
* Madrona
* Tilemill
* Mapnik
* [Forest Vegetation Simulator](http://www.fs.fed.us/fmsc/fvs/)

### Authors

* Matthew Perry ([perrygeo](https://github.com/perrygeo))
* Edwin Knuth ([eknuth](https://github.com/eknuth))
* Mike Mertens ([mmertens](https://github.com/mmertens))
* Ryan Hodges ([rhodges](https://github.com/rhodges))
* Ken Vollmer (kvollmer)
* Will Moore ([willthemoor](https://github.com/willthemoor))
* David Diaz ([d-diaz](https://github.com/d-diaz))

repository: Ecotrust/forestplanner

repo_name: Ecotrust/forestplanner


text:
---
layout: fluid/docs_base
category: resources
id: using_ngx_translate
title: Using ngx-translate
header_sub_title: Ionic Resources
---

# Using ngx-translate

### Installing

To install ngx-translate run `npm install @ngx-translate/core @ngx-translate/http-loader --save`.

### Bootstrapping

To use ngx-translate, it must first be imported and added to the imports array in the NgModule of the application. Here’s an example of how to do this:

```typescript
import { TranslateModule } from '@ngx-translate/core';

@NgModule({
  imports: [
    TranslateModule.forRoot()
  ]
})
```

By default this will look for your translation json files in `i18n/`, but for Ionic you must change this to look in the `src/assets` directory. We can do this by creating a function that returns a new TranslateLoader:

```typescript
import { TranslateModule, TranslateLoader } from '@ngx-translate/core';
import { TranslateHttpLoader } from '@ngx-translate/http-loader';
import { HttpModule, Http } from '@angular/http';
...

export function createTranslateLoader(http: Http) {
  return new TranslateHttpLoader(http, './assets/i18n/', '.json');
}
```
and then adding the following to your NgModules imports array:

```typescript
@NgModule({
  imports: [
    HttpModule,
    TranslateModule.forRoot({
      loader: {
        provide: TranslateLoader,
        useFactory: (createTranslateLoader),
        deps: [Http]
      }
    })
  ]
})
```

## Lazy loading pages
If you want to use Ionics lazy loading pages together with ngx-translate, you have to configure your `component.module.ts` files

```typescript
import { NgModule } from '@angular/core';
import { IonicPageModule } from 'ionic-angular';
import { TranslateModule } from '@ngx-translate/core';
import { HelloPage } from './hello-page';

@NgModule({
  declarations: [
    HelloPage,
  ],
  imports: [
    IonicPageModule.forChild(HelloPage),
    TranslateModule.forChild()
  ],
  exports: [
    HelloPage
  ]
})
export class HelloPageModule {}
```

### Usage

Once the above steps have been completed, we can begin to use in your Ionic app. The first step is to set up the translation assets. The translation assets are just json objects, as shown below:

es.json

```json
{
  "HELLO": "hola"
}
```

en.json

```json
{
  "HELLO": "Hello"
}
```

Now we can use the `TranslatePipe` and the `TranslateService` to translate values in the app. The `TranslatePipe` is an Angular [pipe](https://angular.io/docs/ts/latest/guide/pipes.html) that can be used to translate static values in the application, such as a navbar title. Below is an example of how to use `TranslatePipe` to translate the app title using the above translation assets.

```html
{% raw %}
<ion-title>{{ 'HELLO' | translate }}</ion-title>
{% endraw %}
```

Instead of writing the actual string as the title, we write the key of the string that should be there. The translate pipe then takes care of the rest.

> For Ionic's components it's recommended to use the translate pipe, as this will make things behave correctly with content projections.

The `TranslateService`  can be used both to change the current language the app is using and to translate JavaScript values in an application. To use the `TranslateService` in your app you must first import it and set the default language.

```typescript
import { TranslateService } from '@ngx-translate/core';

@Component({
    selector: 'page-schedule',
    templateUrl: 'schedule.html'
})
export class SchedulePage {
    constructor(translate: TranslateService) {
        // this language will be used as a fallback when a translation isn't found in the current language
        translate.setDefaultLang('en');
    }
}
```

To change the language the app is currently using, there’s the `use` method of the TranslationService.

```typescript
translateService.use('en')
```

To translate any JavaScript values in the application, like the title of an alert, the `TranslateService` provides a `get` [observable](http://angular-2-training-book.rangle.io/handout/observables/using_observables.html).

```typescript
translateService.get('HELLO').subscribe(
  value => {
    // value is our translated string
    let alertTitle = value;
  }
)
```

It takes the key of the string that needs to be translated from the translation assets. We then subscribe to the observable, and it will return the translated string.

For more information on how to use ngx-translate, check out its [docs](https://github.com/ngx-translate/core).

repository: ionic-team/ionic-legacy-docs

repo_name: ionic-team/ionic-legacy-docs


text:
---
layout: post
title: "A note about Charging with Stripe, secret and publishable keys"
date: 2015-02-07 15:29:00
categories: css
---

Stripe Billing
===
@(Brief Guides)[subscription | model]

I found this out while following the official stripe documentation to add stripe API keys to my rails app.
So far I set up my environment variables and am pulling it into `STRIPE_PUBLISHABLE_KEY` and `STRIPE_SECRET_KEY`.

**"What’s the difference between my secret key and my publishable key?"**
Secret and publishable keys are used to identify your Stripe account.

You can grab the test and live API keys for your account under Your Account >> API Keys.

The publishable key is used to generate credit card tokens and should be included with the HTML form. The secret key is used for all other API calls on the server-side.

In  your new charges form views/charges/new.html.erb

```
  <script src="https://checkout.stripe.com/checkout.js" class="stripe-button"
          data-key="<%= Rails.configuration.stripe[:secret_key] %>"
          data-description="A month's subscription"
          data-amount="500"></script>
```
Note it says `:secret_key`
And on the server side on config/initializers/stripe.rb
```
Rails.configuration.stripe = {
  :publishable_key => ENV['STRIPE_PUBLISHABLE_KEY'],
  :secret_key      => ENV['STRIPE_SECRET_KEY']
}

Stripe.api_key = Rails.configuration.stripe[:publishable_key]
```
Note it says `:publishable_key`


text:
# Realtime Application with MongoDB and Socket.io

This application shows how to use MongoDB to create a pub/sub based application.

It uses :

 * MongoDB Capped Collections and Tailable Cursors
 * node.js

[Online Tutorial](http://tgrall.github.io/blog/2015/01/12/how-to-create-a-pub-slash-sub-application-with-mongodb-introduction/)

## Step 1 : Capped Collection and Tailable Cursors with node.js

*See branch step-01*

Installation:

1- Create a new database

  `` use chat ``

2- Create a Capped Collection

`` db.createCollection('messages', { capped: true, size: 100000 }); ``

3- Insert a dummy document

`` db.messages.insert({"type":"init"});``

4- Install node modules

`` npm install``

5- Start application

`` node app``

6- Insert new documents in the collection

`` db.messages.insert({"type":"message", "text":"New message"});``

You can see that message is capture by the node application

## Step 2 : Adding User Interface with Socket.io

*See branch step-02*

In this step, the application has been improved to send message to an HTML client using [socket.io](http://socket.io).

Once you hace checked out the step-02 branch and updated the dependencies `npm install` :

1- Start the application

`` node app``

2- Open your browser and go to:

[http://localhost:3000](http://localhost:3000)

3- Insert new messages in the collection

`` db.messages.insert({"type":"message", "text":"New message pushed in web client"});``

repository: tgrall/mongodb-realtime-pubsub

repo_name: tgrall/mongodb-realtime-pubsub


text:
# Google Ads API Client Library for Perl

[![CPAN version](https://badge.fury.io/pl/Google-Ads-GoogleAds-Client.svg)](https://badge.fury.io/pl/Google-Ads-GoogleAds-Client)
![Build Status](https://storage.googleapis.com/gaa-clientlibs/badges/google-ads-perl/buildstatus_ubuntu.svg)

This project hosts the Perl client library for the [Google Ads
API](https://developers.google.com/google-ads/api/docs/start).

## Features

  * Distributed via [CPAN](https://metacpan.org/release/Google-Ads-GoogleAds-Client).
  * Easy management of credentials.
  * Easy creation of Google Ads API service clients.

## Requirements

  * Perl 5.24.1+

## Getting started

1.  Clone this project in the directory of your choice via:

        git clone https://github.com/googleads/google-ads-perl.git

1.  Change into the `google-ads-perl` directory.

        cd google-ads-perl

    You'll see some files and subdirectories:

    *   `Build.PL`: the Perl build file, which holds the dependencies and test
        types of this project.
    *   `lib`: source code of the library.
    *   `t`: test cases of the library code.
    *   `examples`: many examples that demonstrate how to use the library to
        execute common use cases via the Google Ads API.
    *   `googleads.properties`: the sample configuration file for the library.
    *   `log4perl.conf`: the sample logging configuration file.

1.  Now run the following command at the command prompt. This will install all
    dependencies needed for using the library and running examples.

        cpan install Module::Build
        perl Build.PL
        perl Build installdeps

1.  Set up your OAuth2 credentials.

    The Google Ads API uses [OAuth2](http://oauth.net/2/) as the authentication
    mechanism. Choose the appropriate option below based on your use case, and
    read and follow the instructions that the example prints to the console.

    **If you already have credentials for the AdWords API...**

    *   If you have the `adwords.properties` file you used for the AdWords API,
        copy and name it as `googleads.properties`. Simply change the key names
        in the new configuration file as below:

            oAuth2ClientId       --> clientId
            oAuth2ClientSecret   --> clientSecret
            oAuth2RefreshToken   --> refreshToken
            developerToken       --> developerToken

        If you are authenticating as a manager account, additionally you must
        specify:

            loginCustomerId --> Manager account ID (with hyphens removed).

    **If you're accessing the Google Ads API using your own credentials...**

    *   Copy the sample [`googleads.properties`](googleads.properties)
        to your [home directory](https://en.wikipedia.org/wiki/Home_directory#Default_home_directory_per_operating_system).

    *   Follow the instructions at
        https://developers.google.com/google-ads/api/docs/oauth/cloud-project
        to create an OAuth2 client ID and secret for the **Desktop app**
        OAuth2 flow.

    *   Run the
        [authenticate_in_desktop_application](examples/authentication/authenticate_in_desktop_application.pl)
        example, by providing your OAuth2 client ID and secret as the parameters.

    *   Copy the output from the last step of the example into the
        `googleads.properties` file in your home directory. Don't forget to fill
        in your developer token too.

    **If you're accessing the Google Ads API on behalf of clients...**

    *   Copy the sample [`googleads.properties`](googleads.properties)
        to your [home directory](https://en.wikipedia.org/wiki/Home_directory#Default_home_directory_per_operating_system).

    *   Follow the instructions at
        https://developers.google.com/google-ads/api/docs/oauth/cloud-project
        to create an OAuth2 client ID and secret for the **Web application**
        OAuth2 flow.

    *   Run the
        [authenticate_in_web_application](examples/authentication/authenticate_in_web_application.pl)
        example, by providing your OAuth2 client ID and secret as the parameters.

    *   Copy the output from the last step of the example into the
        `googleads.properties` file in your home directory. Don't forget to fill
        in your developer token too.

1.  Run the [get_campaigns](examples/basic_operations/get_campaigns.pl) example
    to test if your credentials are valid. You also need to pass your Google Ads
    account's customer ID as a command-line parameter:

        perl examples/basic_operations/get_campaigns.pl -customer_id <YOUR_CUSTOMER_ID>

    **NOTE**: Code examples are meant to be run from command prompt, not via the
    web browsers.

1.  Explore other examples.

    The [examples](examples) directory contains several useful examples. Most of
    the examples require parameters. You can either pass the parameters as
    arguments (recommended) or edit the `INSERT_XXXXX_HERE` values in the source
    code. To see a usage statement for an example, pass `-help` as a
    command-line argument.

    **Note:** From the source code, you can ignore comments with `[START...]` and
    `[END...]` in them-they are specifically used by Google.

## Basic usage

To issue requests via the Google Ads API, you first need to create an
[API client](lib/Google/Ads/GoogleAds/Client.pm). For convenience, you can store
the required settings in a properties file (`googleads.properties`) with the
following format:

    ### Google Ads ###
    developerToken=INSERT_DEVELOPER_TOKEN_HERE

    ### OAuth2 ###
    clientId=INSERT_OAUTH2_CLIENT_ID_HERE
    clientSecret=INSERT_OAUTH2_CLIENT_SECRET_HERE
    refreshToken=INSERT_REFRESH_TOKEN_HERE

If you're authenticating as a manager account, additionally you must specify the
manager account ID (with hyphens removed) as the login customer ID:

    ### Google Ads ###
    loginCustomerId=INSERT_LOGIN_CUSTOMER_ID_HERE

If you have an `googleads.properties` configuration file in the above format in
your home directory, you can instantiate the client with no arguments:

```perl
my $api_client = Google::Ads::GoogleAds::Client->new();
```

If your configuration file is not in your home directory, you can pass the file
location to the the `properties_file` property as follows:

```perl
my $properties_file = "/path/to/googleads.properties";

my $api_client = Google::Ads::GoogleAds::Client->new({
  properties_file => $properties_file
});
```

You can also get a [OAuth2ApplicationsHandler](lib/Google/Ads/GoogleAds/OAuth2ApplicationsHandler.pm)
object from the `API client`, and change the client ID, client secret and
refresh token at runtime:

```perl
my $api_client = Google::Ads::GoogleAds::Client->new({
  developer_token   => "INSERT_DEVELOPER_TOKEN_HERE",
  login_customer_id => "INSERT_LOGIN_CUSTOMER_ID_HERE"
});

my $oauth2_applications_handler = $api_client->get_oauth2_applications_handler();
$oauth2_applications_handler->set_client_id("INSERT_CLIENT_ID");
$oauth2_applications_handler->set_client_secret("INSERT_CLIENT_SECRET");
$oauth2_applications_handler->set_refresh_token("INSERT_REFRESH_TOKEN");
```

### Get a service client

Once you have an instance of `API client`, you can obtain a service client for a
particular service using one of the `...Service()` methods:

```perl
my $campaign_serevice = $api_client->CampaignService();
```

### Request/Response Logging

Logging is configured with [Log::Log4perl](https://metacpan.org/pod/Log::Log4perl),
a generic logging library for Perl.

#### Logging layout and functionality

Requests are logged with a one line summary and the full request/response body
and headers. The level at which messages are logged depends on whether the event
succeeded.

| Log type | Log name                       | Success level | Failure level |
| -------- | ------------------------------ | ------------- | ------------- |
| SUMMARY  | Google.Ads.GoogleAds.Summary   | INFO          | WARN          |
| DETAIL   | Google.Ads.GoogleAds.Detail    | DEBUG         | INFO          |

**Caveat**: Mutate requests where [Partial failure](https://developers.google.com/google-ads/api/docs/samples/handle-partial-failure)
is true do not cause the entire request to fail. Therefore, partial failure logs
are always logged at Success level, not at Failure level as may be expected.

#### Configuring logging

The client library uses a custom class for all logging purposes and is exposed
through the [GoogleAdsLogger](lib/Google/Ads/GoogleAds/Logging/GoogleAdsLogger.pm)
module. This class provides a default configuration that both summary and detail
loggers will log to relative files in the `logs` folder under your home directory.
But the default configuration can be overridden by providing a
[log4perl.conf](log4perl.conf) file in your home directory.

Logging can be enabled/disabled using the following methods:

* Enables logging for both loggers.

  ```perl
  Google::Ads::GoogleAds::Logging::GoogleAdsLogger::enable_all_logging();
  ```

* Disables the summary logging.

  ```perl
  Google::Ads::GoogleAds::Logging::GoogleAdsLogger::disable_summary_logging();
  ```

* Disables the detail logging.

  ```perl
  Google::Ads::GoogleAds::Logging::GoogleAdsLogger::disable_detail_logging();
  ```

You can use the methods of the `GoogleAdsLogger` class directly for even more
control over how requests are logged.

## Running in a Docker container

See the [Running in a Docker Container guide](https://developers.google.com/google-ads/api/docs/client-libs/perl/docker).

## Proxy configuration

See the [Proxy guide](https://developers.google.com/google-ads/api/docs/client-libs/perl/proxy).

## Miscellaneous

### Wiki

- https://github.com/googleads/google-ads-perl/wiki

### Issue tracker

- https://github.com/googleads/google-ads-perl/issues

### API Documentation:

- https://developers.google.com/google-ads/api/docs

### Support forum

- https://groups.google.com/forum/#!forum/adwords-api

### Authors

- [Wang Fan](https://github.com/wfansh)

repository: vhalappa/google-ads-perl

repo_name: vhalappa/google-ads-perl


text:
# Polyporus xerophyllaceus Berk., 1856 SPECIES

#### Status
SYNONYM

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

#### Published in
Hooker's J. Bot. Kew Gard. Misc. 8: 200 (1856)

#### Original name
Polyporus xerophyllaceus Berk., 1856

### Remarks
null

repository: mdoering/backbone

path: /life/Fungi/Basidiomycota/Agaricomycetes/Polyporales/Polyporaceae/Nigroporus/Nigroporus vinosus/ Syn. Polyporus xerophyllaceus/README.md

repo_name: mdoering/backbone


text:
# multimeter-software

> A web based application for interfacing with a multimeter created for ENGG4810

## Install

- Install NodeJS v7.x
- Run the following in a terminal

```bash
# Change into the software directory
cd software

# Install the dependencies
npm install

# Run the server
node index.js
```

## Code Style

The code style is the [Airbnb Javascript Styleguide](https://github.com/airbnb/javascript)

The linter can be evoked by running `npm run lint`


text:
# Wwwision.GraphQL

Easily create GraphQL APIs with Neos and Flow.

## Background

This package is a small collection of tools that'll make it easier to provide [GraphQL](http://graphql.org/) endpoints
with Neos and Flow.
It is a wrapper for the [PHP port of webonyx](https://github.com/webonyx/graphql-php) that comes with following additions:

* A `TypeResolver` that allows for easy interdependency between complex GraphQL type definitions
* The `AccessibleObject` and `IterableAccessibleObject` wrappers that make it possible to expose arbitrary objects to
  the GraphQL API
* A `StandardController` that renders the [GraphiQL IDE](https://github.com/graphql/graphiql) and acts as dispatcher
  for API calls
* A HTTP Component that responds to `OPTIONS` requests correctly (required for CORS preflight requests for example)
* A custom `GraphQLContext` that is available in all resolvers and allows access to the current HTTP Request

## Installation

```
composer require wwwision/graphql
```

(Refer to the [composer documentation](https://getcomposer.org/doc/) for more details)

## Simple tutorial

Create a simple Root Query definition within any Flow package:

`ExampleRootQuery.php`:

```php
<?php
namespace Your\Package;

use GraphQL\Type\Definition\ObjectType;
use GraphQL\Type\Definition\Type;
use Wwwision\GraphQL\TypeResolver;

class ExampleRootQuery extends ObjectType
{
    /**
     * @param TypeResolver $typeResolver
     */
    public function __construct(TypeResolver $typeResolver)
    {
        return parent::__construct([
            'name' => 'ExampleRootQuery',
            'fields' => [
                'ping' => [
                    'type' => Type::string(),
                    'resolve' => function () {
                        return 'pong';
                    },
                ],
            ],
        ]);
    }
}
```

Now register this endpoint like so:

`Settings.yaml`:

```yaml
Wwwision:
  GraphQL:
    endpoints:
      'test':
        'querySchema': 'Your\Package\ExampleRootQuery'
```

And, lastly, activate the corresponding routes:

`Settings.yaml`:

```yaml
Neos:
  Flow:
    mvc:
      routes:
        'Wwwision.GraphQL':
          variables:
            'endpoint': 'test'
```

This will make the endpoint "test" available under `/test`.

Note: If you already have more specific routes in place, or want to provide multiple GraphQL endpoints you can as well
activate routes in your global `Routes.yaml` file:

```yaml
-
  name: 'GraphQL API'
  uriPattern: '<GraphQLSubroutes>'
  subRoutes:
    'GraphQLSubroutes':
      package: 'Wwwision.GraphQL'
      variables:
        'endpoint': 'test'
```

**Congratulations**, your first GraphQL API is done and you should be able to invoke the GraphiQL IDE by browsing to `/test`:

![](graphiql.png)

For a more advanced example, have a look at the [Neos Content Repository implementation](https://github.com/bwaidelich/Wwwision.Neos.GraphQL)

## Custom context

Resolvers should be as simple and self-contained as possible. But sometimes it's useful to have access to the current
HTTP request. For example in order to do explicit authentication or to render URLs.
With v2.1+ there's a new `GraphQLContext` accessible to all resolvers that allows to access the current HTTP request:

```php
<?php
// ...
use Wwwision\GraphQL\GraphQLContext;
// ...

        'resolve' => function ($value, array $args, GraphQLContext $context) {
            $baseUri = $context->getHttpRequest()->getBaseUri();
            // ...
        },
```

`$value` is the object containing the field. Its value is `null` on the root mutation/query.
`$args` is the array of arguments specified for that field. It's an empty array if no arguments have been specified.
`$context` is an instance of the `GraphQLContext` with a getter for the current HTTP request.


text:
The **DataRowView** objects expose values as object arrays that are indexed by either the name or the ordinal reference of the column in the underlying table. You can access the <xref:System.Data.DataRow> that is exposed by the **DataRowView** by using the <xref:System.Data.DataRowView.Row%2A> property of the **DataRowView**.

 When you view values by using a **DataRowView**, the <xref:System.Data.DataView.RowStateFilter%2A> property of the **DataView** determines which row version of the underlying **DataRow** is exposed. For information about accessing different row versions using a **DataRow**, see [Row States and Row Versions](../../../../../docs/framework/data/adonet/dataset-datatable-dataview/row-states-and-row-versions.md).

 The following code example displays all the current and original values in a table.

```vb
Dim catView As DataView = New DataView(catDS.Tables("Categories"))
Console.WriteLine("Current Values:")
WriteView(catView)
Console.WriteLine("Original Values:")
catView.RowStateFilter = DataViewRowState.ModifiedOriginal
WriteView(catView)

Public Shared Sub WriteView(thisDataView As DataView)
  Dim rowView As DataRowView
  Dim i As Integer

  For Each rowView In thisDataView
    For i = 0 To thisDataView.Table.Columns.Count - 1
      Console.Write(rowView(i) & vbTab)
    Next
    Console.WriteLine()
  Next
End Sub

```

```csharp
DataView catView = new DataView(catDS.Tables["Categories"]);
Console.WriteLine("Current Values:");
WriteView(catView);
Console.WriteLine("Original Values:");
catView.RowStateFilter = DataViewRowState.ModifiedOriginal;
WriteView(catView);

public static void WriteView(DataView thisDataView)
{
  foreach (DataRowView rowView in thisDataView)
  {
    for (int i = 0; i < thisDataView.Table.Columns.Count; i++)
      Console.Write(rowView[i] + "\t");
    Console.WriteLine();
  }
}
```

## See Also
 <xref:System.Data.DataRowVersion>
 <xref:System.Data.DataViewRowState>
 <xref:System.Data.DataView>
 <xref:System.Data.DataRowView>
 [DataViews](../../../../../docs/framework/data/adonet/dataset-datatable-dataview/dataviews.md)
 [ADO.NET Managed Providers and DataSet Developer Center](http://go.microsoft.com/fwlink/?LinkId=217917)


text:
## code/download-sequences

This code is described in the following section(s) of [`methods/methods_release1.md`](https://github.com/biocore/emp/blob/master/methods/methods_release1.md):

**1.1:**

* `download_ebi_fasta.sh`
* `download_ebi_fastq.sh`

### Mapping EBI sample accessions to Qiita/EMP sample names

There are 97 studies in EMP 16S Release 1. Study IDs in EMP are identical to their corresponding Qiita study IDs, which have the format of a 2- to 5-digit number. The corresponding EBI study accessions have the format "ERP" followed by a 6-digit number. Each study ID (Qiita/EMP format) has an associated EBI study accession. These are listed in `study_ids_qiita_ebi.tsv`.

On each study page on [Qiita](https://qiita.ucsd.edu/), you can find mappings of the Qiita/EMP sample names to the EBI sample accessions. For your convenience, these sample name mappings are provided in the directory `ebi-sample-accessions`.

repository: biocore/emp

gha_language: Jupyter Notebook

repo_name: biocore/emp


text:
---
id: install
title: Installation
---

## App stores

:::note
Todo:
* links and qR codes for app stores
:::

## Manual Assembly (Android)

This project depends on [DIDKit](https://github.com/spruceid/didkit).

For now it's required to build DIDKit on the side before building this project. For more detailed instructions on how to set it up, please see the [DIDKit Installation Manual Installation](/docs/didkit/install#manual) and the [DIDKit Android Bindings](/docs/didkit/ffis#android) Sections.

Once installed, you will have to point to your local copy of DIDKit/SSI in the `pubspec.yaml` file:

```yaml
didkit:
    path: ../path/to/didkit/lib/flutter
```

Then, to build the flutter artifacts, run one of the following
commands from the root of this repository:

```bash
$ flutter build apk             # Android APK
$ flutter build appbundle       # Android Appbundle
```
:::note
Todo:

## Setup & Testing
* instructions on downloading your first "Friend of Spruce" credential here would be nice.

## Recovery
* explanation of seed recovery generation and application

## Rotation?
* when
:::

repository: sayyidisal/credible

repo_name: sayyidisal/credible


text:
# ETM

This is code that accompanies the paper titled "Topic Modeling in Embedding Spaces" by Adji B. Dieng, Francisco J. R. Ruiz, and David M. Blei. (Arxiv link: https://arxiv.org/abs/1907.04907)

ETM defines words and topics in the same embedding space. The likelihood of a word under ETM is a Categorical whose natural parameter is given by the dot product between the word embedding and its assigned topic's embedding. ETM is a document model that learns interpretable topics and word embeddings and is robust to large vocabularies that include rare words and stop words.

## Dependencies

+ python 3.6.7
+ pytorch 1.1.0

## Citation

```
@article{dieng2019topic,
  title={Topic modeling in embedding spaces},
  author={Dieng, Adji B and Ruiz, Francisco J R and Blei, David M},
  journal={arXiv preprint arXiv:1907.04907},
  year={2019}
}
```

repository: EamonJarrett-Mann/OCTIS

repo_name: EamonJarrett-Mann/OCTIS


text:
# Forensics 300 Creation

The generation script does the following to generate each image, before compressing the directory containing the images:
1. Create a randomly generated image of paper
2. Generate the dot matrix with a random serial code (or the flag file)
3. Draw it as many times as it fits with 1/2" padding between the matrices, and a 1/2" margin around the paper
4. Save to file


text:
Strata is a streaming HTTP server for node.js that is patterned after
time-honored web server design principles pioneered in the Python and Ruby
communities, namely [WSGI](http://www.wsgi.org/) and
[Rack](http://rack.rubyforge.org/). Using Strata, developers can build highly
performant web servers in a powerful, modular style that is easy to maintain and
takes full advantage of the streaming capabilities and
excellent I/O handling of node.js.

The core Strata distribution consists of four things:

  - A specification (see SPEC) for building applications and middleware
  - A library (see lib) with many useful utilities and middleware to aid
    developers in the common tasks of building applications that conform to
    the specification
  - An executable (see bin/strata) for running Strata applications from the
    command line
  - A user manual (see doc) that contains detailed documentation and code
    examples

## Installation

Install Strata using [npm](http://npmjs.org/):

    $ npm install strata

You are also free to [browse or download the source](https://github.com/mjijackson/strata).

## Usage

The simplest possible Strata app looks like this:

``` javascript
function app(env, callback) {
    callback(200, {}, "Hello world!");
}

require("strata").run(app);
```

## Documentation

The [Strata user manual](http://stratajs.org/manual) is designed to teach you
how to get up and running with the framework as quickly as possible. Each
chapter of the manual contains documentation about a certain feature of the
framework and a code example.

The manual is written in such a way that the topics and examples discussed in
higher numbered chapters build upon previous ones. Thus, it is recommended to
start with lower numbered chapters when getting started and work your way up to
higher ones.

The user manual refers to the [SPEC](https://raw.github.com/mjijackson/strata/master/SPEC)
in various places. This document is the canonical reference for the key building
blocks of the framework including applications, callbacks, and the Strata
environment.

## Tests

The test directory contains a comprehensive suite of unit tests for all of
Strata's core modules. Use [vows](http://vowsjs.org) to run all tests:

    $ vows test/*_test.js

Run the tests for a specific module with:

    $ vows test/utils_test.js

## License

Copyright 2011 Michael Jackson

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

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

The software is provided "as is", without warranty of any kind, express or
implied, including but not limited to the warranties of merchantability,
fitness for a particular purpose and non-infringement. In no event shall the
authors or copyright holders be liable for any claim, damages or other
liability, whether in an action of contract, tort or otherwise, arising from,
out of or in connection with the software or the use or other dealings in
the software.

## Acknowledgements

Strata was inspired by similar efforts in the Python and Ruby communities,
namely [WSGI](http://www.wsgi.org/) and [Rack](http://rack.rubyforge.org/). It
borrows many code patterns from these libraries, as well as the [JSGI](http://jackjs.org/jsgi-spec.html)
project.

Strata's multipart parser is based on the fast parser in the node-formidable
project written by Felix Geisendörfer. It is included in Strata under the terms
of the MIT license.

My sincere thanks to the authors of each of these libraries for the excellent
work they've done and graciously shared.


text:
# i18n Visualizer
A new way to humanly source i18n translations by comparing a reference language side-by-side with the target language.

## Project Vision
- Owner signs in with GitHub, to create a project.
- Owner provides source language files in JSON.
- App extracts key/value pairs and adds them to a source data set.
- Owner can link screenshots to show the text in context (ie. the button on a page)
- Translator signs in with GitHub.
- Translator selects a project to translate.
- App displays the source texts and text boxes for target text.
- Translator translates source text to target language.
- Translator submits the translation.
- Translator is rewarded 10 points for their effort
- Owner sees the translation with a confidence level of accuracy.
- Translator can approve existing translations for the key/value or add a new one they believe to be better.

## API

### Projects
- `POST /projects` creates a new project
- `GET /projects` returns all my projects
- `GET /projects/{id}` returns a specific project (that I own)
- `PATCH /projects/{id}` updates a specific project (that I own)
- `DELETE /projects/{id}` deletes a specific project (that I own)

### Translations
- `POST /projects/{id}/translations` creates a new translation for a specific project
- `GET /projects/{id}/translations` returns all translations for a specific project
- `GET /projects/{id}/translations/{id}` returns a specific translation for a specific project
- `DELETE /projects/{id}/translations/{id}` deletes a specific translation (for a project that I own)

## Models

### Project
```javascript
{
  "id": ObjectId,
  "title": string,
  "description": string,
  "ownerId": string,
  "isActive": boolean,
  "sourceLanguage": string,
  "targetLanguages": [string],
  "sourceFiles": [Source] // TODO: Figure out how to store the file content better
}
```

### Translation
```javascript
{
  "id": ObjectId,
  "projectId": ObjectId,
  "userId": ObjectId,
  "targetLanguage": string,
  "translationValues": [Target] // TODO: Figure out how to handle translation values
}
```

### Source
```javascript
{
  "key": string,
  "value": string,
  "imageURL": string | undefined
}
```

### Target
```javascript
{
  "key": string,
  "originalText": string,
  "translatedText": string,
}
```


text:
---
sidebarShare: true
sidebarDepth: 3
prev: false
next: false
---

# PyPI Mirror

## Introduction

[PyPI](https://pypi.org/), a.k.a. the Python Package Index, is a centralized "repository of software for the Python programming language".

The PyPI Mirror is synchronized with [pypi.org](https://pypi.org) with [bandersnatch](https://pypi.org/project/bandersnatch/).

## TL;DR

``` sh
pip install --upgrade pip --index-url https://mirrors.sustech.rocks/pypi/simple
pip config set global.index-url https://mirrors.sustech.rocks/pypi/simple
```

That's all.

## Detailed Instructions

### 1. Confirm your python environment

The `python` and `pip` commands you're using may be
- installed with package manager (e.g., `apt-get`, `yum`, etc.)
- self-compiled
- isolated by a python 3 venv (virtual environment)
- equipped with Anaconda or installed in a conda virtual environment
- bundled with Intel Parallel Studio
- ...

You can execute the following commands to gain insight into the `pip` command that you are using.

``` sh
which pip
pip --version
```

::: tip For Python 3 Users:
You may need to replace `pip` with `pip3`.
:::

### 2. Configure Index-url

#### For pip >= 10.0

``` sh
pip config set global.index-url https://mirrors.sustech.rocks/pypi/simple
```

::: warning
- Use the `https` schema instead of `http`
- Don't omit `simple`
:::

#### For older versions

You can upgrade to the latest version first:

``` sh
# you may need root privilege
pip install --upgrade pip --index-url https://mirrors.sustech.rocks/pypi/simple
```

Or, you can stay with the old version and manually edit the configuration file with your text editor:

``` toml
[global]
index-url = https://mirrors.sustech.rocks/pypi/simple
```

Path of the per-user configuration file:
- Linux: `$HOME/.config/pip/pip.conf`
- macOS: `$HOME/Library/Application Support/pip/pip.conf` or `$HOME/.config/pip/pip.conf`
- Windows: `%APPDATA%\pip\pip.ini`

You may create a new file if it doesn't exist.

You can refer to [pip user guide](https://pip.pypa.io/en/stable/user_guide/#configuration) for per-virtualenv or site-wide configuration.

## Temporary Use

``` sh
pip install package-name --index-url https://mirrors.sustech.rocks/pypi/simple
```

## Install Packages without Root Privilege

In an environment where you have no root access, like SUSTech Taiyi/Qiming HPC or your lab machines, you are still able to install the python dependencies you want.

### Option 1: Python 3 Venv (Suggested)

You can create multiple virtual environments in your home directory so that you can have dependencies of different versions for different projects.

``` sh
# 1. Create a virtual environment
[user@host ~]$ python3 -m venv ~/venv-torch

# 2. Activate the virtual environment
[user@host ~]$ source ~/venv-torch/bin/activate

# 3. Now you are in the venv
(venv-torch) [user@host ~]$ pip install --upgrade pip  # optional
(venv-torch) [user@host ~]$ pip install torch torchvision
(venv-torch) [user@host ~]$ python my_awesome_network.py

# 4. Leave the virtual environment
(venv-torch) [user@host ~]$ deactivate
[user@host ~]$  # now you've come back
```

Essentially, this approach creates symbolic links for system-wide python.

Please refer to <https://docs.python.org/3/library/venv.html> for detailed usage.

### Option 2: Pip User Install

Suppose you're using Python 3.7 and you want to install Numpy. You can simply run:

``` sh
pip install --user numpy  # you may need to use pip3
```

By default, `numpy` would be installed to `~/.local/lib/python3.7/site-packages/numpy-*`. This method is not suggested if you are sharing an account with others.

Please refer to <https://pip.pypa.io/en/stable/user_guide/#user-installs> for detailed usage.

### Option 3: Conda virtual environment

If you need Python of different versions, for example, Python 3.4 for project A and Python 3.7 for project B, you can consider create several Conda environments.

Please refer to <https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html> for detailed usage.

repository: ziqin/ccse-mirrors-web

gha_language: Vue

repo_name: ziqin/ccse-mirrors-web


text:
# Open Pension

[![license][license-image]][license-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][dependency-image]][dependency-url] [![Gitter][gitter-image]][gitter-url]

> The repo contains the server & the client parts of the Open Pension project.
Open Pension is [a "Hasadna" project](http://www.hasadna.org.il/), that aimed to revealing the secrets behind the Israeli pension market.

## Our Stack

  * [Angular](https://angular.io/)
  * [Django](https://www.djangoproject.com/)
  * [PostgreSQL](http://www.postgresql.org/)

**Tools we use**

  * [Angular Cli](https://github.com/angular/angular-cli)
  * [Angular Material](https://material.angular.io/)
  * [ngrx](https://github.com/ngrx)

## Pre Requirements

  1. Make sure you have [Python 3.x](https://www.python.org/) and [pip](https://pypi.python.org/pypi/pip) installed.
  2. [NodeJS](nodejs.org)
  3. [Angular CLI](https://github.com/angular/angular-cli)
  4. [PostgreSQL](http://www.postgresql.org/)

## Installation

**Client**

  1. Install requirements with `npm install` (located under `client` directory).
  2. Run the server with `npm start`.
  3. Open the browser at [http://localhost:4200](http://localhost:4200).

**Server**

  1. `cd server/config` then `cp local_settings.template local_settings.py` and modify it by your local settings.
  2. Install requirements with `pip install -r requirements.txt` (located under `server` directory).
  3. Migrate the data with `python manage.py migrate`.
  4. Import the dummy data with `python manage.py import_data`.
  5. Run the server with `python manage.py runserver`.
  6. Open the browser at [http://localhost:8000](http://localhost:8000).

## Tests

**Client**

  * Run `npm run lint` to check for lint mistakes.
  * Run `npm run test` to execute the unit tests via [Karma](https://karma-runner.github.io).
  * Run `npm run e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).

**Server**

  * Not yet.

## Translation

**Client**

Not yet..

**Server**

To make new strings for translation use the command

```shell
python manage.py makemessages -l he
python manage.py compilemessages -l he
```

## Data

If you need the data itself use the `--recursive` flag when you `git clone` this repo.

In order to transform bad CSVs to good:
```bash
python manage.py parse_csv --source=PATH_OF_FOLDER --destination=csv/
```

In order to transform only one:
```bash
python manage.py parse_csv --source=PATH_OF_FOLDER --plugin=PLUGIN --destination=csv/
```

Plugin ID can be achieved from `server/pension/management/commands/plugins.json`

## Deploy

**Client**

  1. Run `ng build -prod -aot` to build the project.
  2. Run `npm run sw` to generate the service worker file (in `dist` directory).

**Server**

  1. Not yet..

## Contribute

Just fork and do a pull request (;

[license-image]: https://img.shields.io/badge/license-MIT-blue.svg
[license-url]: https://github.com/hasadna/open_pension/blob/master/LICENSE
[travis-image]: https://travis-ci.org/hasadna/open_pension.svg?branch=master
[travis-url]: https://travis-ci.org/hasadna/open_pension
[dependency-image]: https://dependencyci.com/github/hasadna/open_pension/badge
[dependency-url]: https://dependencyci.com/github/hasadna/open_pension
[gitter-image]: https://img.shields.io/badge/Gitter-Join_the_chat_%E2%86%92-00d06f.svg
[gitter-url]: https://gitter.im/open-pension/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge