text:
- [![npm version](https://badge.fury.io/js/spiraljs.svg)](https://badge.fury.io/js/spiraljs)
- [![Build Status](https://travis-ci.org/nlesc-sherlock/spiraljs.svg?branch=master)](https://travis-ci.org/nlesc-sherlock/spiraljs)
- [![bitHound Overall Score](https://www.bithound.io/github/nlesc-sherlock/spiraljs/badges/score.svg)](https://www.bithound.io/github/nlesc-sherlock/spiraljs)
- [![bitHound Dependencies](https://www.bithound.io/github/nlesc-sherlock/spiraljs/badges/dependencies.svg)](https://www.bithound.io/github/nlesc-sherlock/spiraljs/master/dependencies/npm)
- [![bitHound Dev Dependencies](https://www.bithound.io/github/nlesc-sherlock/spiraljs/badges/devDependencies.svg)](https://www.bithound.io/github/nlesc-sherlock/spiraljs/master/dependencies/npm)
- [![bitHound Code](https://www.bithound.io/github/nlesc-sherlock/spiraljs/badges/code.svg)](https://www.bithound.io/github/nlesc-sherlock/spiraljs)
- [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)

_this library is still a work in progress_

The sibling repository [https://github.com/nlesc-sherlock/spiraljs-demo](https://github.com/nlesc-sherlock/spiraljs-demo) contains various examples of how spiraljs can be used.

Find the TypeDoc [here](http://nlesc-sherlock.github.io/spiraljs/sites/tsdoc/).

# codepen.io live examples

- [``BubbleSpiral``](http://codepen.io/jspaaks/pen/mOjeda)

# Gallery (static images)

## ArcSpiral

![ArcSpiral-example.png](https://github.com/nlesc-sherlock/spiraljs/raw/master/docs/ArcSpiral-example.png "ArcSpiral-example.png")

## BubbleSpiral

### with ``color_map``

![BubbleSpiral-with-colormap-example.png](https://github.com/nlesc-sherlock/spiraljs/raw/master/docs/BubbleSpiral-with-colormap-example.png "BubbleSpiral-with-colormap-example.png")

### with ``radius_map``

![BubbleSpiral-with-radiusmap-example.png](https://github.com/nlesc-sherlock/spiraljs/raw/master/docs/BubbleSpiral-with-radiusmap-example.png "BubbleSpiral-with-radiusmap-example.png")

## LineSpiral

![LineSpiral-example.png](https://github.com/nlesc-sherlock/spiraljs/raw/master/docs/LineSpiral-example.png "LineSpiral-example.png")

## TimedBubbleSpiral

TODO

# Documentation for users

Installation of the library through ``npm`` in the normal way:
```
npm install spiraljs
```

See also:

- GitHub [repo](http://github.com/nlesc-sherlock/spiraljs-demo) with a website illustrating spiraljs;
- [code coverage](http://nlesc-sherlock.github.io/spiraljs/sites/coverage/remapped/src/index.html);
- [documentation](http://nlesc-sherlock.github.io/spiraljs/sites/tsdoc/);

# Documentation for developers

(this section describes the complete repository on GitHub, only part of which is included in the package on https://www.npmjs.com/package/spiraljs).

## Setting up, building and running

Get a local copy of the spiraljs repository using ``git``:

```bash
# use package manager to install git
sudo apt-get install git

# make a local copy of this repository
git clone https://github.com/nlesc-sherlock/spiraljs.git

# change into spiraljs directory
cd spiraljs
```

Download dependencies:

```bash
# Assuming you already have ``npm`` installed on your system, install with:
npm install
```

We use ``npm`` for the various build tasks (see ``scripts`` in ``packages.json`` for the complete list and their definitions). Here's a summary of the most relevant tasks (see also below for the dependency graph):

```bash
# make a distributable js file, spiral.js
npm run dist

# run the unit tests against the distributable
npm run test

# do all types of linting:
# tslint on the TypeScript from src/
# csslint on the CSS from src/
# jslint and jshint on the JS from test/
npm run lint

# clean up generated files
npm run clean

# do an npm run clean and additionally throw away any downloaded files
npm run purge

# generate the TypeDoc, inspect afterwards in a browser (output will be at <projectroot>/docs/sites/tsdoc)
npm run tsdoc

# generate code coverage in various formats. output will be at <projectroot>/docs/sites/coverage/, e.g.
# <projectroot>/docs/sites/coverage/remapped/ts/spiraljs/index.html
npm run cover

```

## How it all fits together

### General

So you wrote some **source code**. A **distributable** can be created from the source code. Distributables are great, because that's what people can use in their own websites later. However, distributables are only good if they work --you don't want to break other people's websites, now do you? So, the distributable needs to be tested using **unit tests**. For this you typically need to do two things: first, you need to be able to do **assertions**. Assertions help you test different kinds of equality (''is the test result what it is supposed to be?''). Secondly, you need a  **test runner**, i.e. something that runs the tests (and then, typically, reports on their results). Now that you have tests, you also want to generate **code coverage** reports. Code coverage helps to make transparent which parts of the code are covered by tests.

### In our case

- Our **source code** lives at ``src``. The meat of it is written in TypeScript 2.
- We create the **distributable** using ``npm run`` scripting, so there are no Gulp or Grunt files.
- We use **unit tests** written in the style of [``Jasmine``](http://jasmine.github.io/2.0/introduction.html) (i.e. ``describe()`` and ``it()``).
- Our **assertion** library is also [``Jasmine``](http://jasmine.github.io/2.0/introduction.html) (e.g. ``expect(actual).toEqual(expected)``).
- [Karma](https://karma-runner.github.io/1.0/index.html) is our **test runner**.
- We generate code coverage in different formats using [``karma-coverage``](https://www.npmjs.com/package/karma-coverage). However, this gives us code coverage of the (generated) JavaScript, which is not really what we're interested in. So we have [``remap-istanbul``](https://www.npmjs.com/package/remap-istanbul) figure out which parts of the generated JavaScript correspond with which parts of the (written) TypeScript.

Here is a visual representation of our build process:

![visual-description-of-setup.png](https://github.com/nlesc-sherlock/spiraljs/raw/master/docs/visual-description-of-setup.png "visual-description-of-setup.png")

and here is a callgraph generated from [package.json](https://github.com/nlesc-sherlock/spiraljs/blob/master/package.json) using [https://github.com/jspaaks/npm-scripts-callgraph](https://github.com/jspaaks/npm-scripts-callgraph):

![callgraph.png](https://github.com/nlesc-sherlock/spiraljs/raw/master/docs/callgraph.png "callgraph.png")

repository: DomenicoMammola/spiraljs

repo_name: DomenicoMammola/spiraljs


text:
---
description: Combine the Gnosis Safe with Snapshot
---

# SafeSnap

With help of SafeSnap and Gnosis Safe, you can have a trustless on-chain execution of off-chain votes.

{% embed url="https://blog.gnosis.pm/introducing-safesnap-the-first-in-a-decentralized-governance-tool-suite-for-the-gnosis-safe-ea67eb95c34f" %}

## Setup

Here is the official guide on how to setup a SafeSnap for your project:

{% embed url="https://github.com/gnosis/dao-module/blob/main/docs/setup\_guide.md" %}

Learn more about SafeSnap in this video:

{% embed url="https://www.youtube.com/watch?v=ncDeEuJfVkg" %}

license: MIT

repository: octavioamu/snapshot-docs

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: octavioamu/snapshot-docs


text:
---
layout: post
title: Identity and Violence
authors: Amartya Sen

---

- **Book Title**: Identity and Violence - The Illusion of Destiny
- **Author**: [Amartya Sen](http://en.wikipedia.org/wiki/Amartya_Sen)
- **About the Author**: 1998 Economics Nobel Laureate
- **Year written/published**: 2006
- **My Comments**: Great insight!
- **Contents page**:

1.  The Violence of Illusion
2. Making Sense of Identity
3. Civilisational Confinement
4. Religious Affiliations and Muslim History
5. West and Anti-West
6. Culture and Captivity
7. Globalisation and Voice
8. Multiculturism and Freedom
9. Freedom to Think

Some extracts: How similar are we all...

> Oscar Wilde made the enigmatic claim, “Most people are other people”… … defended his view with considerable cogency: “Their thoughts are someone else’s opinions, their lives a mimicry, their passions a quotation.” We are indeed influenced to an amazing extent by people with whom we identify. Actively promoted sectarian hatreds can spread like wildfire… … … With suitable instigation, a fostered sense of identity with one group of people can be made into powerful weapon to brutalise another.

Religions…

> Increasing reliance of religion-based classification of the people opf the world also tends to made the Western response to global terrorism and conflict peculiarly ham-handed. Respect for “other people” is shown by praising their religious books, rather than by taking note of the many-sided involvements and achievements, in nonreligious as well as religious fields, of different people in a globally interactive world.

Conflicts…

> The conflict between the priorities and demands of different identities can be significant both for contrasting and more non-contrasting categories. It is not so much that a person has to deny one identity to give priority to another, but rather that a person with plural identities has to decide, in case of conflict, on a relative importance of the different identities for the particular decision in question. Reasoning and scrutiny can thus play a major role both in the specification of identities and in thinking through the relative strengths of their respective claims.

Global roots of democracy

> Similarly, democracy is often seen as a quintessentially Western idea which is alien to the non-western world. That civilisational simplification has received some encouragement by the US led coalition in establishing a democratic system of government in Iraq.

Schools, reasoning and faith

> Rather than reducing existing state0financed faith based schools, actually adding other to them - Muslims schools, Hindu schools, the Sikh schools to pre-existing Christian ones 0 can have the effect of reducing the role of reasoning which the children may have the opportunity to cultivate and use. And this is happening at a time when there is a great need for broadening the horizon of understanding of other people and other groups, and when the ability to undertake reason decision making is of particular importance.

repository: sayanee/books

gha_language: HTML

gha_license_id: MIT

repo_name: sayanee/books


text:
# How to add a new model to the gallery

1. Make sure you start from the master branch.
1. Create a directory in `problems` and put the files `description.txt`, `script.jl`, and `url.txt` in it. See [problems/LaserTag](problems/LaserTag) for an example.
    - `url.txt` should be the URL for a git repository (or other website) for the model.
    - `description.txt` should be a short description of the problem
    - `script.jl` should be a short Julia script that creates `out.gif` assuming that julia is executed with the environment in the problem directory.
2. Use Pkg to create a `Project.toml` and `Manifest.toml` to specify the dependency environment.
2. Generate `README.md` by running `POMDPGallery.gen_readme()`.
3. Submit a pull request with all of the new and updated files.

gha_language: Julia

gha_license_id: NOASSERTION


text:
---
title: "Module 3: Amazon EKS Cluster Networking"
chapter: true
weight: 30
pre: "<b>3. </b>"
---

## Objectives:

* Examine major components of AWS VPC routed CNI and demonstrate how it handles traffic for:
  * Pod to Pod communication
* Examine  the communication channels between Amazon EKS Kubernetes Control Plane and Customer worker nodes.

## Overview
* Perform intra-node Pod to Pod communication and exam the major components involved in the life of a ping packet
* Perform inter-node Pod to Pod communication and exam the major components involved in the life of a ping packet
* Exam the IPtable for kubernete services

gha_language: CSS


text:
---
title: rawavg Function
keywords: query language reference
tags: [reference page]
sidebar: doc_sidebar
permalink: ts_rawavg.html
summary: Reference to the rawavg() function
---
## Summary
```
rawavg(<expression>[,metrics|sources|sourceTags|tags|<pointTagKey>])
```
Returns the average (the mean) of all series. In contrast to `avg()`, `rawavg()` does not use interpolation to fill gaps in the data.

## Parameters

Parameter	Description

 [expression](query_language_reference.html#expressions)
Expression to create an average (mean) for.

metrics|sources|sourceTags|tags|<pointTagKey>
Optional additional expressions to include in the average. You can use these expressions to group the results.

## Description

The `rawavg()` function aggregates any values that are truly reported at a given time slice across all reported series. The function displays the average total value as a single line on a chart.

If you want to group the results, you can use one of the optional arguments. For example, suppose you want to see the request latency for all sources.

Using `rawavg()` instead of `avg()` can significantly improve query performance.

## Example

The following example shows the raw average for sample requests, grouped by the `az` tag, which indicates the region to which the hosts below to.

![raw average](images/ts_rawavg.png)

## See Also
[Detecting Anomalies With Functions and Statistical Functions](query_language_statistical_functions_anomalies.html#mean-and-median)
[The align() Function](https://docs.wavefront.com/query_language_align_function.html)

repository: humphreyh/docs

repo_name: humphreyh/docs


text:
# horizon-youtube-mp3

Get info and download MP3 audio from youtube videos in node.js using horizon-youtube-mp3.

I developed this module to simplify how you convert a video directly to mp3. It was developed for a project called Horizon Mp3 Converter which will be available soon for online use.

### Prerequisites

#### ffmpeg and ffprobe

fluent-ffmpeg requires ffmpeg >= 0.9 to work.  It may work with previous versions but several features won't be available (and the library is not tested with lower versions anylonger).

If the `FFMPEG_PATH` environment variable is set, fluent-ffmpeg will use it as the full path to the `ffmpeg` executable.  Otherwise, it will attempt to call `ffmpeg` directly (so it should be in your `PATH`).  You must also have ffprobe installed (it comes with ffmpeg in most distributions).  Similarly, fluent-ffmpeg will use the `FFPROBE_PATH` environment variable if it is set, otherwise it will attempt to call it in the `PATH`.

Most features should work when using avconv and avprobe instead of ffmpeg and ffprobe, but they are not officially supported at the moment.

**Windows users**: most probably ffmpeg and ffprobe will _not_ be in your `%PATH`, so you _must_ set `%FFMPEG_PATH` and `%FFPROBE_PATH`.

**Debian/Ubuntu users**: the official repositories have the ffmpeg/ffprobe executable in the `libav-tools` package, and they are actually rebranded avconv/avprobe executables (avconv is a fork of ffmpeg).  They should be mostly compatible, but should you encounter any issue, you may want to use the real ffmpeg instead.  You can either compile it from source or find a pre-built .deb package at https://ffmpeg.org/download.html (For Ubuntu, the `ppa:jon-severinsson/ffmpeg` PPA provides recent builds).

## Main features

- Convert video from youtube in mp3 files (128 kBit/s) in realtime.
- Auto delete files from server after Download
- When used to download on server, it supports downloading the same audio without overwriting another (if 2 or more people are downloading the same audio).

With [npm](https://www.npmjs.com/) do:

```
npm install horizon-youtube-mp3
```

## Usage
### Get info from video.

``` js
var horizon = require('horizon-youtube-mp3');

horizon.getInfo("http://youtube.com/watch?v=NEA0BLnpOtg", function(e){

    console.log(e);

    /**
     * Will Return:
     *
     * { isValid: true,
     *   videoName: 'OZIELZINHO - TOP GEAR 2.0',
     *   videoThumb: 'https://i.ytimg.com/vi/NEA0BLnpOtg/hqdefault.jpg?custom=true&w=320&h=180&stc=true&jpg444=true&jpgq=90&sp=68&sigh=FoGsoudXCGPU-Fb6epRh1eIzVDs',
     *   videoTime: '2:35',
      *  videoFile: 'https://....'}
     */
});
```

### Simple mp3 file download

``` js
var horizon = require('horizon-youtube-mp3');
var path = require('path');

var downloadPath = path.join(__dirname);
var fileName = "mySound.mp3"; //Optional. The file automatically have the video name.

horizon.download("http://youtube.com/watch?v=NEA0BLnpOtg", downloadPath, null, fileName, function(e){

    console.log(e); //Will return: "Downloading file complete!"

    //Your code here...
});
```

After complete download (mySound.mp3 file):

### Use for server-side processing and client-side downloading

``` js
var horizon = require('horizon-youtube-mp3');
var path = require('path');
var http = require("http");
var url  = require('url') ;

var downloadPath = path.join(__dirname); //Path in your server to alocate temporaly file

var server = http.createServer(function(request, response) {

    var paramsUrl = url.parse(request.url, true).query;
    console.log("URL Video: " + paramsUrl.youtubeURL);

    horizon.download(paramsUrl.youtubeURL, downloadPath, response, null, function(e){

        console.log(e); //Will return: "Downloading file complete!"

        //Your code here...
    });
});

server.listen(3000);
console.log("Server running!");
console.log("Put on browser: http://localhost:3000/?youtubeURL=http://youtube.com/watch?v=NEA0BLnpOtg");
```

Process with unique id on server side:

After that, the browser opens a window asking the client where he wants to save the file.

# License
MIT

gha_language: JavaScript


text:
---
computation_units: Yes/No
data_non_statistical: false
date_metadata_updated: February, 2018 (Kali Kong)
goal_meta_link: http://unstats.un.org/sdgs/files/metadata-compilation/Metadata-Goal-11.pdf
graph_title: Has the US established national and local disaster risk reduction strategies?
graph_type: binary
has_metadata: true
indicator: 11.b.1
indicator_definition: "Local DRR Strategies in line with the Sendai Framework for\
  \ Disaster Risk Reduction 2015-2030: local disaster risk reduction strategies and\
  \ plans, across different timescales with targets, indicators and time frames, aimed\
  \ at preventing the creation of risk, the reduction of existing risk and the strengthening\
  \ of economic, social, health and environmental resilience (Sendai Framework, para27\
  \ (b)). Note: the DRR strategies need to be based on risk information and assessments.\
  \ Local Government: Form of public administration at the lowest tier of administration\
  \ within a given state, which generally acts within powers delegated to them by\
  \ legislation or directives of the higher level of government. \tNote: Terminology\
  \ will be discussed and finalized in the Open-ended Intergovernmental Working Group\
  \ for Sendai Framework for Disaster Risk Reduction."
indicator_name: Number of countries that adopt and implement national disaster risk
  reduction strategies in line with the Sendai Framework for Disaster Risk Reduction
  2015-2030
indicator_sort_order: 11-0b-01
indicator_variable: disaster_rsk_rdctn
layout: indicator
method_of_computation: Summation of data from National Progress Report of the Sendai
  Monitor
national_geographical_coverage: United States
periodicity: Annual
permalink: /11-b-1/
published: true
rationale_interpretation: "Sendai Framework for Disaster Risk Reduction 2015-2030\
  \ calls for local governments to adopt and implement local DRR strategies with their\
  \ own targets, indicators and timeframes. \nGlobal population is now half urban\
  \ and expected to be nearly 70% urban by 2050. Increasing resilience of cities is\
  \ critical to reduce disaster risk and achieve sustainable development. Cities are\
  \ also very vulnerable to natural disasters, especially climate-related shocks.\
  \ Over half of all coastal areas are urbanized and 21 of the world's 33 megacities\
  \ lie in coastal flood zones. Coastal cities are particularly affected by sea level\
  \ rise, coastal flooding and erosion, and extreme events (e.g. tsunamis and storm\
  \ surges) due to the undermining natural protective barriers, low levels of development\
  \ combined with rapid population growth in low lying coastal areas and inadequate\
  \ capacity to adapt. In addition to the impact on communities and non-human species,\
  \ the unplanned urbanization also undermines the ecosystem services that support\
  \ much hard urban infrastructure. This type of development also exacerbates urban\
  \ vulnerability to climate change impacts, including hydro-meteorological and geological\
  \ hazards. \nLocated mostly in cities where disadvantaged groups are situated and\
  \ when affordable access is addressed, resilient infrastructures such as health,\
  \ education, road and other critical infrastructures will have direct impact on\
  \ reducing inequality and making growth more inclusive and sustainable. \nThe opportunity\
  \ is that 60% of the area expected to be urban by 2030 remains to be built, indicating\
  \ that the shape of future cities can be proactively guided into more risk-sensitive\
  \ development. An increasing number of cities that adopt and implement local DRR\
  \ strategies will contribute to sustainable development from economic, environmental\
  \ and social perspectives. \nThe indicator will build bridge between the SDGs and\
  \ the Sendai Framework for DRR because the adoption of local DRR strategies is one\
  \ of Sendai Framework global targets and will be also monitored under the Sendai\
  \ Framework Monitoring System. \n(mainly based on TST Issue Brief 20, 11, 23, 14\
  \ and 12)"
reporting_status: complete
sdg_goal: 11
source_active_1: true
source_agency_staff_email_1<EMAIL_ADDRESS>source_agency_staff_name_1: Elan Strait
source_agency_survey_dataset_1: National Security Council/Executive Office of the
  President
source_notes_1: null
source_organisation_1: National Security Council/Executive Office of the President
source_title_1: null
source_url_1: https://www.dhs.gov/presidential-policy-directive-8-national-preparedness
source_url_text_1: https://www.dhs.gov/presidential-policy-directive-8-national-preparedness
target: By 2020, substantially increase the number of cities and human settlements
  adopting and implementing integrated policies and plans towards inclusion, resource
  efficiency, mitigation and adaptation to climate change, resilience to disasters,
  and develop and implement, in line with the Sendai Framework for Disaster Risk Reduction
  2015-2030, holistic disaster risk management at all levels.
target_id: 11.b
title: Number of countries that adopt and implement national disaster risk reduction
  strategies in line with the Sendai Framework for Disaster Risk Reduction 2015-2030
un_custodial_agency: 'UNISDR (Partnering Agencies: UN Habitat, UNEP)'
un_designated_tier: '1'
us_method_of_computation: 'US Presidential Policy Directive 8: National Preparedness,
  including the National Preparedness Goal and the National Preparedness System'
variable_description: null
variable_notes: null
---

repository: GSA/sdg-data-usa

branch_name: refs/heads/develop

gha_language: Python

repo_name: GSA/sdg-data-usa


text:
# Agaricus ericetorum Bull., 1792 SPECIES

#### Status
SYNONYM

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

#### Published in
Syn. meth. fung. (Göttingen) 2: 472 (1801)

#### Original name
Agaricus ericetorum Bull., 1792

### Remarks
null

repository: mdoering/backbone

path: /life/Fungi/Basidiomycota/Agaricomycetes/Agaricales/Hygrophoraceae/Lichenomphalia/Lichenomphalia umbellifera/ Syn. Agaricus ericetorum/README.md

repo_name: mdoering/backbone


text:
# Cloud-Init support

Virtlet is using [Cloud-Init](https://cloudinit.readthedocs.io/en/latest/) to configure VMs. As always you can check [Virtlet Cloud-Init documentation](../../reference/cloud-init/) to see exactly how Virtlet uses it.

Cloud-Init data is passed to the VM using Pod's annotations.

The most common use case is to pass SSH public key to the VM:

```yaml
VirtletSSHKeys: |
      ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCaJEcFDXEK2ZbX0ZLS1EIYFZRbDAcRfuVjpstSc0De8+sV1aiu+dePxdkuDRwqFtCyk6dEZkssjOkBXtri00MECLkir6FcH3kKOJtbJ6vy3uaJc9w1ERo+wyl6SkAh/+JTJkp7QRXj8oylW5E20LsbnA/dIwWzAF51PPwF7A7FtNg9DnwPqMkxFo1Th/buOMKbP5ZA1mmNNtmzbMpMfJATvVyiv3ccsSJKOiyQr6UG+j7sc/7jMVz5Xk34Vd0l8GwcB0334MchHckmqDB142h/NCWTr8oLakDNvkfC1YneAfAO41hDkUbxPtVBG5M/o7P4fxoqiHEX+ZLfRxDtHB53 me@localhost
```

or it can be pulled from [Secret](https://kubernetes.io/docs/concepts/configuration/secret/):

```yaml
VirtletSSHKeySource: secret/mysecret
```

It's also possible to create a new user by defining user data:

```yaml
    VirtletCloudInitUserData: |
      ssh_pwauth: True
      users:
      - name: testuser
        gecos: User
        primary-group: testuser
        groups: users
        lock_passwd: false
        shell: /bin/bash
        # the password is "testuser"
        passwd: "$6$rounds=4096$wPs4Hz4tfs$a8ssMnlvH.3GX88yxXKF2cKMlVULsnydoOKgkuStTErTq2dzKZiIx9R/pPWWh5JLxzoZEx7lsSX5T2jW5WISi1"
        sudo: ALL=(ALL) NOPASSWD:ALL
        ssh-authorized-keys:
           ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCaJEcFDXEK2ZbX0ZLS1EIYFZRbDAcRfuVjpstSc0De8+sV1aiu+dePxdkuDRwqFtCyk6dEZkssjOkBXtri00MECLkir6FcH3kKOJtbJ6vy3uaJc9w1ERo+wyl6SkAh/+JTJkp7QRXj8oylW5E20LsbnA/dIwWzAF51PPwF7A7FtNg9DnwPqMkxFo1Th/buOMKbP5ZA1mmNNtmzbMpMfJATvVyiv3ccsSJKOiyQr6UG+j7sc/7jMVz5Xk34Vd0l8GwcB0334MchHckmqDB142h/NCWTr8oLakDNvkfC1YneAfAO41hDkUbxPtVBG5M/o7P4fxoqiHEX+ZLfRxDtHB53 me@localhost
```

It's also possible to use [ConfigMap](https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/) as a source for user data:

```yaml
VirtletCloudInitUserDataSource: configmap/vm-user-data
```

When you are passing
[environment variables](../../reference/vm-pod-spec/#environment-variables) to a Pod Virtlet
uses Cloud-Init to pass it to a VM and store them in a
`/etc/cloud/environment` file.  When you are using ConfigMap or Secret
in a Pod then they are passed to the VM using Cloud-Init by creating
new files there. Pod's volumes are also converted to `mounts` and
mounted in VM using cloud-init when listed in the `volumeMounts`
field.

See `examples/k8s.yaml` where `VirtletCloudInitUserData` is used to do some advanced scripting there.

repository: leyao-daily/virtlet

repo_name: leyao-daily/virtlet


text:
---
title: Assembling Documents Using Bates Numbering
seo-title: Assembling Documents Using Bates Numbering
description: Use Bates numbering to assemble PDF documents using the Java and Web Service API.
seo-description: Use Bates numbering to assemble PDF documents using the Java and Web Service API.
uuid: 28d5faeb-6915-41a2-b6a0-78d255df024f
contentOwner: admin
content-type: reference
geptopics: SG_AEMFORMS/categories/assembling_pdf_documents
products: SG_EXPERIENCEMANAGER/6.5/FORMS
topic-tags: operations
discoiquuid: 77e9b895-1313-4a5b-a2d5-cdb65bdc1966
role: Developer
exl-id: 2a4e21c4-f2f5-44cd-b8ed-7b572782a2f1
---
# Assembling Documents Using Bates Numbering {#assembling-documents-using-bates-numbering}

**Samples and examples in this document are only for AEM Forms on JEE environment.**

You can assemble PDF documents that contain unique page identifiers by using Bates numbering. *Bates numbering* is a method of applying unique identifies to a batch of related documents. Each page in the document (or set of documents) is assigned a Bates number that uniquely identifies the page. For example, manufacturing documents that contain bill of material information and are associated with the production of an assembly can contain an identifier. A Bates number contains a sequentially incremented numeric value and an optional prefix and suffix. The prefix + numeric + suffix is referred to as a *bates pattern*.

The following illustration shows a PDF document that contains a unique identifier located in the document's header.

![au_au_batesnumber](assets/au_au_batesnumber.png)

For the purpose of this discussion, the unique page identifier is placed in a document's header. Assume that the following DDX document is used.

```xml
 <?xml version="1.0" encoding="UTF-8"?>
 <DDX xmlns="https://ns.adobe.com/DDX/1.0/">
        <PDF result="out.pdf">
        <Header>
         <Center>
             <StyledText>
                 <p font-size="20pt"><BatesNumber/></p>
             </StyledText>
         </Center>
     </Header>
           <PDF source="map.pdf" />
          <PDF source="directions.pdf" />
          </PDF>
 </DDX>
```

This DDX document merges two PDF documents named *map.pdf* and *directions.pdf* into a single PDF document. The resultant PDF document contains a header that consists of a unique page identifier. For example, the document in the above illustration shows 000016.

>[!NOTE]
>
>Before reading this section, it is recommended that you are familiar with assembling PDF documents using the Assembler service. This section does not discuss the concepts, such as creating a collection object that contains input documents, or extracting the results from the returned collection object. (See [Programmatically Assembling PDF Documents](/help/forms/developing/programmatically-assembling-pdf-documents.md).)

>[!NOTE]
>
>For more information about the Assembler service, see [Services Reference for AEM Forms](https://www.adobe.com/go/learn_aemforms_services_63).

>[!NOTE]
>
>For more information about a DDX document, see [Assembler Service and DDX Reference](https://www.adobe.com/go/learn_aemforms_ddx_63).

## Summary of steps {#summary-of-steps}

To assemble a PDF document that contains a unique page identifier (Bates numbering), perform the following tasks:

1. Include project files.
1. Create a PDF Assembler client.
1. Reference an existing DDX document.
1. Reference input PDF documents.
1. Set the initial Bates number value.
1. Assemble the input PDF documents.
1. Extract the results.

**Include project files**

Include the necessary files in your development project. If you are creating a client application by using Java, include the necessary JAR files. If you are using web services, ensure that you include the proxy files.

The following JAR files must be added to your project's class path:

* adobe-livecycle-client.jar
* adobe-usermanager-client.jar
* adobe-assembler-client.jar
* adobe-utilities.jar (required if AEM Forms is deployed on JBoss)
* jbossall-client.jar (required if AEM Forms is deployed on JBoss)

If AEM Forms is deployed on a supported J2EE application server other than JBoss, you must replace the adobe-utilities.jar and jbossall-client.jar files with JAR files that are specific to the J2EE application server on which AEM Forms is deployed. For information about the location of all AEM Forms JAR files, see [Including AEM Forms Java library files](/help/forms/developing/invoking-aem-forms-using-java.md#including-aem-forms-java-library-files).

**Create a PDF Assembler client**

Before you can programmatically perform an Assembler operation, you must create an Assembler service client.

**Reference an existing DDX document**

A DDX document must be referenced to assemble a PDF document. For example, consider the DDX document that was introduced in this section. To assemble a PDF document that contains unique page identifiers, the DDX document must contain the `BatesNumber` element.

**Reference input PDF documents**

Input PDF documents must be referenced to assemble a PDF document. For example, the map.pdf and directions.pdf documents must be referenced to assemble these PDF documents into a single PDF document.

**Set the initial Bates number value**

You can set the initial Bates number value to meet your business requirements. For example, assume that it is a requirement to set the initial value to 000100. If you do not set the initial value, the value of the first page is 000000.

**Assemble the input PDF documents**

After you create the Assembler service client, reference the DDX document that contains `BatesNumber` element information, reference an input PDF document, and set run-time options, you can invoke the `invokeDDX` operation that results in the Assembler service assembling a PDF document that contains unique page identifiers.

**Extract the results**

The Assembler service returns a collection object that contains the job results. You can extract the resultant PDF document and any exceptions that are thrown. In this situation, an encrypted PDF document is located within the collection object.

>[!NOTE]
>
>A collection object is returned if you invoke the `invokeDDX` operation. This operation is used when passing two or more input PDF documents to the Assembler service. However if you pass only one input PDF document to the Assembler service, you should invoke the `invokeOneDocument` operation. For information about using this operation, see [Assembling Encrypted PDF Documents](/help/forms/developing/assembling-encrypted-pdf-documents.md).

**See also**

[Including AEM Forms Java library files](/help/forms/developing/invoking-aem-forms-using-java.md#including-aem-forms-java-library-files)

[Setting connection properties](/help/forms/developing/invoking-aem-forms-using-java.md#setting-connection-properties)

[Programmatically Assembling PDF Documents](/help/forms/developing/programmatically-assembling-pdf-documents.md)

## Assemble documents with Bates numbering using the Java API {#assemble-documents-with-bates-numbering-using-the-java-api}

Assemble a PDF document that uses unique page identifiers (Bates numbering) by using the Assembler Service API (Java):

1. Include project files.

   Include client JAR files, such as adobe-assembler-client.jar, in your Java project's class path.

1. Create a PDF Assembler client.

    * Create a `ServiceClientFactory` object that contains connection properties.
    * Create an `AssemblerServiceClient` object by using its constructor and passing the `ServiceClientFactory` object.

1. Reference an existing DDX document.

    * Create a `java.io.FileInputStream` object that represents the DDX document by using its constructor and passing a string value that specifies the location of the DDX file.
    * Create a `com.adobe.idp.Document` object by using its constructor and passing the `java.io.FileInputStream` object.

1. Reference input PDF documents.

    * Create a `java.util.Map` object used to store input PDF documents by using a `HashMap` constructor.
    * For each input PDF document, create a `java.io.FileInputStream` object by using its constructor and passing the location of the input PDF document. In this situation, pass the location of an unsecured PDF document.
    * For each input PDF document, create a `com.adobe.idp.Document` object and pass the `java.io.FileInputStream` object that contains the PDF document.
    * Add an entry to the `java.util.Map` object by invoking its `put` method and passing the following arguments:

        * A string value that represents the key name. This value must match the value of the PDF source element specified in the DDX document. For example, the name of the PDF source file specified in the DDX document that is introduced in this section is Loan.pdf.
        * A `com.adobe.idp.Document` object that contains the unsecured PDF document.

1. Set the initial Bates number value.

    * Create an `AssemblerOptionSpec` object that stores run-time options by using its constructor.
    * Set the initial Bates number by invoking the `AssemblerOptionSpec` object's `setFirstBatesNumber` and passing a numeric value that specifies the initial value.

1. Assemble the input PDF documents.

   Invoke the `AssemblerServiceClient` object's `invokeDDX` method and pass the following required values:

    * A `com.adobe.idp.Document` object that represents the DDX document.
    * A `java.util.Map` object that contains the input unsecured PDF file.
    * A `com.adobe.livecycle.assembler.client.AssemblerOptionSpec` object that specifies the run-time options, including default font and job log level.

   The `invokeDDX` method returns a `com.adobe.livecycle.assembler.client.AssemblerResult` object that contains a password-encrypted PDF document.

1. Extract the results.

   To obtain the newly created PDF document, perform the following actions:

    * Invoke the `AssemblerResult` object's `getDocuments` method. This action returns a `java.util.Map` object.
    * Iterate through the `java.util.Map` object until you find the `com.adobe.idp.Document` object.
    * Invoke the `com.adobe.idp.Document` object's `copyToFile` method to extract the PDF document.

**See also**

[Quick Start (SOAP mode): Assembling a PDF document with bates numbering using the Java API](/help/forms/developing/assembler-service-java-api-quick.md#quick-start-soap-mode-assembling-a-pdf-document-with-bates-numbering-using-the-java-api)

[Including AEM Forms Java library files](/help/forms/developing/invoking-aem-forms-using-java.md#including-aem-forms-java-library-files)

[Setting connection properties](/help/forms/developing/invoking-aem-forms-using-java.md#setting-connection-properties)

## Assemble documents with Bates numbering using the web service API {#assemble-documents-with-bates-numbering-using-the-web-service-api}

Assemble a PDF document that uses unique page identifiers (Bates numbering) by using the Assembler Service API (web service):

1. Include project files.

   Create a Microsoft .NET project that uses MTOM. Ensure that you use the following WSDL definition: `http://localhost:8080/soap/services/AssemblerService?WSDL&lc_version=9.0.1`.

   >[!NOTE]
   >
   >Replace `localhost` with the IP address of the server hosting AEM Forms.

1. Create a PDF Assembler client.

    * Create an `AssemblerServiceClient` object by using its default constructor.
    * Create an `AssemblerServiceClient.Endpoint.Address` object by using the `System.ServiceModel.EndpointAddress` constructor. Pass a string value that specifies the WSDL to the AEM Forms service (for example, `http://localhost:8080/soap/services/AssemblerService?blob=mtom`). You do not need to use the `lc_version` attribute. This attribute is used when you create a service reference.
    * Create a `System.ServiceModel.BasicHttpBinding` object by getting the value of the `AssemblerServiceClient.Endpoint.Binding` field. Cast the return value to `BasicHttpBinding`.
    * Set the `System.ServiceModel.BasicHttpBinding` object's `MessageEncoding` field to `WSMessageEncoding.Mtom`. This value ensures that MTOM is used.
    * Enable basic HTTP authentication by performing the following tasks:

        * Assign the AEM forms user name to the field `AssemblerServiceClient.ClientCredentials.UserName.UserName`.
        * Assign the corresponding password value to the field `AssemblerServiceClient.ClientCredentials.UserName.Password`.
        * Assign the constant value `HttpClientCredentialType.Basic` to the field `BasicHttpBindingSecurity.Transport.ClientCredentialType`.
        * Assign the constant value `BasicHttpSecurityMode.TransportCredentialOnly` to the field `BasicHttpBindingSecurity.Security.Mode`.

1. Reference an existing DDX document.

    * Create a `BLOB` object by using its constructor. The `BLOB` object is used to store the DDX document.
    * Create a `System.IO.FileStream` object by invoking its constructor and passing a string value that represents the file location of the DDX document and the mode to open the file in.
    * Create a byte array that stores the content of the `System.IO.FileStream` object. You can determine the size of the byte array by getting the `System.IO.FileStream` object's `Length` property.
    * Populate the byte array with stream data by invoking the `System.IO.FileStream` object's `Read` method. Pass the byte array, the starting position, and the stream length to read.
    * Populate the `BLOB` object by assigning its `MTOM` field with the contents of the byte array.

1. Reference input PDF documents.

    * For each input PDF document, create a `BLOB` object by using its constructor. The `BLOB` object is used to store the input PDF document.
    * Create a `System.IO.FileStream` object by invoking its constructor. Pass a string value that represents the file location of the input PDF document and the mode in which to open the file.
    * Create a byte array that stores the content of the `System.IO.FileStream` object. You can determine the size of the byte array by getting the `System.IO.FileStream` object's `Length` property.
    * Populate the byte array with stream data by invoking the `System.IO.FileStream` object's `Read` method. Pass the byte array, the starting position, and the stream length to read.
    * Populate the `BLOB` object by assigning its `MTOM` property with the contents of the byte array.
    * Create a `MyMapOf_xsd_string_To_xsd_anyType` object. This collection object is used to store the input PDF documents.
    * For each input PDF document, create a `MyMapOf_xsd_string_To_xsd_anyType_Item` object. For example, if two input PDF documents are used, create two `MyMapOf_xsd_string_To_xsd_anyType_Item` objects.
    * Assign a string value that represents the key name to the `MyMapOf_xsd_string_To_xsd_anyType_Item` object's `key` field. This value must match the value of the PDF source element specified in the DDX document. (Perform this task for each input PDF document.)
    * Assign the `BLOB` object that stores the PDF document to the `MyMapOf_xsd_string_To_xsd_anyType_Item` object's `value` field. (Perform this task for each input PDF document.)
    * Add the `MyMapOf_xsd_string_To_xsd_anyType_Item` object to the `MyMapOf_xsd_string_To_xsd_anyType` object. Invoke the `MyMapOf_xsd_string_To_xsd_anyType` object's `Add` method and pass the `MyMapOf_xsd_string_To_xsd_anyType` object. (Perform this task for each input PDF document.)

1. Set the initial Bates number value.

    * Create an `AssemblerOptionSpec` object that stores run-time options by using its constructor.
    * Set the initial Bates number by assigning a numeric value to the `firstBatesNumber` data member that belongs to the `AssemblerOptionSpec` object.

1. Assemble the input PDF documents.

   Invoke the `AssemblerServiceClient` object's `invoke` method and pass the following values:

    * A `BLOB` object that represents the DDX document.
    * The `MyMapOf_xsd_string_To_xsd_anyType` object that contains the input PDF documents. Its keys must match the names of the PDF source files, and its values must be the `BLOB` objects that corresponds to those files.
    * An `AssemblerOptionSpec` object that specifies run-time options.

   The `invoke` method returns an `AssemblerResult` object that contains the results of the job and any exceptions that occurred.

1. Extract the results.

   To obtain the newly created PDF document, perform the following actions:

    * Access the `AssemblerResult` object's `documents` field, which is a `Map` object that contains the result PDF documents.
    * Iterate through the `Map` object until you find the key that matches the name of the resultant document. Then cast that array member's `value` to a `BLOB`.
    * Extract the binary data that represents the PDF document by accessing its `BLOB` object's `MTOM` property. This returns an array of bytes that you can write out to a PDF file.

**See also**

[Invoking AEM Forms using MTOM](/help/forms/developing/invoking-aem-forms-using-web.md#invoking-aem-forms-using-mtom)

branch_name: refs/heads/main

gha_language: Groovy


text:
---
layout: post
title:      "Get Postman"
date:       2020-03-09 14:35:51 -0400
permalink:  get_postman
---

This blog post is going to be a short and sweet appreciation post for Postman. I have been doing a fair amount of backend projects lately to work on routes, manipulating data, and just general API building. While working on these projects the one tool that I have found the most invaluable is Postman.

Postman is a client that allows you to quickly build and send REST, SOAP, and GraphQL requests. When I work on new projects my process generally looks something like this: 1) Draw out models, attributes, and relationships on a whiteboard. 2) Create and run table migrations. 3) Add seed data. 4) And lastly, I like to work on the routes starting with basic GET requests and working on from there.

Now, testing GET routes is not too bad in the browser. It really just involves navigating to the URL and then using some tool like JSONView to format the data to make it easy to interpret. Postman does this too, but it gives us a lot more control and also gives us the opportunity to save the response data to a file if we need.

Postman really becomes useful though when we start hitting other types of requests like POST or DELETE requests. Postman allows us to edit the request header and body with the information we want to use for these requests without having to write any code, and the best part is we can save those requests so we can run them over and over and over to test our API.

I also find it incredibly useful when working on frontend projects that use an existing API, because I can create a lot of sample requests and know exactly what the data is going to look like when it is returned to me.

Postman has allowed me to easily test the API's I am working on and by the time I get to the front end there is no guess work as to what data I am working with or how it is formatted. It is a huge time saver and by far one of my favorites tools to use when developing.

More on Postman and JSONView, the other browser tool I mentioned, can be found here:

[Postman](https://www.postman.com/)
[JSONView](https://chrome.google.com/webstore/detail/jsonview/chklaanhfefbnpoihckbnefhakgolnmc?hl=en)

extension: markdown


text:
Extending Linguistic Style Transfer for "Trumpifying" Text
=============

How it Works
------------
This repository is largely forked from https://github.com/agaralabs/transformer-drg-style-transfer. However, because we completed this project on Colab, some features have been adapted. Notably, bash scripts exist to run Python files on Colab. Specifically, train.sh trains the BERT Classifier in Part (1), dg.sh trains the OpenAI GPT Delete and Generate model in Part (4) and drg.sh trains the OpenAI GPT Delete, Retrieve, Generate model in Part (4). The pickle file senlist.data contains the results the processed sentences in Part (2) to reduce time spent retraining. Head-selection-2.ipynb should be used instead of Head-selection.ipynb.

In terms of directory structure, our LSTM / RNN baseline model (sourced from https://github.com/rpryzant/delete_retrieve_generate) is in baseline/. Our raw data, preprocessed data, and processed and tokenized data can be found under data/. The trained Delete and Generate model weights and parameters can be found under dg_model_weights/ and the trained Delete Retrieve Generate model weights and parameters can be found under dgr_model_weights/. Losses for both aforementioned models as well as the BERT Classifier are in losses/. The trained BERT Classifier can be found under models/.

Part (4) may be run alone using the pre-trained models listed in the directories above. Please note that the models are stored using git-lfs; this may affect how the model should be loaded. We have found calling !sudo apt-get install git-lfs followed by !git-lfs pull allows us to work with git-lfs files on Colab. Also note that git-lfs has somewhat strict usage limits and may require you to purchase additional storage or bandwith space.

Finally, some notebooks may not run on Jupyter because of !sudo apt-get install commands, which to our knowledge, is only a feature on Colab. There may also be some Path names that have to be changed before running.

Again, this repository is sourced from https://github.com/agaralabs/transformer-drg-style-transfer. The instructions provided at the source repository work for the most part on this repository, with modifications listed above.

Technical Requirements
----------------------

**Instructions and platform specifications**

>**Languages and tools used:**
>
>- torch    >= 1.0.1.post2
>- pandas   >= 0.23.4
>- numpy    >= 1.15.4
>- python   >= 3.7.1
>- tqdm     >= 4.28.1
>- boto3    >= 1.9.107
>- requests >= 2.21.0
>- regex    >= 2019.2.21
>- git-lfs
>
>**Instructions**
>
>1. Clone this repository.
>2. Follow the instructions listed at https://github.com/agaralabs/transformer-drg-style-transfer, noting the exceptions listed above.


text:
# Note Taker

  [![License](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)

## Project Description

  This applciation allows the user to take, save, and delete notes using an express server.

  Live App: [Live App](https://note-taker-coreyparker.herokuapp.com/)

## Table of Contents

  * [Installation Instructions](#installation)
  * [Usage](#usage)
  * [License](#license)
  * [Questions](#questions)

## Usage

  This project can be used by anyone to easily and effectively take notes on their computer.

## License

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

## Questions

My GitHub: [CoreyParker12](https://github.com/CoreyParker12)
Email<EMAIL_ADDRESS>
Deployed Application: [Heroku Deployment](https://note-taker-coreyparker.herokuapp.com/)


text:
# PyRadio pip installation on Linux

**PyRadio**: Command line internet radio player.

## Table of contents
<!-- vim-markdown-toc Marked -->

* [Preface](#preface)
* [Take care of your PATH](#take-care-of-your-path)
* [Install a media player](#install-a-media-player)
* [Get the installation script](#get-the-installation-script)
* [Debian and derivatives](#debian-and-derivatives)
* [Fedora and derivatives](#fedora-and-derivatives)
* [openSUSE and derivatives](#opensuse-and-derivatives)

<!-- vim-markdown-toc -->

[[Return to PyRadio Build Instructions]](build.md)

## Preface

This document will help you install **PyRadio** within your **.local** directory, using `pip`.

In order to install **PyRadio** to your system you will:

1. Take care of your PATH
2. Install a media player
1. Download the installation script
2. Install the basic python system and **PyRadio** dependencies
3. Perform the installation

## Take care of your PATH

**PyRadio** will be installed in the **~/.local/bin** directory.

Please make sure this directory is in your PATH shell variable. The way to do this depends on the default shell you are using; please refer to its documentation on how to edit your PATH.

## Install a media player

**PyRadio** relies on the existence of at least one of the following media players: **mpv**, **mplayer** or **vlc**.

Please install at least one of them beforehand:

```
# on Debian
sudo apt-get install [ mpv / mplayer / vlc ]

# on Fedora
sudo dnf install [ mpv / mplayer / vlc ]

# on openSUSE
sudo zypper install [ mpv / mplayer / vlc ]
```

## Get the installation script

Open a terminal and execute:

```
cd
wget https://raw.githubusercontent.com/coderholic/pyradio/master/pyradio/install.py
```

or using curl:
```
cd
curl -L \
    https://raw.githubusercontent.com/coderholic/pyradio/master/pyradio/install.py \
    -o install.py
```

If you are going to use **Python 2**, please execute:

```
sed -i.orig 's/from rich import print/pass/' install.py
```

This will fix the instllation script for **Python 2**; the original script will be renamed to *install.py.orig*.

Please follow the instructions that match/suit your distribution.

## Debian and derivatives

**Note:** The following instructions were tested on a freshly installed **Debian Testing**.

Install the requirements for the installation script:

```
sudo apt-get install \
    python3-full \
    python3-pip \
    python3-rich \
    python3-requests \
    python3-dnspython \
    python3-psutil \
    python3-netifaces \
    python3-dateutil
cd
python3 install.py
```

## Fedora and derivatives

**Note:** The following instructions were tested on a freshly installed **Fedora 38 Workstation**.

Execute:
```
sudo dnf install \
    python3-pip \
    python3-wheel \
    python3-rich \
    python3-requests \
    python3-netifaces \
    python3-psutil \
    python3-dns \
    python3-dateutil
cd
python install.py
```

## openSUSE and derivatives

**Note:** The following instructions were tested on a freshly installed **openSUSE Tumbleweed 20230427**.

repository: coderholic/pyradio

repo_name: coderholic/pyradio


text:
---
author: roundcrisis
comments: true
date: 2019-05-24 20:48:00+00:00
layout: post
title: No long term damage. Day 5
categories:
- environmental
- wfh
---

Day 5 of a week trying to generate the least amount of long lived rubbish by not buying non renewable things. My rules are:

* Focus only on things I buy or consume directly.
* From Monday 20/05 till Sunday 26/05 evening.
* Document what I do buy and questions that arise from this experiment.

Previous days:

* [Day 1](http://www.roundcrisis.com/2019/05/20/no-longter-damage-1/)
* [Day 2](http://www.roundcrisis.com/2019/05/21/no-longter-damage-2/)
* [Day 3](http://www.roundcrisis.com/2019/05/22/no-longer-damage-3/)
* [Day 4](http://www.roundcrisis.com/2019/05/23/no-longer-damage-4/)

## Day 5: Friday

Working from home again today.

All food an drink consumed today was bought before the start of the week or not by me, so I figured I would document anything I put in the bin.

 The container was clear plastic which is "widely" recycled, not so for the fork (or at least not mentioned) nor the film covering it. There was a note about how you can bring this to a big store, my nearest one is about 5 miles from here, which I would probably have to drive to, especially If I am buying more food there.  I wonder if the home delivery would take this instead.

![]({{ site.images }}/2019/friday-lunch1.png)
![]({{ site.images }}/2019/friday-lunch2.png)

#### Later and Questions

I cooked from this evening. There was:

* Ham wrapper, I think that is not recyclable.
* Oranges net. Also it appears it's not recyclable
* Chips bag. Not recyclable.

![]({{ site.images }}/2019/friday1.png)
![]({{ site.images }}/2019/friday2.png)
![]({{ site.images }}/2019/friday3.png)

Pretty sad.

### Long lived Rubbish for today

* Ham wrapper, I think that is not recyclable.
* Oranges net. Also it appears it's not recyclable
* Chips bag. Not recyclable.
* Film and fork from beetroot container.

#### Today's questions

* Can anything be done about these things that are not recyclable? How could we upcycle them?
* I heard (but not researched yet) that there is some rubbish you can bring back to where you bought it and they will deal with it, but I don't understand if that is true or what does "deal with it" means?

#### TL;DR

* Quite a lot of rubbish for one day.


text:
---
title: "Concepts"
menuTitle: Concepts
description: Understanding Gloo Mesh Concepts
weight: 20
---

Gloo Mesh is a management plane that simplifies operations and workflows of service mesh installations across multiple clusters and deployment footprints. With Gloo Mesh, you can install, discover, and operate a service-mesh deployment across your enterprise, deployed on premises, or in the cloud, even across heterogeneous service-mesh implementations.

![Gloo Mesh Architecture]({{% versioned_link_path fromRoot="/img/gloomesh-3clusters.png" %}})

## Why Gloo Mesh

A service mesh provides powerful service-to-service communication capabilities like request routing, traffic observability, transport security, policy enforcement and more. A service mesh brings its highest value when many services (as many as possible) take advantage of its traffic control capabilities. In today's modern cloud deployments, both on-premises and in a public cloud, the expectation is that more, smaller clusters or deployment targets are preferred for the following reasons:

* Fault tolerance
* Compliance and data access
* Disaster recovery
* Scaling needs
* Geographic needs

Managing a service mesh deployment that is consistent and secure across multiple clusters is tedious and error prone at best. Gloo Mesh provides a single unified pane of glass driven by a declarative API (CRDs in Kubernetes) that orchestrates and simplifies the operation of a multi-cluster service mesh including the following concerns:

* Unifying/federating trust domains
* Achieving a single pane of glass for operational observability
* Multi-cluster routing
* Access policy

### A multi-cluster management plane

Gloo Mesh consists of a set of components that run on a single cluster, often referred to as your *management plane cluster*. The management plane components are stateless and rely exclusively on declarative CRDs.  Each service mesh installation that spans a deployment footprint often has its own control plane. You can think of Gloo Mesh as a management plane for multiple control planes.

![Gloo Mesh Architecture]({{% versioned_link_path fromRoot="/img/concepts-gloomesh-components.png" %}})

Once a cluster is registered with Gloo Mesh, it can start managing that cluster - discovering workloads, pushing out configurations, unifying the trust model, scraping metrics, and more.

In this section, we take a look at the concepts and components that comprise Gloo Mesh.

{{% children description="true" %}}

repository: rvennam/gloo-mesh

repo_name: rvennam/gloo-mesh


text:
# Boilerplate Configurable Widget

This widget is factored from essence of material from  [Add a dashboard widget](https://www.visualstudio.com/en-us/docs/integrate/extensions/develop/add-dashboard-widget) tutorial and [Widget Samples](https://github.com/Microsoft/vsts-extension-samples/), to help get into efficient Widget development inner loop as quickly as possible, based on existing Widget patterns.

## Critical steps
Critical Steps to start testing your widget:

From the repo directory:
1. (Command Line: get current bits with bower) bower install
2. Override the publisher in vss-extension.json with your publisher Id. Learn to [create a publisher](https://www.visualstudio.com/en-us/docs/integrate/extensions/publish/overview).
3. (Command Line: Create your extension) tfx extension create --manifest-globs vss-extension.json --rev-version
4. Publish your extension from [Marketplace](https://marketplace.visualstudio.com/manage/publishers)
5. Share your extension to your test account
6. From your account, "Manage Extensions", select "Boilerplate Configuration Widget" and "Install" it

## Customization steps
These are not critical until you are packaging a widget for public consumption.
1. Line 3- Override the publisher-unique extension "id". This is the identity of the extension for it's lifespan.
2. Line 5-Override the extension "name", this is the user facing name of the extension from the gallery.
3. Line 6-Override the user facing extension "description".
4. Line 14-Update the catalog image users see for your extension.
5. Line 19 - Override the unique id of your widget contribution.
6. Line 43 - Override the unique id of your config contribution. Apply this name to line 23.
7. Line 26 - Override the user facing widget name. This is what is visible in the widget Catalog.
8. Line 27 - Override the user facing widget description, as seen in the widget Catalog.
9. Line 28 & 29 - Override the catalog and loading images.
10. Line 31 - Specify the range of allowed Sizes for your widget. Currently 1-10 in each dimension is supported.


text:
# Alan Kay Cool Stuff

Sources for these writings:

* [Power of Simplicity](https://www.youtube.com/watch?v=NdSD07U5uBs&feature=youtu.be)
* [The Computer Revolution not happened yet](https://www.youtube.com/watch?v=oKg1hTOQXoY&feature=youtu.be)
* [Rethinking CS education](https://www.youtube.com/watch?v=N9c7_8Gp7gI)
* [Normal Considered Harmful](https://www.youtube.com/watch?v=FvmTSpJU-Xc)
* [Doing with images make symbols](https://www.youtube.com/watch?v=p2LZLYcu_JY&feature=youtu.be)
* [ARPA / Xerox PARC culture](https://www.youtube.com/watch?v=wdHtYW_wcAs)

## Science definition

Greatest thought process ever created by humankind exactly
because it is not about "truth". There is reality and there is
our limited brains and how can they represent reality. Science is about
building N representations of the reality, all of them are false on some
sense since our brains are very limited, and realising that and exploring
this representation space is a very powerful concept.

To be able to see you have to realise you are actually blind.

## Mind as canyons

This metaphor compares our view of reality as canyons that are formed by erosion.
As time passes they only get deeper and it gets really hard to see out of them.

It is human nature to die in the same world that you was born, it has been like that
for thousands of years, so it is on our nature to resist change and also to get
attached to our representation of reality and ideas.

There is a great way to observe that on astronomy.

## Circles VS Ellipses

I won't recall the names, because I suck at remembering names =(, but
basically for hundreds of years man tried to explain the orbit of planets
using circles. Why ? Well, it seemed like the planets where moving on a very
messy way (the word planet in greek refers to "wanderer"), and God is perfect,
since God is perfect the way everything works must be perfect too.

So instead of accepting old works that suggested elliptic orbits, there was a lot
of work to explain it with circles. Since circles where not fitting the reality did
they revised the circle/perfection thing ? No, humans are not really great with this
kind of thing remember ? =) They just started to explain things with multiple circles,
basically patching their broken model with more circles.

Certainly this reminds me of something =), just as we patch bad ideas we patch
bad software, a huge failure of imagination but at the same time part of our nature,
and changing human nature is much slower than we would like to believe.

The end of the history is that the guy who was able to establish the elliptic orbits
model took decades of trying to work with other models. Why ? Well he thought that
ellipses where so basic and simple that the previous geniuses SURELY would have thought
of that and discarded because it did not worked. They where geniuses alright, but still
human, his lack of understanding human nature costed him some decades =).

This shows another side to studying and respecting previous work. The software industry
suffers a great deal for not knowing the past and repeating its mistakes, but sometimes
it is important to let go of old assumptions and try again an idea.

## First human powered flight

McReady was the first man to implement successfully human powered flight.
What is cool on the history is how he was able to do that, basically two things:

* He was not trying to build a plane, he was trying do to human powered flight
* He found a way to get feedback fast

The fast feedback is key, everyone expended months rebuilding the planes after a
failure. He built a VERY simple prototype, rebuilding and hacking it was pretty fast.

With this process of "try, fail, correct, try again" he was able to get it working in
six months (some of the planes took almost this just to be built).

 When the monkey
grabs the nut it can't take its hand from the jar. The monkeys could get free
at any time just by releasing the nut, almost none of them do this, they get
caught because of their inability of letting go. This is a human trait as well,
since we are primates :-).

Sometimes to get something you need to let it go.

## Science of Computing

There is a great deal of effort on presenting computing science as something
completely unrelated to computers, which makes sense, just as thinking architecture
has everything to do with autocad, it does not make sense.

The original idea of having a science for computing was like a science for
processes. The way we think is a process, an entire nation is a process,
in the way they interact and operate.
The idea was to study how to represent this kind of
phenomenons as processes and study them (not necessarily implementing them on
a computer, although this reminds me a lot of simulations).

He mention the American constitution as an amazing process that keeps the nation
working almost unaltered for more than a hundred years, for example.

This is very hard for me to understand since I'm pretty low level / machine
oriented on how I think about computing, but it does make sense to define
science this way.

## Organic VS Mechanic

I always found more inspiration for software in organic systems than buildings,
so it has a great appeal to me when Alan Kay talks about how great life is
at scaling. Not that metaphors and analogies with architecture are bad, actually
you can see architecture and design in life too.

The thing is that scaling mechanisms, at least on how we build them, is very hard.
His example is always the dog house, you can build a dog house from almost anything,
and it works. But if you think to scale it to become a cathedral you can't just
multiply the dog house by a hundred, it will fall because of very know physics rules.

This is the same way a lot of software is built, get something that works on a small scale
and just force it to scale until it crumbles. When it crumbles two things can happen:

* Admit you was wrong
* Build a pyramid on top of the fallen build and say that this is what you wanted to build

Sadly almost all the times we convince ourselves that what we wanted was the pyramid =P.
We got a lot better at building great structures, but still it does not come close as
the level of scalability of life.

OK, but what can be applied from life itself to software ? Well take the cell, it is the
perfect example of something completely encapsulated by its cell membrane, everything
that comes in and goes out follows the protocol enforced by the membrane, nothing
comes inside without inspection, and what enables this awesome level of composition is
the fact that they have a great generic interface between them, proteins/DNA.

On Roy Fielding [dissertation on REST](https://www.ics.uci.edu/~fielding/pubs/dissertation/top.html)
he explains that the most important aspect of REST is the imposed constraint
of having the same generic interface between components,
to scale at the level of the web it was mandatory to be able to compose new
and old stuff without causing disruption.

The constraints may make some things harder to implement,
but the better the generic interface, and the simpler, less limitations will be
generated by imposing the generic interface.

Life teaches us that to a system to scale it needs the right interfaces and the right constraints.
All life on earth needs the same basic building blocks, this imposes limitations on how life can
manifest itself, but it allows an awesome level of scalability and composition between everything
that is alive.

We need great building blocks or we are doomed to build things that will never scale,
being able to identify a bad building block and invest on building better ones is extremely
rare on the software industry, where companies are usually just worried with quarter profits.

## Reinventing the flat tire

On the [ARPA / Xerox PARC culture](https://www.youtube.com/watch?v=wdHtYW_wcAs)
presentation, besides a whole lot of awesome ideas, Kay talks about how
we are constantly reinventing the flat tire, not the wheel. Reinventing
the wheel would be great actually, the problem is that we keep stuck on
wrong interpretations of really good ideas and keep reinventing them.

One current example that happened just now (2020) is a new implementation
of NodeJS fixing all the terrible mistakes of NodeJS, the whole Javascript
enterprise is a flat tire and we are still pouring a lot of resources and time
in reinventing this kind of stuff instead of going for something really better.
Even if it is better than NodeJS, it will be at best a fancier flat tire.

One interesting thing about this metaphor is the whole reasoning that it works
and a lot of people uses it, so it must be good. You can get around with a flat
tire and the most scary part is that if what you ever had is flat tires you will
think that it is normal the way a car behaves with the flat tires, it has
always been like that, you have no idea of how different and faster it will
be with actual good tires, so you may convince yourself that flat tires
are awesome. It is the same as the canyon metaphor, after people are inside it
they can't see outside it, it is like the canyon is the whole world.

## Point of view is worth 80 IQ points

TODO: Talk about correlation with good abstractions

## Catch phrases

* It is big meaning, not big data
* The best way to predict the future is to invent it
* Point of view is worth 80 IQ points

repository: katcipis/sophia

repo_name: katcipis/sophia


text:
# brew-bot - The algorithmic beer recipe generator

[![Github Runner](https://github.com/wall-brew-co/brew-bot/workflows/Clojurescript%20CI/badge.svg)](https://github.com/Wall-Brew-Co/brew-bot/actions?query=workflow%3A%22Clojurescript+CI%22)
[![Clojars Project](https://img.shields.io/clojars/v/com.wallbrew/brew-bot.svg)](https://clojars.org/com.wallbrew/brew-bot)
[![cljdoc badge](https://cljdoc.org/badge/com.wallbrew/brew-bot)](https://cljdoc.org/d/com.wallbrew/brew-bot/CURRENT)
[![GitHub](https://img.shields.io/github/license/Wall-Brew-Co/brew-bot)](https://github.com/Wall-Brew-Co/brew-bot/blob/master/LICENSE)
[![Twitter Follow](https://img.shields.io/twitter/follow/WallBrew?style=social)](https://twitter.com/WallBrew)

> We’re making beer. I’m the brewery!
> Bender Bending Rodriguez from [*Futurama*](https://www.imdb.com/title/tt0149460/)

A Clojure(Script) library to create randomized beer recipes!

The beta release of our SPA is now [available!](https://brewbot.wallbrew.com/)

This repository follows the guidelines and standards of the [Wall Brew Open Source Policy.](https://github.com/Wall-Brew-Co/open-source "Our open source guidelines")

## Installation

A deployed copy of the most recent version of [brew-bot can be found on clojars.](https://clojars.org/com.wallbrew/brew-bot)
To use it, add the following as a dependency in your project.clj file:

[![Clojars Project](http://clojars.org/com.wallbrew/brew-bot/latest-version.svg)](http://clojars.org/com.wallbrew/brew-bot)

The next time you build your application, [Leiningen](https://leiningen.org/) or [deps.edn](https://clojure.org/guides/deps_and_cli) should pull it automatically.
Alternatively, you may clone or fork the repository to work with it directly.

## Dependencies

This library heavily relies upon the [common-beer-format](https://github.com/Wall-Brew-Co/common-beer-format) and returns all recipes and ingredients to match its specification.
Therefore, all arguments passed to functions in brew-bot are normalized to these standards as well.
Most importantly, it assumes measurements are provided in the [International System of Units](https://en.wikipedia.org/wiki/International_System_of_Units), also known as the modern metric system.
Since many brewing applications, especially those based in America, operate on Imperial Measurements, you may wish to add [brewtility](https://github.com/Wall-Brew-Co/brewtility) to any applications consuming this library to assist with conversions between systems of measure.

## Usage

All functions necessary to generate a recipe are provided in the core namespace.

```clj
(:require [brew-bot.core :refer :all])

(def fermentables
  (select-fermentables))

(def hops
  (select-hops :random))

(def yeast
  (select-yeasts :random {:count-cutoff 1}))

(def my-random-recipe
  (ingredients->cbf-recipe-template fermentables hops yeast))
```

Each of the three functions `select-fermentables`, `select-hops`, and `select-yeasts` support multiple arities:

- Zero - Selects ingredients completely randomly across the full set provided by `common-beer-format`
- One - Given a strategy, select ingredients from the full set provided by `common-beer-format`
- Two - Given a strategy and a map of options, select ingredients with fine-grained control.

These are the currently supported strategies:

- `:random` - Select ingredients at random with an even probability of selection and with replacement
- `:weighted` - Select ingredients with a provided selection probability and with replacement. For example, `{:galaxy 15.0, :el-dorado 5.0, :topaz 1.0}`. In this example, galaxy hops have a 71.43% chance of being selected (15.0 / (15.0 + 5.0 + 1.0)).

These are the currently supported options:

- amount-cutoff - The maximum weight, in kilograms, of fermentable ingredients to select. Defaults to `2.26796` kilograms (5 pounds)
- count-cutoff - The maximum number of unique ingredients to allow.
- selection-weights - A map from ingredient names to probability weights. e.g. `{:amber-liquid-extract 5.0 :biscuit-malt 15.0 ...}`. Only applicable for the `:weighted` strategy
- default-weight - A probability weight to fall back to for ingredients not specified in selection-weights. Only applicable for the `:weighted` strategy

Additionally, per ingredient type, you may focus the possible ingredient selections.
Hops also support two additional options for determining when hops are added and their primary use case.

### Fermentables

- include-adjuncts? - A boolean switch to include adjuncts in the list of selectable ingredients. Defaults to `true`
- include-dry-extracts? - A boolean switch to include dry extracts in the list of selectable ingredients. Defaults to `true`
- include-extracts? - A boolean switch to include extracts in the list of selectable ingredients. Defaults to `true`
- include-grains? - A boolean switch to include grains in the list of selectable ingredients. Defaults to `true`
- include-sugars? - A boolean switch to include sugars in the list of selectable ingredients. Defaults to `true`

### Hops

- timing-strategy - A keyword from the set `#{:random :weighted :inferred}` to determine how hop timings and uses should be selected. Defaults to `:random`
- time-weights - A map from hop addition times to weights. e.g. `{120 60.0 45 15.0 ...}`
- use-weights - A map from hop use names to weights. e.g. `{"boil" 60 ...}`
- include-aroma? - A boolean switch to include aromatic hops. Defaults to `true`
- include-bittering? - A boolean switch to include bittering hops. Defaults to `true`
- include-both? - A boolean switch to include dual-purpose hops. Defaults to `true`

### Yeasts

- include-brewtek? - A boolean switch to include yeasts from Brewtek. Defaults to `true`
- include-dcl-fermentis? - A boolean switch to include yeasts from DCL Fermentis. Defaults to `true`
- include-lallemand? - A boolean switch to include yeasts from Lallemand. Defaults to `true`
- include-white-labs? - A boolean switch to include yeasts from White Labs. Defaults to `true`
- include-wyeast? - A boolean switch to include yeasts from Wyeast. Defaults to `true`

## Testing

[doo](https://github.com/bensu/doo), a Leiningen plugin used to run ClojureScript tests in many JS environments, is already in `project.clj`.
[Karma](https://karma-runner.github.io/latest/index.html) is used as the test runner, and is included in `package.json`.

To install Karma, simply install the Node package:

```shell
npm install
```

Then build the application and run the tests:

```shell
lein test-build
```

The tests will also execute on the JVM, to ensure the library is compatible for both runtime environments.

## Contributors

## License

Copyright © 2019-2022 - [Wall Brew Co](https://wallbrew.com/)

This software is provided for free, public use as outlined in the [MIT License](https://github.com/Wall-Brew-Co/brew-bot/blob/master/LICENSE)

repository: Wall-Brew-Co/brew-bot

gha_language: Clojure

repo_name: Wall-Brew-Co/brew-bot


text:
---
layout: post
title: Understanding this keyword in Javascript
bigimg: /img/image-header/ravashing-beach.jpg
tags: [Front-End, Javascript]
---

In C++, ```this``` keyword usually refer to the object ifself. It always uses in the method of class. And there are no any tricks with ```this``` keyword. But in Javascript, ```this``` keyword is affected by many things such as context of object, the usage of functions, ...

So, in this article, we will discuss about ```this``` keyword to make our concern more clear about ```this``` keyword.

## Table of contents
- [Introduction to this keyword](#introduction-to-this-keyword)
- [Simple rule for this keyword](#simple-rules-for-this-keyword)
- [Examples for this keyword](#examples-for-this-keyword)
- [Wrapping up](#wrapping-up)

## Introduction to this keyword
According to the [w3school.com](https://www.w3schools.com/js/js_this.asp), we have:
- The JavaScript ```this``` keyword refers to the object it belongs to.
- It has different values depending on where it is used:
    - In a method, ```this``` refers to the owner object.
    - Alone, ```this``` refers to the global object.
    - In a function, ```this``` refers to the global object.
    - In a function, in strict mode, ```this``` is undefined.
    - In an event, ```this``` refers to the element that received the event.
    - Methods like call(), and apply() can refer ```this``` to any object.

## Simple rules for this keyword
So, with the previous section, we will have a rule:

```
this keyword will refer to the object or context that is the nearest to it.
```

## Examples for this keyword
- Regular function

    ```javascript
    function foo() {
        console.log("Simple function call");
        console.log(this === window);
    }

    foo()
    ```

    Because, ```foo()``` is a regular function, so the ```this``` will refer to the global object - ```window```.

    Result:

    ```
    Simple function call
    true
    ```

    But if we use strict mode, we have:

    ```javascript
    function foo() {
        'use strict';
        console.log("Simple function call");
        console.log(this === window);
    }

    foo()
    ```

    So, we have a result will look something like;

    ```
    Simple function call
    false
    ```

    Now, ```this``` will refer to ```undefined```, not ```window``` object.

- Constructor function

    ```javascript
    function Person(first_name, last_name) {
        this.first_name = first_name;
        this.last_name = last_name;

        this.displayName = function() {
            console.log(`Name: ${this.first_name} ${this.last_name}`);
        }
    }

    let john = new Person('John', 'Reid');
    john.displayName();
    ```

    When we call ```new``` on ```Person``` constructor function, Javascript will create a new object inside the ```Person``` constructor function and save it as ```this```. Then, the ```first_name```, ```last_name``` and ```displayName``` properties will be added on the newly created this object.

- Simple object

    ```javascript
    function simpleFunction () {
        console.log("Simple function call")
        console.log(this === window);
    }

    let user = {
        count: 10;
        simpleFunction: simpleFunction,
        anotherFunction: function() {
            console.log(this === window);
        }
    };
    ```

    When we call ```user.simpleFunction()``` or ```user.anotherFunction()```, we have a result:

    ```
    Simple function call
    false
    ```

    Because ```this``` now refer to the ```user``` object.

    But if we do something like:

    ```javascript
    let ourFunction = user.anotherFunction();
    ourFunction();
    ```

    Then, we have:

    ```
    Simple function call
    true
    ```

    Because ```ourFunction()``` is a regular function, so ```this``` will refer to the global object - window.

- Embedded regular function into method class

    ```javascript
    var john = {
        name: 'john',
        yearOfBirth: 1990,
        calculateAge: function() {
            console.log(this);
            console.log(2016 - this.yearOfBirth);

            function innerFunction() {
                console.log(this);
            }
            innerFunction();
        }
    }
    ```

    When we call ```john.calculateAge()```, the ```this``` will be implicitly passed into a register. So, ```calculateAge()``` function is called, CPU will get value form that register and assign to the ```this``` keyword such as ```this```, ```this.yearOfBirth````.

    But, inside the ```innerFunction()``` function, ```this``` will not refer to the ```john``` object, mainly because it is a regular function. Therefore, ```this``` in ```innerFunction()``` will refer to global object - ```window```.

- Use arrow function

    Unlike regular function, arrow functions do not get their own ```this``` keyword. They simply use the ```this``` keyword of the function they are written in.

    ```javascript
    var box = {
        color: 'green', // 1
        position: 1, // 2
        clickMe: function() { // 3
            document.querySelector('body').addEventListener('click', function() {
                var str = 'This is box number ' + this.position + ' and it is ' + this.color; // 4
                alert(str);
            });
        }
    }
    ```

    When we call ```box.clickMe()``` method, a result we have:

    ```
    This is box number undefined and it is undefined
    ```

    Because inside the ```clickMe()``` function, ```this``` keyword also is passed to it. But in callback function, ```this``` keyword of ```box``` object do not pass. So, ```this``` in callback function will be ```undefined````.

    To solve this problem, we need to save the ```this``` keyword of ```box``` object into the other variable of ```clickMe()``` function.

    ```javascript
    var box = {
        color: 'green', // 1
        position: 1, // 2
        clickMe: function() { // 3
            let self = this;

            document.querySelector('body').addEventListener('click', function() {
                var str = 'This is box number ' + self.position + ' and it is ' + self.color; // 4
                alert(str);
            });
        }
    }
    ```

    So, we have:

    ```
    This is box number 1 and it is green
    ```

    Another solution is to use arrow function.

    ```javascript
    var box = {
        color: 'green', // 1
        position: 1, // 2
        clickMe: function() { // 3
            document.querySelector('body').addEventListener('click', () => {
                var str = 'This is box number ' + this.position + ' and it is ' + this.color; // 4
                alert(str);
            });
        }
    }
    ```

    The amazing thing about arrow functions is that they share the lexical ```this``` keyword of their surroundings.

    Then, we have:

    ```
    This is box number 1 and it is green
    ```

    And we still have other case for arrow function such ash.

    ```javascript
    var box = {
        color: 'green', // 1
        position: 1, // 2
        clickMe: () => { // 3
            document.querySelector('body').addEventListener('click', () => {
                var str = 'This is box number ' + this.position + ' and it is ' + this.color; // 4
                alert(str);
            });
        }
    }
    ```

    When we have ```box.clickMe()```, we have:

    ```
    This is box number undefined and it is undefined
    ```

    The ```this``` keyword of the click event listener’s closure shares the value of the ```this``` keyword of its surroundings. Its surroundings in this case is the arrow function ```clickMe()```. The ```this``` keyword of the ```clickMe``` arrow function refers to the global object, in this case the ```window``` object.

    So, ```this.position``` and ```this.color``` will be ```undefined``` because our ```window``` object does not know anything about the ```position``` or the ```color``` properties.

- Some ways to pass ```this``` in ```map``` function

    Come back to the previous example, we have:

    ```javascript
    function Person(firstName, lastName) {
        this.firstName = firstName;
        this.lastName = lastName;

        this.displayName = function() {
            console.log(`Name: ${this.firstName} ${this.lastName}`);
        }
    }

    Person.prototype.myFriends = function(friends) {
        var arr = friends.map(function(friend) {
            return this.firstName + ' is friends with ' + friend;
        });
        console.log(arr);
    }

    let john = new Person("John", "Watson");
    ```

    So, call ```john.myFriends(["Emma", "Tom"])``` we have a result:

    ```
    "undefined is friends with Emma", "undefined is friends with Tom"
    ```

    Because ```this``` in callback function of ```map``` will refer to the global object - ```window```.

    To fix this problem, we have 3 solutions:
    - Save ```this``` keyword inside the other variable in ```myFriends()``` function.

        ```javascript
        Person.prototype.myFriends = function(friends) {
            let self = this;

            var arr = friends.map(function(friend) {
                return self.firstName + ' is friends with ' + friend;
            });
            console.log(arr);
        }
        ```

    - Using ```bind``` on the ```map``` function's closure.

        ```javascript
        Person.prototype.myFriends = function(friends) {
            var arr = friends.map(function(friend) {
                return this.firstName + ' is friends with ' + friend;
            }.bind(this));

            console.log(arr);
        }
        ```

        Calling ```bind``` will return a new copy of the ```map``` callback function but with a ```this``` keyword mapped to the outer ```this``` keyword, which is, in this case, will be the ```this``` keyword referring to the object calling ```myFriends```.

    - Using arrow function for map function's closure

        ```javascript
        Person.prototype.myFriends = function(friends) {
            var arr = friends.map(friend => {
                `${this.firstName} is friends with ${friend}`;
            });

            console.log(arr);
        }
        ```

## Wrapping up
- In regular function, ```this``` refer to global object.
- Arrow function will retain the ```this``` keyword of outer function.

Thanks for your reading.

Refer:

[https://itnext.io/the-this-keyword-in-javascript-demystified-c389c92de26d](https://itnext.io/the-this-keyword-in-javascript-demystified-c389c92de26d)


text:
# Tables and Keys

## Tables
column --> attribute
row --> record

## Keys
### primary key
- the unique key for rows in this table
### Composite key (Compound key)
- when multiple columns to uniquely identify one row, these columns make up a composite key
### surrogate key
only has meaning in this table
### natural key
has meaning outside the table, may be used in other places
### foreign key
is primary key of another table, linking this row to another row (in another table or in the same table)

repository: ZhongkaiLiu/learnsql

repo_name: ZhongkaiLiu/learnsql


text:
+++
title = "Installation"
weight = 1
+++

There are two means of installing SpectralAnalysis and you can choose the one that best fits your use case. The standalone version works without requiring a MATLAB licence, however this cannot be modified or make use of any of the ['advanced' functionality](/advanced-use/). The source code version requires a valid MATLAB licence, however can perform both [general](/basic-usage/) and [advanced](/advanced-use/) functionality.

## Standalone Version

Currently requires 64-bit Windows. If you are running 32-bit Windows and want a standalone version please [contact me](https://github.com/AlanRace/SpectralAnalysis/issues/new).

1. Download and extract the zip file of the [latest release](https://github.com/AlanRace/SpectralAnalysis/releases)
2. Download and install the [R2016b (9.1) MATLAB Runtime](https://uk.mathworks.com/products/compiler/mcr/)
3. Download and install the [Visual C++ Redistributable for Visual Studio 2015](https://www.microsoft.com/en-us/download/details.aspx?id=48145)
4. Run SpectralAnalysis.exe

## Source code Version {#source-version}

The source code version requires a valid MATLAB licence.

### Increase Java Heap Space
Prior to running SpectralAnalysis, it is advisable to increase the 'Java Heap Size' allocated to MATLAB to the maximum available. This enables larger imzML files to be opened successfully.

* [MATLAB 2010a or later](http://uk.mathworks.com/help/matlab/matlab_external/java-heap-memory-preferences.html)
* [MATLAB 2009b or earlier](https://uk.mathworks.com/matlabcentral/answers/92813-how-do-i-increase-the-heap-space-for-the-java-vm-in-matlab-6-0-r12-and-later-versions)

### Installation with Git

     git clone https://github.com/AlanRace/SpectralAnalysis
     cd SpectralAnalysis
     git submodule update --init

### Installation without Git

1. Download the source code of the [latest release](https://github.com/AlanRace/SpectralAnalysis/releases)
2. Download the latest version of [MOOGL](https://github.com/AlanRace/MOOGL/tree/develop) and place in the `SpectralAnalysis\src\gui\MOOGL` folder
2. Open MATLAB and navigate to the folder containing the source code
3. Run the command `runSpectralAnalysis`

### Compatible MATLAB Versions

If you use a currently untested version of MATLAB, please let me know any successes or issues you encounter ([submit issues](https://github.com/AlanRace/SpectralAnalysis/issues)).

| MATLAB Version | Compatibility        | Notes  |
| -------------- |-------------| -----|
| R2016b | Compatible |  |
| R2016a | Compatible |  |
| R2015b | Compatible |    |
| R2015a | Compatible |     |
| R2014b | Compatible |     |
| R2014a | Compatible |     |
| R2013b | Untested |     |
| R2013a | Untested |     |
| R2012b | Untested |     |
| R2012a | Untested |     |
| R2011b | Untested |     |
| R2011a | Untested |     |
| R2010b | Untested |     |
| R2010a | Untested |     |
| R2009b | Untested |     |
| R2009a | Untested |     |

repository: XLoizeau/SpectralAnalysis

repo_name: XLoizeau/SpectralAnalysis


text:
# Creating an event

Events are basic types that represent something that happened in the system
We typically give these a name that has meaning in the domain one is working in.
This name represents something that happened to the system and is typically named
in past tense.

In addition to the name, it needs to be uniquely identified. The same event is
not necessarily ubiquitous in name and therefor needs an identifier. The event
can also change name over time as the domain knowledge and language evolves.
Technically for Cratis, the Kernel also does not know anything about the connected
client and in fact one can be defining events outside of code, leveraging the REST
API and in the future, other clients for other programming languages.

With C# you define an event simply by creating a `record` and adorning it with the
attribute `[EventType]` located in the `Aksio.Cratis.Events` namespace.
The first and required parameter it takes on the attribute is the unique identifier in
the form of a string representation of a [Guid](https://docs.microsoft.com/en-us/dotnet/api/system.guid?view=net-6.0).

```csharp
[EventType("3daa0bf9-4cca-455e-87bc-c27dade3eb11")]
public record DebitAccountOpened(AccountName Name, CustomerId Owner);
```

You can also create event types using classes and properties. However, since events are
to considered immutable, `record` gives you that out of the box without having to resort
to either `init` properties or private properties with a constructor that sets them.

> Note: Notice the use of [concepts](../fundamentals/concepts.md) for the value types
> on the events.

All events are automatically discovered at runtime and registered in the Cratis Schema Store.

repository: aksio-insurtech/Cratis

gha_language: C#

repo_name: aksio-insurtech/Cratis