text:
+++
date = "2016-09-08T22:46:48-04:00"
next = "/basics/studies/"
prev = "/basics/"
title = "Create a tyche.json file"
toc = true
weight = 1

+++

After you have tyche installed, there is one thing you'll need to do.
Create a `tyche.json` file in the root of your repo (or where ever you
want to launch tasks from). A tyche.json file is a description of
tasks that work together to achieve some kind of result. Each task can
have rules (or not) that allow you define tasks with great detail.

For example, it might make sense to create a task that runs `npm install`
if, and only if, the node_modules directory doesn't exist or the
package.json file changes.

In order to do that, the `tyche.json` file might look something like:

``` json
{
    "settings": {
        "defaultTool": "native"
    },
    "tasks": [
        {
            "name": "install-dependencies",
            "description": "run npm install",
            "exec": {
                "native": {
                    "command": "npm install"
                }
            },
            "skips": {
                "files_not_changed": ["package.json"],
                "path_exists": ["node_modules"]
            }
        }
    ]
}
```

{{% notice info %}}
Make sure your task names are globally unique. They are the identifier
used internally.
{{% /notice %}}

The output of `tyche --help`:

```
Usage: tyche [options] [command]

  Commands:

    install-dependencies [options]   run npm install
    init                             Initialize the tool in this repository
    bump [options]                   Bump the build number +1

  Options:

    -h, --help     output usage information
    -V, --version  output the version number
    -v, --verbose  Turn on verbose logging
```

Another use case might be to build something, use `./configure` and `make`
for example:

``` json
{
    "settings": {
        "defaultTool": "native"
    },
    "tasks": [
        {
            "name": "make",
            "description": "Run make",
            "exec": {
                "native": {
                    "command": "make"
                }
            },
            "tasks": [
                {
                    "name": "configure",
                    "description": "Run configure",
                    "exec": {
                        "native": {
                            "command": "./configure"
                        }
                    }
                }
            ]
        }
    ]
}
```

And the output of `tyche --help`

```
Usage: tyche [options] [command]

  Commands:

    make [options] [configure]  Run make
    init                        Initialize the tool in this repository
    bump [options]              Bump the build number +1

  Options:

    -h, --help     output usage information
    -V, --version  output the version number
    -v, --verbose  Turn on verbose logging
```

Notice how the tasks are nested inside one another. This means that the
`make` task depends on the `configure` task. This also makes running
immediate children of a top-level task easy from the cli as well. Since
you can run `tyche make configure` to run that specific task.

tyche uses this internally to build and develop the documentation you
are reading right now. `tyche docs dev` to enable development while
watching the filesystem and `tyche docs new-chapter` for example.

------------------------------

It's important to note that the command you specify will inherit the
same environment variables that are present from wherever you invoke tyche
as well as run the command in a shell. This is what makes tyche pretty
amazing as a lot of build environments (such as TravisCI or TeamCity)
inject environment variables into the build process.

{{% notice warning %}}
Currently, there's not any way to trap a signal 9 (SIGKILL). This means
a command started by a task, may continue to run in the background when
the tyche process is killed in this way.
Most likely, this will only affect people running TeamCity on versions
less than 10.02... You've been warned.
{{% /notice %}}

repository: withinboredom/tyche

repo_name: withinboredom/tyche


text:
---
uid: crmscript_whats_new
title: What's new in CRMScript
author:
so.date: 10.15.2020
keywords:
so.topic: reference
---

# What's new

## 10.15.2020

New HTTP class functions to easily send documents and attachments in a POST request.

* [HTTP.addAttachmentData][1]
* [HTTP.addDocumentData][2]
* [HTTP.addBinaryData][3]

<!-- Referenced links -->
[1]: ../api-reference/classes/http/addattachmentdata.md
[2]: ../api-reference/classes/http/adddocumentdata.md
[3]: ../api-reference/classes/http/addbinarydata.md

license: MIT

repository: stianol/crmscript

branch_name: refs/heads/main

extension: md

gha_license_id: MIT

license_type: permissive

repo_name: stianol/crmscript


text:
# PC Rule Grouping

This is my graduation project @NSLab, Tsinghua.

The goal is to provide a rule grouping algorithm for packet classification (PC), to improve the PC performance.

---

The main script is `grouping.py` under `bin\` directory.

Usage:

```sh
$ ./bin/grouping.py [-h] [-n MAX_GROUP_NUM] [-m MEMORY_SIZE] [-o OPTIMIZE_RATIO] [-s SAVE_RESULTS] [-v] <ruleset> {bitcuts,efficuts}
```

```
positional arguments:
  <ruleset>               the ruleset to load
  {bitgrouping,efficuts}    grouping algorithm selected

optional arguments:
  -h, --help            show this help message and exit
  -n MAX_GROUP_NUM, --max-group-num MAX_GROUP_NUM
                        maximum number of groups
  -m MEMORY_SIZE, --memory-size MEMORY_SIZE
                        expected memory size of data structures
  -o OPTIMIZE_RATIO, --optimize-ratio OPTIMIZE_RATIO
                        the decreasing ratio when optimize the memory size,
                        only works when --memory_size is set
  -s SAVE_RESULTS, --save-results SAVE_RESULTS
                        the file to save the group results
  -v, --verbosity       output the running log of bitcuts algorithm
```

**Note**:
Using `pypy` to accelerate.

---

e.g.

```sh
$ pypy bin/grouping.py -n 10 -m 39 -o 0.8 -s result/ipc1_1K_grp ruleset/ipc1_1K bitgrouping
```

This command will use `BitGrouping` to group the rules from ruleset `ruleset/ipc1_1K` and save the grouping result into `result/ipc1_1K_grp`. The maximum grouping number is `10`. Optimization is enabled and the memory size is expected to be smaller than `39`KB. The decreasing ratio is set to `0.8`.

branch_name: refs/heads/master


text:
---
title: Insertion-Sort
tags:
  - Algorithms
date: 2019-01-24
---

> Know about it by writing CODE.

> ***Because it's really easy!!!!***

## Pseudocode

```
for j = 2 to A.length
	key = A[j]
	// Insert A[j] into the sorted sequence A[1...j-1]
	i = j - 1
	while i > 0 and A[i] > key
		A[i+1] = A[i]
		i = i - 1
	A[i + 1] = key
```

> Know more by reading the complete code:

```c
#ifndef _INSERT_SORT_H_
#define _INSERT_SORT_H_

void insert_sort(int *p, int length);
void insert_sort_test();

#endif /*_INSERT_SORT_H_*/

#include <stdio.h>

void
insert_sort(int *p, int length)
{
	int key = 0;
	// start from the second element
	for (int i = 1; i < length; ++i)
	{
		key = p[i];
		int j = i - 1;
		while (j >= 0 && p[j] > key)
		{
			p[j + 1] = p[j];
			j = j - 1;
		}
		p[j + 1] = key;
	}
}

void
insert_sort_test()
{
	int a[] = {15, 1, 51, 6, 13};
	printf("before sorted!\n");
	for (int i = 0; i < 5; ++i)
		printf("%d\t", a[i]);
	insert_sort(a, 5);
	printf("\nafter sorted\n");
	for (int i = 0; i < 5; ++i)
		printf("%d\t", a[i]);
	printf("\n");
}

```

## Process

In order to help people who don't know about insertion-sort before. I made this. Let's check.

![step1](https://sherlockblaze.com/resources/img/cs/insertion-sort/step1.png)

As we know, we start from the second element. We call it i, the value of i is between 0 and the size of this array or some structure else, the total number of elements. Then we get a key, the value of key is A[i].

![step2](https://sherlockblaze.com/resources/img/cs/insertion-sort/step2.png)

Then we put the second pointer points to the element just before i, we call it j, j start from i - 1, end with 0.

![step3](https://sherlockblaze.com/resources/img/cs/insertion-sort/step3.png)

If the element is pointed by j is bigger than the pointer i points, they exchange their values.

![step4](https://sherlockblaze.com/resources/img/cs/insertion-sort/step4.png)

when j got the end, i plus one, new loop start.

![step5](https://sherlockblaze.com/resources/img/cs/insertion-sort/step5.png)

***And so on....***

![step6](https://sherlockblaze.com/resources/img/cs/insertion-sort/step6.png)

![step7](https://sherlockblaze.com/resources/img/cs/insertion-sort/step7.png)

![step8](https://sherlockblaze.com/resources/img/cs/insertion-sort/step8.png)

![step9](https://sherlockblaze.com/resources/img/cs/insertion-sort/step9.png)

![step10](https://sherlockblaze.com/resources/img/cs/insertion-sort/step10.png)

repository: sherlockblaze/blog

gha_language: JavaScript

repo_name: sherlockblaze/blog


text:
centos-packer
=============

CentOS 6 / 7 x64 + VirtualBox / VMWare for Packer Template

## Packer Build for VirtualBox

```
cd centos6 or centos7
packer validate [ CentOS_6.json | CentOS_7.json ]
VERSION=v20161130 packer build [ -only virtualbox-iso | -only vmware-iso ]  [ CentOS_6.json | CentOS_7.json ]
```

## Add Vagrant Box

```
vagrant box add BOXNAME INSANEWORKS-CentOS-6-x86_64-v20161130-virtualbox.box
vagrant box add BOXNAME INSANEWORKS-CentOS-7-x86_64-v20161130-virtualbox.box
or
vagrant box add BOXNAME INSANEWORKS-CentOS-6-x86_64-v20161130-vmware.box
vagrant box add BOXNAME INSANEWORKS-CentOS-7-x86_64-v20161130-vmware.box
```

## Atlas a.k.a Vagrant Cloud

```
mkdir centos
cd centos
vagrant init insaneworks/centos
or
vagrant init insaneworks/centos7
vagrant up
```

## or Public URL Init

```
mkdir centos
cd centos
vagrant init INSANEWORKS-CentOS-6-x86_64-v20161130 https://www.insaneworks.co.jp/pub/boxes/INSANEWORKS-CentOS-6-x86_64-v20161130-virtualbox.box
vagrant init INSANEWORKS-CentOS-7-x86_64-v20161130 https://www.insaneworks.co.jp/pub/boxes/INSANEWORKS-CentOS-7-x86_64-v20161130-virtualbox.box
or
vagrant init INSANEWORKS-CentOS-6-x86_64-v20161130 https://www.insaneworks.co.jp/pub/boxes/INSANEWORKS-CentOS-6-x86_64-v20161130-vmware.box
vagrant init INSANEWORKS-CentOS-7-x86_64-v20161130 https://www.insaneworks.co.jp/pub/boxes/INSANEWORKS-CentOS-7-x86_64-v20161130-vmware.box
vagrant up
```

## or Edit Vagrantfile (Vagrant 1.5.0 or Higher)

```diff
   # please see the online documentation at vagrantup.com.

   # Every Vagrant virtual environment requires a box to build off of.
-  config.vm.box = "base"
+  config.vm.box = "insaneworks/centos" or "insaneworks/centos7"

   # Create a forwarded port mapping which allows access to a specific port
   # within the machine from a port on the host machine. In the example below,
```

```
vagrant up
```

## Known Issues

[mitchellh/vagrant: Authentication failure after inserting new key with Vagrant 1.8.5.](https://github.com/mitchellh/vagrant/issues/7610)

fix ex.
```diff
--- vagrant-original/plugins/guests/linux/cap/public_key.rb     2016-07-19 12:06:56.575045974 -0500
+++ vagrant/plugins/guests/linux/cap/public_key.rb      2016-07-19 12:07:34.303376009 -0500
@@ -54,6 +54,7 @@
             if test -f ~/.ssh/authorized_keys; then
               grep -v -x -f '#{remote_path}' ~/.ssh/authorized_keys > ~/.ssh/authorized_keys.tmp
               mv ~/.ssh/authorized_keys.tmp ~/.ssh/authorized_keys
+              chmod 0600 ~/.ssh/authorized_keys
             fi

             rm -f '#{remote_path}'
end
```

Enjoy!!

repository: evilensky/centos-packer

repo_name: evilensky/centos-packer


text:
# frzr

frzr is a deployment and automatic update mechanism for operating systems. It deploys pre-built systems via read-only btrfs subvolumes, thus ensuring safe and atomic updates that never interrupt the user.

Updated system images are downloaded at boot time and deployed to an entirely separate subvolume so as not to interfere with the currently running system. Upon next boot, the newly installed system is started and the old one is deleted, completely seamlessly and invisibly.

Persistence is handled by making `/home` and `/var` separate subvolumes mounted into the read-only root.
`/etc` is made read-write via overlayfs.

repository: liberodark/frzr

repo_name: liberodark/frzr


text:
# Caesar's Cipher

"One of the simplest and most widely known ciphers is a Caesar cipher, also known as a shift cipher. In a shift cipher the meanings of the letters are shifted by some set amount.

A common modern use is the [ROT13](https://en.wikipedia.org/wiki/ROT13) cipher, where the values of the letters are shifted by 13 places. Thus 'A' ↔ 'N', 'B' ↔ 'O' and so on." — [FreeCodeCamp](https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/javascript-algorithms-and-data-structures-projects/caesars-cipher)

This is a part of my FreeCodeCamp [Javascript Algorithms and Data Structures Certification](https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/javascript-algorithms-and-data-structures-projects/). It's the third project in the module. The code passes all of the tests in the [project requirements](https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/javascript-algorithms-and-data-structures-projects/caesars-cipher). See for yourself!

## Technologies Used

HTML, CSS, and JavaScript

## Usage

Download the code and open `index.html` in your browser. Or, just go to [this link](https://dreamy-fermat-506703.netlify.app/).

## License

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

repository: davidgbiggs/caesars-cipher

repo_name: davidgbiggs/caesars-cipher


text:
# Usage

```c
#include <sodium.h>

int main(void)
{
    if (sodium_init() == -1) {
        return 1;
    }
    ...
}
```

`sodium.h` is the only header that has to be included.

The library is called `sodium` (use `-lsodium` to link it), and proper compilation/linker flags can be obtained using `pkg-config` on systems where it is available:

```bash
CFLAGS=$(pkg-config --cflags libsodium)
LDFLAGS=$(pkg-config --libs libsodium)
```

`sodium_init()` initializes the library and should be called before any other function provided by Sodium.
The function can be called more than once, but it should not be executed by multiple threads simultaneously. Add appropriate locks around the function call if this scenario can happen in your application.

After this function returns, all of the other functions provided by Sodium will be thread-safe.

`sodium_init()` doesn't perform any memory allocations. However, on Unix systems, it opens `/dev/urandom` and keeps the descriptor open, so that the device remains accessible after a `chroot()` call.
Multiple calls to `sodium_init()` do not cause additional descriptors to be opened.

`sodium_init()` returns `0` on success, `-1` on failure, and `1` is the library had already been initialized.

license: ISC

repository: paragonie/libsodium-doc

repo_name: paragonie/libsodium-doc


text:
---
title: Rest vs Spread Operator in JavaScript, Simplified
category: javascript
date: 2020-06-14
pageDescription: >-
  The Rest and Spread operator are two features of JavaScript introduced in ES6 which makes development easier with JavaScript. Learn their differences in this article.
pageKeywords: "rest, spread, rest vs spread"
tags: ["es6"]
cover: "https://res.cloudinary.com/dillionmegida/image/upload/v1592158803/images/thewebfor5/rest_and_spread_xmwdsn.png"
---

The Rest and Spread operator are two features of JavaScript introduced in [ES6](http://es6-features.org/). They work entirely different but their similar syntax (triple dots `...`) brings some misconceptions when working with them.

In this article, I'll explain what these operators do and where they can be used.

## TLDR;

The `rest` operator, is used to group **remaining** arguments in, usually in functions.

The `spread` operator, on the other hand, is used to split a group of values in JavaScript.

Key takeaway: `rest` groups, `spread` splits.

Now in detail,

## The Rest Operator

This operator is used to get all or remaining arguments in a function as an array. For example:

```js
function printArgs(args) {
  console.log(args)
}
```

No matter the arguments passed to this function when used, only the first argument is considered. To get more arguments, the function declaration may contain something like `args1, args2, args2...`, but for how long? The `args1, args2...` approach is perfect for functions which only care about a definite number of arguments, but for indefinite arguments, `rest` makes things easy.

Although, before `rest`, was `arguments`. Here's an example:

```js
function printArgs(args) {
  console.log(args)
  console.log(arguments)
}
printArgs(1, 2, 3, 4, 5)
// 1
// { '0': 1, '1': 2, '2': 3, '3': 4, '4': 5 }
```

The same program with `rest`:

```js
function printArgs(...args) {
  console.log(args)
}
printArgs(1, 2, 3, 4, 5)
// [1, 2, 3, 4, 5]
```

`rest` is more useful than `arguments` because:

- it allows you to name the arguments array whatever you like (as we saw above, `args`)
- it returns an array, while `arguments` is an object, hence, array methods can be performed on `rest`'s result
- while `arguments` gets **all** the arguments in the function, `rest` can be used to get the **remaining** arguments after some have been selected. Here's what I mean:

```js
function printNumbers(firstNumber, secondNumber, ...remainingNumbers) {
  console.log(firstNumber)
  console.log(secondNumber)
  console.log(remainingNumbers)
}
printNumbers(1, 2, 3, 4, 5)
// 1
// 2
// [3, 4, 5]
```

**NOTE THAT**, the first number can also be gotten with `args[0]` but with `rest`, we can select the values we want right from the arguments declaration.

## Spread Operator

This operator is used to split a group of values. The group could be a string, array, or object.

For strings and arrays, the result of the spread operator is an array because they are iterable based on their index nature. By index nature, I mean:

```js
const str = "javascript"
const arr = ["javascript"]
console.log(str[0])
// j
console.log(arr[0])
// javascript
```

For objects, the result of the spread operator is an object because objects are based on their key-value nature.

### Uses

The `spread` operator can be used in four contexts. They are:

#### Array expressions

Syntax:

```js
const newArray = [...oldArray]
```

For example:

```js
const oldArray = [3, 4, 5]
const newArray1 = [...oldArray]
console.log(newArray1)
// [3,4,5]
const newArray2 = [1, 2, ...oldArray]
console.log(newArray2)
// [1,2,3,4,5]
```

From the above, you'd notice how the values of the `oldArray` were **spread** in the new arrays.

#### String expressions

Syntax:

```js
const strArray = [...string]
```

This is similar to be `string.split`. For example:

```js
const str = "javascript"
const strArray = [...str]
console.log(strArray)
// [ 'j', 'a', 'v', 'a', 's', 'c', 'r', 'i', 'p', 't' ]
```

#### Function expressions

Syntax:

```js
const result = fn(...stringOrArray)
```

For example:

```js
function add(a, b) {
  console.log(a + b)
}
const numbers = [5, 6]
add(...numbers)
// 11
```

You'd observe that we didn't place the `numbers` in an array when using it as an argument. What the above does is to spread the values for `add`. It translates to `add(5,6)`.

#### Object expressions

Syntax:

```js
const newObj = { ...oldObj }
```

For example:

```js
const oldObj = {
  lang: "javascript",
  score: 23,
}
const newObj1 = { ...oldObj }
console.log(newObj1)
// {lang: 'javascript', score: 23}
const newObj2 = { ...oldObj, short: "JS" }
console.log(newObj2)
// { lang: 'javascript', score: 23, short: 'JS' }
const newObj3 = { ...oldObj, score: 40 }
console.log(newObj3)
// { lang: 'javascript', score: 40 }
```

For `newObj1`, you can see how the old object properties were spread.

For `newObj2`, you can see how the old object properties were spread, and a new property `short`, was added.

For `newObj3`, you can see how the old object properties were spread, and the property `score` was modified at the same time. **NOTE THAT** if `score:40` was declared before the old object properties were spread, the `score:23` would take priority.

The `spread` operator is considered very useful especially in array and object expressions because it ensures [immutability in JavaScript objects](https://dillionmegida.com/p/mutability-vs-immutability-in-javascript/)

## Wrap up

`rest` and `spread` are two special features that make development easier. They also have cool benefits when using [array and object destructuring](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment).

Thanks for reading : )

gha_language: TypeScript


text:
# DApp Lab

English | [简体中文](./README.zh-CN.md)

## Introduction

Some simple examples of DApp and examples of DApp interacting with web3.

Live version available at [http://blog.junezhu.top/dapp-lab/](http://blog.junezhu.top/dapp-lab/)

## Catalog

* DApp
	* Dice (Guesses the number from 1 to 10)
	* Zombie card game (Acknowledge Loom)
	* Lottery (TBD)
	* Airdrop (TBD)

* Interactive function between smart contract and web3
	* Smart contract read and write
	* Message signing for smart contracts
	* Get information about a specified smart contract
	* Get random number via Oraclize
	* Compile data by abi
	* Send transactions directly with the private key

## Author

**June** -><EMAIL_ADDRESS>
## Getting started
```bash
# Installing
npm install
# Compiles and hot-reloads for development
npm run dev
```

App will be running at: http://localhost:8080/dapp-lab/

## Build
```bash
npm run build
```

## License

This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details

gha_language: Vue


text:
---
title: Monitor containers using the InfluxData Platform
description: Use the InfluxData TICK stack to monitor containers, including Kubernetes and Docker
menu:
  platform:
    name: Monitor containers
    weight: 2
    parent: Monitor
---

This is a new section of the documentation and new content will be added frequently
as support for the InfluxData Platform and containers rapidly evolves.

## [Monitor Kubernetes using the InfluxData Platform](/platform/monitoring/containers/kubernetes/)

You can use the InfluxData Platform to monitor your Kubernetes installations.


text:
---
layout: post
title: "OSOTP51"
description: ""
category: genes
tags: [photosystem]
---

* **Information**
    + Symbol: OSOTP51
    + MSU: [LOC_Os02g47360](http://rice.uga.edu/cgi-bin/ORF_infopage.cgi?orf=LOC_Os02g47360)
    + RAPdb: [Os02g0702000](https://rapdb.dna.affrc.go.jp/locus/?name=Os02g0702000)

* **Publication**
    + [A mutation of OSOTP 51 leads to impairment of photosystem I complex assembly and serious photo-damage in rice](http://www.ncbi.nlm.nih.gov/pubmed?term=A mutation of OSOTP 51 leads to impairment of photosystem I complex assembly and serious photo-damage in rice%5BTitle%5D), 2012, J Integr Plant Biol.
    + [A chloroplast-localized pentatricopeptide repeat protein involved in RNA editing and splicing and its effects on chloroplast development in rice.](http://www.ncbi.nlm.nih.gov/pubmed?term=A chloroplast-localized pentatricopeptide repeat protein involved in RNA editing and splicing and its effects on chloroplast development in rice.%5BTitle%5D), 2022, BMC Plant Biol.

* **Genbank accession number**

* **Key message**
    + A mutation of OSOTP 51 leads to impairment of photosystem I complex assembly and serious photo-damage in rice.

* **Connection**

[//]: # * **Key figures**


text:
# Prerequisites #

- [Node.js](http://nodejs.org/) ( 6.x - LTS )
- [Python](http://python.org/downloads/) ( 2.x )
- [Git](https://git-for-windows.github.io/) ( 2.6.x )

After installing the tools above follow the instructions below according to your IDE of choice.


text:
# MobileFirst Foundation Analytics Helm Chart
IBM MobileFirst™ Analytics gives a rich view into both your mobile landscape and server infrastructure. Included are default reports of user retention, crash reports, device type and operating system breakdowns, custom data and custom charts, network usage, push notification results, in-app behavior, debug log collection, and beyond.

For more information: [MobileFirst Operational Analytics Documentation](https://www.ibm.com/support/knowledgecenter/en/SSHS8R_8.0.0/com.ibm.worklight.analytics.doc/analytics/c_introduction.html)
## Prerequisites

1. (Mandatory) PersistentVolume needs to be pre-created prior to installing the chart if `persistance.enabled=true` and `persistence.dynamicProvisioning=false` (default values, see [persistence](#persistence) section). It can be created by using the IBM Cloud Private UI or via a yaml file as the following example:
The PVC will be used to store analytics data.

```
apiVersion: v1
kind: PersistentVolume
metadata:
  name: <persistent volume name>
spec:
  capacity:
    storage: 20Gi
  accessModes:
    - ReadWriteMany
  hostPath:
    path: <PATH>
```

2. (Optional) You can provide your own keystore and truststore to the deployment by creating a secret with your own keystore and truststore.

Pre-create a secret with keystore.jks, keystore-password.txt, truststore.jks, truststore-password.txt and provide the secret name in the field keystores.keystoresSecretName.

Keep the files keystore.jks and its password in a file named keystore-password.txt, truststore.jks and its password in a file named truststore-password.jks.
From the command line, execute:
*      `kubectl create secret generic mfpf-cert-secret --from-file keystore-password.txt --from-file truststore-password.txt --from-file keystore.jks --from-file truststore.jks`

Note that the names of the files should be the same as mentioned here: keystore.jks,keystore-password.txt, truststore.jks and truststore-password.txt.

Provide this secret name in keystoresSecretName, and overide the default keystores.
## Accessing MobileFirst Analytics

From a browser, use *external_ip:nodeport/analytics/console* to access MobileFirst Operational Analytics console.
Get the Analytics URL by running these commands:
 1. If you need to use https port:
   ```
   export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} \
          -o jsonpath="{.items[0].status.addresses[0].address}")
   export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} \
          -o jsonpath="{.spec.ports[1].nodePort}" services {{ template "fullname" . }})
   echo https://$NODE_IP:$NODE_PORT/analytics/console
   ```
 2. If you need to use http port:
   ```
   export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} \
          -o jsonpath="{.items[0].status.addresses[0].address}")
   export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} \
          -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "fullname" . }})
   echo http://$NODE_IP:$NODE_PORT/analytics/console
   ```

NOTE: The Port number 9600 is exposed internally in the Kubernetes service. This is used by the MobileFirst Analytics instances as the transport port

### Parameters

| Qualifier | Parameter  | Definition | Allowed Value |
|---|---|---|---|
| arch     |      | Worker node architecture | Worker node architecture to which this chart should be deployed. Only AMD64 platform is currently supported |
| image     | pullPolicy | Image Pull Policy | Always, Never, or IfNotPresent. Default: IfNotPresent |
|           | name          | Docker image name | Name of the MobileFirst Operational Analytics docker image |
|           | tag          | Docker image tag | See Docker tag description |
| scaling | replicaCount | The number of instances (pods) of MobileFirst Operational Analytics that need to be created | Positive integer (Default: 2) |
| mobileFirstAnalyticsConsole | user | Username for MobileFirst Operational Analytics | Default: admin |
|                       | password | Password for MobileFirst Operational Analytics | Default: admin |
|  analyticsConfiguration | clusterName | Name of the MobileFirst Analytics cluster. | defaults to "mobilefirst"|
|                       | numberOfShards | Number of Elasticsearch shards for MobileFirst Analytics | default to 2|
|                       | replicasPerShard | Number of Elasticsearch replicas to be maintained per each shard for MobileFirst Analytics | default to 2|
|                          | analyticsDataDirectory | Path where analytics data is stored. ( It will also be the same path where the persistent volume claim is mounted inside the container) | defaults to "/analyticsData"|
| keystores | keystoresSecretName | Refer the configuration section to pre-create the secret with keystores and their passwords.|
| jndiConfigurations | mfpfProperties | MobileFirst JNDI properties to be specified to customize operational analytics| Supply comma separated name value pairs  |
| ingress | enabled | Enable ingress | Default: false |
|         | sslSecretName | Ingress SSL Certificate Secret name (Optional) | If you need to expose your ingress endpoint over SSL, create a secret with the certificate and provide the name of the secret here. Required if you need to use the ingress endpoint over SSL. See the readme for creating the secret |
| resources | limits.cpu  | Describes the maximum amount of CPU allowed.  | Default is 2000m. See Kubernetes - [meaning of CPU](https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/#meaning-of-cpu) |
|                  | limits.memory | Describes the maximum amount of memory allowed. | Default is 4096Mi. See Kubernetes - [meaning of Memory](https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/#meaning-of-memory)|
|           | requests.cpu  | Describes the minimum amount of CPU required - if not specified will default to limit (if specified) or otherwise implementation-defined value.  | Default is 1000m. See Kubernetes - [meaning of CPU](https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/#meaning-of-cpu) |
|           | requests.memory | Describes the minimum amount of memory required. If not specified, the memory amount will default to the limit (if specified) or the implementation-defined value. | Default is 2048Mi. See Kubernetes - [meaning of Memory](https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/#meaning-of-memory) |
| persistence | enabled         | Use a PVC to persist data                        | true                                                     |
|            |useDynamicProvisioning      | Specify a storageclass or leave empty  | false                                                    |
| dataVolume|existingClaimName| Provide an existing PersistentVolumeClaim          | nil                                                      |
|           |storageClass     | Storage class of backing PVC                       | nil                                                      |
|           |size             | Size of data volume                                | 20Gi                                                     |


text:
[![](https://jitpack.io/v/com.vinted/preferx.svg)](https://jitpack.io/#com.vinted/preferx)
[![Build Status](https://travis-ci.com/vinted/preferx.svg?branch=master)](https://travis-ci.com/vinted/preferx)

# PrefeRx

This is a reactive SharedPreferences library for Kotlin

 - allows to integrate & manage your preferences with RxJava
 - easily stores primitives, enums and other serializable objects

Download
--------

```groovy
dependencies {
  implementation 'com.vinted:preferx:<version>'
}
```

Supported types
--------
Library supports default `SharedPreferences` types with default fallback values when preference was not yet set or was cleared.

```kotlin

  sharedPreferences.intPreference("counter", 0)

  sharedPreferences.stringPreference("string", "")

  sharedPreferences.booleanPreference("seen", false)

  sharedPreferences.longPreference("timestamp", 0L)

```

It also allows easy storing of enums and objects.

```kotlin

  sharedPreferences.enumPreference("notifications", Frequency.ALL)

  sharedPreferences.objectPreference(
    name = "current_user"
    defaultValue = User.ANONYMOUS,
    serializer = someSerializer,
    clazz = User::class
  )
```

Basic example
--------

```kotlin
class ExampleActivity : Activity {

  private val sharedPreferences by lazy {
    getSharedPreferences("app-pref", Context.MODE_PRIVATE)
  }

  private val sessionCounter : IntPreference by lazy {
    sharedPreferences.intPreference("counter", 0)
  }

  @Override
  public fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.simple_activity)

    val incrementedCount = sessionCounter.get() + 1
    sessionCounter.set(incrementedCount)

    counter_view.text = "Application was started $incrementedCount times"
  }
}
```

RxJava example
--------

```kotlin
class ExampleActivity : Activity {

  ...

  private var disposable: Disposable? = null

  override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)

    Observable.just(stringPreference.get())
      .concatWith(stringPreference.onChangeObservable)
      .subscribe {
          text_view.text = it
      }
    }.apply { disposable = this }
  }

  override fun onDestroy() {
    disposable?.dispose()
    super.onDestroy()
  }

  ...
}
```

For more usage examples see:
 - [preferences with dagger](app/src/main/kotlin/com/vinted/preferx/examples/DaggerActivityExample.kt)
 - [preferences in Rx stream](app/src/main/kotlin/com/vinted/preferx/examples/RxActivityExample.kt)

Caveats
--------

 - When `EnumSerializer` fails to resolve enum value for any reason it will fallback to default value
 - When using `EntitySerializer` one must ensure that it returns value. In case of `null` it will fallback to default value.

License
--------

```
MIT License

Copyright (c) 2021 Vinted UAB

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.

 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.
```

repository: vinted/preferx

gha_language: Kotlin

repo_name: vinted/preferx


text:
This is a fork from Kira2/parse-server-sendinblue-adapter, the original repo stopped working and maintainance. Now you can use this repo instead.

# @seeck/parse-server-sendinblue-email-adapter
Used to send Parse Server password reset emails, and verification emails through SendinBlue

### Installation
```
npm install @seeck/parse-server-sendinblue-email-adapter --save
```

### Configuration
```javascript
var api = new ParseServer({
  ...
  // Your application name. It may appear into the subject and body of the emails that are sent.
  appName: "My App",
  // The options for the email adapter
  emailAdapter: {
    module: "@seeck/parse-server-sendinblue-adapter",
    options: {
      // The API key of the SendinBlue account (required)
      // WARNING: USE ENVIRONMENT VARIABLE HERE !!! DO NOT EXPOSE YOUR API_KEY !!!
      apiKey: "YOUR_SENDINBLUE_API_KEY",
      // The default sender name (required)
      fromName: "The Sender",
      // The default sender email address (required)
      fromEmail<EMAIL_ADDRESS>      // The languages preferences (required)
      translation: {
        default: "en", // default locale for templates and texts (required)
        locale: "locale" // the name of the property that stores the language of the user into the User table. It must be a two-letter language code: 'en', 'fr', 'de' etc. (optional)
      },

      /**
       * Options for the reset password emails
       */

      // Set it to use templates of the SendinBlue account (optional)
      passwordResetTemplateId: {
        en: 12345,  // the template id to use for english user
        fr: 67890   // the template id to use for french user
      },

      // 1. set the subject here, according to the languages you support.
      // Required only if passwordResetTemplateId is not defined.
      passwordResetSubject: {
        en: "Reset My Password on %APP_NAME%",
        fr: "Réinitialiser mon mot de passe sur %APP_NAME%"
      },
      // 2. set the plain text part here, according to the languages you support.
      // Required only if passwordResetTemplateId is not defined.
      passwordResetTextPart: {
        en: "Hello,\n\nYou requested to reset your password for %APP_NAME%.\n\nPlease, click here to set a new password: %LINK%",
        fr: "Bonjour,\n\nVous avez demandé la réinitialiser de votre mot de passe pour %APP_NAME%.\n\nMerci de cliquer ici pour choisir un nouveau mot de passe : %LINK%"
      },
      // 3. set the html text part here, according to the languages you support.
      // Required only if passwordResetTemplateId is not defined.
      passwordResetHtmlPart: {
        en: "Hi,<p>You requested to reset your password for <b>%APP_NAME%</b>.</p><p>Please, click <a href=\"%LINK%\">here</a> to set a new password.</p>",
        fr: "Bonjour,<p>Vous avez demandé la réinitialiser de votre mot de passe pour <b>%APP_NAME%</b>.</p><p>Merci de cliquer <a href=\"%LINK%\">ici</a> pour choisir un nouveau mot de passe.</p>"
      },

      /**
       * Options for the email verification emails
       */

      // Set it to use templates of the SendinBlue account (optional)
      verificationEmailTemplateId: {
        en: 12345,  // the template id to use for english user
        fr: 67890   // the template id to use for french user
      },

      // 1. set the subject here, according to the languages you support.
      // Required only if verificationEmailTemplateId is not defined.
      verificationEmailSubject: {
        en: "Verify your email",
        fr: "Vérifier votre adresse e-mail"
      },
      // 2. set the plain text part here, according to the languages you support.
      // Required only if verificationEmailTemplateId is not defined.
      verificationEmailTextPart: {
        en: "Hi,\n\nYou are being asked to confirm the e-mail address {EMAIL} with %APP_NAME%\n\nClick here to confirm it: %LINK%",
        fr: "Bonjour,\n\nMerci de confirmer l'adresse e-mail {EMAIL} avec %APP_NAME%\n\nCliquez ici pour confirmer : %LINK%"
      },
      // 3. set the html text part here, according to the languages you support.
      // Required only if verificationEmailTemplateId is not defined.
      verificationEmailHtmlPart: {
        en: "Hi,<p>You are being asked to confirm the e-mail address {EMAIL} with <b>%APP_NAME%</b></p><p>Click <a href=\"%LINK%\">here</a> to confirm it.</p>",
        fr: "Bonjour,<p>Merci de confirmer l'adresse e-mail {EMAIL} avec <b>%APP_NAME%</b></p><p>Cliquez <a href=\"%LINK%\">ici</a> pour confirmer.</p>"
      },

      // Pass host url if you needed (optional)
      hostUrl: serverUrl.replace( mountPath, "" ),

      // Optional: A callback function that returns the options used for sending
      // verification and password reset emails. The returned options are merged
      // with this options object.
      // If needed, this function can also return a promise for an options object.
      getIndividualOptions: function(targetOpts) {
        var toMail = targetOpts.to || (targetOpts.user && targetOpts.user.get("email"));
        if (toMail ===<EMAIL_ADDRESS>{
          return {
            passwordResetSubject: {
              en: "Please reset your password your Highness",
              fr: "Veuillez réinitialiser votre mot de passe Votre Altesse"
            }
          };
        }
        return {};
      }
    }
  }
  ...
});
```

The variables **{EMAIL}**, **%APP_NAME%** and **%LINK%** are automatically replaced with the email of the recipient, the name you provided for your application and the link to reset the password or to verify the email.

It may happen, when you use a button into your templates for example, that SendinBlue prefixes automatically the link with a scheme (http:// or https://). In this case, use **%LINK_SHORT%** instead of **%LINK%** into your template.

You can use either templates, or texts to send the emails to reset password or to verify the account.

When you want to send the reset password emails: if you do not define the ids of the templates into **passwordResetTemplateId**, then passwordResetSubject, passwordResetTextPart and passwordResetHtmlPart are required.

When you want to send the verification emails: if you do not define the ids of the templates into **verificationEmailTemplateId**, then verificationEmailSubject, verificationEmailTextPart and verificationEmailHtmlPart are required.

### Multilanguage
The option **translation.default** must contain the code of the language to use for the emails.

If you store the language of your users into a property of the user, assign the name of this property to the option **translation.locale**.

This way, when an email is sent, the adapter checks if a property to get the language of the user exists. If it does not exist, or it is not set, or there is no email template or text defined for the specific language of the user, it will use **translation.default** as the default language to send the emails.

This requires to use a two-letter language code to store the language of the user: "en", "fr", "de" etc.

To define a specific template id or text for a given language, just use the key/value pair like this when you define your templates ids or texts:

```javascript
// The templates ids of the emails sent to verify the account
verificationEmailTemplateId: {
  en: 12345, // the template id to use for english user
  fr: 67890  // the template id to use for french user
},
```

```javascript
// The subjects of the emails sent to reset password
passwordResetSubject: {
  en: "Reset My Password on %APP_NAME%", // the subject to for english user
  fr: "Réinitialiser mon mot de passe sur %APP_NAME%" // the subject to for french user
}
```

Same thing for the texts : passwordResetTextPart, passwordResetHtmlPart, verificationEmailSubject, verificationEmailTextPart, verificationEmailHtmlPart.

### Tests
The test file spec/sendinblue_adapter_spec.js is here to allow you to test the module without deploying a parse-server. It tests several settings: with templates, with plain/html text etc. You will have to update the variables into the **customization part** of the file to test the emails by your own. Use your own SendinBlue account, your own templates and your own email addresses. Once you correctly set the variables, you receive the 20 tests emails by running this command:

```
npm test
```


text:
# UIUC Themes for R Markdown (`uiucthemes`)

<!-- badges: start -->

[![R build
status](https://github.com/coatless/uiucthemes/workflows/R-CMD-check/badge.svg)](https://github.com/coatless/uiucthemes/actions)
[![Package-License](http://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat)](https://opensource.org/licenses/MIT)
[![CRAN Version
Badge](http://www.r-pkg.org/badges/version/uiucthemes)](https://cran.r-project.org/package=uiucthemes)
[![CRAN
Status](https://cranchecks.info/badges/worst/uiucthemes)](https://cran.r-project.org/web/checks/check_results_uiucthemes.html)
[![CRAN RStudio mirror
downloads](http://cranlogs.r-pkg.org/badges/uiucthemes)](http://www.r-pkg.org/pkg/uiucthemes)
[![CRAN
status](https://www.r-pkg.org/badges/version/uiucthemes)](https://CRAN.R-project.org/package=uiucthemes)
<!-- badges: end -->

The `uiucthemes` package includes a collection of UIUC-themed templates
for presentations, journal articles, and exam templates.

Included in the package are:

-   `beamer_illinois`: Illinois colored header boxes
-   `beamer_orange`: Minimialist slides with a color preference to
    orange.
-   `beamer_mil`: Beamer Market Information Lab (MIL)
-   `beamer_imetropolis`: Metropolis Theme with Illinois colors for
    Beamer.
-   `html_imetropolis`: `xaringan`-powered Metropolis Theme for
    Illinois.
-   `latex_journal_report`: initial implementation of a journal entry
    for a class.

Screenshots of each template are included in package overview vignette.

## `beamer_illinois` - Example

Within an `RMarkdown` file, add the following:

``` md
---
title: '"Illinois" UIUC Beamer Theme'
short-title: "Beamer Slides"
author: "John and Mary Doe"
short-author: "J & M Doe"
date: 'August 19, 2021'      # Month DD, YYYY (Main Slide)
short-date: '08/19/2021' # MM/DD/YYYY (Lower Right)
institute: "University of Illinois at Urbana-Champaign"
short-institute: "UIUC"
department: "Department of Magic"                # Institute must be defined
license: "Did you license this slide deck? "
section-titles: false                            # Provides slide headings
safe-columns: true                               # Enables special latex macros for columns.
output:
   uiucthemes::beamer_illinois
---

# Section title
## Subsection title

### Frame Title

Frame content

**Unordered List**

- [University of Illinois at Urbana-Champaign (UIUC)](http://illinois.edu)
- [Department of Statistics](http://www.stat.illinois.edu/)
- [Illinois Informatics Institute](http://www.informatics.illinois.edu/)

*Ordered List*

1. <http://thecoatlessprofessor.com>
2. <https://github.com/coatless>

#### Title for block box

Content inside of a box

### \LaTeX

\begin{exampleblock}{Binomial Theorem}
\begin{equation}
  f\left(k\right) = \binom{n}{k} p^k\left(1-p\right)^{n-k}
  \label{eq:binom}
\end{equation}
\end{exampleblock}

Hello Equation \ref{eq:binom}
```

This generates:

![](https://raw.githubusercontent.com/illinois-r/uiucthemes/main/tools/readme/beamer_illinois_slide_example.png)

## Materials Referenced

-   [Custom Document
    Templates](http://rmarkdown.rstudio.com/developer_document_templates.html)
    / [Custom
    Formats](http://rmarkdown.rstudio.com/developer_custom_formats.html)
-   [Beamer Presentation
    Format](http://rmarkdown.rstudio.com/beamer_presentation_format.html)
-   [LaTeX Generic Pandoc
    Template](https://github.com/jgm/pandoc-templates/blob/db59a5e77b0a5629f0801eb82103814842f2e2ed/default.latex)
-   [`rticles` An R Package](https://github.com/rstudio/rticles)

### Prerequisites

-   LaTeX Distribution
    -   Windows: <http://miktex.org/download>
    -   Mac: <http://tug.org/mactex/mactex-download.html>

### Using `uiucthemes` from RStudio

To use **uiucthemes** from RStudio:

1.  Install the latest
    [RStudio](http://www.rstudio.com/products/rstudio/download/).

2.  Install the **uiucthemes** package:

``` r
install.packages(c("rmarkdown","uiucthemes"))
```

3.  Use the **New R Markdown** dialog to create an article from one of
    the templates:

![New R
Markdown](https://raw.githubusercontent.com/illinois-r/uiucthemes/main/tools/readme/uiucthemes.png)

### Using `uiucthemes` outside of RStudio

1.  Install [pandoc](http://johnmacfarlane.net/pandoc/) using the
    [instructions for your
    platform](https://github.com/rstudio/rmarkdown/blob/bd5c509c888bfd309ef059ae6cbdeb408ec53d66/vignettes/pandoc.Rmd).

2.  Install the **rmarkdown** and **uiucthemes** packages:

``` r
install.packages(c("rmarkdown","uiucthemes"))
```

3.  Use the `rmarkdown::draft` function to create articles:

``` r
rmarkdown::draft("slide_deck.Rmd", template = "beamer_illinois", package = "uiucthemes")
```

### Using a development version of `uiucthemes`

To access the development version of `uiucthemes`, e.g. not on CRAN,
please use:

``` r
if(!requireNamespace("remotes")) { install.packages("remotes") }
remotes::install_github("coatless/uiucthemes")
```

## Authors

James Joseph Balamuta with contributions from Steven Andrew Culpepper,
David Dalpiaz, and Jose Luis Rodriguez.

## Citing the `uiucthemes` package

To ensure future development of the package, please cite `uiucthemes`
package if used for a presentation. Citation information for the package
may be acquired by using in *R*:

``` r
citation("uiucthemes")
```

## License

MIT - James Joseph Balamuta

repository: illinois-r/uiucthemes

gha_language: TeX

gha_license_id: NOASSERTION

repo_name: illinois-r/uiucthemes


text:
# dwm-ipc
![Main CI](https://github.com/mihirlad55/dwm-ipc/workflows/Main%20CI/badge.svg)

dwm-ipc is a patch for dwm that implements inter-process communication through a
UNIX socket. This allows you to query the window manager for information, listen
for events such as tag changes or layout changes, as well as send commands to
control the window manager from other programs/scripts.

## Requirements
In order to build dwm you need the Xlib header files. The patch
additionally requires `yajl` which is a tiny C JSON library.

## Applying the Patch
The patch can be found on the
[Releases page](https://github.com/mihirlad55/dwm-ipc/releases). Download the
latest version of the patch that matches your version of dwm.

The patch is best applied after all of your other patches due to the number of
additions to dwm.c. The patch was designed with compatability in mind, so there
are minimal deletions.

### Tips
- Apply the patch last after all your other patches to avoid merge conflicts

## Patch Compatability
At the moment, the patch will only work on systems that implement epoll and is
not completely portable. Portability will be improved in the future.

## Supported IPC Messages
At the moment the IPC patch supports the following message requests:
- Run user-defined command (similar to key bindings)

- Get information about available layouts

- Get information about the tags available

- Get the properties of all of the monitors

- Get the properties of a specific dwm client

- Subscribe to tag change, client focus change, layout change events, monitor
focus change events, and focused title change events.

For more info on the IPC protocol implementation, visit the
[wiki](https://github.com/mihirlad55/dwm-ipc/wiki/).

## dwm-msg
`dwm-msg` is a cli program included in the patch which supports all of the IPC
message types listed above. The program can be used to run commands, query dwm
for information, and listen for events. This program is particularly useful for
creating custom shell scripts to control dwm.

## Related Projects
See [dwmipcpp](https://github.com/mihirlad55/dwmipcpp)

See [polybar dwm module \[WIP\]](https://github.com/mihirlad55/polybar)

gha_language: C


text:
# Angular-4+-Dashboard-Framework
This is an angular 4+ based dashboard framework that is inspired by JIRA's dashboard implementation and https://github.com/angular-dashboard-framework/angular-dashboard-framework

The primary projects leveraged:
* angular 4+ - https://angularjs.org/
* ngx-charts (angular based d3 charts) - https://github.com/swimlane/ngx-charts
* Semantic-UI - https://semantic-ui.com/
* ng2-dnd drag and drop - https://github.com/akserg/ng2-dnd

Additional Features:
* Leverages Angular's dynamic data driven forms approach for gadget property pages and properties - https://angular.io/guide/dynamic-form
* Dynamic component strategy for creating gadget instances during runtime - https://angular.io/guide/dynamic-component-loader

![Image of Main Screen](https://github.com/catalogicsoftware/Angular-2-Dashboard-Framework/blob/master/screenshot-main.png)
![Image of Add Gadget Screen](https://github.com/catalogicsoftware/Angular-2-Dashboard-Framework/blob/master/screenshot-add-gadget.png)

repository: sasitha/big-data-dashboard

repo_name: sasitha/big-data-dashboard


text:
# Ubuntu 20.10: Docker image

## Prerequistes

* [Docker](https://docs.docker.com/desktop/)

> Notice: [Subscription](https://www.docker.com/blog/updating-product-subscriptions/) is required for buisness use.

## Preparation

(Optional) Fetch Tanzu CLI

```
cp ../scripts/fetch-tanzu-cli.sh .
./fetch-tanzu-cli.sh {VMWUSER} {VMWPASS} linux {TANZU_CLI_VERSION}
```
> Replace `{VMWUSER}` and `{VMWPASS}` with credentials you use to authenticate to https://console.cloud.vmware.com.  Replace `{TANZU_CLI_VERSION}` with a supported (and available) version number for the CLI you wish to embed in the container image.  If your account has been granted access, the script will download a tarball, extract the [Tanzu CLI](https://docs.vmware.com/en/VMware-Tanzu-Kubernetes-Grid/1.3/vmware-tanzu-kubernetes-grid-13/GUID-tanzu-cli-reference.html) and place it into a `dist` directory.  The tarball and other content will be discarded.  (The script has "smarts" built-in to determine whether or not to fetch a version of the CLI that may have already been fetched and placed in the `dist` directory).

## Building

If you want to build a portable container image, then execute

```
mkdir -p dist
docker build -t tanzu/k8s-toolkit .
```

## Launching

Execute

```
docker run --rm -it tanzu/k8s-toolkit /bin/bash
```

## Inventory

If you want an inventory of all the relevant tools installed

```
cp ../scripts/inventory.sh .
docker run --rm -v ${PWD}:/home/docker tanzu/k8s-toolkit /bin/bash /home/docker/inventory.sh
```

repository: fastnsilver/make-onboarding-suck-less

repo_name: fastnsilver/make-onboarding-suck-less


text:
---
layout: post
title: Calculating WAIC from Bayesian AFT models run in JAGS
subtitle: How the loo and R2jags packages make Bayesian computation fun and easy in R
tags: [R, RStudio, Jekyll, Github, Markdown]
---

Before I begin this post, I'd like to apologize to all of my dedicated readers (thanks mom) who've been
checking in during the past few months and haven't seen any new posts.

I took a course in Bayesian methods this past semester, and we ended with a lecture on Bayesian accelerated
failure time (AFT) models. The details of the AFT model are beyond this post (if you're interested, please get the [Bayesian Ideas and Data Analysis](http://blogs.oregonstate.edu/bida/) book and read chapter 13, which I'm basing this post on), but the basic idea is that we have "failure" times, which are usually times to events such as death
or recurrence of a disease, and we want to model these failure times using covariates. In addition,
it is common to have right-censored observations, which means that we know that the event of interest did not
occur until a certain point, but we do not observe the actual failure time. This often occurs
when subjects drop out of a study, or when a study ends before we are able to observe failure
times for all subjects.

The AFT model is a parametric model, meaning that we assume that the failure times
have a certain distribution. Two common distributions used are the Weibull distribution
and the log-normal distribution. If we decide to use an AFT model, but are not sure
which distribution to use, it might be of use to fit both and find a measure to compare
how well each distribution fits the data. One such measure is the [deviance information criterion](https://en.wikipedia.org/wiki/Deviance_information_criterion), or DIC.
I will be using JAGS (Just Another Gibbs Sampler) to fit these two models, and JAGS conveniently provides the
DIC for each model. However, **DIC is not calculated correctly for models with censored observations in JAGS**,
which I will prove later in this post.

The widely applicable information criteron (WAIC) is
viewed as an improvement on DIC (Aki Vehtari, Andrew Gelman, and Jonah Gabry have much more on this [here](http://www.stat.columbia.edu/~gelman/research/unpublished/loo_stan.pdf)), and is viewed as
a fully Bayesian way of comparing models. In order to calculate the WAIC, we assume we have
S draws of the parameters in our model from their posterior distribution, and then we calculate
the log-likelihood for each data point for each of these draws. If we have N observations,
we will then have an N x S matrix of log-likelihoods, and can use the [loo package](https://cran.r-project.org/web/packages/loo/loo.pdf) to calculate the WAIC.

Now let's get to the modeling with R! As I mentioned before, we will be using
JAGS, which can be downloaded [here](https://sourceforge.net/projects/mcmc-jags/files/).
We will also be using the `data.table`, `R2jags` and `loo` packages in R, so you should install
those if you haven't already.

The data we will be analyzing is taken from Example 13.1.1 in the Bayesian Ideas and Data Analysis
book that I linked to earlier. The subjects for the data are 90 males with cancer of the larynx, and the outcome
variable of interest is the time from diagnosis to death or censoring. Our covariates
are stage of the disease at diagnosis (from 1-4), the year of diagnosis, and the age at diagnosis. Let's
first read the data in, get rid of unecessary columns, and rename the columns.

```r
library(data.table)
larynx.url <- "http://people.oregonstate.edu/~calverta/BIDA/Chapter13/Larynx-Cancer-Data.txt"
larynx.dat <- fread(larynx.url)
larynx.dat <- larynx.dat[1:90, c(1, 2, 4, 5, 6)]
colnames(larynx.dat) <- c("stage", "time", "age", "yr", "cens_time")
```

Note that if we have a censored observation, the time column will be `NA`,
and the cens_time column will contain the censoring time. I
also subsetted the data to the first 90 observations, as the last set of
observations in the data were used for different purposes. I will now
extract each column as a vector, since this is easier for JAGS to work with.

```r
stage <- larynx.dat$stage
t <- larynx.dat$time
age <- larynx.dat$age
yr <- larynx.dat$yr
c <- larynx.dat$cens_time
```

In order to deal with censoring in JAGS, we first will create a variable that
says whether or not our observation is censored.

```r
is.censored <- is.na(t)
```

We will also change our censoring time variable so that for any non-censored observations,
the variable `c` is greater than the observed time.

```r
c[!is.censored] <- t[!is.censored] + 1
```

The reason we do this is because JAGS
handles censored observations with the `dinterval()` function. For observation i,
our JAGS code will have a line like this:

```r
is.censored[i] ~ dinterval(t[i], c[i])
```

The `dinterval()` function will evaluate to 0 if the first argument is less than
or equal to the second argument, and will evaluate to 1 otherwise. Because is.censored
is 0 for our non-censored observations, we want t to be less than c for these subjects. When
is.censored is 1, because the `t` variable is `NA for the censored observations, JAGS
knows to impute a failure time that is greater than our censoring time for that observation.

Now let's write the Weibull and log-normal models in JAGS. Note that I will be using non-informative
priors. I will not explain every step in this model, since there are lots of
resources out there for learning JAGS. However, I also want to calculate
the log-likelihoods for each observation at each scan. For non-censored
observations, this is simply the log-density. For censored observations,
we must use the log of the survival function, which is the probability of obtaining a survival time
at least as extreme as our censoring time.

```r
larynx.weibull.model <- function() {
    for(i in 1:90){
        sAge[i] <- (age[i] - mean(age[])) / sd(age[])
        sYr[i] <- (yr[i] - mean(yr[])) / sd(yr[])
        is.censored[i] ~ dinterval(t[i], c[i])
        t[i] ~ dweib(shape, lambda[i])
        lambda[i] <- exp(-mu[i] * shape)
        mu[i] <- beta[1] + beta[2]*equals(stage[i], 2) +
            beta[3]*equals(stage[i], 3) + beta[4] * equals(stage[i], 4) +
            beta[5] *sAge[i] + beta[6] *sYr[i]

        ### calculate log-likelihoods
        y[i] <- ifelse(is.censored[i], c[i], t[i])
        loglik[i] <- log(ifelse(is.censored[i],
                                exp(-lambda[i] * (y[i] ^ shape)),
                                shape * lambda[i] * (y[i] ^ (shape - 1)) * exp(-lambda[i] * (y[i] ^ shape))))
    }

    ## priors for betas
    for(j in 1:6){
        beta[j] ~ dnorm(0, 0.001)
    }

    ### prior for shape
    shape ~ dgamma(.001, .001)

}

larynx.ln.model <- function() {
    for(i in 1:90){
        sAge[i] <- (age[i] - mean(age[])) / sd(age[])
        sYr[i] <- (yr[i] - mean(yr[])) / sd(yr[])
        is.censored[i] ~ dinterval(t[i], c[i])
        t[i] ~ dlnorm(mu[i], tau)
        mu[i] <- beta[1] + beta[2]*equals(stage[i], 2) +
            beta[3]*equals(stage[i], 3) + beta[4] * equals(stage[i], 4) +
            beta[5] *sAge[i] + beta[6] *sYr[i]

        ### log-likelihood
        y[i] <- ifelse(is.censored[i], c[i], t[i])
        loglik[i] <- log(ifelse(is.censored[i],
                                  1 - plnorm(y[i], mu[i], tau),
                                  dlnorm(y[i], mu[i], tau)))
    }

    ## priors for betas
    for(j in 1:6){
        beta[j] ~ dnorm(0, 0.001)
    }

    ### prior on precision
    tau ~ dgamma(.001, .001)
}
```

We can now fit the two models using the `R2jags` package. I set my parameter
vector to only return the draws for the coefficients at each scan, along
with the log-likelihoods. I will use 10,000 iterations, with a burn-in of 1000,
and a thinning parameter of 3. Each model should took my computer about 30
seconds to run.

```r
library(R2jags)
```

```
## Loading required package: rjags
```

```
## Loading required package: coda
```

```
## Linked to JAGS 4.2.0
```

```
## Loaded modules: basemod,bugs
```

```
##
## Attaching package: 'R2jags'
```

```
## The following object is masked from 'package:coda':
##
##     traceplot
```

```r
larynx.data <- c("t", "age", "yr", "c", "stage", "is.censored")
larynx.params <- c("beta", "loglik")

larynx.weibull.fit <- jags(data = larynx.data,
                           parameters.to.save = larynx.params,
                           n.chains = 1,
                           n.iter = 10000,
                           n.burnin = 1000,
                           n.thin = 3,
                           model.file = larynx.weibull.model)
```

```
## module glm loaded
```

```
## Compiling model graph
##    Resolving undeclared variables
##    Allocating nodes
## Graph information:
##    Observed stochastic nodes: 140
##    Unobserved stochastic nodes: 47
##    Total graph size: 2742
##
## Initializing model
```

```r
larynx.ln.fit <- jags(data = larynx.data,
                      parameters.to.save = larynx.params,
                      n.chains = 1,
                      n.iter = 10000,
                      n.burnin = 1000,
                      n.thin = 3,
                      model.file = larynx.ln.model)
```

```
## Compiling model graph
##    Resolving undeclared variables
##    Allocating nodes
## Graph information:
##    Observed stochastic nodes: 140
##    Unobserved stochastic nodes: 47
##    Total graph size: 2241
##
## Initializing model
```

We can compare the coefficient estimates as follows, using the `matrixStats` package.

```r
library(matrixStats)
weibull.paramlist <- larynx.weibull.fit$BUGSoutput$sims.list
ln.paramlist <- larynx.ln.fit$BUGSoutput$sims.list

### 2.5%, 50% and 97.% for weibull coefficients
colQuantiles(weibull.paramlist$beta, probs = c(.025, .5, .975))
```

```
##            2.5%         50%       97.5%
## [1,]  2.0650218  2.56100867  3.22255810
## [2,] -1.0698571 -0.15369496  0.81935225
## [3,] -1.4199184 -0.66998286  0.02309342
## [4,] -2.6029519 -1.67601729 -0.86959939
## [5,] -0.5473477 -0.20654198  0.09109159
## [6,] -0.2388373  0.07391305  0.41158055
```

```r
### 2.5%, 50% and 97.% for log-normal coefficients
colQuantiles(ln.paramlist$beta, probs = c(.025, .5, .975))
```

```
##            2.5%        50%      97.5%
## [1,]  1.7458899  2.3209185  3.0231148
## [2,] -1.2921459 -0.2410810  0.7543392
## [3,] -1.8559071 -0.9657416 -0.1884367
## [4,] -3.1281712 -2.0165055 -1.0512617
## [5,] -0.5608449 -0.2217514  0.1010787
## [6,] -0.2200562  0.1181072  0.5046185
```

We see that the two models return similar, but not identical, parameter estimates
for the different posterior quantiles. Before I show how to calculate the WAIC
for the two models, let me first show that JAGS does not take into account
censored observations into calculating DIC. The reason for this is due to us having to
enter censored observations as `NA` for our observed failure times (the t variable in the models).

Part of the DIC calculation is done using the deviance, defined as -2 * log-likelihood, at each scan. We can obtain the deviances for the log-normal model, calculated in JAGS, by doing

```r
jags.ln.dev <- ln.paramlist$deviance
```

and we can calculate the deviances with only the non-censored observations
as follows

```r
ln.loglik <- ln.paramlist$loglik
ln.observed.loglik <- ln.loglik[, !is.censored]

est.ln.dev <- -2 * rowSums(ln.loglik)
est.observed.ln.dev <- -2 * rowSums(ln.observed.loglik)
```

Comparing the deviances calculated with JAGS to the one using all of our observations,
we see that they are very different. However, using the deviances calculated from
the non-censored observations, we see that these are essentially the same as the ones
calculated in JAGS (minus rounding errors)

```r
summary(est.ln.dev - jags.ln.dev)
```

```
##        V1
##  Min.   :28.62
##  1st Qu.:43.99
##  Median :49.22
##  Mean   :49.66
##  3rd Qu.:54.60
##  Max.   :76.52
```

```r
summary(est.observed.ln.dev - jags.ln.dev)
```

```
##        V1
##  Min.   :-1.705e-13
##  1st Qu.:-5.684e-14
##  Median : 0.000e+00
##  Mean   :-1.032e-14
##  3rd Qu.: 2.842e-14
##  Max.   : 1.421e-13
```

Having shown this, I will finally show how to calculate the WAIC for each model with the
`loo` package. I've already extracted the log-likelihoods from the log-normal model above,
so I will first do the same for the Weibull model.

```r
weibull.loglik <- weibull.paramlist$loglik
```

Note that these log-likelihoods are matrices:

```r
dim(weibull.loglik)
```

```
## [1] 3000   90
```

```r
dim(ln.loglik)
```

```
## [1] 3000   90
```

Finally, we simply use the `waic()` function from the `loo` package to calculate the
WAICs.

```r
library(loo)
```

```
## This is loo version 1.1.0
```

```r
ln.waic <- waic(ln.loglik)
```

```
## Warning: 3 (3.3%) p_waic estimates greater than 0.4.
## We recommend trying loo() instead.
```

```r
weibull.waic <- waic(weibull.loglik)

compare(ln.waic, weibull.waic)
```

```
## elpd_diff        se
##      -0.2       1.7
```

After looking at the `compare` documentation, we see that a negative value
means that the first model, the log-normal model, has a higher predictive
accuracy.

Thanks for taking the time to read this, I hope you found it helpful! There are a lot of things that I glossed over in this post in order to not take up all of your time, so please get in contact if you have any
questions or comments.


text:
LogBook
---

- [ ] make commits as MONTHYEAR-commitNUMBER

# January 2018

In the following file, you will find the speakers for the coming year.
If you have any suggestions for speakers you would like to invite,
please add them to the list
https://docs.google.com/spreadsheets/d/1RaTlI4DA3GyGp_aCOVXzaAgqKxGSbCO5J_7ur5MKOms/

## Template TODO
- [ ] Activity _(CREATED:DayMonthYear SORTED:DayMonthYear COMMIT(s): )_

## TODO LIST

- [ ] organise logbook file  _(CREATED:21january2018 SORTED:DayMonthYear COMMIT(s): )_

- [ ] Attendance to the presentations will be monitored and every term, prizes will be
given for best presentation. (This is only a suggestion and it does not require
  to the audience to be present in all the seminars)
  _(CREATED:21january2018 SORTED:DayMonthYear COMMIT(s): )_

- [ ] The 2-3 volunteers will chair the seminar sessions, take attendance,
gather feedback and help in nominating researchers for prizes.
(This is only a suggestion to be consider in coming seminars)
_(CREATED:21january2018 SORTED:DayMonthYear COMMIT(s): )_

- [ ] Advertise the seminar via talks@bham to get a wider audience.
(This is only a suggestion to be consider in coming seminars)
_(CREATED:21january2018 SORTED:DayMonthYear COMMIT(s): )_

- [ ] Contact mexgrocer for the prizes for the best presentation, Mexican
snacks and a present for the monthly speaker.
(This is only a suggestion to be consider in coming seminars)
_(CREATED:21january2018 SORTED:DayMonthYear COMMIT(s): )_

- [ ] contact previous speakers to ask them about the missing information
of their profiles in the website.
> Dear
We have noticed that there are some missing information about your profile
(slides, abstract and bio) in the website of the science seminars of the
Mexican society. Would you be kindly enough to share such information.
We want that the visitors of the website find reliable and useful information

- [ ] Decide where to share the slides of the presentations, the options are:
https://figshare.com/ https://gitpitch.com/,  https://issuu.com/. _(CREATED:13Dec2017 SORTED:DayMonthYear COMMIT(s): )_

- [ ] Create the members site

- [ ] Create google form or doodle form for the speakers. Something like [this](https://www.youtube.com/watch?v=bWN4W2aE0Y0)

- [ ] Create a search bar like the one in ciudaddelasideas in order to have the following
bar: SEARCH[]  CATEGORIES[] YEAR[]. This is the example https://www.ciudaddelasideas.com/ponentes.php

- [ ] Explore /docs in the seminars repository

- [ ] Create a gmail account:

MexicanSociety
UniversityOfBirmingham
MexicanSocietyUoB
@gmail.com

I tried to create such account, however the google policies mentioned that each
gmail account has to be linked to a mobile number to which I would not be able
to create the account. just for the record I tried some Online SMS Verification
Sites but none of the work on August 2017 for which I am going to use my
personal gmail account to create the forms for the time slots for the
presenters.

- [ ] Add comments section / https://mmistakes.github.io/minimal-mistakes/docs/configuration/#front-matter-defaults

Step 1. Add Staticman to your repository

https://api.staticman.net/v2/connect/{your GitHub username}/{your repository name}
https://api.staticman.net/v2/connect/MexicanSocietyUoB/seminars

OK

MORE
https://staticman.net/docs/index.html

Step 4. Approve entries (optional)

If you enable content moderation (by setting moderation: true in the config), I will send a pull request whenever a new entry is submitted. Merge the pull request to approve it, or close to discard.

Continue the exploration to make it work on the following links https://github.com/mmistakes/minimal-mistakes/issues/1308#issuecomment-337437135

##  Possible Speakers for 2017/2018
 - [ ] ~~Marco~~ (thesis stage),
 - [ ] Marisol,
 - [ ] Samantha,
 - [ ] Ana Quevedo,
 - [ ] Fabricio,
 - [ ] ~~Fernanda~~ (back to mex in jan2018),
 - [ ] ~~Frida~~ (talk in december 2017),
 - [ ] ~~Jorge~~ (talk in october 2017),
 - [ ] Gerardo,
 - [ ] Xuan,
 - [ ] ~~Perla~~ (talk in March 2017)

# ADDITIONALS
- [ ]  Update or create  the website for the MexSoc at UoB https://mexicansocietyuob.wordpress.com/

# SORTED

 - [x] fixed the links for the presenters
 - [x] use splash layout for the home page
 - [x] Change the main background image of the seminars for the poster seminars
 - [x] Create a list for possible speakers for next term

repository: MexicanSocietyUoB/seminars

repo_name: MexicanSocietyUoB/seminars


text:
# Usage
Tiller can be used to dynamically generate configuration files based on ERb templates before passing execution over to a daemon process or other command. It is usually used inside a Docker container as the `CMD` or `ENTRYPOINT` process.

In a basic use-case, when you are bundling your templates and configuration inside the container, all you need to do is tell Tiller which environment you want to use e.g.

```
$ docker run -ti -e environment=staging my-application:latest
tiller v1.0.0 (https://github.com/markround/tiller<EMAIL_ADDRESS>Using common.yaml v2 format configuration file
Using configuration from /etc/tiller
Using plugins from /usr/local/lib/tiller
Using staging development
Template sources loaded [FileTemplateSource]
Data sources loaded [FileDataSource]
Available templates : ["application.erb"]
Building template application.erb
Not running as root, so not setting ownership/permissions on /etc/application.ini
Template generation completed
Executing ["/usr/sbin/my_application"]...
Child process forked with PID 87560
```

If no environment is specified, it will default to using "development".

# A word about configuration
Tiller uses YAML for configuration files. If you're unfamiliar with YAML, don't worry - it's very easy to pick up. A good introduction is here : ["Complete idiot's introduction to YAML"](https://github.com/Animosity/CraftIRC/wiki/Complete-idiot's-introduction-to-yaml)

Prior to Tiller v0.7, configuration was spread out over several files. If you had 3 environments (e.g. dev, stage and prod), you'd have a `common.yaml` for main configuration, one yaml file for each of your environments (`dev.yaml`,`stage.yaml` and so on), and possibly more depending on which plugins you'd enabled (`defaults.yaml` etc.)

However, 0.7 and later versions allow you to place most configuration inside a single `common.yaml` file, which can make things a lot clearer - you have a single place to view your configuration at once. I have therefore updated the documentation to cover this new style as the preferred approach. See [this blog post](http://www.markround.com/blog/2015/09/07/tiller-0-dot-7-0-and-simpler-configuration-files/) for an example.

Of course, you can always use the old "one file for each environment" approach if you prefer. Tiller is 100% backwards compatible with the old approach, and I have no intention of removing support for it as it's very useful in certain circumstances. The only thing to be aware of is that you can't mix the two configuration styles: If you configure some environments in `common.yaml`, Tiller will ignore any separate environment configuration files.

# Arguments
Tiller understands the following *optional* command-line arguments (mostly used for debugging purposes) :

* `-n` / `--no-exec` : Do not execute a child process (e.g. you only want to generate the templates)
* `-v` / `--verbose` : Display verbose output, useful for debugging and for seeing what templates are being parsed
* `-d` / `--debug` : Enable additional debug output
* `-b` / `--base-dir` : Specify the tiller_base directory for configuration files
* `-l` / `--lib-dir` : Specify the tiller_lib directory for user-provided plugins
* `-e` / `--environment` : Specify the tiller environment. This is usually set by the 'environment' environment variable, but this may be useful for debugging/switching between environments on the command line.
* `-a` / `--api` : Enable the HTTP API (See below)
* `-p` / `--api-port` : Set the port the API listens on (Default: 6275)
* `-x` / `--exec` : Specify an alternate command to execute, overriding the exec: parameter from your config files
* `-h` / `--help` : Show a short help screen
* `--md5sum` : Only write templates if they do not already exist, or their content has changed (see [below](#checksums)).
* `--md5sum-noexec` : If no templates were written/updated, do not execute any  process.

repository: schuylr/tiller

repo_name: schuylr/tiller


text:
## Luhn-Check

a Tiny Credit Card Validation module.

[![browser support](https://ci.testling.com/meandavejustice/luhn-check.png)](https://ci.testling.com/meandavejustice/luhn-check)

[![NPM](https://nodei.co/npm/luhn-check.png?downloads=true)](https://nodei.co/npm/luhn-check/)

* perfect for the browser
* perfect for the server

## Developers

* `npm i`
* `npm test`

repository: meandavejustice/luhn-check

repo_name: meandavejustice/luhn-check


text:
![DyDaQ](../images/dydaq.png)

### Metadata Class Generation

sample Metadata class generated based on the Root Entity Doctor:

![](../images/DyDaQBasics3.png)

* For dynamic query generations, we need to pass the graph levels, and columns to be used for joining graphs.
* Graph Levels are the different pojo/entity levels in the request payload from which fields are requested. They follow some specific naming conventions.
* Metadata Generator provides us utility to generate these Graph levels constant class and the columns names on basis of which we are joining the tables/graphs.

***

1. Declare root entities by adding annotation @RootEntity to the entity class which you want to keep as root object of the entity/create a join table.

2. Add the plugin **graphql-ddq-plugin** with other supporting tags as below for dynamic query Meta Class Generation and change source(Dynamic Query Entity package) and destination(destination for Meta data class) package:

```xml
<build>
    <resources>
        <resource>
            <directory>src/main/resources</directory>
        </resource>
    </resources>
    <!-- Plugin for Dynamic Query meta data generation -->
    <plugins>
        <plugin>
            <groupId>com.americanexpress.dydaq</groupId>
            <artifactId>graphql-ddq-plugin</artifactId>
            <version>1.0.0</version>
            <configuration>
              <sourcePackage>com.americanexpress.dydaq.datagraph.dto</sourcePackage>
              <!--for creating meta constant files for specific class provide class name inside sourceclassList tag as below else don't add the tag and all classes will be processed-->
              <sourceClassList>Surgeon.java,Hospital.java</sourceClassList>
              <destinationPackage>com.americanexpress.dydaq.datagraph.util</destinationPackage>
            </configuration>
            <goals>
              <goal>graphql-ddq-dquery</goal>
            </goals>
        </plugin>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>repackage</goal>
                        </goals>
                        <!--: Comment this after DDQ Plugin execution: Begin-->
                        <configuration>
                            <classifier>exec</classifier>
                        </configuration>
                        <!--: END-->
                    </execution>
                </executions>
        </plugin>
    </plugins>
</build>
```

3. Remove entity and table related annotations and annotate the entities as @MappedSuperClass.

With the above steps entity MappedSuperClass is generated which has all the columns of the table for which entity needs to be created. MappedSuperClass be extended to give a concrete implementation of the table. Multiple implementations can  be provided based on different association requirements.

4. For Generating Metadata class run below maven command (Ignore Warning) and confirm the destination package has the required class generated.If you want to generate Meta class for few files only,you can provide the classes inside sourceClassList tag.

    `mvn install graphql-ddq-plugin`

5. Metadata class will be generated in the location mentioned in the destinationPackage by reading the root entities from the source package.

***

**How to use Meta classes**

Suppose you have below class hierarchy :

```java
@RootEntity
public class Hospital extends HospitalBase{
    Surgeon surgeon;
    //setter and getter
}

@ChildEntity
public class Surgeon extends SurgeonBase{
    Speciality speciality;
    //setter getters
}
```

Once using above 5 steps the Meta files are generated (with "Meta" appended in the root entity in destination folder) and we should be able to access the constants as below :

1. For accessing graph level of Root entity :

String graphLevelForRootEntity = HospitalMeta.GRAPH_LEVEL;

2. For accessing graphlevel of child entity Surgeon inside Hospital entity:

String graphLevelForSurgeonEntity = HospitalMeta.Surgeon.GRAPH_LEVEL

3. For accessing columns of HospitalEntity :

String columnNameOfHospitalEntity = HospitalMeta.AllColumns.{COLUMN_NAME}

Similarly Columns annotated as @DynamicJoinColumns can be accessed via JoinColumn inner class and Columns annotated with Ids can be accessed via Keys class.

repository: mdtamim/dydaq

repo_name: mdtamim/dydaq


text:
---
layout: article
title: Basic Image Classification with Julia on Google Colab
coverPhoto: /assets/posts/2020-02-04/flux_julia_colab_logo.png
---

## TLDR

Check out my [ML Flux on Colab Tutorial](https://github.com/GdMacmillan/ml_flux_tutorial)! If you click on the .ipynb file in github, it contains a link to the Colab notebook at the top of the rendered notebook.

## Motivation

I happened to be browsing the Julia community discourse forums and came across this post:

[flux-jl-vanilla-ann-loss-goes-to-nan-with-mini-batch](https://discourse.julialang.org/t/flux-jl-vanilla-ann-loss-goes-to-nan-with-mini-batch/25511)

After seeing this, I wanted to build a small relatively easy example in order to show the core components you can build with Flux. With this in mind, I set out to try and repeat some work I [had seen](https://discourse.julialang.org/t/julia-on-google-colab-free-gpu-accelerated-shareable-notebooks/15319) where some enterprising soul had set out to re-create a Julia kernel using the popular Google Colaboratory free Jupyter notebook environment. I also wanted to test Julia and ML Flux on a GPU to see if I could write a basic ad-hoc training workflow.

## Julia Programming Language

[Julia](https://docs.julialang.org/en/latest/) is a high performance dynamic language. Types in Julia are [a property of values not expressions](https://stackoverflow.com/questions/28078089/is-julia-dynamically-typed) i.e. the language does not set expectations for assigned types before executing expressions. Many people believe there is a good reason to prefer this type of execution model when it comes to applications in scientific and high performance computing.

One of the goals of the Julia development community is to provide a flexible language that eliminates the need for separating prototyping and deployment environments. The Julia programming language fulfills this requirement by allowing developers to work on scientific and numerical computing and then deploy code which runs nearly as fast as traditional statically-typed languages.

## Flux

[Flux](https://fluxml.ai/Flux.jl/stable/) comes prebuilt with a variety of tools needed to build machine learning workflows. Install by typing `] add Flux` in your Julia based IDE. If you have CUDA, you can also run `] add CuArrays` to get GPU support. The notebook built for this explainer uses several other packages as well as Flux but the core methods are created using Flux and CuArrays. If you want to build deep learning models for your project, Flux is a good library to start with.

## Google Colab

What is [Colab](https://colab.research.google.com)? I will let the official platform documentation do the explaining. As far as what Data Scientists like to use it for? Well, it arguably provides the best platform on the web for students, engineers and otherwise curious individuals to play around with some seriously great hardware. Documents (Ipython notebooks) can be read or created and stored/executed with just a Google account. There are [Python helpers built by Google](https://colab.research.google.com/notebooks/io.ipynb) to help with connecting to data stored in either Drive or Gcloud. The most popular Python modules come pre-installed in an Anaconda environment and there is even access to bash so you can access the filesystem for more control over your environment. This is how we are able to install Julia and packages required to do deep learning.

## What is Deep Learning?

You may, as I was several years ago, be wondering what is Deep Learning and how could I possibly understand it. The first example of an artificial neural network is thought to have been created by Frank Rosenblatt with the multi-layered perceptron in 1957.

![Multilayer perceptron]({{ site.url }}/assets/posts/2020-02-04/multilayer_perceptron.png)

This form of deep learning was heralded as a turning point in history, from which we would be creating machines that could walk, talk, think and reason about things just as humans do. That could still end up being true, but as of now, modern learning systems must be highly specialized. To perform well, a learning system can not be fed an input which deviates from the expected data type. In the simple case, this means an image classifier must be fed images, an audio classifier, audio, etc... There are various methods which use a backbone neural net to convert data from one form to another, but in each case, we may have a set of inputs X that maps to an output set y.

![Feature mapping]({{ site.url }}/assets/posts/2020-02-04/feature_mapping.png)

### Artificial Neural Netork (NN)

In essence a Neural Network can recognize patterns from complex inputs such as image, audio, video, text and human speech data.

Input samples are passed into NN's creating a set of on-off activations encoding many possible states. Network topology influences the number of ideas or cumulative abstraction applied. Weights are trained to learn input patterns that should map similar states or to features which encode a specific output.

## Conclusion

Because the internet is such a beautiful network of information and there are more qualified people, whose job is in teaching complex mathematical topics, I will offer some links to tools and resources I have used. Again, take a look at the notebook and I encourage you to play around and experiment with it.

* [Neural Networks Intro](https://github.com/sallamander/neural-networks-intro)

* [Lenet](http://deeplearning.net/tutorial/lenet.html)

* [CS231N](http://cs231n.github.io)

A couple of my python projects with deep learning examples:

* [biological image classification](https://github.com/GdMacmillan/kaggle-protein-classification)

* [text classification](https://gitlab.com/denver-ml/kaggle-toxic-comments).

* Small library built using Numpy and Tensorflow: [Pypi](https://pypi.org/project/LensFlare/)


text:
# Installation
> `npm install --save @types/redux-promise`

# Summary
This package contains type definitions for redux-promise (https://github.com/acdlite/redux-promise).

# Details
Files were exported from https://www.github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/redux-promise

Additional Details
 * Last updated: Wed, 25 Oct 2017 18:38:05 GMT
 * Dependencies: redux
 * Global values: none

# Credits
These definitions were written by Rogelio Morrell Caballero <https://github.com/molekilla>, Kaur Kuut <https://github.com/xStrom>.

gha_language: CSS


text:
# hast-util-raw

[![Build][build-badge]][build]
[![Coverage][coverage-badge]][coverage]
[![Downloads][downloads-badge]][downloads]
[![Size][size-badge]][size]
[![Sponsors][sponsors-badge]][collective]
[![Backers][backers-badge]][collective]
[![Chat][chat-badge]][chat]

[**hast**][hast] utility to parse the [*tree*][tree] again, now supporting
embedded `raw` nodes.

One of the reasons to do this is for “malformed” syntax trees: for example, say
there’s an `h1` element in a `p` element, this utility will make them siblings.

Another reason to do this is if raw HTML/XML is embedded in a syntax tree, which
can occur when coming from Markdown using [`mdast-util-to-hast`][to-hast].

If you’re working with [**remark**][remark] and/or
[`remark-rehype`][remark-rehype], use [`rehype-raw`][rehype-raw] instead.

## Install

[npm][]:

```sh
npm install hast-util-raw
```

## Use

```js
var h = require('hastscript')
var raw = require('hast-util-raw')

var tree = h('div', [h('h1', ['Foo ', h('h2', 'Bar'), ' Baz'])])

var clean = raw(tree)

console.log(clean)
```

Yields:

```js
{ type: 'element',
  tagName: 'div',
  properties: {},
  children:
   [ { type: 'element',
       tagName: 'h1',
       properties: {},
       children: [Object] },
     { type: 'element',
       tagName: 'h2',
       properties: {},
       children: [Object] },
     { type: 'text', value: ' Baz' } ] }
```

## API

### `raw(tree[, file])`

Given a [**hast**][hast] [*tree*][tree] and an optional [vfile][] (for
[positional info][position-information]), return a new parsed-again
[**hast**][hast] [*tree*][tree].

## Security

Use of `hast-util-raw` can open you up to a [cross-site scripting (XSS)][xss]
attack as `raw` nodes are unsafe.
The following example shows how a raw node is used to inject a script that runs
when loaded in a browser.

```js
raw(u('root', [u('raw', '<script>alert(1)</script>')]))
```

Yields:

```html
<script>alert(1)</script>
```

Do not use this utility in combination with user input or use
[`hast-util-santize`][sanitize].

## Related

*   [`mdast-util-to-hast`](https://github.com/syntax-tree/mdast-util-to-hast)
    — transform mdast to hast
*   [`rehype-raw`](https://github.com/rehypejs/rehype-raw)
    — wrapper plugin for [rehype](https://github.com/rehypejs/rehype)

## Contribute

See [`contributing.md` in `syntax-tree/.github`][contributing] for ways to get
started.
See [`support.md`][support] for ways to get help.

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

## License

[MIT][license] © [Titus Wormer][author]

<!-- Definitions -->

[build-badge]: https://img.shields.io/travis/syntax-tree/hast-util-raw.svg

[build]: https://travis-ci.org/syntax-tree/hast-util-raw

[coverage-badge]: https://img.shields.io/codecov/c/github/syntax-tree/hast-util-raw.svg

[coverage]: https://codecov.io/github/syntax-tree/hast-util-raw

[downloads-badge]: https://img.shields.io/npm/dm/hast-util-raw.svg

[downloads]: https://www.npmjs.com/package/hast-util-raw

[size-badge]: https://img.shields.io/bundlephobia/minzip/hast-util-raw.svg

[size]: https://bundlephobia.com/result?p=hast-util-raw

[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg

[backers-badge]: https://opencollective.com/unified/backers/badge.svg

[collective]: https://opencollective.com/unified

[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg

[chat]: https://github.com/syntax-tree/unist/discussions

[npm]: https://docs.npmjs.com/cli/install

[license]: license

[author]: https://wooorm.com

[contributing]: https://github.com/syntax-tree/.github/blob/HEAD/contributing.md

[support]: https://github.com/syntax-tree/.github/blob/HEAD/support.md

[coc]: https://github.com/syntax-tree/.github/blob/HEAD/code-of-conduct.md

[tree]: https://github.com/syntax-tree/unist#tree

[position-information]: https://github.com/syntax-tree/unist#positional-information

[hast]: https://github.com/syntax-tree/hast

[to-hast]: https://github.com/syntax-tree/mdast-util-to-hast

[vfile]: https://github.com/vfile/vfile

[remark]: https://github.com/remarkjs/remark

[remark-rehype]: https://github.com/remarkjs/remark-rehype

[rehype-raw]: https://github.com/rehypejs/rehype-raw

[xss]: https://en.wikipedia.org/wiki/Cross-site_scripting

[sanitize]: https://github.com/syntax-tree/hast-util-sanitize

gha_language: HTML


text:
# IEDC-Tech-Trainees
Repo for Submission of tasks for IEDC Tech Team Trainees final round

## How to submit your project

1) Fork this repo - Click on the fork button on the top-right of this page
2) Clone the forked repo to your local machine
```
git clone https://github.com/<your_github_username>/IEDC-Tech-Trainees.git
```
3) Navigate into the respective task folder
4) Create a new folder there with folder name as <yourName_yourClass> and put your entire project in this folder
5) Add your changes using git
```
git add .
```
6) Commit your changes using git
```
git commit -m "Added <your_name> Project"
```
7) Push the changes to Github
```
git push
```
8) Go to your fork on github and click on Pull request
9) Create a New Pull Request to the main repo with title as "Submitting <yourName_yourClass>"
10) That's it, Done!!

repository: adithyaanilkumar/IEDC-Tech-Trainees

repo_name: adithyaanilkumar/IEDC-Tech-Trainees


text:
# Airship SDK for iOS

The Airship SDK for iOS provides a simple way to integrate Airship
services into your iOS applications.

## Resources
- [AirshipCore Docs](https://docs.airship.com/reference/libraries/ios/latest/AirshipCore)
- [AirshipBasement Docs](https://docs.airship.com/reference/libraries/ios/latest/AirshipBasement/)
- [AirshipAutomation Docs](https://docs.airship.com/reference/libraries/ios/latest/AirshipAutomation)
- [AirshipExtendedActions Docs](https://docs.airship.com/reference/libraries/ios/latest/AirshipExtendedActions)
- [AirshipMessageCenter Docs](https://docs.airship.com/reference/libraries/ios/latest/AirshipMessageCenter)
- [AirshipPreferenceCenter Docs](https://docs.airship.com/reference/libraries/ios/latest/AirshipPreferenceCenter)
- [AirshipNotificationServiceExtension Docs](https://docs.airship.com/reference/libraries/ios/latest/AirshipNotificationServiceExtension)
- [AirshipNotificationContentExtension Docs](https://docs.airship.com/reference/libraries/ios/latest/AirshipNotificationContentExtension)
- [Getting started guide](http://docs.airship.com/platform/ios/)
- [Migration Guides](https://github.com/urbanairship/ios-library/tree/main/Documentation/Migration)

repository: urbanairship/ios-library

gha_language: Swift

repo_name: urbanairship/ios-library