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

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

## `2.0.1` - 2018-11-27
### `Fixed`
- [`<3e4f760>`](https://github.com/marcocavanna/FireDataModeler/commit/3e4f7608f95dfed42ca55bec28f4ab1218239b01) Fixed an error that caused unexpected behaviour while updating data
- [`<bcea4a6>`](https://github.com/marcocavanna/FireDataModeler/commit/bcea4a64579c9689529dc3e1bda0cc274eb04f78) Fixed an error while parsing Object/Array on Array Data Model
- [`<d8e7563>`](https://github.com/marcocavanna/FireDataModeler/commit/d8e7563354bdd7e61ff8da32c0731a7a3bc170ec) Fixed an error that occured while parsing Empty Object or Null/Undefined Data. Parsing Empty Object now will return `null`

## `2.0.0` - 2018-11-26
### `Added`
- [`<6617ce3>`](https://github.com/marcocavanna/FireDataModeler/commit/6617ce34c6fa59bff232b167c5454dce0efa8dd2) Added symbol `&` into FireData Type Declaration string to define an expresion that has to be evaluated during parsing

### `Changed`
- [`<5e5632c>`](https://github.com/marcocavanna/FireDataModeler/commit/5e5632c3f2f36ff94b6149623da4bff58f8a045a) Value are AutoCasted to the desired type only of they are required
- [`<6617ce3>`](https://github.com/marcocavanna/FireDataModeler/commit/6617ce34c6fa59bff232b167c5454dce0efa8dd2) When using functions parameters in Model Declaration: Parameters have now to be placed in Invoke Parenthesis
- [`<6617ce3>`](https://github.com/marcocavanna/FireDataModeler/commit/6617ce34c6fa59bff232b167c5454dce0efa8dd2) Required field now will be checked at the end of the Parsing function
- [`<6617ce3>`](https://github.com/marcocavanna/FireDataModeler/commit/6617ce34c6fa59bff232b167c5454dce0efa8dd2) `$get` Talker Function now could get more then a child, passing multiple IDs (Array) as argument
- [`<6617ce3>`](https://github.com/marcocavanna/FireDataModeler/commit/6617ce34c6fa59bff232b167c5454dce0efa8dd2) `$update` Talker Function now could update more then a child, passing as first parameters an Object containing as key the ID that must be updated:
  ```js
    Talker.$update('Contact')({
      id1: { name: 'The First' },
      id2: { name: 'The Second' }
    })
  ```

## `1.2.9` - 2018-11-20
### `Added`
- [`<ae9b0c2>`](https://github.com/marcocavanna/FireDataModeler/commit/ae9b0c2b82958ce222742c706c6f41ecb583b967) `$parsePath` function added to Talker to return a parsed path string using replacers
- [`<dbb6b37>`](https://github.com/marcocavanna/FireDataModeler/commit/dbb6b37288d1e725cef46213b6a2e6e87d152fec) Can now use String and Numbers parameter in calling functions

### `Changed`
- [`<ae9b0c2>`](https://github.com/marcocavanna/FireDataModeler/commit/ae9b0c2b82958ce222742c706c6f41ecb583b967) `$update` function refactored to accept also multiple id updating

### `Fixed`
- [`<22398d2>`](https://github.com/marcocavanna/FireDataModeler/commit/22398d2312291aed9a597d23d2319c19bd900dca) Fixed an error that caused the double replacement in path string using FireDataObject while parsing data
- [`<53a498f>`](https://github.com/marcocavanna/FireDataModeler/commit/53a498f86b9903d06145496f1705be6590af45b9) Fixed an error that will cause unexpected updating in model non ID-Based

## `1.2.6` - 2018-11-19
### `Fixed`
- [`<8830c79>`](https://github.com/marcocavanna/FireDataModeler/commit/8830c795428ad76e62e5fcfa997823abe591d204) Fixed an issue that caused a 'Referenced' function to be invoked on each model parsing

## `1.2.5` - 2018-11-18
### `Added`
- [`<b52de94>`](https://github.com/marcocavanna/FireDataModeler/commit/b52de946962cd2cf45ad037d2d0f075d2a1cab62) Added possibility to set Priority for Function Executions

## `1.2.4` - 2018-11-17
### `Added`
- [`<4e1899f>`](https://github.com/marcocavanna/FireDataModeler/commit/4e1899fd254da0e8767310e342c554834bf30ad6) Added 4 new Hook function `afterAdd`, `afterUpdate`, `afterSet`, `afterDelete` that are executed in the same way of the `on` Hook functon, but after data changed on Database. They could be Async function and the main `Talker` function will wait for the resolution of Hooks before resolve itself.

### `Changed`
- [`<4e1899f>`](https://github.com/marcocavanna/FireDataModeler/commit/4e1899fd254da0e8767310e342c554834bf30ad6) The `onDelete` Hook function now receive as first argument a copy of the raw data on the Database for the deleting element.
- [`<1ba121c>`](https://github.com/marcocavanna/FireDataModeler/commit/1ba121c8b000e84470ba8424ec339edbba5ad507) The `onUpdate` Hook function now receive as second argument the old data
  ```js
  {
    ...
    onDelete: [
      function (newData, oldData, $id) {
        /**
         * newData is the new parsed object
         * oldData is the old parsed object
         */
      }
    ]
  }
  ```

## `1.2.3` - 2018-11-17
### `Changed`
- [`<ca90232>`](https://github.com/marcocavanna/FireDataModeler/commit/ca9023283602889ab9f396710a030c4782c2a6de) The `this` keyword in Hook Functions (onAdd, onGet, onSet, onUpdate, onDelete) now referr to the current instance of `Talker`

### `Fixed`
- [`<eadd1b3>`](https://github.com/marcocavanna/FireDataModeler/commit/eadd1b322de015031015ecb7ca058f28810bdb71) `$delete` function now will convert correctly a String type $id in an Array to delete multiple data

## `1.2.2` - 2018-11-16
### `Added`
- [`<95f4816>`](https://github.com/marcocavanna/FireDataModeler/commit/95f481687da564b66428499b07187a30ac77ea8e) Writed and added the ReadMe file

### `Changed`
- [`<10b56f1>`](https://github.com/marcocavanna/FireDataModeler/commit/10b56f1882df2e312de700b0920f55ff2aec1f50) $update function now return only the key updated
- [`<62d83d4>`](https://github.com/marcocavanna/FireDataModeler/commit/62d83d46ed02a7479c3d9b1ee018c8c134c17289) Changed the execution of validators function. Now are not while getting data

### `Fixed`
- [`<404d99c>`](https://github.com/marcocavanna/FireDataModeler/commit/404d99cdec4dedc4b3ecef5a736af8fa247374ba) Fixed an Issue with Add Data ID parameters
- [`<c5d8d5d>`](https://github.com/marcocavanna/FireDataModeler/commit/c5d8d5d7d4d57111954363fcffc6d9d2a8db618d) Fixed an Issue while using $id placeholder into `Paths` inf $update function

## `1.2.1` - 2018-11-13
### `Changed`
- [`<06f667e>`](https://github.com/marcocavanna/FireDataModeler/commit/06f667e61d47fee4b51d527e710a7ec831e67add) Delete function now accept an Array of IDS to delete multiple data from database

## `1.2.0` - 2018-11-06
### `Added`
- [`<e2981b4>`](https://github.com/marcocavanna/FireDataModeler/commit/e2981b4ab86cf72efa2ae12af7f20e1e3040c57f) Added the possibility to set some Hook function (sync/async), like __onAdd__, __onSet__, __onUpdate__, __onDelete__ and __orGet__ that will be executed before database operation. This function have to be inserted into the Model declaration, have to be an Array of Function and all are executed at the same time.
If one of the function is a Promise than the database action will wait untill promise will be resolved. If promise will be rejected no database action will be performed.

```js
  Modeler.$model('Me', {
    model: {
      name: '?String|toUpperCase',
      surname: '?String|toUpperCase'
    },
    paths: {
      hasID: true,
      read: 'team/$team/contact'
    },
    onAdd: [
      ($data, $id) => {
        console.log(`I'm adding Data with ID ${$id}`, $data)
      }
    ]
  })
```

### `Changed`
- [`<849c8c3>`](https://github.com/marcocavanna/FireDataModeler/commit/849c8c3649a73c17f46734205e55d331f8250e7c) Functions Fields could now be asyncronous. Parsing data will wait for function resolution before continue process

### `Fixed`
- [`<0234ab0>`](https://github.com/marcocavanna/FireDataModeler/commit/0234ab01547bdb92e01e9bd571a6560075ba4e64) Fixed an error showing Error stack functions
- [`<739a490>`](https://github.com/marcocavanna/FireDataModeler/commit/739a490af6fd72c3905039197eb49706076f40aa) Fixed an error occured using `error.original` getter that sometimes returned `undefined` value

## `1.1.0` - 2018-11-03
### `Added`
- [`<ae5344c>`](https://github.com/marcocavanna/FireDataModeler/commit/ae5344cba46063e21ee62f8910a11d4f249f9582) `$filter`: Can now use filters to change Model key

  ```js
  Modeler.$model('Me', {
    model: {
      name: '?String|toUpperCase',
      surname: '?String|toUpperCase'
    }
  })

  Modeler.$filter('toUpperCase', $str => $str.toUpperCase());
  ```

### `Fixed`
- [`<38d8a26>`](https://github.com/marcocavanna/FireDataModeler/commit/38d8a26bcc605aaaabdd4ed6e80fc73e71e20bcb) `this` keyword of Function Fields now refer correctly to the Model Parsed

## `1.0.2` - 2018-11-02
### `Added`
- [`<e530e0f>`](https://github.com/marcocavanna/FireDataModeler/commit/e530e0f89ee4083e0ea5186b78f6a0d672ed6047)  This CHANGELOG file to keep change updated
- [`<580ce11>`](https://github.com/marcocavanna/FireDataModeler/commit/580ce115856bbd02df29f512d1576320606c969e) `$id` can be added in path to get and parse child data, a this moment, id placeholder inside path string can be used in `$get` functions only and will produce an error while `$add` or `$set` data

  ```js
  Modeler.$model('UserDetail', {
    model: {
      name: '?String',
      surname: '?String',
      email: '?String'
    },
    paths: {
      hasID: true,
      read: 'users/$id/detail'
    }
  });
  ```

### `Fixed`
- [`<7afb36f>`](https://github.com/marcocavanna/FireDataModeler/commit/7afb36fe54f523f387bbab71d3f24279f2fb80a8) Fixed an error when loading an existance Firebase Admin object during Talker initialization

## `1.0.1` - 2018-11-01
### `Added`
- [`<4969ad4>`](https://github.com/marcocavanna/FireDataModeler/commit/d969ad49c040ba5a9e5db4445460395a25928fa8) `Talker` instance appendend to Function evaluated fields Arguments

  ```js
  // Talker instance is always the last arguments
  Modeler.$function('UID', Talker => Talker.$path('uid').get() )
  ```
- [`<802f0c2>`](https://github.com/marcocavanna/FireDataModeler/commit/802f0c27fd883484d990946ab892a7af3cb4e25e) `Talker.$path(<placeholder>).get()` : Return replacer for a path placeholder

  ```js
  Talker.$path('uid').replace(userUID);

  // Later on your code
  const $uid = Talker.$path('uid').get();
  ```

## [`1.0.0`](https://github.com/marcocavanna/FireDataModeler/commit/0db0fce2d16eb4cfe1bd274edf49272de5914e79) - 2018-10-31
### First Package Publish

repository: marcocavanna/FireDataModeler

repo_name: marcocavanna/FireDataModeler


text:
# PyCIP
Common Industrial Protocol (CIP) for Python3

Allows Communiction as Originator to Target devices using the CIP protocol over EtherNet/IP

see CIP_Demo.py for example on how to use

see wiki for core componets documentation

repository: nguyenvudtd/ICSwiki

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: nguyenvudtd/ICSwiki


text:
codebreaker
===========

Hacking Secret Ciphers with Python" programs

This repo contains the source for the encryption and code breaking programs featured in the book "Hacking Secret Ciphers with Python".

Here's a general description of each of the files:

affineBreaker.py
    Break Affine Cipher-encrypted messages.

affineCipher.py
    Encrypt and decrypt using the Affine Cipher.

al_sweigart_privkey.txt
    A sample private key file that is used by the rsaCipher.py program.

al_sweigart_pubkey.txt
    A sample public key file that is used by the rsaCipher.py program.

buggy.py
    Used as practice for using Python's debugger.

caesarBreaker.py
    Break Caesar Cipher-encrypted messages.

caesarCipher.py
    Encrypts and decrypts using the Caesar Cipher.

coinFlips.py
    Used as practice for using Python's debugger.

detectEnglish.py
    Used to detect if a string is English.

dictionary.txt
    A dictionary file of English words, one per line.

encrypted_file.txt
    A sample encrypted file from the

frankenstein.txt
    A large text file sample. (The public domain novel Frankenstein.)

freqFinder.py
    Module for gathering letter frequency statistics.

makeRsaKeys.py
    Generate a public/private RSA key pair.

nullBreaker.py
    Breaks Null Cipher-encrypted messages.

nullCipher.py
    Encrypts and decrypts using the Null Cipher.

primeSieve.py
    Generates prime numbers using the Sieve of Erastothenes algorithm

pyperclip.py
    A module for copying and pasting to the clipboard. This source code isn't going to be featured in the book, and is only included so that people can test the programs that use it.

rabinMiller.py
    Module for primality testing using the Rabin-Miller algorithm.

README.md
    The file that you are reading right now, silly. :D

reverseCipher.py
    Encrypts with the reverse "cipher", which just reverse the string.

rsaCipher.py
    Encrypts and decrypts using the RSA Cipher.

simpleSubBreaker.py
    Breaks Simple Substitution Cipher-encrypted messages.

simpleSubCipher.py
    Encrypts and decrypts using the Simple Substitution Cipher.

simpleSubKeyword.py
    Encrypts and decrypts using the Simple Substitution Cipher, using an English word for the key.

transpositionBreaker.py
    Breaks Transposition Cipher-encrypted messages.

transpositionCipherFile.py
    Encrypts and decrypts files using the Transposition Cipher.

transpositionDecrypt.py
    Decrypts messages using the Transposition Cipher.

transpositionEncrypt.py
    Encrypts messages using the Transposition Cipher.

transpositionFileBreaker.py
    Breaks Transposition Cipher-encrypted files.

transpositionTest.py
    Tests to see if the Transposition Cipher program works.

vigenereBreaker.py
    Breaks Vigenere Cipher-encrypted messages.

vigenereCipher.py
    Encrypts and decrypts using the Vigenere Cipher.

license: MIT

repository: coolhacks/python-hacks

repo_name: coolhacks/python-hacks


text:
# Eclipse Deeplearning4j Training Labs

Running examples strategically structured to enhance understanding of building models with Eclipse Deeplearning4j.

This repo contains codes for hands-on purpose during training session. All codes had been tested using CPU.

## Contents

#### DL4J-Lab
- [classification](https://github.com/CertifaiAI/TrainingLabs/tree/master/dl4j-labs/src/main/java/ai/certifai/solution/classification):
  This folder contains various binary and multiple classification task exercises for learners to practice and solutions to refer to.
- [convolution](https://github.com/CertifaiAI/TrainingLabs/tree/master/dl4j-labs/src/main/java/ai/certifai/solution/convolution):
  This folder contains MNIST classification and object detection using transfer learning of TinyYOLO and VGG16.
- [dataexamples](https://github.com/CertifaiAI/TrainingLabs/tree/master/dl4j-labs/src/main/java/ai/certifai/solution/dataexamples):
  This folder contains model that train neural network to learn drawing.
- [datavec](https://github.com/CertifaiAI/TrainingLabs/tree/master/dl4j-labs/src/main/java/ai/certifai/solution/datavec):
  This folder contains K-Fold cross-validation tutorial, load and transform CSV and Image files using DataVec.
- [feedforward](https://github.com/CertifaiAI/TrainingLabs/tree/master/dl4j-labs/src/main/java/ai/certifai/solution/feedforward):
  This folder contains simplest neural network to approximate a function that can map input to an output, and model that can detect the gender of a person based on his/her name.
- [generative](https://github.com/CertifaiAI/TrainingLabs/tree/master/dl4j-labs/src/main/java/ai/certifai/solution/generative):
  This folder contains a GAN model that can generate MNIST digits.
- [humanactivity](https://github.com/CertifaiAI/TrainingLabs/tree/master/dl4j-labs/src/main/java/ai/certifai/solution/humanactivity):
  This folder contains a LSTM model and a hybrid CNN-LSTM neural network to perform human activity classification.
- [modelsaveload](https://github.com/CertifaiAI/TrainingLabs/tree/master/dl4j-labs/src/main/java/ai/certifai/solution/modelsaveload):
  This folder contains step-by-step on how to save and load a model.
- [nd4j](https://github.com/CertifaiAI/TrainingLabs/tree/master/dl4j-labs/src/main/java/ai/certifai/solution/nd4j):
  This folder contains ND4J tutorial and exercise.
- [recurrent](https://github.com/CertifaiAI/TrainingLabs/tree/master/dl4j-labs/src/main/java/ai/certifai/solution/recurrent):
  This folder contains a basic RNN network that learn to create a string, a LSTM model to generate texts, and a LSTM model for mortality prediction.
- [regression](https://github.com/CertifaiAI/TrainingLabs/tree/master/dl4j-labs/src/main/java/ai/certifai/solution/regression):
  This folder contains neural network that predict ridership demand.
- [VAE](https://github.com/CertifaiAI/TrainingLabs/tree/master/dl4j-labs/src/main/java/ai/certifai/solution/VAE):
  This folder contains a VAE model for bank transaction anomaly detection.
#### DL4J-cv-labs
- [classification](https://github.com/CertifaiAI/TrainingLabs/tree/master/dl4j-cv-labs/src/main/java/ai/certifai/solution/classification):
  This folder contains a custom model and a VGG16 model for dog breed classification, and a ResNet-50 model for food classification.
- [facial_recognition](https://github.com/CertifaiAI/TrainingLabs/tree/master/dl4j-cv-labs/src/main/java/ai/certifai/solution/facial_recognition):
  This folder contains facial recognition with a pipeline of video streaming, face detection and face recognition.
- [image processing](https://github.com/CertifaiAI/TrainingLabs/tree/master/dl4j-cv-labs/src/main/java/ai/certifai/solution/image_processing):
  This folder contains step-by-step on image processing.
- [object_detection](https://github.com/CertifaiAI/TrainingLabs/tree/master/dl4j-cv-labs/src/main/java/ai/certifai/solution/object_detection):
  This folder contains a TinyYOLO model and a YOLOv2 model for Avocado and Banana Object Detection, and a pre-trained YOLOv2 model for metal surface defects detection.
- [segmentation](https://github.com/CertifaiAI/TrainingLabs/tree/master/dl4j-cv-labs/src/main/java/ai/certifai/solution/segmentation):
  This folder contains semantic segmentation on the car images and the cell nucleus images from Data Science Bowl 2018 using a pre-trained U-Net.

## Built with
- deeplearning4j 1.0.0-M1.1
- CUDA 11.2 (Note: Optional if you are using CPU)
- cuDNN 8.1.1 (Note: Optional if you are using CPU)

## Getting Started

### Install Java

Download Java JDK [here](https://www.oracle.com/java/technologies/javase/javase-jdk8-downloads.html).
(Note: Use Java 8 for full support of DL4J operations)

Check the version of Java using:
```sh
java -version
```

Make sure that 64-Bit version of Java is installed.

### Install IntelliJ IDEA Community Edition
Download and install [IntelliJ IDEA](https://www.jetbrains.com/idea/download/).

### Install Apache Maven  *Optional*
IntelliJ provides a default Maven that is bundled with the installer. Follow these [instructions](https://maven.apache.org/install.html) to install Apache Maven.

### GPU setup  *Optional*
Follow the instructions below if you plan to use GPU setup.
1. Install CUDA and cuDNN
    Requirements:
   -  CUDA 11.2
   -  cuDNN 8.1.1

CUDA and cuDNN can be downloaded from [here](https://developer.nvidia.com/cuda-11.2.0-download-archive) and [here](https://developer.nvidia.com/rdp/cudnn-archive). Step by step installation guides can be found [here](https://docs.nvidia.com/deeplearning/sdk/cudnn-install/index.html).

2. Dependencies are needed to be included into Maven project if we wish to use GPU for training. Follow the links below for instructions in details.
   - [ND4J backends for GPUs](https://deeplearning4j.konduit.ai/multi-project/explanation/configuration/backends#nd-4-j-backends-for-gpus-and-cpus)
   - [Using Deeplearning4J with cuDNN](https://deeplearning4j.konduit.ai/multi-project/explanation/configuration/backends/cudnn#using-cudnn-via-deeplearning-4-j)

## Usage
All examples are separated into [training](https://github.com/CertifaiAI/TrainingLabs/tree/master/dl4j-labs/src/main/java/ai/certifai/training) and [solution](https://github.com/CertifaiAI/TrainingLabs/tree/master/dl4j-labs/src/main/java/ai/certifai/solution) folders. The download will take some time to download dependencies from maven when you first run these examples.

All codes in training folder have few lines commented out so that they can be taught and demonstrated in the class. The solution folder contains the un-commented version for every line of codes.

For bad internet connection and unable to perform task smoothly, you can go to src\main\resources\config.properties and download necessary dataset before the sessions.

## Known Issues
Problem:
```sh
jnind4jcpu.dll: Can't find dependent libraries
```
Solution:
 Change the maven dependencies of Javacpp to the latest (1.4.3 works).

Problem:
```sh
"C:\Users\LohJZ\.javacpp\cache\cuda-10.0-7.3-1.4.3-windows-x86_64.jar\org\bytedeco\javacpp\windows-x86_64\jnicudnn.dll": Can't find procedure
```
Solution:
 Install latest CUDA (version 7.6 works)

## Contributor's Guide
For contributors or someone who wishes to contribute, please take a look at the guideline [here](https://github.com/CertifaiAI/TrainingLabs/wiki/Contributor's-Guide) to help you in your journey.

repository: muame-amr/cdle-traininglabs

branch_name: refs/heads/main

repo_name: muame-amr/cdle-traininglabs


text:
# Extending Polynomials

The [`AbstractPolynomial`](@ref) type was made to be extended via a rich interface.

```@docs
AbstractPolynomial
```

A polynomial's  coefficients  are  relative to some *basis*. The `Polynomial` type relates coefficients  `[a0, a1,  ..., an]`, say,  to the  polynomial  `a0 +  a1*x + a2*x^  + ... +  an*x^n`,  through the standard  basis  `1,  x,  x^2, ..., x^n`.  New polynomial  types typically represent the polynomial through a different  basis. For example,  `CheyshevT` uses a basis  `T_0=1, T_1=x,  T_2=2x^2-1,  ...,  T_n  =  2xT_{n-1} - T_{n-2}`.  For this type  the  coefficients  `[a0,a1,...,an]` are associated with  the polynomial  `a0*T0  + a1*T_1 +  ...  +  an*T_n`.

To implement a new polynomial type, `P`, the following methods should
be implemented.

!!! note
    Promotion rules will always coerce towards the [`Polynomial`](@ref) type, so not all methods have to be implemented if you provide a conversion function.

As always, if the default implementation does not work or there are more efficient ways of implementing, feel free to overwrite functions from `common.jl` for your type.

| Function | Required | Notes |
|----------|:--------:|:------------|
| Constructor | x | |
| Type function (`(::P)(x)`) | x | |
| `convert(::Polynomial, ...)` | | Not required, but the library is built off the [`Polynomial`](@ref) type, so all operations are guaranteed to work with it. Also consider writing the inverse conversion method. |
| `domain` | x | Should return an  [`AbstractInterval`](https://invenia.github.io/Intervals.jl/stable/#Intervals-1) |
| `vander` | | Required for [`fit`](@ref) |
| `companion` | | Required for [`roots`](@ref) |
| `fromroots` | | By default, will form polynomials using `prod(variable(::P) - r)` for reach root `r`|
| `+(::P, ::P)` | | Addition of polynomials |
| `-(::P, ::P)` | | Subtraction of polynomials |
| `*(::P, ::P)` | | Multiplication of polynomials |
| `divrem` | | Required for [`gcd`](@ref)|
| `variable`| | Convenience to find monomial `x` in new  basis|

Check out both the [`Polynomial`](@ref) and [`ChebyshevT`](@ref) for examples of this interface being extended.

gha_language: Julia

gha_license_id: NOASSERTION


text:
# Serialize With fast_jsonapi In A Rails App

Netflix put out a Ruby gem for super fast JSON serialization --
[`fast_jsonapi`](https://github.com/Netflix/fast_jsonapi). It is great for
serializing JSON responses for Rails API endpoints.

First, add `gem 'fast_jsonapi'` to your `Gemfile` and `bundle install`.

Then create the `app/serializers` directory for housing all of your JSON
serializers.

Next you can create a `serializer` that corresponds to the model you want to
serialize:

```ruby
# app/serializers/recipe_serializer.rb
class RecipeSerializer
  include FastJsonapi::ObjectSerializer

  set_id :id
  attributes :name, :source_url
end
```

Last, use it to generate a JSON response in your controller:

```ruby
# app/controllers/recipes_controller.rb
class RecipesController < ApiController
  def index
    render json<EMAIL_ADDRESS>  end
end
```

Requests to that endpoint will receive a response that looks something like
this:

```json
{
  data: [
    {
      id: 1,
      attributes: { name: "Old Fashioned", source_url: "http://..." },
    },
    {
      id: 2,
      attributes: { name: "Sazerac", source_url: "http://..." },
    },
  ]
}
```

repository: jbranchaud/til

gha_language: Vim Script

gha_license_id: MIT

repo_name: jbranchaud/til


text:
### Heating timings

 Once the machine reaches the desired temperature it’s time to place the plate between the two heating elements. In our tests we found that PS usually takes less than 6-10 min, while HDPE takes around 30-40 min for the same sheet thickness (10mm).

Since PS is way quicker to bend than HDPE or PP we think that  bending machines with a heated sword on top that goes inside the material could work better.


text:
# nodeblecomm

[![bitHound Overall Score](https://www.bithound.io/github/perusworld/nodeblecomm/badges/score.svg)](https://www.bithound.io/github/perusworld/nodeblecomm)
[![bitHound Dependencies](https://www.bithound.io/github/perusworld/nodeblecomm/badges/dependencies.svg)](https://www.bithound.io/github/perusworld/nodeblecomm/master/dependencies/npm)
[![bitHound Code](https://www.bithound.io/github/perusworld/nodeblecomm/badges/code.svg)](https://www.bithound.io/github/perusworld/nodeblecomm)

Node.js BLE Communication Helper Library

## Usage

It has both the server and client helper implementations.
look at test-client.js for sample client implementation and test-server.js for the server implementation

## Installation
include the following in your package.json

```json
"nodeblecomm": "perusworld/nodeblecomm"
```

## iOS implementation
Looking to do communications betweeen your iOS app and your Node.js application , use the  [BleComm](https://github.com/perusworld/BleComm) CocoaPod.

## License

nodeblecomm is available under the MIT license. See the LICENSE file for more info.

repository: perusworld/nodeblecomm

repo_name: perusworld/nodeblecomm


text:
# Release Notes

## v1.0.7 (09/05/2018)

### Changed
* Fixed `storeName()`, `brand()`, and `categoryName()` from causing an error when passed an array. There should be no array, but for some reason the API decided to send array through brands, lets fix that issue by converting an array to string.

## v1.0.6 (09/05/2018)

### Added
* Added `aecpc()` method using the `['aecpc']` on the product array.
* Added `categoryId()` method to `Product` class.
* Added `['category_id']` to the `Product` array.
* Added `getCategoryWithIds()` method on the `Results` class

### Changed
* Change the `cpc()` method to `ecpc()` using the `['ecpc']`

## v1.0.5 (08/28/2018)

### Changed
* Removed the `filebase` requirement from `composer.json`

## v1.0.4 (08/22/2018)

### Added
* Added `subid` property into the `User` class as a new variable to pass into the API
* Added `subid` into the API call request. (using `DEFAULT` as the default value)

### Changed
* Removed `subid` property (could not use) from the `ProductSearch` class.

## v1.0.3 (08/08/2018)

### Changed
* Fixed the product array for `cpc` values. Was using `acpc` instead of `aecpc`

## v1.0.2 (07/24/2018)

### Changed
* Fixed `getBrands()`, `getStores()`, and `getCategories()` from having empty arrays.

## v1.0.1 (07/24/2018)

### Added
* Added `brand()` in `Product` object.
* Added `listPrice()` in `Product` object.
* Added `getBrands()` in `Results` object.

## v1.0.0 (07/23/2018)
* Version 1.0 - Initial Release

repository: tmarois/baseify-php-sdk

repo_name: tmarois/baseify-php-sdk


text:
---
layout: post
title:  "AWS Notes - SQS"
date:   2018-12-31 00:00:00 +1000
categories: tech blogs
---

* Messages can contain up to _256kb_ of text in any format.
* Standard Queue more than one copy of a message might be delivered _out of order_.
* FIFO queue ensure ::ordering:: and a message is delivered ::once:: only.
* SQS is ::pull based::.
* Messages can be kept from **1 min to 14 days**, default is **4 days**.
* SQS guarantees messages will be processed at least once.
* SQS visibility timeout: default is 30 sec, up to 12 hours.
* Short polling vs Long polling

repository: yang-zhang-syd/incredible-cloud

gha_language: JavaScript

repo_name: yang-zhang-syd/incredible-cloud


text:
## SwiftCode
An application that was created during SwiftCode workshop conducted by Betsol

https://betsol.com/swiftcode/

![Technology Stack](http://i.imgur.com/rksQ1gG.png)


text:
# [fluttertoast](https://pub.dartlang.org/packages/fluttertoast)

Android and iOS Toast Library for Flutter

> Supported Platforms
> - Android
> - IOS

## Usage

```yaml
# add this line to your dependencies

```

```dart
import 'package:fluttertoast/fluttertoast.dart';
```

```dart
FlutterToast.showToast(
        message: "You message here",
        toastLength: ToastLength.LENGTH_SHORT
        );
```

| property        | description                                                        |
| --------------- | ------------------------------------------------------------------ |
| msg             | String (Not Null)(required)                                        |
| toastLength     | ToastLength.LENGTH_SHORT or ToastLength.LENGTH_LONG (optional)     |

## If you need any features suggest


text:
# app_ctrl

**Author:** Ulf Wiger<EMAIL_ADDRESS>
This application implements an OTP distributed application controller.

Currently, only local application control is supported, but one particular
feature is that it allows applications to be started *before* another
application.

## Background

The standard application controller respects dependencies specified in
an application's `.app` file, where the `applications` attribute lists
other applications that must be running before the given application can
be started.

In some cases, one may want to ensure that a certain application is started
before a third-party application, whose `.app` file is already set.

For example:

* An application running before mnesia, which checks conditions and
  e.g. creates a database schema (this must be done before mnesia starts)
* Applications needed by `exometer_core` probes, which could then be
  declaratively defined and started automatically by `exometer_core`.

## Configuring `app_ctrl`

The idea is to automate parts of the configuration, e.g. through a rebar3
plugin, but currently, all configuration needs to be done manually.

* Set the `app_ctrl` application environment variable `applications`.
  The option of interest for now is `start_before`:

```erlang
{app_ctrl, [{applications,
             [
              {gproc, [{start_before, [exometer_core]}]}
             ]}
            ]}
```

* In order for the application control to work, permissions must also
  Be set to `false` for the affected applications. The `app_ctrl`
  application will set all permissions to `true` as soon as it is set up
  and has acquired control of the relevant applications.

```erlang
{kernel, [{permissions,
           [
            {gproc, false},
            {exometer_core, false}
           ]}
         ]}
```

## Build

    $ rebar3 compile

license: ISC


text:
# Awesome Machine Learning Resources for SEO

A curated list of libraries with application to SEO

## Contents

- [Machine Learning Frameworks](#machine-learning-frameworks)
- [Deep Learning Frameworks](#deep-learning-frameworks)
- [Deep Learning Tools](#deep-learning-tools)
- [Deep Learning Projects](#deep-learning-projects)
- [Natural Language Processing(NLP)](#nlp)
- [Public Data Sets](#public-data-sets)

## Machine Learning Frameworks

- [scikit-learn](http://scikit-learn.org/stable/) - scikit-learn: machine learning in Python.
- [vowpal_porpoise](https://github.com/josephreisinger/vowpal_porpoise) - Wrapper for vowpal_wabbit.
- [Xgboost](https://xgboost.readthedocs.io/en/latest/) - Scalable, Portable and Distributed Gradient Boosting.

## Deep Learning Frameworks

- [Pytorch](https://github.com/pytorch/pytorch) - Tensors and Dynamic neural networks in Python with strong GPU acceleration
- [Tensorflow](https://github.com/tensorflow/tensorflow) - Computation using data flow graphs for scalable machine learning.
- [Keras](https://keras.io) - High-level neutral networks API.
- [chainer](https://github.com/chainer/chainer) - A flexible framework of neural networks for deep learning.

## Deep Learning Projects

- [fairseq-py](https://github.com/facebookresearch/fairseq-py) - Sequence-to-Sequence Toolkit.
- [DrQA](https://github.com/facebookresearch/DrQA) - Reading Wikipedia to Answer Open-Domain Questions.
- [tensorflow-wavenet](https://github.com/ibab/tensorflow-wavenet) - DeepMind's WaveNet.

## NLP

- [gensim](https://github.com/piskvorky/gensim) - Topic Modeling.
- [nltk](http://www.nltk.org) - Natural Language Toolkit.
- [pattern](https://github.com/clips/pattern) - Web mining module.
- [goose3 / goose3](https://github.com/goose3/goose3) - A Python 3 compatible version of goose web text extraction.
- [SpaCy](https://github.com/explosion/spaCy) - library is pretty awesome. Hard to install on windows.
- [jellyfish](https://github.com/jamesturk/jellyfish) - Approximate and phonetic matching of strings.
- [facebook/fastText](https://github.com/facebookresearch/fastText) - Library for fast text representation and classification.
- [google/sentencepiece](https://github.com/google/sentencepiece) - Unsupervised text tokenizer for Neural Network-based text generation.

## Public Data Sets

- [Awesome Public Datasets](https://github.com/caesar0301/awesome-public-datasets)

Started based on [Awsome Python Data Science](https://github.com/thomasjpfan/awesome-python-data-science)

repository: BritneyMuller/MLTS

repo_name: BritneyMuller/MLTS


text:
简单了解了如下框架/库

### Express
Node.js Web 框架
> Fast, unopinionated, minimalist web framework for node.

### nodemon
Node自动重启工具
> nodemon is a tool that helps develop node.js based applications by automatically restarting the node application when file changes in the directory are detected.

### mongoose
mongoose是在node.js异步环境下对mongodb进行便捷操作的对象模型工具
> Mongoose is a MongoDB object modeling tool designed to work in an asynchronous environment. Mongoose supports both promises and callbacks.

### body-parser
node.js body 解析中间件。处理程序之前，在中间件中对传入的请求体进行解析
> Node.js body parsing middleware.
Parse incoming request bodies in a middleware before your handlers, available under the req.body property.

### dotenv
从文件加载环境变量
> Dotenv is a zero-dependency module that loads environment variables from a .env file into process.env. Storing configuration in the environment separate from code is based on The Twelve-Factor App methodology.

repository: Liangzhihe/notes

repo_name: Liangzhihe/notes


text:
# zcow

Manages temporary [zram] backed COW (Copy On Write) devices. `zcow` uses
Device Mapper to combine a [zram] device and the origin device, such that
unchanged blocks are read from the origin device and written blocks are stored
in the [zram] device.

## Dependencies

* Linux
* `bash`
* `udevadm`
* `dmsetup`
* `zramctl`

## Synopsis

Create a zram device for `/dev/sda4`:

    $ zcow create /dev/sda4

Create a zcow device for `/dev/sda4`, but with the custom name
`foo`:

    $ zcow create /dev/sda4 foo

List all zcows:

    $ zcow
    sda4	/dev/sda4	/dev/zram0
    foo	/dev/sda4	/dev/zram1

Get info about the zcow named `foo`:

    $ zcow info foo
    Origin:	/dev/sda4
    COW:	/dev/zram1

    NAME       ALGORITHM DISKSIZE DATA COMPR TOTAL STREAMS MOUNTPOINT
    /dev/zram1 lzo-rle       100M   0B    0B    0B       8

Remove the zcow named `foo`:

    $ zcow destroy foo

### systemd

Register a systemd unit that manages a zcow device for `/dev/sda4`:

    $ sudo systemctl enable zcow@/dev/sda4

## Install

    wget -O zcow-0.1.0.tar.gz https://github.com/postmodern/zcow/archive/v0.1.0.tar.gz
    tar -xzvf zcow-0.1.0.tar.gz
    cd zcow-0.1.0/
    sudo make install

### PGP

All releases are [PGP] signed for security. Instructions on how to import my
PGP key can be found on my [blog][1]. To verify that a release was not tampered
with:

    wget https://raw.github.com/postmodern/ruby-install/master/pkg/zcow-0.1.0.tar.gz.asc
    gpg --verify zcow-0.1.0.tar.gz.asc zcow-0.1.0.tar.gz

## Limitations

* Cannot work with loopback devices.
* Cannot mount zcow devices for some unknown reason:

      mount: /mnt: wrong fs type, bad option, bad superblock on /dev/mapper/zcow-test, missing codepage or helper program, or other error.

[zram]: https://www.kernel.org/doc/Documentation/blockdev/zram.txt

[PGP]: http://en.wikipedia.org/wiki/Pretty_Good_Privacy
[1]: http://postmodern.github.com/contact.html#pgp

repository: postmodern/zcow

repo_name: postmodern/zcow


text:
# Software Engineering UML Projects

The project aims to develop the main UML diagrams to a specific application: system of management of an online auction.

# Tools
The diagrams were developed based on [draw.io](https://www.draw.io/) interface.

# Credits

  * [Matheus Nascimento](https://github.com/matheusns)
  * Antonio Morais
  * Cleisom Coelho
  * Professor: André Portugal


text:
### [CVE-2021-41139](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-41139)
![](https://img.shields.io/static/v1?label=Product&message=timetracker&color=blue)
![](https://img.shields.io/static/v1?label=Version&message=n%2Fa&color=blue)
![](https://img.shields.io/static/v1?label=Vulnerability&message=CWE-79%3A%20Improper%20Neutralization%20of%20Input%20During%20Web%20Page%20Generation%20('Cross-site%20Scripting')&color=brighgreen)

### Description

Anuko Time Tracker is an open source, web-based time tracking application written in PHP. When a logged on user selects a date in Time Tracker, it is being passed on via the date parameter in URI. Because of not checking this parameter for sanity in versions prior to <IP_ADDRESS>00, it was possible to craft the URI with malicious JavaScript, use social engineering to convince logged on user to click on such link, and have the attacker-supplied JavaScript to be executed in user's browser. This issue is patched in version <IP_ADDRESS>00. As a workaround, one may introduce `ttValidDbDateFormatDate` function as in the latest version and add a call to it within the access checks block in time.php.

### POC

#### Reference
No PoCs from references.

#### Github
- https://github.com/ARPSyndicate/cvemon
- https://github.com/indevi0us/indevi0us

repository: trickest/cve

gha_language: HTML

repo_name: trickest/cve


text:
# distant-pictures
A simple server that serves webcam pictures to a website.

When the user clicks take picture, a regular high quality picture is taken. If the user instead presses the button controlled by the Arduino, the image is rotated. Lastly, if the user presses LED ON/OFF the Arduino light turns on and off.

An SVG file for a camera stand + visor (to control lighting) and button enclosure as well as diagrams for different webcam + arudino + raspberry pi ideas

repository: dingaaling/distant-pictures

repo_name: dingaaling/distant-pictures


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

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

## [Unreleased]

## [1.0.2] - 2021-04-11

### Changed
- fixing dockerfile
- fixing changelog

## [1.0.1] - 2021-04-11
### Added
- tests for the scraping functions were added
- linting via pre-commit added (flake 8, autopep8)
- CI added: testing and codecov reporting
- CD added: automatic Github release, publishing to Docker and deployment on heroku

### Changed
- selecting spoken languages on repositories was fixed
- lxml dependency was updated to fix security issue

## [1.0.0] - 2021-03-11

Project released.

[Unreleased]: https://github.com/NiklasTiede/Github-Trending-API/compare/v1.0.2...HEAD
[1.0.2]: https://github.com/NiklasTiede/Github-Trending-API/releases/tag/v1.0.2
[1.0.1]: https://github.com/NiklasTiede/Github-Trending-API/releases/tag/v1.0.1
[1.0.0]: https://github.com/NiklasTiede/Github-Trending-API/releases/tag/v1.0.0

repository: Dhruv-Kapoor/Github-Trending-API

repo_name: Dhruv-Kapoor/Github-Trending-API


text:
# GoogleTranslate - Simple Ruby Client for Google Translate API

http://code.google.com/apis/language/translate/overview.html

## Installation

Add this line to your application's Gemfile:

    gem 'google_translate'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install google_translate

## Usage

    from_language = 'es'
    to_language = 'en'
    @gt = Google::Translate.new(from_language, to_language, {:api_key => 'YOUR_API_KEY'})
    puts @gt.translate('perro')

By default, the translator caches term translations in order to avoid unnecessary requests.
This can be globally disabled passing:

    :cache => false

in the options hash.

You can also skip the caching only for certain translation requests by passing

    :cache => false

to the translate method.

    @gt.translate('A longer sentence that won't likely be repeated', { :cache => false })

See Google Translate API v2 for details about parameters, including [supported language codes](http://code.google.com/apis/language/translate/v2/using_rest.html#language-params).

Note: Google::Translator can still be used instead of Google::Translate for backwards compatibility

## Contributing

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

## License

Copyright © 2011 Christian Hein, released under the MIT license


text:
# Actuator Subscriber (NODEMCU3)

## Getting Started

First you need to create a file called `config.h` inside the `./src` directory. The `config.h` file should look something like this:

```cpp
// Update to fit your network configuration
#define STASSID "your-network-ssid"
#define STAPSK "your-network-password"

// Change to your username in the plarform
#define USER "your-username"

// Put to true the actuator you are using
#define ACTUATOR1 true
#define ACTUATOR1_UUID "9e13dd7f-2480-4b17-95b7-9407f17b5373"
#define ACTUATOR1_DESCRIPTION "LED1"
#define ACTUATOR1PIN D0

#define ACTUATOR2 false
#define ACTUATOR2_UUID "9e13dd7f-2480-4b17-95b7-9407f17b5374"
#define ACTUATOR2PIN D1
#define ACTUATOR2_DESCRIPTION "LED2"

// Platform host and port
#define PLATFORM_HOST "<IP_ADDRESS>"
#define PLATFORM_PORT 80

// MQTT broker host and port
#define MQTT_HOST "<IP_ADDRESS>"
#define MQTT_PORT 1883
```

## Description

This code enables the platform to actuate on actuators connected to this microcontroller.
It subscribes to `actuator/$ACTUATOR#_UUID` defined in the `config.h` file and puts to `HIGH` or `LOW` the correspondent `ACTUATOR#PIN` depending on the message received.

repository: dvcorreia/greenscale

gha_language: Python

repo_name: dvcorreia/greenscale


text:
# 274. H-Index
Given an array of citations (each citation is a non-negative integer) of a researcher, write a function to compute the researcher's h-index.

According to the definition of h-index on Wikipedia: "A scientist has index h if h of his/her N papers have at least h citations each, and the other N − h papers have no more than h citations each."

For example, given citations = [3, 0, 6, 1, 5], which means the researcher has 5 papers in total and each of them had received 3, 0, 6, 1, 5 citations respectively. Since the researcher has 3 papers with at least 3 citations each and the remaining two with no more than 3 citations each, his h-index is 3.

Note: If there are several possible values for h, the maximum one is taken as the h-index.

Hint:
- An easy approach is to sort the array first.
- What are the possible values of h-index?
- A faster approach is to use extra space.
``` js
/**
 * @param {number[]} citations
 * @return {number}
 */
var hIndex = function(citations) {
    //在数组中找到一个数字H，使得数组中至少有H个数字大于等于H，其余的数字小于等于H

    //升序排序
    citations.sort(function(a,b){
        return a-b;
    });

    // console.log(citations);
    for(var i=0;i<citations.length;i++){
        if(citations.length-i<=citations[i]){
            return  citations.length-i;
        }
    }
    return 0;
};
```

repository: wdpm/leetcode

path: /274. H-Index/README.md

repo_name: wdpm/leetcode


text:
# SetScriptTransaction

Structure of a [set script transaction](/blockchain/transaction-type/set-script-transaction.md).

## Constructor

``` ride
SetScriptTransaction(script: ByteVector|Unit, id: ByteVector, fee: Int, timestamp: Int, version: Int, sender: Address, senderPublicKey: ByteVector, bodyBytes: ByteVector, proofs: List[ByteVector])
```

## Fields

| # | Name | Data type | Description |
| :--- | :--- | :--- | :--- |
| 1 | script | ByteVector|Unit | Script that must be set for the [account](/blockchain/account.md) |
| 2 | id | ByteVector | [Transaction ID](/blockchain/transaction/transaction-id.md) |
| 3 | fee | Int | [Transaction fee](/blockchain/transaction-fee.md) |
| 4 | timestamp | Int | [Transaction timestamp](/blockchain/transaction/transaction-timestamp.md) |
| 5 | version | Int | Version of the [data structure](/blockchain/binary-format/transaction-binary-format.md) of a transaction |
| 6 | sender | Address | [Address](/blockchain/address.md) of a transaction sender |
| 7 | senderPublicKey | ByteVector | Account public key of a sender |
| 8 | bodyBytes | ByteVector | Transaction's array of bytes |
| 9 | proofs | List[ByteVector] | Array of [proofs](/blockchain/transaction-proof.md) |

repository: acrylplatform/acryl-documentation

repo_name: acrylplatform/acryl-documentation


text:
# get-artist-title change log

All notable changes to this project will be documented in this file.

This project adheres to [Semantic Versioning](http://semver.org/).

## 1.3.1
* Support `~` as a separator. ([@DaliborTrampota](https://github.com/DaliborTrampota) in [#34](https://github.com/goto-bus-stop/get-artist-title/pull/34))
* Clean (Audio) fluff. ([@DaliborTrampota](https://github.com/DaliborTrampota) in [#34](https://github.com/goto-bus-stop/get-artist-title/pull/34))

## 1.3.0
* Add Node.js 12 to CI.
* Clean (Full Album) fluff. ([@jgchk](https://github.com/jgchk) in [#24](https://github.com/goto-bus-stop/get-artist-title/pull/24))

## 1.2.0
* Add Node.js 10 to CI.
* Add typescript type definitions.

## 1.1.1
* Remove video size names like `1080p`, `4K` from titles.

## 1.1.0
* Ignore potential artist/title separators inside quotes.
  Previously, a dash inside a quoted song title could cause this bug:
  ```js
  assert.strictEqual(
    oldGetArtistTitle('TWICE(트와이스) "OOH-AHH하게(Like OOH-AHH)"'),
    ['TWICE(트와이스) "OOH', 'AHH하게(Like OOH-AHH)"']
  )
  ```
  Now, it correctly identifies the title:
  ```js
  assert.strictEqual(
    getArtistTitle('TWICE(트와이스) "OOH-AHH하게(Like OOH-AHH)"'),
    ['TWICE(트와이스)', 'OOH-AHH하게(Like OOH-AHH)']
  )
  ```

## 1.0.0
* Remove custom plugin functionality.

repository: goto-bus-stop/get-artist-title

branch_name: refs/heads/default

repo_name: goto-bus-stop/get-artist-title


text:
---
layout: post
title: 4 18 1906, 5:12am, or just 4 20
date: 2018-04-20  15:00:00
categories: updates
---
__STATUS__:
- current version: __3.47.0__
- next scheduled release: __4/27/2018__

__COMING SOON__:
- Our next major release is scheduled to include the new permissions model.

__RECENT HIGHLIGHTS__:
- Instructor Course Visualization Reports
- Performance improvements

__MORE DETAILS__:
- [http://bit.ly/IliosWeeklyUpdates](http://bit.ly/IliosWeeklyUpdates){:target="updates"}

Questions? Comments? Feedback? Please let us know at [support<EMAIL_ADDRESS>or in [https://team-ilios.slack.com/messages/help/](https://team-ilios.slack.com/messages/help/){:target="_slackithelp"}.  (If you have not yet joined our slack channel, you can get started at [https://ilios-slack.herokuapp.com/](https://ilios-slack.herokuapp.com/){:target="_slackit"}.)

Please [download the most recent release](https://www.github.com/ilios/ilios/releases/latest){:target="_releases"} and update your frontend to take advantage of all the latest updates!

extension: markdown

gha_language: SCSS


text:
# Usage

# Dashboard

Siren's dashboard view provides a summary of all performance and key validator metrics. Sync statuses, uptimes, accumulated rewards, hardware and network metrics are all consolidated on the dashboard for evaluation.

![](imgs/ui-dashboard.png)

## Account Earnings

The account earnings component accumulates reward data from all registered validators providing a summation of total rewards earned while staking. Given current conversion rates, this component also converts your balance into your selected fiat currency.

Below in the earning section, you can also view your total earnings or click the adjacent buttons to view your estimated earnings given a specific time frame based on current device and network conditions.

![](imgs/ui-account-earnings.png)

## Validator Table

The validator table component is a list of all registered validators, which includes data such as name, index, total balance, earned rewards and current status. Each validator row also contains a link to a detailed data modal and additional data provided by [Beaconcha.in](https://beaconcha.in).

![](imgs/ui-validator-table.png)

## Validator Balance Chart

The validator balance component is a graphical representation of each validator balance over the latest 10 epochs. Take note that only active validators are rendered in the chart visualization.

![](imgs/ui-validator-balance1.png)

By clicking on the chart component you can filter selected validators in the render. This call allow for greater resolution in the rendered visualization.

## Hardware Usage and Device Diagnostics

The hardware usage component gathers information about the device the Beacon Node is currently running. It displays the Disk usage, CPU metrics and memory usage of the Beacon Node device. The device diagnostics component provides the sync status of the execution client and beacon node.

## Log Statistics

The log statistics present an hourly combined rate of critical, warning, and error logs from the validator client and beacon node. This analysis enables informed decision-making, troubleshooting, and proactive maintenance for optimal system performance.

# Validator Management

Siren's validator management view provides a detailed overview of all validators with options to deposit to and/or add new validators. Each validator table row displays the validator name, index, balance, rewards, status and all available actions per validator.

![](imgs/ui-validator-management.png)

## Validator Modal

Clicking the validator icon activates a detailed validator modal component. This component also allows users to trigger validator actions and as well to view and update validator graffiti. Each modal contains the validator total income with hourly, daily and weekly earnings estimates.

# Settings

Siren's settings view provides access to the application theme, version, name, device name and important external links. From the settings page users can also access the configuration screen to adjust any beacon or validator node parameters.

![](imgs/ui-settings.png)

# Validator and Beacon Logs

The logs page provides users with the functionality to access and review recorded logs for both validators and beacons. Users can conveniently observe log severity, messages, timestamps, and any additional data associated with each log entry. The interface allows for seamless switching between validator and beacon log outputs, and incorporates useful features such as built-in text search and the ability to pause log feeds.

Additionally, users can obtain log statistics, which are also available on the main dashboard, thereby facilitating a comprehensive overview of the system's log data. Please note that Siren is limited to storing and displaying only the previous 1000 log messages. This also means the text search is limited to the logs that are currently stored within Siren's limit.

![](imgs/ui-logs.png)

repository: sigp/lighthouse

branch_name: refs/heads/stable

gha_language: Rust

repo_name: sigp/lighthouse


text:
# Duration

Golang like send/receive communication channel with multi-listen capability.

# Usage

## Send

```dart
main() async {
  final channel = Channel<int>();
  channel.send(i);
}
```

## Receive

```dart
main() async {
  final channel = Channel<int>();
  print(await channel.tryReceive(i));
}
```

## Pipe

`pipe` method offers a way to pipe the contents of the given stream into the channel.

```dart
main() async {
  final channel = Channel<int>();
  await channel.pipe(Stream.fromIterable(Iterable.generate(10, (i) => i)));
  channel.close();
}
```

```dart
main() async {
  final channel = Channel<int>();
  final event = await channel.receive(i);
  if(!event.isClosed) {
    print(event.data);
  }
}
```

# Close

```dart
main() async {
  final channel = Channel<int>();
  channel.send(i);
  channel.close();
}
```

# Stream

```dart
main() async {
  final channel = Channel<int>();
  channel.asStream.listen((d) {
    print(d);
  });
}
```

# Example

```dart
import 'package:channel/channel.dart';
import 'package:pedantic/pedantic.dart';

void main() async {
  final channel = Channel<int>();

  unawaited(Future.microtask(() async {
    while (true) {
      final data = await channel.receive();
      if (!data.isClosed) {
        print('In first task: ${data.data}');
      } else {
        print('First task closed');
        break;
      }
    }
  }));

  unawaited(Future.microtask(() async {
    while (true) {
      final data = await channel.receive();
      if (!data.isClosed) {
        print('In second task: ${data.data}');
      } else {
        print('Second task closed');
        break;
      }
    }
  }));

  for (int i = 0; i < 10; i++) {
    channel.send(i);
  }

  channel.close();

  await Future.delayed(Duration(seconds: 5));
}
```

repository: desktop-dart/channel

gha_language: Dart

repo_name: desktop-dart/channel


text:
# Squaddie

A huge selling point for XCOM 2 was their Character Pool system. Using it, characters I had created could naturally appear as if one of their randomly generated characters throughout a campaign. I found great joy in filling a character pool full of people I knew, so that I could be rescuing my brother who is a scientist in one campaign, to seeing myself turn up as a captured prisoner to rescue. This system is not without its flaws however, the UI to create a character for the character pool is full of animations, transitions and other UI features that just slow everything down enough to be a chore for mass character creation. That is where Squaddie comes in.

Squaddie is a library to load the native Character Pool binary format into a C# structure for editing and to compliment this I also added the ability to re-serialize the structure as a JSON file.

Then for ease of use by non-developers, I have provided a simple CLI windows application that can be used to convert from a binary to json, or a json to binary.

# Squaddie CLI
A simple command line windows application that can be used to convert from a binary to json, or a json to binary.

### Commands
|Command| Function |
|--|--|
|-h, --help| List commands and usage instructions. |
|-j, --toJson| Convert from binary input to json output. |
|-b, --toBinary| Convert from json input to binary output. |
|-m, --merge| Merge multiple pools of the same kind into a single pool. You should also specify the type with -b or -j. |
|-p, --pretty| Whether to out JSON as pretty print. |
|-i, --input| Provide the input file filepath. |
|-o, --output| Provide the output file filepath (Will overwrite any existing file). |

### Examples

Converting from a binary to a JSON file. Also using -p to provide us pretty print (line breaks that aid human readability)

    ./SquaddieCLI.exe -j -p -i myCoolPool.bin -o myCoolPool.json

Converting from a JSON file to a binary file

    ./SquaddieCLI.exe -b -i myCoolerPool.json -o woahThisLoadsIntoXCOM.bin

Merge multiple character pool files in a directory into a single character pool (In binary format)

    ./SquaddieCLI.exe -m -i .\Importable -o Merged.bin -b

Merge multiple character pool files in a directory into a single character pool (In json format)

    ./SquaddieCLI.exe -m -i .\Importable -o Merged.json -j -p

# Squaddie C# Library
*ICharacterPoolFileBuilder* provides the interface for all Character Pool file loaders. The ones included within the library are *CharacterPoolJsonBuilder* for converting to/from JSON and *CharacterPoolBinaryBuilder*  for converting to/from XCOM 2 Character Pool Binary files.

A *CharacterPool* represents the collection of *Character*s and the name of the pool. From this you can access the *Characters* property to access the collection.

A *Character* is pretty much a collection of *IProperty*. These can be viewed as a simple struct contain a Key and a Value.

repository: Hesketh/Squaddie

gha_language: C#

repo_name: Hesketh/Squaddie


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

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

## [Unreleased]

## [0.1.3] - 2021-01-14
### Added
- This changelog

### Fixed
- Instruct Kubernetes to send bookmark events for watches. This ensures restarted watches start from a recent
  enough resource version. [#6]
- Fixes the resource filter applied to PVC and VA watches. A bug introduced in 0.1.2 caused the HA Controller to filter
  all resources (Pods, PVCs, VolumeAttachments) based on filters for Pods.

[#6]: https://github.com/piraeusdatastore/piraeus-ha-controller/pull/6

## [0.1.2] - 2021-01-12
### Added
- `--leader-election-resource-name` option added. Used to set the name of the lease resource [#1]

[#1]: https://github.com/piraeusdatastore/piraeus-ha-controller/pull/1

### Fixed
- Kubernetes Watches are now re-tried instead of crashing the whole application in case of timeouts [#5]

[#5]: https://github.com/piraeusdatastore/piraeus-ha-controller/pull/5

## [0.1.1] - 2020-12-16
### Fixed
- Fixed a crash caused by watching PersistentVolumeClaims instead VolumeAttachments

## [0.1.0] - 2020-12-15
### Added
- Initial implementation of HA Controller (watching Kubernetes and LINSTOR events, deleting Pods and VolumeAttachments)
- Deployment example
- README with motivating example

[Unreleased]: https://github.com/piraeusdatastore/piraeus-ha-controller/compare/v0.1.3...HEAD
[0.1.3]: https://github.com/piraeusdatastore/piraeus-ha-controller/compare/v0.1.2...v0.1.3
[0.1.2]: https://github.com/piraeusdatastore/piraeus-ha-controller/compare/v0.1.1...v0.1.2
[0.1.1]: https://github.com/piraeusdatastore/piraeus-ha-controller/compare/v0.1.0...v0.1.1
[0.1.0]: https://github.com/piraeusdatastore/piraeus-ha-controller/releases/tag/v0.1.0


text:
# TempoIQ Python API Library

The TempoIQ Python API Client makes calls to the [TempoIQ API](http://tempoiq.com/).  The module is not yet available on PyPI, so you must install it directly from source:

    cd tempoiq-python
    python setup.py install

Run unit tests:

    cd path/to/tempoiq-python
    python setup.py nosetests

Build documentation:

    cd path/to/tempoiq-python/docs
    make html
    cd build
    firefox index.html

Examples can be found in the HTML documentation.

repository: meshulam/tempoiq-python

repo_name: meshulam/tempoiq-python


text:
# Snake game

## Motivation
This is my learn by doing project. I've never done any game development so I decided to learn a bit more about game loops and game mechanics by recreating the classic snake game.

## Project status: WIP
At this point the snake game is functional, but needs work in terms of graphics, score counter, etc.

## Tech/framework used
<b>This project uses</b>
- vanilla JavaScript
- [webpack](https://webpack.js.org/) for deployment

## Available Scripts
In the project directory, you can run:

> `npm start`
Launches the dev server on http://localhost:8080/.

> `npm run build`
Runs webpack build for deployment.

> `npm run lint`
Runs eslint with [eslint-config-salt](https://github.com/appliedtechnology/eslint-config-salt) configuration.

## Installation and usage
First install all the dependencies:

> `npm install`

Once the installation is done you can simply start the app by running:

> `npm start`

## License
MIT © [Barbara Zujewska]()

repository: b-zuj/snake

repo_name: b-zuj/snake


text:
# Dashboard Backend

To use: Clone or download the repository to yourself.

Install dependencies with:
```
npm install
```

Run with
```
npm start
```

## License

MIT © [Hannu Kärkkäinen](http://blankpace.net/HK/)

The project is generated by [LoopBack](http://loopback.io).

repository: Hellenic/dashboard-backend

repo_name: Hellenic/dashboard-backend


text:
# TA-opnsense
Splunk Add on for [OPNsense firewall](https://opnsense.org/).

```
Version 1.2.0

* Release Notes
- removed static timestamp configurations to work with all syslog timestamp formats.
```

## Supported Sourcetypes

```
opnsense:filterlog
opnsense:dhcpd
opnsense:suricata
opnsense:squid
```

### Where to Install
Splunk platform Instance type | Supported | Required | Actions required/ Comments
----------------------------- | --------- | -------- | --------------------------
Search Heads | Yes | Yes | Install this add-on to all search heads
Indexers | Yes | Conditional | Not required if heavy forwarders are used to collect data.
Heavy Forwarders | Yes | Conditional | Not required.

\* **This add-on must be installed on either the HF or Indexers.**

## Input Requirements
Set the sourcetype to "opnsense" in the inputs.conf file on the forwarder.

i.e.

```
# Sample inputs.conf

[monitor:///var/log/firewall.log]
disabled = 0
host = opnsense_firewall
sourcetype = opnsense
```

## Bugs
Please open an issue at [github.com](https://github.com/ZachChristensen28/TA-opnsense)

repository: dgersting/TA-opnsense

repo_name: dgersting/TA-opnsense


text:
[![Build Status](https://travis-ci.org/nduplessis/payxml.svg?branch=master)](https://travis-ci.org/nduplessis/payxml)
[![Gem Version](https://badge.fury.io/rb/payxml.svg)](https://badge.fury.io/rb/payxml)
# PayXML

PayXML is an easy use wrapper for the the PayGate PayXML payment gateway API.

https://www.paygate.co.za

Compatible with:
- `PayXML 4.0`

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'payxml'
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install payxml

## Usage

### Test vs Production

### Example

```ruby
require 'payxml'

payxml = PayXML::PayXML.new( '10011013800', 'test' )
response = payxml.purchase({customer_name: 'John Doe', customer_reference: 'customer ref 1', credit_card_number: '4000000000000002', expiry_date: '122018', cvv: '123', amount: '30020', currency: 'ZAR', notify_callback_url: 'http://mysite.dev/notify', response_url: 'http://mysite.dev/order-complete'})

if response.requires_secure_redirect?
  # redirect to response.secure_redirect_url
end
```

## Development

After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/nduplessis/payxml. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.

## License

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

repository: nduplessis/payxml

gha_language: Ruby

repo_name: nduplessis/payxml


text:
<!---
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements.  See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership.  The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License.  You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
-->
# Apache Flink Changelog

## Release 1.5.4 - Unreleased (as of 2018-09-12)

### IMPROVEMENTS:

| JIRA | Summary | Priority | Component | Reporter | Contributor |
|:---- |:---- | :--- |:---- |:---- |:---- |
| [FLINK-10082](https://issues.apache.org/jira/browse/FLINK-10082) | Initialize StringBuilder in Slf4jReporter with estimated size |  Major | Metrics | Chesnay Schepler | Chesnay Schepler |
| [FLINK-10137](https://issues.apache.org/jira/browse/FLINK-10137) | YARN: Log completed Containers |  Major | Distributed Coordination, ResourceManager, YARN | Gary Yao | Gary Yao |
| [FLINK-10131](https://issues.apache.org/jira/browse/FLINK-10131) | Improve logging around ResultSubpartition |  Major | Logging, Network | Nico Kruber | Nico Kruber |
| [FLINK-10185](https://issues.apache.org/jira/browse/FLINK-10185) | Make ZooKeeperStateHandleStore#releaseAndTryRemove synchronous |  Major | Distributed Coordination | Till Rohrmann | Till Rohrmann |

### BUG FIXES:

| JIRA | Summary | Priority | Component | Reporter | Contributor |
|:---- |:---- | :--- |:---- |:---- |:---- |
| [FLINK-10101](https://issues.apache.org/jira/browse/FLINK-10101) | Mesos web ui url is missing. |  Major | Mesos | Renjie Liu | Renjie Liu |
| [FLINK-10116](https://issues.apache.org/jira/browse/FLINK-10116) | createComparator fails on case class with Unit type fields prior to the join-key |  Major | DataSet API | Will | Fabian Hueske |
| [FLINK-10172](https://issues.apache.org/jira/browse/FLINK-10172) | Inconsistentcy in ExpressionParser and ExpressionDsl for order by asc/desc |  Major | Table API & SQL | Rong Rong | Rong Rong |
| [FLINK-10204](https://issues.apache.org/jira/browse/FLINK-10204) | StreamElementSerializer#copy broken for LatencyMarkers |  Major | Metrics, Streaming | Ben La Monica | Ben La Monica |
| [FLINK-10142](https://issues.apache.org/jira/browse/FLINK-10142) | Reduce synchronization overhead for credit notifications |  Major | Network | Nico Kruber | Nico Kruber |
| [FLINK-10141](https://issues.apache.org/jira/browse/FLINK-10141) | Reduce lock contention introduced with 1.5 |  Major | Network | Nico Kruber | Nico Kruber |
| [FLINK-10115](https://issues.apache.org/jira/browse/FLINK-10115) | Content-length limit is also applied to FileUploads |  Major | REST, Webfrontend | Yazdan Shirvany | Chesnay Schepler |
| [FLINK-10150](https://issues.apache.org/jira/browse/FLINK-10150) | Chained batch operators interfere with each other other |  Blocker | Metrics, Webfrontend | Helmut Zechmann | Chesnay Schepler |
| [FLINK-10261](https://issues.apache.org/jira/browse/FLINK-10261) | INSERT INTO does not work with ORDER BY clause |  Major | Table API & SQL | Timo Walther | xueyu |
| [FLINK-10193](https://issues.apache.org/jira/browse/FLINK-10193) | Default RPC timeout is used when triggering savepoint via JobMasterGateway |  Critical | Distributed Coordination | Gary Yao | Gary Yao |
| [FLINK-10293](https://issues.apache.org/jira/browse/FLINK-10293) | RemoteStreamEnvironment does not forward port to RestClusterClient |  Major | Client, Streaming | Chesnay Schepler | Chesnay Schepler |
| [FLINK-10267](https://issues.apache.org/jira/browse/FLINK-10267) | [State] Fix arbitrary iterator access on RocksDBMapIterator |  Major | State Backends, Checkpointing | Yun Tang | Yun Tang |
| [FLINK-10011](https://issues.apache.org/jira/browse/FLINK-10011) | Old job resurrected during HA failover |  Blocker | JobManager | Elias Levy | Till Rohrmann |

repository: aw-was-here/eco-release-metadata

repo_name: aw-was-here/eco-release-metadata


text:
# `@mdx-js/runtime`

[![Build Status][build-badge]][build]
[![lerna][lerna-badge]][lerna]
[![Join the community on Spectrum][spectrum-badge]][spectrum]

Parse and render [MDX][] in a runtime environment.

> :warning: **warning**: this is not the preferred way to use MDX since it
> introduces a substantial amount of overhead and dramatically increases
> bundle sizes.
> It should also not be used with user input that isn’t sandboxed.

## Installation

[npm][]:

```sh
npm i -S @mdx-js/runtime
```

## Usage

### Props

The MDX Runtime component accepts two props:

| Name         | Description                                                      |
| ------------ | ---------------------------------------------------------------- |
| `components` | Globally available components for the runtime                    |
| `scope`      | Variables that are accessible in the JSX portion of the document |

### Example code

```jsx
import React from 'react'
import MDX from '@mdx-js/runtime'

// Provide custom components for markdown elements
const components = {
  h1: props => <h1 style={{color: 'tomato'}} {...props} />,
  Demo: props => <h1>This is a demo component</h1>
}

// Provide variables that might be referenced by JSX
const scope = {
  some: 'value'
}

const mdx = `
# Hello, world!

<Demo />

<div>Here is the scope variable: {some}</div>
`

export default () => (
  <MDX components={components} scope={scope}>
    {mdx}
  </MDX>
)
```

## Contribute

See the [Support][] and [Contributing][] guidelines on the MDX website for ways
to (get) help.

This project has a [Code of Conduct][coc].
By interacting with this repository, organisation, or community you agree to
abide by its terms.

## License

[MIT][] © [Compositor][] and [Vercel][]

<!-- Definitions -->

[build]: https://travis-ci.com/mdx-js/mdx
[build-badge]: https://travis-ci.com/mdx-js/mdx.svg?branch=master
[lerna]: https://lernajs.io/
[lerna-badge]: https://img.shields.io/badge/maintained%20with-lerna-cc00ff.svg
[spectrum]: https://spectrum.chat/mdx
[spectrum-badge]: https://withspectrum.github.io/badge/badge.svg
[contributing]: https://mdxjs.com/contributing
[support]: https://mdxjs.com/support
[coc]: https://github.com/mdx-js/.github/blob/master/code-of-conduct.md
[mit]: license
[compositor]: https://compositor.io
[vercel]: https://vercel.com
[mdx]: https://github.com/mdx-js/mdx
[npm]: https://docs.npmjs.com/cli/install

repository: KishanMaurya/personal-portfolio

repo_name: KishanMaurya/personal-portfolio


text:
---
layout: documentation
title: Maximizing the minimum margin
permalink: /applications/max-min-margin
hide: true
root-page: Operational applications
docu-section: none
docu-parent: none
feature-img: "assets/img/farao3.jpg"
tags: [Applications]
order: 2
summary-hmax: 0
---

## CASTOR - maximization of the minimum margin

#### Example of use cases :

Flow based CORE Capacity Calculation operated by RCC

Based on a simulated Market Clearing point resulting for net positions forecast, CASTOR will
maximize the available margin on all CNECs while limiting the loop-flows – all critical outages will be simulated and
solved to ensure grid security.

Where no positive available margin can be ensured the set of available remedial actions, CASTOR will reduce as much as
possible the negative margin on CNEC.


text:
## v1.7.0

### Features

- Adds `truncate` filter; [#3](https://github.com/wbotelhos/normalizy/pull/3) by [rafaeldev](https://github.com/rafaeldev)

### Updates

- Adds RuboCop task on the CI;

## v1.6.0

### Fixes

- Fix Money Filter to use the correct default Rails path for Currency and Percentage;

### Updates

- Adds Code Quality;
- Adds Test Coverage;
- Migrates the build to Github Actions;
- Removes Git dependency for the build;

## v1.5.0

### Features

- Filter `date` now supports call object that responds to `beginning_of_day` or `end_of_day`;

## v1.4.0

### Features

- Adds `date` support for `Date` class.

## v1.3.0

### Updates

- Support Rails 6.

## v1.2.0

### Features

- `money` filter now allows negative numbers.

## v1.1.1

### Fixes

- When using `slug` filter the original values were not saved.

## v1.1.0

### Features

- Added `slug` filter with the option to apply the value on other fields.

## v1.0.1

### Fixes

- When `type` options were `cents` and had no decimal on the number, extra decimals were added.

## v1.0.0

### Updates

- `raw` options was dropped since `prepend` already works before type cast;
- Multiple lines of `normalizy` will be evaluated from the bottom to top.

### Features

- `alias` configuration now accepts options;

### Fixes

- Multiple filters were not running together.

## v0.2.0

### Updates

- `number` filter no more make cast automatically.
- `number` now accept `cast` options with a method to be used on cast type;

### Features

- add `date` filter with `format`, `time_zone` and I18n error message support;
- add `money` filter with `cast`, `type` and I18n support;
- add `percent` filter with `cast`, `type` and I18n support.

## v0.1.0

- First release.

repository: wbotelhos/normalizy

repo_name: wbotelhos/normalizy


text:
---
layout: post
title: "Android Custom Layout: FlowLayout"
category: programming
tags: [android, java, ui]
---

Hello, Android devs! This is my first blog about Android.  So where is `FlowLayout`,
which works like a multiline `TextView` but holding views instead of texts? Developers can just add
views to a `FlowLayout` and each view is put to the right of the previous one and wraps to a new row
when the current row is full. I'm gonna show you how you could implement your own `FlowLayout` with
less than 100 lines of code.

<!-- more start -->

## Prerequisites

To understand this tutorial, you should have some Android development experience. You should already
know what views and viewgroups are. You also should have used one of the SDK builtin layouts before.

## How it works

A layout should subclass
[ViewGroup](http://developer.android.com/reference/android/view/ViewGroup.html) and implement
`onMeasure()` and `onLayout()`. `onMeasure(int, int)` is called when the parent of this view wants
to know this view's dimension, `onLayout(boolean, int, int, int, int)` is called when the parent
layouts this view. Since a layout has its own children, it should also layout them in `onLayout()`.

So we basically do two things, calculate the size of the layout in `onMeasure()` and layout the
children in `onLayout()`.

## The code

In `onMeasure()`, we go through all children, measure each child and put the child to the right of
previous child if there's enough room for it. Otherwise, wrap the line and put the child to next
line. At last, we know how much room the layout itself want to be to hold all its children.

{%highlight java%}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
  int childLeft = getPaddingLeft();
  int childTop = getPaddingTop();
  int lineHeight = 0;
  // 100 is a dummy number, widthMeasureSpec should always be EXACTLY for FlowLayout
  int myWidth = resolveSize(100, widthMeasureSpec);
  int wantedHeight = 0;
  for (int i = 0; i < getChildCount(); i++) {
    final View child = getChildAt(i);
    if (child.getVisibility() == View.GONE) {
      continue;
    }
    // let the child measure itself
    child.measure(
        getChildMeasureSpec(widthMeasureSpec, getPaddingLeft() + getPaddingRight(),
            child.getLayoutParams().width),
        getChildMeasureSpec(heightMeasureSpec, getPaddingTop() + getPaddingBottom(),
            child.getLayoutParams().height));
    int childWidth = child.getMeasuredWidth();
    int childHeight = child.getMeasuredHeight();
    // lineheight is the height of current line, should be the height of the heightest view
    lineHeight = Math.max(childHeight, lineHeight);
    if (childWidth + childLeft + getPaddingRight() > myWidth) {
      // wrap this line
      childLeft = getPaddingLeft();
      childTop += paddingVertical + lineHeight;
      lineHeight = childHeight;
    }
    childLeft += childWidth + paddingHorizontal;
  }
  wantedHeight += childTop + lineHeight + getPaddingBottom();
  setMeasuredDimension(myWidth, resolveSize(wantedHeight, heightMeasureSpec));
}
{%endhighlight%}

`onLayout()` basicly does the same thing except it layouts the children instead of calculating the
dimension.

{%highlight java%}
@Override
protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
  int childLeft = getPaddingLeft();
  int childTop = getPaddingTop();
  int lineHeight = 0;
  int myWidth = right - left;
  for (int i = 0; i < getChildCount(); i++) {
    final View child = getChildAt(i);
    if (child.getVisibility() == View.GONE) {
      continue;
    }
    int childWidth = child.getMeasuredWidth();
    int childHeight = child.getMeasuredHeight();
    lineHeight = Math.max(childHeight, lineHeight);
    if (childWidth + childLeft + getPaddingRight() > myWidth) {
      childLeft = getPaddingLeft();
      childTop += paddingVertical + lineHeight;
      lineHeight = childHeight;
    }
    child.layout(childLeft, childTop, childLeft + childWidth, childTop + childHeight);
    childLeft += childWidth + paddingHorizontal;
  }
}
{%endhighlight%}

To make use of our fresh new `FlowLayout`, put it in an activity and add some views into it.

{%highlight java%}
public class MainActivity extends Activity {
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    ViewGroup flowContainer = (ViewGroup) findViewById(R.id.flow_container);
    for (Locale locale : Locale.getAvailableLocales()) {
      String countryName = locale.getDisplayCountry();
      if (!countryName.isEmpty()) {
        flowContainer.addView(createDummyTextView(countryName),
            new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
      }
    }
  }

  private View createDummyTextView(String text) {
    TextView textView = new TextView(this);
    textView.setText(text);
    return textView;
  }
}
{%endhighlight%}

We add the country name of all locale available on this device into a FlowLayout and see how it
works:

![](/image/flowlayout_portrait.png)

![](/image/flowlayout_landscape.png)

The full code lives on [gist](https://gist.github.com/hzqtc/7940858).

<!-- more end -->


text:
# Novicap Checkout Challenge

##### Besides providing invoice finance, NoviCap also runs a physical store which sells (only) 3 products:

```
Code         | Name                |  Price
-------------------------------------------------
VOUCHER      | NoviCap Voucher      |   5.00€
TSHIRT       | NoviCap T-Shirt      |  20.00€
MUG          | NoviCap Coffee Mug   |   7.50€
```
Various departments have insisted on the following discounts:

 * The marketing department believes in 2-for-1 promotions (buy two of the same product, get one free), and would like for there to be a 2-for-1 special on `VOUCHER` items.

 * The CFO insists that the best way to increase sales is with discounts on bulk purchases (buying x or more of a product, the price of that product is reduced), and demands that if you buy 3 or more `TSHIRT` items, the price per unit should be 19.00€.

Examples:

    Items: VOUCHER, TSHIRT, MUG
    Total: 32.50€

    Items: VOUCHER, TSHIRT, VOUCHER
    Total: 25.00€

    Items: TSHIRT, TSHIRT, TSHIRT, VOUCHER, TSHIRT
    Total: 81.00€

    Items: VOUCHER, TSHIRT, VOUCHER, VOUCHER, MUG, TSHIRT, TSHIRT
    Total: 74.50€
## Getting Started

Clone The Project

### Prerequisites

The project requires no external dependencies. Just a Runtime

```
Python 3.7
```
## Running the console application

You can run the console application using

```
python3.7 main.py
```
## Running the tests

Run the test cases using

```
python3.7 test.py
```
## Challenge Author

* **Nicolas Overloop**

## License

This project is licensed under the MIT License

## Acknowledgments
* None

repository: eagwasim/checkout-challenge

repo_name: eagwasim/checkout-challenge


text:
# Working with SimpleStyle
To use Simply Style guide the following folders are mainly required during your development.
## ./app
This folder contains all your source code configurations of the Simple Style Guide.
## ./app/_config
This folder contains the configuration of you're currently used patterns. The file 'pattern.conf.json' will be autogenerate via a gulp task. Whenever you add a new pattern this new pattern will be written to the 'pattern.conf.json'
## ./app/_pattern
This folder contains all pattern and html snippets your style guide contains. Files needs to be stored to this folder with the  extension '.hbs'.
The 'atoms', 'molecules', 'organism', 'templates' and 'pages' folder helps you to organise your patterns and combine them together.
## ./app/scripts
In case you need custom javascript in your style guide you can put them in this scripts folder.
By default the only the main.js, that already exists in this folder is embedded in the style guide.
## ./app/styles
This folder contains the file 'main.scss'. This file allows you to customise the design of your patterns.
It is recommended to structure your styles in folders and multiple files.
To use them in your 'main.scss' you can simply use the [Sass @import](http://sass-lang.com/guide) statement.

repository: StfBauer/generator-simplestyle

gha_language: CSS

repo_name: StfBauer/generator-simplestyle


text:
Ansible role to install nextcloud client
----------------------------------------------

This ansible role installs the nextcloud client and the gnome keyring.
It will also enable and create a systemd unit file to launch nextcloud-client always.

### WARNING

This ansible role is not tested well.
Please be carefully by using it!

currently some features of this ansible role is not used by its maintainer. it could contain bugs and errors.


text:
# React Stopwatch
An iOS stopwatch clone made with React. Adapted from [this JSFiddle](https://jsfiddle.net/vakhtang/j276r2zh/) for learning purposes.

To demo, clone repo and run `npm run-script dev`.

repository: kkozee/react-stopwatch

repo_name: kkozee/react-stopwatch


text:
pythonJinjaUserLogin
====================

This is a simple project for user register and login.

Technology Stack:

1. Python
2. Jinja
3. MongoDb

How to run
==========

Ensure that you have the complete technology stack installed.

next : simply go to the project directory and type python hello.py


text:
language-cil: Manipulating Common Intermediate Language AST
===========================================================

Language-Cil is a Haskell library for manipulating CIL abstract syntax and
generating .il files using the concrete syntax of CIL.

Common Intermediate Language (CIL), formerly known as Microsoft Intermediate
Language (MSIL), is the lowest level language that runs on the Microsoft .NET
and Mono platforms.

The [examples](https://github.com/tomlokhorst/language-cil/tree/master/examples/)
directory has a couple of files showing how to construct different CIL ASTs.

Read more on the Wikipedia page on
[Common Intermediate Language](http://en.wikipedia.org/wiki/Common_Intermediate_Language).

Current status
--------------

This library is still very much under development.
Only a subset of the full CIL AST is implemented.

A parser for concrete syntax has not yet been implemented.

Module overview
---------------

 - **Language.Cil** Top level module, reexports sub modules
 - **Language.Cil.Analysis** Some analysis functions over AST, not really used
   yet.
 - **Language.Cil.Build** Smart constructors and convenience functions, it is
   suggested to use these over raw AST constructors.
 - **Language.Cil.Pretty** Pretty printer function `pr`. Returns a `ShowS`.
 - **Language.Cil.Syntax** Concrete AST data types.

Getting started
---------------

 1. Make sure you have Mono or .NET installed.
 2. Install the library.
 3.
          , call [] Void "mscorlib" "System.Console" "WriteLine" [String]

            -- Reads an integer from stdin, add one to it, print result to stdout.
          , call [] String "mscorlib" "System.Console" "ReadLine" []
          , call [] Int32 "" "int32" "Parse" [String]

          , ldc_i4 1
          , add
          , call [] Void "mscorlib" "System.Console" "WriteLine" [Int32]

          , ret
          ]
 4. Write the AST to a file by running `main`.
 5. Run the IL assembler: `ilasm Test.il`
 6. Run the generated executable: `mono Test.exe` (or `Test.exe` on Windows)

repository: tomlokhorst/language-cil

gha_language: Haskell

repo_name: tomlokhorst/language-cil


text:
---
layout: default
---

# 1996-02-25 - Re: Internet Privacy Guaranteed ad (POTP Jr.)

## Header Data

From<EMAIL_ADDRESS>To<EMAIL_ADDRESS>Message Hash: 3cd04ed6a44cb6b6c773c989f5bca3400933ef2e64b9a71c9a9cc5436af5ea67

Message ID<EMAIL_ADDRESS>Reply To: _N/A_

UTC Datetime: 1996-02-25 02:09:03 UTC

Raw Date: Sun, 25 Feb 1996 10:09:03 +0800

## Raw message

```
{% raw  %}From<EMAIL_ADDRESS>Date: Sun, 25 Feb 1996 10:09:03 +0800
To<EMAIL_ADDRESS>Subject: Re: Internet Privacy Guaranteed ad (POTP Jr.)
Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

Perry Metzger<EMAIL_ADDRESS>writes:
> Dan Bailey writes:
> > My suggestion
> > is to post the OTP-expansion algorithm to sci.crypt.
>
> Call it what it is -- a pseudo-random number generator, at best. As

I think this is the crux of the problem - they are simply misnaming
their proprietry algorithm.

I don't see any stigma attached with IPG admitting they have a PRNG
seeded with a key, and XORing the PRNG stream with the data - this is
exactly what RC4 does.  But of course RC4 (now) has the advantage of
open review, and before that it had the advantage of Ron Rivests
reputation associated with it.  Simply change all the literature to
replace "OTP" with "PRNG", or "seed" in appropriate places.

So, submitting your PRNG for open peer review would be a good start.
But I don't think the fact that IPG generates the keys for their
clients is good.  I don't see this as a viable key distribution
mechanism.

But you *really* must stop equating your system with a one time pad,
it absolutely is NOT a OTP.

> you likely know (but the IPG folks don't seem to care) you can't
> "expand" a one time pad. One time means ONE TIME. Look at how the NSA
> broke the Venona intercepts of of even two-time use of keying material.

exactly.

I do hope IPG will take the trouble to consider comments such as this,
and Perrys comments above, if they are at all serious about their
system every gaining any reputation.

Adam

{% endraw %}
```

## Thread

+ Return to [February 1996](/archive/1996/02)

+ Return to "[aba@atlas.ex.ac.uk](/authors/aba_at_atlas_ex_ac_uk)"

+ 1996-02-25 (Sun, 25 Feb 1996 10:09:03 +0800) - Re: Internet Privacy Guaranteed ad (POTP Jr.) -<EMAIL_ADDRESS>


text:
# logger

## timing(name, cb)

```javascript
import { logger } from '@ataola/utils';

function makeBaby() {
  for (let i = 0; i < 20; i++) {
    console.log(`the ${i}th baby was born.\n`)
  }
}

logger.timing('test', makeBaby);

// the 0th baby was born.

// the 1th baby was born.

// the 2th baby was born.

// the 3th baby was born.

// the 4th baby was born.

// the 5th baby was born.

// the 6th baby was born.

// the 7th baby was born.

// the 8th baby was born.

// the 9th baby was born.

// the 10th baby was born.

// the 11th baby was born.

// the 12th baby was born.

// the 13th baby was born.

// the 14th baby was born.

// the 15th baby was born.

// the 16th baby was born.

// the 17th baby was born.

// the 18th baby was born.

// the 19th baby was born.

// time: 1.174072265625 ms
```

## timeConsuming(cb)
```javascript
import { logger } from '@ataola/utils';

function makeBaby() {
  for (let i = 0; i < 20; i++) {
    console.log(`the ${i}th baby was born.\n`)
  }
}

logger.timeConsuming(makeBaby);

// the 0th baby was born.

// the 1th baby was born.

// the 2th baby was born.

// the 3th baby was born.

// the 4th baby was born.

// the 5th baby was born.

// the 6th baby was born.

// the 7th baby was born.

// the 8th baby was born.

// the 9th baby was born.

// the 10th baby was born.

// the 11th baby was born.

// the 12th baby was born.

// the 13th baby was born.

// the 14th baby was born.

// the 15th baby was born.

// the 16th baby was born.

// the 17th baby was born.

// the 18th baby was born.

// the 19th baby was born.

// time-consuming: 1.07 ms

```

repository: AbbyZheng/utils

repo_name: AbbyZheng/utils


text:
---
published: true
title: Reading Articles
layout: page
---
Following *temporariry* lists my current reading. Each of them is categozed subjectively into a category.

## Academic Papers

### Abstract Argumentation

* [Similarity, causality and argumentation](https://mindmodeling.org/cogsci2013/papers/0479/paper0479.pdf){:target="_blank"}

### Argumentation Schemes

* [Argumentation Schemes for Statutory
Interpretation: A Logical Analysis](http://www.dougwalton.ca/papers%20in%20pdf/14JurixSart.pdf){:target="_blank"}
* [Argumentation Schemes: From Informal Logic to
Computational Models](https://cgi.csc.liv.ac.uk/~katie/waltonFest10.pdf){:target="_blank"}
* [The function of negation in argumentation](http://www.sciencedirect.com/science/article/pii/037821669390068Z){:target="_blank"}

### Argumentation Systems

* [Argumentation-based Normative Practical Reasoning](http://homepages.abdn.ac.uk/n.oren/pages/TAFA-15/TAFA-15_submission_17.pdf){:target="_blank"}

### Logic Programming

* [Foundations of Logic Programming](http://citeseerx.ist.psu.edu/viewdoc/download?doi=<IP_ADDRESS>.7090&rep=rep1&type=pdf){:target="_blank"}
* [Extended Logic Programs](https://www.doc.ic.ac.uk/~mjs/teaching/KnowledgeRep491/ExtendedLP_491-2x1.pdf){:target="_blank"}

## Forums

### Logic Programming

* [Double negation and execution model in Prolog](http://stackoverflow.com/questions/11613868/double-negation-and-execution-model-in-prolog){:target="_blank"}
* [Negation in prolog](http://stackoverflow.com/questions/10799834/negation-in-prolog){:target="_blank"}
* [Why double negation doesn't bind in Prolog](http://stackoverflow.com/questions/19369952/why-double-negation-doesnt-bind-in-prolog){:target="_blank"}
* [How does Negation-as-Failure works in Prolog?](http://stackoverflow.com/questions/14079805/how-does-negation-as-failure-works-in-prolog){:target="_blank"}

## Lecture Slides

### Logic Programming

* [Resolution in Propositional and First-Order Logic](http://www.csee.umbc.edu/courses/graduate/691/spring12/03/notes/19resolution.pdf){:target="_blank"}

## Wikipedia

* [Gödel's incompleteness theorems](https://en.wikipedia.org/wiki/G%C3%B6del%27s_incompleteness_theorems){:target="_blank"}