text:
# Sync Pipedrive with Zendesk

This script (`syncpipedrive.py`) allows you to synchronize your accounts & contacts from Pipedrive to Zendesk.

# Getting Started

These instructions will get you running with the project.

### Prerequisites

What things you need to install the software and how to install them

```
Python 2.x with the following library installed:
requests==2.18.2
```
## Creating your own config.json
Use the config.json below as a template and modify its values to match your credentials and configuration.

```
{
  "zendesk": {
    "enduserurl": "https://{subdomain}.zendesk.com/api/v2/users.json?role\[\]=end-user",
    "orgurl": "https://{subdomain}.zendesk.com/api/v2/organizations.json",
    "username": "",
    "apikey": "",
    "url": "{subdomain}.zendesk.com"
  },
  "pipedrive": {
    "apikey": ""
  }
}
```

 - Zendesk API key:
   https://support.zendesk.com/hc/en-us/articles/226022787-Generating-a-new-API-token-

 - Pipedrive API key:
   https://support.pipedrive.com/hc/en-us/articles/207344545-How-to-find-your-personal-API-key

## Running the sync
Upon running ```python syncpipedrive.py```, status messages will be printed to the terminal window:
```
Start sync of organizations from pipedrive to zendesk
Synchronized all organizations from pipedrive to zendesk
Start sync of persons from pipedrive to zendesk
Synchronized all contacts from pipedrive to zendesk
Sync took 0:21:00.792935
```

repository: mindthevirt/syncpipedrive

repo_name: mindthevirt/syncpipedrive


text:
# ngReactive #

> Try to keep as many of your components as possible stateless.
>
> --- <cite>[React Documentation](https://facebook.github.io/react/docs/interactivity-and-dynamic-uis.html)</cite>

ngReactive is a variant to the traditional ngReact which takes a slightly different approach to how you integrate React
components into your angular application.

The attractive nature of React is it's speed. So the glue you use to integrate React with your angular app should try
to be just that, a glue and not a bottle neck.

React recommends you should have one stateful component at the top of the hierarchy, with ngReactive the manipulation of
states are managed by your angular controller and the React components are left stateless. This along with a series of
micro-optimisations allow for faster, more efficient renders.

ngReactive auto-wraps functions passed as properties in angular $digests, and DOESN'T for renders. As such, all
communication from your React component back to your angular app should be done so through callbacks. Adhering to this
practice allows a reduction in unnecessary angular $digest cycles and allows for faster asynchronous rendering of
components.

### Usage ###

1. Include ngReactive as a dependency

```javascript
angular.module('myApp', [
        'react',
        'ngReactive'
    ]);
```

2. Create a directive for your React component

```javascript
let Test = React.createClass({
    displayName: 'Test',
    propTypes: {
        val: React.PropTypes.number,
        callback: React.PropTypes.func
    },
    click () {
        this.props.callback();
    },
    render: function () {
        return <div>
            <p onClick={this.click}>Val: {this.props.val}</p>
        </div>;
    }
});

angular.module("myApp")
    .directive("test", (ngReactive) => ngReactive(Test));
```

3. Awesome success

### API ###

ngReactive takes up to three arguments;

* reactComponent {ReactClass} The React component class
* params {Object} (Optional) Parameters to set on angular directive
* deepParse {Boolean=false} (Optional) When enabled replaces parameters passed to your React component with a lazy load
proxy that auto wraps any nested functions in a $digest cycle.

license: MIT

repository: raininglemons/ng-reactive

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: raininglemons/ng-reactive


text:
📱 💻 🖥 ❤ 🖥 💻 📱

# SwiftUI-UI-Testing

This project aims to demonstrate how to write automated UI tests for SwiftUI components.

Writing good UI testing code is hardly different from writing good software in general: Learn from the past, follow SOLID principles, and read Robert Martin’s [Clean Code](https://sites.google.com/site/unclebobconsultingllc/books).

![alt text](https://github.com/burhanaras/SwiftUI-UI-Testing/raw/main/Screenshots/screen.gif "SwiftUI Automated UI Testing")

## Understanding Best Practices for Testing
The acronym FIRST describes a concise set of criteria for effective unit tests. Those criteria are:

- **Fast:** Tests should run quickly.
- **Independent/Isolated:** Tests shouldn’t share state with each other.
- **Repeatable:** You should obtain the same results every time you run a test. External data providers or concurrency issues could cause intermittent failures.
- **Self-validating:** Tests should be fully automated. The output should be either “pass” or “fail”, rather than relying on a programmer’s interpretation of a log file.
- **Timely:** Ideally, you should write your tests before writing the production code they test. This is known as test-driven development.

Following the FIRST principles will keep your tests clear and helpful, instead of turning into roadblocks for your app.

## Given-When-Then Style
The essential idea is to break down writing a scenario (or test) into three sections:
- The **GIVEN** part describes the state of the world before you begin the behavior you're specifying in this scenario. You can think of it as the pre-conditions to the test.
- The **WHEN** section is that behavior that you're specifying.
- Finally the **THEN** section describes the changes you expect due to the specified behavior.

repository: burhanaras/SwiftUI-UI-Testing

branch_name: refs/heads/main

repo_name: burhanaras/SwiftUI-UI-Testing


text:
Variables are saved globally for each file, so you can access them from different lines!

### Input
```
execute store result score Player*(players = [1, 2, 3])* Progress run bossbar get example:player_*(players)* value
execute if score Player*(players)* Progress matches 100.. run say The winner is player *(players)*!
```

### Result
```mcfunction
execute store result score Player1 Progress run bossbar get example:player_1 value
execute store result score Player2 Progress run bossbar get example:player_2 value
execute store result score Player3 Progress run bossbar get example:player_3 value
execute if score Player1 Progress matches 100.. run say The winner is player 1!
execute if score Player2 Progress matches 100.. run say The winner is player 2!
execute if score Player3 Progress matches 100.. run say The winner is player 3!
```


text:
# caMicroscope GSoC 2020
caMicroscope is a digital pathology image viewer with support for human/machine generated annotations and markups. The source code of the caMicroscope project can be found at https://github.com/camicroscope/caMicroscope, released with BSD 3-Clause License. In addition to the caMicroscope project, caMicroscope as an organization also hosts several related tools and products at https://github.com/camicroscope/

# Cancer Region of Interest Extraction and Machine Learning

Mentors: Insiyah Hajoori and Ryan Birmingham

Overview:

This project would involve extending the existing machine learning intergrations beyond marking up images, and allow users to fetch regions of interest from a given slide automatically. This would allow for users and scientists to train other models for tasks such as synthetic data generation. Specifically, this task would involve letting a user run a model on an image and download sections of the image based on model output.

The aim is to support a wider range of models and flexible use of their outputs. One such example is a two stage CNN described here. Currently, caMicroscope supports single stage networks showing results directly, but no provision to use those results in any other model.

Current Status: Currently, caMicroscope supports uses of multiple types of models for markup, implemented with TensorFlow.js. Likewise, download of areas in an image given a bounding box is also supported.

## Code Challenge:
Using a machine learning toolkit of your choice, create a tool which identifies objects in the image, then returns positions in pixels corresponding to bounding boxes of a user-selected class of object in the image. For example, given an image with both cats and dogs, return bounding boxes for only cats.

 - My project on codesandbox:
   https://codesandbox.io/s/object-detection-using-tensorflow-js-g4k9n

## Proposal

repository: EmanElrefai/caMicroscope

repo_name: EmanElrefai/caMicroscope


text:
+++
title = "OpenShift on AWS Storage options"
chapter = true
weight = 30
+++

# OpenShift on AWS Storage Options

AWS provides a braod variety of storage options for customers to use in the solution stacks. Each of these storage options caters for different use cases and provides different options for resilience, scale and recover.

The following AWS white paper discusses the various AWS storage options as well as related considerations.
https://docs.aws.amazon.com/whitepapers/latest/aws-storage-services-overview/aws-storage-services-overview.pdf

This is a recommended read not only for container solutions but also for any workload which as a storage requirement on AWS.

## Ephemeral storage:

AWS EC2 instances which form the compute layer under pinning OpenShift on AWS have directly attached physical disk storage.
This is low cost, high performance storage which comes as part of the EC2 instance selection. i.e when you select an AWS instance type as an OpenShift worker node it will come with some ephemeral or instance store storage.

OpenShift can make use of ephemeral storage.

However it should be noted that ephemeral storage is linked to a specific node, if the container or pod changes state or is moved to an other node that data is lost, if the Ec2 instance is stopped, or replaced that storage is lost. It is Volatile storage. As such careful consideration should be made when deciding to make use of ephemeral storage.

These considerations are discusses from page 22 of the above white paper.

The following documentation discusses emphemeral storage within OpenShift
https://docs.openshift.com/container-platform/4.7/storage/understanding-ephemeral-storage.html

## persistant storage

More commonly customers make use of peristant storage.
Storage is provisioned and presented to the OpenShift cluster, on AWS this is commonly EBS volumes attached to EC2 instances. OpenShift then allows for Kubernettes persistant volume claims to allow pods to claim portions of the provisioned storage.

It should be noted that AWS EBS storage can be provisioned from the AWS console and attached to OpenShift worker nodes, or EBS volumes can be provisioned from within the OpenShift web console.

OpenShift 4 controls AWS EBS via an AWS EBS CSI:
https://docs.openshift.com/container-platform/4.7/storage/container_storage_interface/persistent-storage-csi-ebs.html#persistent-storage-csi-ebs

## Shared Storage

Shared storage is provisioned and presented to multiple OpenShift nodes, which allows for scale and resilience benefits.
Common options include AWS EFS and AWS S3, OpenShift 3 could implement glusterFS, but OpenShift 4 it is more common to see ceph.
Ceph implementations will see EBS volumes attached to OpenShift strorage nodes, this storage is then aggregated and presented to OpenShift worker nodes.

## Food for thought... if you don't have to .... Don't!

Feedback from successful customers is that running OpenShift on AWS allows for reduction of persistent storage management.
Making use of AWS native services such as AWS Relational database service (RDS), Amazon elsticache, Amazon S3, Amazon Dynamodb can replace application stack layers running within OpenShift. This means that customers no longer need to manage the related persistant storage for these layers. The native AWS services in many cases provide storage expantion and scaling as needed.

{{% children showhidden="false" %}}

repository: mayurshetty/openshift-on-aws

repo_name: mayurshetty/openshift-on-aws


text:
---
# This page was generated from the add-on.
title: Options Statistics screen
type: userguide
weight: 21
---

# Options Statistics screen

This screen allows you to configure the [statistics](/docs/desktop/start/features/stats/)
that ZAP maintains.

### In Memory Statistics Enabled

By default ZAP maintains the statistics in memory. To disable the in memory statistics uncheck this box.

### Statsd Server Enabled

Check this box in order to configure the address of a Statsd server that ZAP will send its statistics to.

### Statsd Hostname

The host that the Statsd server is running on.

### Statsd Port

The port that the Statsd server is listening to, default 8125.

### Statsd Prefix

The prefix ZAP will prepend to the statistics that it sends to the Statsd server.

## See also

|   |                                                      |                                                 |
|---|------------------------------------------------------|-------------------------------------------------|
|   | [UI Overview](/docs/desktop/ui/)                     | for an overview of the user interface           |
|   | [Options dialogs](/docs/desktop/ui/dialogs/options/) | for details of the other Options dialog screens |

repository: zaproxy/zaproxy-website

gha_language: HTML

gha_license_id: MIT

repo_name: zaproxy/zaproxy-website


text:
# jira-tools
Scripts to query JIRA, generate tree graphics etc.
Note these are pretty rough draft quality at present...

# Tree Diagram

First, you need to create a file called `private_jira_password.py`, which must contain a tuple `my_auth`.
The content of this file could look something like this:
`my_auth=('jira_username', 'jira_password')`

*This example will not work. Use your own SKA JIRA login details.*

Then you can run the script `make_png_tree.sh`, which will generate an image file `jira-tree-diagram.png`, and output some status information along the way.

The JIRA query is hard-coded, modify `jira-parse.py` to suit your needs. I will update to make it a bit more flexible when I get a chance.

## Example Output

```
$ ./make_png_tree.sh
Starting with query type = Objective and labels = "Team_PERENTIE" and fixVersion="PI4"
Crawling Objective SPO-215
Crawling Objective SPO-214
Crawling Objective SPO-213
Crawling Objective SPO-212
Crawling Objective SPO-211
Crawling Objective SPO-210
Crawling Objective SPO-209
Crawling Objective SPO-208
Crawling Objective SPO-207
SPO-215 Implement custom 25G communications firmware between FPGAs to enable multi-LRU systems in preparation for optical circuit
	SP-540 Operational Optical Comms
		AT6-226 Implement 25G inter-FPGA communications firmware
		AT6-227 Add QSFP to two development boards
		AT6-228 Basic testing of communications firmware in FPGA functions as expected over the optical link
```
*[... output continues ...]*

![Example Tree Diagram](example/jira-tree-diagram.png)

# Story Points by Person & Iteration

Run the `storypoints.py` script.

Output is a table of points allocated to each person by iteration (sprint).
Again, query is hard-coded.

## Example Output

```
$ python3 storypoints.py
Abel, Norbert	 12    3    2    4    0
Bengston, Keith	  5    4    3    0   11
Bolin, Andrew	  4   19    4    0    9
Bunton, John	  8    6    2    3    0
Chen, Yuqing	  4    4    0    4    4
Hampson, Grant	 13    9    8    7    3
Humphrey, David	  0    0    8    5    7
Troup, Euan	  0    2   15    9    0
```

repository: ska-telescope/jira-tools

gha_language: Python

repo_name: ska-telescope/jira-tools


text:
# Meadowsweet (*Filipendula Ulmaria*)

## Treat these health issues with flowers of meadowsweet

- **Inflammation** and **pain affecting the joints** and connective tissue (rheumatism).
- Calmative that **reduces anxiety or nervousness**.
- **Heartburn**. Stomach and duodenal **ulcers**.
- Natural **pain reliever**. Effective for **menstrual pain**.

[Read why it works safely](#todo-add-section-link)

## Preparation

To prepare a meadowsweet infusion, steep **2 g** (1 teaspoon) of meadowsweet flowers in **1 cup** (250 mL) of boiling water (**100°C**) for **10-15 minutes** and then strain.

A meadowsweet infusion can be taken anytime for pure enjoyment of its floral notes with a sweet aftertaste.

## Dosage and course of treatment

For acute, serious, and immediately present symptoms of the health issues described above, drink **1 cup** during waking hours **every 1-2 hours**. As symptoms subside, gradually space out the dose to **1-2 cups daily**.

For a chronic health issue drink **1 cup** before meals **3 times daily**.

When using meadowsweet to treat or prevent a health issue, or relieve the symptoms, take the appropriate dose for **at least 8 days**. If your health issues has been remedied, you can stop taking doses on a regular basis.

If a regular basis is needed, drink **1 cup** before meals **3 times daily** for **8 days**. Let the body acclimate and **stop taking doses for 3 days** before starting another **8 day treatment**. Meadowsweet can be taken in this 8-days-on-3-days-off cycle continuously.

[Start your trial now](#todo-add-page-link)

## Precautions

It's always advised to consult your health professional and do your own research before starting any treatment to avoid interactions.

It's best to **avoid mixing** medication and herbs within **3 hours of each other**, as many combinations have not been tried or tested. Meadowsweet is known to interact with aspirin, as both have similar effects.

If you're on any medication, stay on it unless otherwise prescribed by your doctor.

Use smaller doses for children under 12, due to salicylate content. Meadowsweet should be avoided by those with a sensitivity to aspirin or salicylates.

Avoid meadowsweet during pregnancy, as it may stimulate uterine activity.

## Contraindications and warnings

Salicylate constituents have been documented and therefore the usual precautions recommended for salicylates are relevant for meadowsweet (TODO [Willow]). Meadowsweet is stated to be used for the treatment of diarrhoea in children, but in view of the salicylate constituents, this is not advisable. Bronchospastic activity has been documented in preclinical studies and, therefore, it is prudent to advise that meadowsweet should be used with caution by asthmatics. Aqueous extracts have been reported to contain high tannin concentrations and excessive consumption should therefore be avoided.

## Pregnancy and lactation

In vitro utero-activity has beendocumented for meadowsweet. In view of the salicylate constituents and the lack of toxicity data, the use of meadowsweet during pregnancy and lactation should be avoided.

## Proven safety and effectiveness of meadowsweet

- **Inflammatory joint pain** as well as **non-inflammatory joint pain**.
- **Soft tissue pain** (fibromylagia).
- **Fever**.
- Calmative that **reduces anxiety or nervousness**.
- **Heartburn**. Stomach and duodenal **ulcers**.
- Natural reliever for **general pain** and aches. Effective for **menstrual pain**.

---

Meadowsweet flowers, like many natural products, contain pro-drugs. Pro-drugs are substances which must undergo a biotransformation inside the body (in vivo) to become an active medical drug.

Meadowsweet flowers naturally contain a group of compounds called salicylates. The primary ingredient in aspirin (acetyl-salicylic acid) is a salicylate and a pro-drug. Aspirin becomes the active compound salicylic acid inside the body.

A standard dose of aspirin contains approximately 325 mg of acetylsalicylic acid (99% pure) and is taken every 4-6 hours for general pain relief, inflammation, and swelling ([J&J C. Inc., n.d.]). A dose of 2 g of meadowsweet flowers prepared in an infusion has less than 3 mg of methyl salicylate, the primary salicylate naturally present ([Olennikov, 2017]).

Clearly, just the 3 mg of methyl salicylate present in a 2 g dose of meadowsweet flowers would give a lower level of pain relief than a dose of 325 mg concentrated pharmaceutical strength aspirin.

However, 2 g of meadowsweet flowers contains about 270 mg of 119 different compounds ([Olennikov, 2017]; [Bijttebier, 2016]). The major active compounds are salicylates, tannins, and phenolic compounds. The mixture of these compounds creates an overall effect that is safer than aspirin as will be explained below.

Firstly, it has been confirmed that that the tannins and phenolic compounds found in meadowsweet are partially responsible for the anti-ulcer, anti-fever (antipyretic), and anti-inflammatory properties ([Samardžića, 2018]).

Aspirin, and other nonsteroidal anti-inflammatory drugs ([J&J C. Inc., n.d.]), have been proven to provoke ulcers. [ref Cryer]  The probability of a person dying from a stomach (peptic) ulcer is low today, at 1 in 100,000. For a duodenal ulcer, the probability is much higher at 5 in 100 ([Anand, 2018]).

An infusion from meadowsweet protects the body from ulcers forming in the first place (anti-ulcerogenic) [ref A Clinical Guide to, ref Braun, Lesley]. In an in vivo study done on rats, ulcers were induced using high doses of aspirin. Rats that were given meadowsweet infusions before the high dose of aspirin did not form ulcers. Furthermore, rats that already had stomach ulcers experienced higher healing when given meadowsweet infusions as treatment ([Barnaulov, 1980]).

The anti-inflammatory and pain-relieving (analgesic) actions of meadowsweet flowers have been well studied and confirmed ([Bone, 2003]; [Bone, 2007]; [ref Hoffmann, Lewis]).

[Start your trial now](#todo-add-page-link)

<!-- TODO image: tube -->

## Cultural history of meadowsweet

In Russian folklore the heroic knight Kudryash became terrified at the prospect of his own death and refused to fight. In shame, Kudryash planned to drown himself, a fair maiden emerged from the water giving him a garland of meadowsweet flowers, then told him that "no harm would befall of him if he wore it in battle". Kudryash remained unscathed and undefeated.

Fresh meadowsweet is placed on the altar for love spells, or dried is used in various love mixtures. It is also strewn about the house to keep peace and the scent of Meadowsweet is said to cheer the heart. If gathered on midsummer, Meadowsweet will give you information regarding thieves: if you have been robbed, place Meadowsweet on water. If it sinks, the thief is a man. If it floats, a woman.

Meadowsweet is used for love, peace and happiness. The fresh plant is used as an altar decoration or in a bridal bouquet. The scent of meadow sweet is said to cheer the heart.

[Start your trial now](#todo-add-page-link)

## References

- Johnson & Johnson Consumer Inc. (n.d.). *Adult NSAID Dosage Chart*. Retrieved August 17, 2019, from https://www.getreliefresponsibly.com/use-pain-medicine-safely/adult-nsaid-dosage-chart
- Samardžića S., Arsenijević J., Božić D., Milenković M., Tešević V. & Maksimović Z. (2018).
Antioxidant, Anti-Inflammatory and Gastroprotective Activity of Filipendula Ulmaria (L.) Maxim. and Filipendula Vulgaris Moench. *Journal of Ethnopharmacology*, 213, 132-137. https://www.sciencedirect.com/science/article/pii/S0378874117332749
- Barnaulov, O.D. & Denisenko P.P. (1980). Anti-Ulcer Action of a Decoction of the Flowers of the Dropwort, Filipendula Ulmaria (L.) Maxim. *Farmakologiya i Toksikologiya*, 43(6), 700-5. https://www.ncbi.nlm.nih.gov/pubmed/7450008
- Bijttebier S., Van der Auwera A., Voorspoels S., Noten B., Hermans N., Pieters L., Apers S. (2016). A First Step in the Quest for the Active Constituents in Filipendula Ulmaria (Meadowsweet): Comprehensive Phytochemical Identification by Liquid Chromatography Coupled to Quadrupole-Orbitrap Mass Spectrometry. *Planta Medica*, 82(6), 559–572. https://www.ncbi.nlm.nih.gov/pubmed/26845709
- Bone, K. (2003). *A Clinical Guide to Blending Liquid Herbs: Herbal Formulations for the Individual Patient* (1st Edition). London, England: Churchill Livingstone.
- Bone, K. (2007) *The Ultimate Herbal Compendium: a Desktop Guide for Herbal Prescribers*. Phytotherapy Press.
- Olennikov, D.N., Kashchenko N.I. & Chirikova N.K. (2017) Meadowsweet Teas as New Functional Beverages: Comparative Analysis of Nutrients, Phytochemicals and Biological Effects of Four Filipendula Species. *Molecules*, 22(1), 16 https://www.ncbi.nlm.nih.gov/pmc/articles/PMC6155584
- Anand B.S. (2018). *What Is the Mortality Rate for Peptic Ulcer Disease (PUD)?* Retrieved August 19, 2019, from  https://www.medscape.com/answers/181753-13872/what-is-the-mortality-rate-for-peptic-ulcer-disease-pud

[J&J C. Inc., n.d.]: https://www.getreliefresponsibly.com/use-pain-medicine-safely/adult-nsaid-dosage-chart 'Adult NSAID Dosage Chart'
[Samardžića, 2018]: https://www.sciencedirect.com/science/article/pii/S0378874117332749 'Antioxidant, Anti-Inflammatory and Gastroprotective Activity of Filipendula Ulmaria (L.) Maxim. and Filipendula Vulgaris Moench'
[Barnaulov, 1980]: https://www.ncbi.nlm.nih.gov/pubmed/7450008 'Anti-Ulcer Action of a Decoction of the Flowers of the Dropwort, Filipendula Ulmaria (L.) Maxim'
[Bijttebier, 2016]: https://www.ncbi.nlm.nih.gov/pubmed/26845709 'A First Step in the Quest for the Active Constituents in Filipendula Ulmaria (Meadowsweet)'
[Bone, 2003]: https://www.elsevier.com/books/a-clinical-guide-to-blending-liquid-herbs/bone/978-1-4557-3400-9 'A Clinical Guide to Blending Liquid Herbs'
[Bone, 2007]: https://books.google.ch/books/about/The_Ultimate_Herbal_Compendium.html?id=8JyIGAAACAAJ 'The Ultimate Herbal Compendium: a Desktop Guide for Herbal Prescribers'
[Olennikov, 2017]: https://www.ncbi.nlm.nih.gov/pmc/articles/PMC6155584 'Meadowsweet Teas as New Functional Beverages'
[Anand, 2018]: https://www.medscape.com/answers/181753-13872/what-is-the-mortality-rate-for-peptic-ulcer-disease-pud 'What is the mortality rate for peptic ulcer disease (PUD)?'

TODO reference formatting:

- Braun, Lesley, and Marc Cohen. "Herbs and Natural Supplements: an Evidence-Based Guide." Churchill Livingstone, 2015.
- Cryer, Byron, and Kenneth W Mahaffey. "Gastrointestinal Ulcers, Role of Aspirin, and Clinical Outcomes: Pathobiology, Diagnosis, and Treatment." Journal of Multidisciplinary Healthcare, Dove Medical Press, 3 Mar. 2014, www.ncbi.nlm.nih.gov/pmc/articles/PMC3970722/.
- Elsevier. “Home.” 2nd Edition, Churchill Livingstone, 31 Dec. 2012, www.elsevier.com/books/principles-and-practice-of-phytotherapy/9780443069925.
- Hoffmann, David. "Medical Herbalism: the Science and Practice of Herbal Medicine." Healing Arts Press, 2003.
- Lewis, Walter H. "Medical Botany: Plants Affecting Human Health, 2nd Edition." John Wiley & Sons, 2003.


text:
# Code Wars 13 - Mutate My Strings

**Author**: Jennifer Bach
**Version**: 1.1.0

## Overview
<!-- I will give you two strings. I want you to transform stringOne into stringTwo one letter at a time.

Example:
stringOne = 'bubble gum';
stringTwo = 'turtle ham';

Result:
bubble gum
tubble gum
turble gum
turtle gum
turtle hum
turtle ham
 -->

gha_language: JavaScript


text:
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) > [stentor-models](./stentor-models.md) > [OptionSelectRequest](./stentor-models.optionselectrequest.md) > [index](./stentor-models.optionselectrequest.index.md)

## OptionSelectRequest.index property

For the selection of an item in a list, this is the index of the item.

This is not always available.

<b>Signature:</b>

```typescript
index?: number;
```

repository: stentorium/stentor

gha_language: TypeScript

repo_name: stentorium/stentor


text:
---
author: alex
comments: true
date: 2013-02-05 19:45:51+00:00
layout: post
redirect_from: /2013/02/podcast-42-2
hero: /images/category/podcasts.jpg
slug: podcast-42-2
title: 'Podcast #42 - It''s The Exception That Proves The Rule'
wordpress_id: 13150
tags:
- company
- podcasts
---

Welcome to Stack Exchange Podcast #42 - it's our usual gang back this week with Joel, Jay, David, and Producer Alex.  There's plenty of inside baseball, so put on your rally caps and make sure to stick it through to the end!

  * David Mamet, apparently. Jay was a drama major.

  * Michael forgot to pay the Google bill, so our hangouts are back down to 10 person limits (but it's fixed now!)

  * We have one big thing to talk about that made a change and generated controversy. Joel correctly guesses what it is: we no longer display your accept rate (the percentage of questions you asked that you accepted an answer for).

  * The team walks us through this feature's history and the rationale for removing it.  This is related.)

  * Enjoy our _hilariously awkward pause_

  * Jeff Atwood recommended [replacing the accept rate with some kind of citizenship score](http://meta.stackoverflow.com/questions/165179/replace-accept-rate-with-citizenship-level). Will this just cause the same problems as the accept rate? How can we get around the problem of ridiculing people for low "citizenship scores"? People will learn how to game anything, after all - remember flag weight?

  * David wonders why we need a third number at all. We already have your reputation and your badges on your little user card. Those already show how good of a citizen you are.

  * Finally, this is something we're still looking at, so let us know your thoughts on [the meta post](http://meta.stackoverflow.com/questions/165179/replace-accept-rate-with-citizenship-level).

  * Site milestones! We have some good ones this week. Our [Magento](http://magento.stackexchange.com/) site went live (not to be confused with [Mag_ne_to](http://fc09.deviantart.net/fs11/i/2006/238/0/0/Erik_Magnus_Magneto_Colors_by_ErikVonLehmann.jpg)). This one is remarkable because it's something nobody in the company knows anything about, but it got created anyway.

  * Congratulations to [Math](http://mathematics.stackexchange.com/) for being the first non-Trilogy site to hit 100,000 questions! Our hosts discuss the Math site and its relationships with other sites on the network for a while.

  * One more new site to go over: [English Language Learners](http://ell.stackexchange.com/). David and Joel don't really understand this site, so Jay tells us what's going on (hint: it's not about an X-Men villain). ELL should help relieve some stress from [English Language and Usage](http://english.stackexchange.com/), which was frustrated by the high number of certain types of questions that were coming in.

  * Is this podcast the exception that proves the rule?

  * Another site milestone: we have finally rolled out the final design of [our Travel site](http://travel.stackexchange.com/). (It was blocked for a while because Joel had strong opinions about the original design.) When you finish listening to this podcast, go to [Travel](http://travel.stackexchange.com/) and ask or answer a question!

  * [Subscribe to your favorite site's newsletter](http://stackexchange.com/newsletters)!

  * On to our next topic. We are changing some things with how duplicates work. We want to make it more positive! (It's the [you lucky bastard] close reason.) This is the first closing change, and it's going out in the next week or so.

Well that's the podcast for this week!  ****Thanks for tuning in, and now for our standard disclaimers:

###### _This podcast is not sponsored by self-driving car manufacturer Audible.com. Alexis Ohanian did not invent the DVR.  Join us next week when Alexis Ohanian eats a spoonful of cinnamon! Alex is not fired because correlation definitely implies causation._

extension: markdown


text:
---
layout: post
title: JVM
date:   2021-05-21 15:00:00 -0700
categories: reference
tag: java
---

* content
{:toc}

## JVM Commons

__Common Options__
* Standard Option
* Non-standard Option (-X), `-Xms100M -Xmx100M`
* Advanced Runtime Option (-XX), `-XX:+PrintFlagsFinal`

__Common Commands__
```shell
> javac *.java # generate *.class
> javap -p -v *.class # print out an human readable interpretation similar to Assembly
> jps # check for jvm-running processes
> jinfo -flag MaxHeapSize [pid] # check specific option
> jinfo -flags [pid] # check all options
> jstat -class [pid] 500 10 # check for class loading and unloading activities
> jstat -gc [pid] 500 10 # check for gc activities
> jstack [pid] # check for deadlocks
> jmap -heap [pid] # check for heap usage snapshot
```

## Class Loading

Class Loading requires an external program __ClassLoader__ that puts *.class into JVM.
* Loading
  * Take in *.class files as `ByteStreams` and initialize __method area__
  * Generate corresponding `Class` objects in heap, allowing for runtime access to encapsulated data.
* Linking
  * Verification
    * ensures that the binary representation of a class or interface is structurally correct
  * Preparation
    * creating the static fields for a class or interface and initializing such fields to their default values
  * Resolution
    * the process of dynamically determining concrete values __by memory__ from symbolic references in the run-time constant pool
* Initializing
  * class initialization

__Static Constant Pool__ is the most important part represented in *.class files. It is a table of structures representing various string constants, class and interface names, field names, and other constants that are referred to within the ClassFile structure and its substructures. The format of each constant_pool table entry is indicated by its first "tag" byte.

__What happens when developers' code contains the same class as java.lang.* ?__
Both default and customized class loaders follow __parents delegation__ pattern when `loadClass`, as the following example shows.

When loading classes, parent implementation always takes higher priority.

| Class Loader | Loading Scope | Priority | Note |
| :----: | :----: | :----: | :----: |
| BootstrapClassLoader | jre/lib/rt.jar | 0 | written in C |
| ExtClassLoader |  jre/lib/*.jar | 1 | extends BootstrapClassLoader |
| AppClassLoader |  Djava.class.path/*.jar | 2 | extends ExtClassLoader |
| CustomClassLoader | undefined | 3 | |

```java
public abstract class ClassLoader {

    // ... omit other implementations

    protected Class<?> loadClass(String name, boolean resolve)
        throws ClassNotFoundException
    {
        synchronized (getClassLoadingLock(name)) {
            // First, check if the class has already been loaded
            Class<?> c = findLoadedClass(name);
            if (c == null) {
                long t0 = System.nanoTime();
                try {
                    if (parent != null) {
                        c = parent.loadClass(name, false);
                    } else {
                        c = findBootstrapClassOrNull(name);
                    }
                } catch (ClassNotFoundException e) {
                    // ClassNotFoundException thrown if class not found
                    // from the non-null parent class loader
                }

                if (c == null) {
                    // If still not found, then invoke findClass in order
                    // to find the class.
                    long t1 = System.nanoTime();
                    c = findClass(name);

                    // this is the defining class loader; record the stats
                    sun.misc.PerfCounter.getParentDelegationTime().addTime(t1 - t0);
                    sun.misc.PerfCounter.getFindClassTime().addElapsedTimeFrom(t1);
                    sun.misc.PerfCounter.getFindClasses().increment();
                }
            }
            if (resolve) {
                resolveClass(c);
            }
            return c;
        }
    }
}
```

## Runtime Data Area

__Method Area__
* It is created on JVM start-up, shared among all threads
* It stores per-class data structures such as the run-time constant pool, field and method data

__Heap__
* Check [Heap and GC](#heap-and-gc).

__Java Method Stacks__
* It is created at the same time as a thread, private to the thread
* It consists of frames, which contains
    * local variables
    * operand stacks
    * dynamic linking
        * translating these symbolic method references into concrete method references
        * loading classes as necessary to resolve as-yet-undefined symbols
        * translates variable accesses into appropriate offsets in storage structures associated with the run-time location of these variables
    *
* Native Method Stacks
* The pc Register, aka program counter
    * created at the same time as a thread, private to the thread
    * contains the address of the JVM instruction currently being executed

![]({{ '/styles/images/jvm/runtime-data-area.png' | prepend: site.baseurl }})

## Heap and GC

The part of the __heap__ memory managed by GC is divided into __yound generation and old generation__. Their default allocation ratio is 1:2. Young generation is further divided into __Eden, S0 and S1__. Their default allocation ratio is 8:1:1. __Minor GC__ runs whenever Eden is about to reach capacity. __Major GC__ runs whenever old generation is about to reach capacity. Newly created object always goes to Eden unless it cannot fit in, in which case it goes to old generation directly.

__Full GC__ `System.gc()` = minor GC + major GC + MetaSpace GC (historically known as PermGen space GC). Note that __PermGen__ (before Java 8) is allocated within JVM memory. However __MetaSpace__ (After Java 8) is allocated as part of the main/native memory by calling JNI at the system level. It reduces PermGen OOM because it's difficult to estimate how much PermGen space is needed before running a program.

__What triggers a minor GC?__
Minor GC will be triggered by any of the Eden, S0, S1 running out of capacity.

__When an object will be moved from young generation to old generation?__
When an object is still referenced after 15 minor GC. Why 15? Because the age attribute of every object is only 4-bit.

__Why dividing heap memory into young generation and old generation?__
Full GC is expensive as it scans all the heap space. However 98% of the objects are short-lived. That's why it is often sufficient and less expensive to have a smaller space as young generation and conduct minor GC (scan only young generation).

__Why young generation is further divided into Eden, S0 and S1?__
Imagine without S0 and S1, after several GCs, the young generation memory space will be heavily fragmented (objects of various sizes are freed randomly). Now with S0 and S1, the first GC moves the "live" objects from Eden to S0. The second GC moves the "live" objects from Eden and S0 to S1. The third GC moves the "live" objects from Eden and S1 to S0 again....so that after each GC, Eden and one of the survivor area are always clean.

![]({{ '/styles/images/jvm/gc-flow.png' | prepend: site.baseurl }})

## GC Algorithms

__Generally, there are two stages in a GC algorithms__
* Mark Stage
    * Reference counting algorithm fails at circular reference, causing memory leak.
    * Reachability analysis algorithm (root finding algorithm)
        * Description: Starting from GC root, traverse by DFS and mark all the reachable objects.
        * GC root includes:
            * local variable
            * static variable
            * constant
            * JNI
* Clean Stage
    * often causing memory fragmentation depending on how it is done

_Note that application is suspended during GC. Newer garbage collectors, such as G1, tend to have reduced suspension time._

__Specifically, JVM adopted GC algorithms are__
* Mark-Sweep Algorithm
    * Traverse, mark the "live" objects, clean the "dead" objects
    * Memory Fragmentation

* Copy Algorithm
    * Traverse, move the "live" objects to new space, clean the old space
    * Given default ratio 8:1:1 in young generation, 1/10 memory is wasted

* Mark-Compact Algorithm
    * Traverse, mark the "live" objects, clean the "dead" objects, re-organize the "live" objects to avoid fragmentation
    * One of the commonly used compact technique is "sliding" all "live" objects to one end of the heap, overwriting "dead" ones
    * Longer suspension time

__Implemenation-wise, JVM has different GC collectors implement different algorithms__
* Serial collector implements copy algorithm
    * single-threaded, long suspension time, used in minor GC
* Serial Old collector implements mark-compact algorithm
    * single-threaded, long suspension time, used in major GC
* ParNew collector implements multi-threaded version of Serial collector
    * exploiting multi-core hardware to reduce suspension time

* Parallel Scavenge implements copy algorithm
    * multi-threaded, reduced suspension time, used in minor GC
    * focusing on improving throughput (throughput = app runtime / (app runtime + gc time))
* Parallel Od, implements mark-compact algorithm
    * multi-threaded, reduced suspension time, used in major GC
    * focusing on improving throughput (throughput = app runtime / (app runtime + gc time))

* CMS (Concurrent Mark Sweep) implements mark-sweep algorithm
    * initial mark: find all GC roots and their directly pointed objects
    * concurrent mark: multi-threaded, allow app thread to interrupt
    * re-mark: some references are modified, re-mark those objects, doesn't allow app threads to interrupt???
    * concurrent sweep

* G1 (Garbage First) allows users to specify desired suspension time
    * divide the heap into 2048 regions
        * Eden Region
        * S0, S1 Region
        * Old Region
        * Humongous Region
        * Empty Region
    * each region is evaluated and prioritized according to its occupancy
    * given specified suspension time, regions will be GC'ed according to their priorities
    * reduced suspension time means quicker response
    * increased GC invocation means lower throughput

* ZGC
    * experimenting in JDK 11

__Concurrent Mark Sweep__
![]({{ '/styles/images/jvm/concurrent-mark-sweep.png' | prepend: site.baseurl }})

__G1 Heap__
![]({{ '/styles/images/jvm/g1-heap.png' | prepend: site.baseurl }})

## Case Study

In a high-concurrency transaction scenario (black Friday sales), backend servers are more likely to see the following issues co-occurring:
* OOM
* GC rate over limit (probably due to memory leak)
* CPU too high
  * jstack check for deadlock
  * jmap check heap usage

![]({{ '/styles/images/jvm/case-study.png' | prepend: site.baseurl }})

__How much memory space does an object take?__
![]({{ '/styles/images/jvm/how-much-memory-does-an-object-take.png' | prepend: site.baseurl }})

__What is memory alignment?__
Memory alignment means putting the data in memory at address equal to some multiple of the word size.

![]({{ '/styles/images/jvm/why-memory-alignment-1.png' | prepend: site.baseurl }})
![]({{ '/styles/images/jvm/why-memory-alignment-2.png' | prepend: site.baseurl }})

## Other References

[JVM Master Notes]({{ site.baseurl }}/assets/jvm-master-notes.pdf)

[JVM Internals](https://blog.jamesdbloom.com/JVMInternals.html)

[Java Platform](https://docs.oracle.com/javase/8/docs/index.html)

__Unsolved Questions__

1. During CMS GC, re-mark and sweep steps are concurrent. Does it enforce "Stop The World"? If not, how does it make sure all the objects are correctly marked?

2. In GC copy algorithm, it just moves pointers to place a "live" object to new space, instead of making deep copies? If so, how does it solve memory fragmentation issue?

gha_language: CSS


text:
---
templateKey: 'blog-post'
title: 'Then & Now'
description: ''
author: ariwrees
type: post
date: 2013-04-28T17:01:00+00:00
url: /?p=692
blogger_blog:
  - www.igobyari.com
blogger_author:
  - Arianna Rees
blogger_permalink:
  - /2013/04/then-now.html
blogger_internal:
  - /feeds/3142898329549879465/posts/default/4145691566820316539
wpmm_postgrid_views:
  - 42
categories:
  - Uncategorized
tags:
  - reflection

---
[![](https://sphotos-b.xx.fbcdn.net/hphotos-prn1/30853_1482440858612_6787569_n.jpg)](https://sphotos-b.xx.fbcdn.net/hphotos-prn1/30853_1482440858612_6787569_n.jpg)

Then: I complained a lot about bad days and bad weeks.

Then: all I wanted was for some cute boy to notice me.
Now: all I want is to become something great.

Then: I did everything everyone else was doing.
Now: I dread being a clone.

Then: I didn’t listen to much music.
Now: I sometimes feel emotional pain when I have to go a day without it.

Then: I read books that made me notice what I lacked as a girl.
Now: I read books that mentally and spiritually fulfill me.

Then: I got really lonely.
Now: being alone affords me some of the greatest moments of my life.

Then: I wanted to write books and get famous.
Now: I want to write something that changes a life.

Then: I found a lot of people in my life uncomfortable and too awkward to associate with.
Now: I realize the importance of treating every person like a friend.

Then: I thought feminism and celebration of womanhood was terrible.
Now: I still think feminism is kind of terrible, but hope to be able to celebrate womanhood every day.

Then: I said stuff like, “Obama is a communistic, socialist Muslim! Everyone knows it!”
Now: I say stuff like, “Obama is a scapegoat! If all of these Tea Party crackpots would just shut up for a moment, they’d realize that _they’re_ the problem.”

Then: I took pains to share every detail that wasn’t really important.
Now: realizing how little people tend to care, I take care to share what I feel is important.

Then: I wanted to grow up and be a vinyl sticker, mini-van, Pinterest addicted mom.
Now: I want to raise children who are well-educated, kind, and different.

Then: I thought God was real.
Now: I know He is.

Then: I had no interest in politics.
Now: voting and being knowledgeable about what happens in the country is _crucial_.

Then: I thought that my generation was the problem.
Now: I see what parents allow their kids to do these days and blame everything on those who are older.

Then: I thought I would die if school didn’t end soon.
Now: I don’t want school to end. At all. I want to keep learning.

Then: I was naive.
Now: I know too much.

Then: I was just another girl.
Now: I’m Arianna, and I mean something. That’s why I’m here.

[![](https://sphotos-a.xx.fbcdn.net/hphotos-prn1/551309_551873711511632_2000444468_n.jpg)](https://sphotos-a.xx.fbcdn.net/hphotos-prn1/551309_551873711511632_2000444468_n.jpg)

repository: chrisjpatty/igobyari-gatsby

repo_name: chrisjpatty/igobyari-gatsby


text:
Kapow! v0.4.0

## Features

* [#76][i76] Implement `https` support in the user server.

* [#104][i104] Implement TLS mutual auth with x509 certs.

* Built and tested against Go 1.14.

## Known issues and limitations

### Data API

* [#73][i73] `/response/body` and `/response/stream` behave identically for now.

* [#92][i92] `KAPOW_DATA_URL` is always set to its default value of
  `http://localhost:8082`, and not to the actual value, as specified by the
  `kapow server --data-bind "host:port"` invocation.

### Windows®

* [#83][i83] `kapow server file.pow` will try to run `file.pow` through `bash`, not `cmd`
  or `powershell`.
* `kapow route` default entrypoint is `/bin/sh`, so in order to use `cmd` or
  `powershell`, it must be explicitly set.

[i73]: https://github.com/BBVA/kapow/issues/73
[i76]: https://github.com/BBVA/kapow/issues/76
[i83]: https://github.com/BBVA/kapow/issues/83
[i92]: https://github.com/BBVA/kapow/issues/92
[i104]: https://github.com/BBVA/kapow/issues/104

repository: BBVA/kapow

gha_language: Go

repo_name: BBVA/kapow


text:
# pb.locationIntelligence.Api.LIAPIGeoEnrichServiceApi

All URIs are relative to *https://api.pitneybowes.com/location-intelligence*

Method | HTTP request | Description
------------- | ------------- | -------------
[**GetAddress**](LIAPIGeoEnrichServiceApi.md#getaddress) | **GET** /geoenrich/v1/address/bylocation | Address By Location.
[**GetEntityByLocation**](LIAPIGeoEnrichServiceApi.md#getentitybylocation) | **GET** /geoenrich/v1/poi/bylocation | Points Of Interest By Location.
[**GetPlaceByLocation**](LIAPIGeoEnrichServiceApi.md#getplacebylocation) | **GET** /geoenrich/v1/place/bylocation | Place By Location.

# **GetAddress**
> Locations GetAddress (string latitude, string longitude, string searchRadius = null, string searchRadiusUnit = null)

Address By Location.

This service accepts longitude and latitude as input and returns an address for that location.

### Example
```csharp
using System;
using System.Diagnostics;
using pb.locationIntelligence.Api;
using pb.locationIntelligence.Client;
using pb.locationIntelligence.Model;

namespace Example
{
    public class GetAddressExample
    {
        public void main()
        {

            // Configure OAuth2 API_KEY and SECRET for authorization: oAuth2Password
            Configuration.Default.OAuthApiKey = "API_KEY";
            Configuration.Default.OAuthSecret = "SECRET";

            var apiInstance = new LIAPIGeoEnrichServiceApi();
            var latitude = latitude_example;  // string | Latitude of the location.
            var longitude = longitude_example;  // string | Longitude of the location.
            var searchRadius = searchRadius_example;  // string | Radius range within which search is performed. (optional)
            var searchRadiusUnit = searchRadiusUnit_example;  // string | Radius unit such as feet, kilometers, miles or meters. (optional)

            try
            {
                // Address By Location.
                Locations result = apiInstance.GetAddress(latitude, longitude, searchRadius, searchRadiusUnit);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling LIAPIGeoEnrichServiceApi.GetAddress: " + e.Message );
            }
        }
    }
}
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **latitude** | **string**| Latitude of the location. |
 **longitude** | **string**| Longitude of the location. |
 **searchRadius** | **string**| Radius range within which search is performed. | [optional]
 **searchRadiusUnit** | **string**| Radius unit such as feet, kilometers, miles or meters. | [optional]

### Return type

[**Locations**](Locations.md)

### Authorization

[oAuth2Password](../README.md#oAuth2Password)

### HTTP request headers

 - **Content-Type**: application/json, application/xml
 - **Accept**: application/xml, application/json

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **GetEntityByLocation**
> PoiByLocation GetEntityByLocation (string longitude, string latitude, string brandName = null, string category = null, string maxCandidates = null, string searchRadius = null, string searchRadiusUnit = null, string searchDataset = null, string searchPriority = null, string travelTime = null, string travelTimeUnit = null, string travelDistance = null, string travelDistanceUnit = null, string mode = null)

Points Of Interest By Location.

Identifies and retrieves Points of Interest that exist around a specific location (ordered by distance from the location).

### Example
```csharp
using System;
using System.Diagnostics;
using pb.locationIntelligence.Api;
using pb.locationIntelligence.Client;
using pb.locationIntelligence.Model;

namespace Example
{
    public class GetEntityByLocationExample
    {
        public void main()
        {

            // Configure OAuth2 API_KEY and SECRET for authorization: oAuth2Password
            Configuration.Default.OAuthApiKey = "API_KEY";
            Configuration.Default.OAuthSecret = "SECRET";

            var apiInstance = new LIAPIGeoEnrichServiceApi();
            var longitude = longitude_example;  // string | Longitude of the location.
            var latitude = latitude_example;  // string | Latitude of the location.
            var brandName = brandName_example;  // string | Specifies the name of the brand to be searched. Also performs search on partially specified brand names. (optional)
            var category = category_example;  // string | Specific Category/Categories for which the POI search is performed. (Categories 10020102,10020103 are for Chinese and Italian Restaurants .https://developer2.pitneybowes.com/docs/location-intelligence/v1/en/poicategory/EightDigitPOICategoryCodes.xlsx  (optional)
            var maxCandidates = maxCandidates_example;  // string | Maximum number of POIs that can be retrieved. (optional)
            var searchRadius = searchRadius_example;  // string | Radius range within which search is performed. (optional)
            var searchRadiusUnit = searchRadiusUnit_example;  // string | Radius unit such as Feet, Kilometers, Miles or Meters. (optional)
            var searchDataset = searchDataset_example;  // string | The datasets upon which the POI search can be performed. (optional)
            var searchPriority = searchPriority_example;  // string | Search order of POI datasets mentioned in searchDataset. (optional)
            var travelTime = travelTime_example;  // string | Specifies the travel time within which method searches for results (POIs which can be reached within travel time)the search boundary in terms of time mentioned in 'travelTimeUnit'. The results are retrieved from the polygon formed based on the travel time specified. This means search can be done in the mentioned time results be from the mentioned time. (optional)
            var travelTimeUnit = travelTimeUnit_example;  // string | Specifies acceptable time units.Allowed values Minutes,Hours,Seconds and Milliseconds (optional)
            var travelDistance = travelDistance_example;  // string | Specifies the search boundary in terms of distance mentioned in 'travelDistanceUnit'. The results are retrieved from the polygon formed based on the travel distance specified. (optional)
            var travelDistanceUnit = travelDistanceUnit_example;  // string | Specifies acceptable time units.Allowed values Feet,Kilometers,Miles and Meters (optional)
            var mode = mode_example;  // string | Specifies the available mode of commute. This is required when u r trying to do search by travel distance or travel time.Allowed values driving and walking (optional)

            try
            {
                // Points Of Interest By Location.
                PoiByLocation result = apiInstance.GetEntityByLocation(longitude, latitude, brandName, category, maxCandidates, searchRadius, searchRadiusUnit, searchDataset, searchPriority, travelTime, travelTimeUnit, travelDistance, travelDistanceUnit, mode);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling LIAPIGeoEnrichServiceApi.GetEntityByLocation: " + e.Message );
            }
        }
    }
}
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **longitude** | **string**| Longitude of the location. |
 **latitude** | **string**| Latitude of the location. |
 **brandName** | **string**| Specifies the name of the brand to be searched. Also performs search on partially specified brand names. | [optional]
 **category** | **string**| Specific Category/Categories for which the POI search is performed. (Categories 10020102,10020103 are for Chinese and Italian Restaurants .https://developer2.pitneybowes.com/docs/location-intelligence/v1/en/poicategory/EightDigitPOICategoryCodes.xlsx  | [optional]
 **maxCandidates** | **string**| Maximum number of POIs that can be retrieved. | [optional]
 **searchRadius** | **string**| Radius range within which search is performed. | [optional]
 **searchRadiusUnit** | **string**| Radius unit such as Feet, Kilometers, Miles or Meters. | [optional]
 **searchDataset** | **string**| The datasets upon which the POI search can be performed. | [optional]
 **searchPriority** | **string**| Search order of POI datasets mentioned in searchDataset. | [optional]
 **travelTime** | **string**| Specifies the travel time within which method searches for results (POIs which can be reached within travel time)the search boundary in terms of time mentioned in 'travelTimeUnit'. The results are retrieved from the polygon formed based on the travel time specified. This means search can be done in the mentioned time results be from the mentioned time. | [optional]
 **travelTimeUnit** | **string**| Specifies acceptable time units.Allowed values Minutes,Hours,Seconds and Milliseconds | [optional]
 **travelDistance** | **string**| Specifies the search boundary in terms of distance mentioned in 'travelDistanceUnit'. The results are retrieved from the polygon formed based on the travel distance specified. | [optional]
 **travelDistanceUnit** | **string**| Specifies acceptable time units.Allowed values Feet,Kilometers,Miles and Meters | [optional]
 **mode** | **string**| Specifies the available mode of commute. This is required when u r trying to do search by travel distance or travel time.Allowed values driving and walking | [optional]

### Return type

[**PoiByLocation**](PoiByLocation.md)

### Authorization

[oAuth2Password](../README.md#oAuth2Password)

### HTTP request headers

 - **Content-Type**: application/json, application/xml
 - **Accept**: application/xml, application/json

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **GetPlaceByLocation**
> PlaceByLocations GetPlaceByLocation (string longitude, string latitude, string levelHint = null)

Place By Location.

Identifies and retrieves the nearest neighborhood around a specific location. This GeoEnrich service accepts latitude & longitude as input and returns a place name.

### Example
```csharp
using System;
using System.Diagnostics;
using pb.locationIntelligence.Api;
using pb.locationIntelligence.Client;
using pb.locationIntelligence.Model;

namespace Example
{
    public class GetPlaceByLocationExample
    {
        public void main()
        {

            // Configure OAuth2 API_KEY and SECRET for authorization: oAuth2Password
            Configuration.Default.OAuthApiKey = "API_KEY";
            Configuration.Default.OAuthSecret = "SECRET";

            var apiInstance = new LIAPIGeoEnrichServiceApi();
            var longitude = longitude_example;  // string | Longitude of the location.
            var latitude = latitude_example;  // string | Latitude of the location.
            var levelHint = levelHint_example;  // string | Numeric code of geographic hierarchy level which is classified at six levels.Allowed values 1,2,3,4,5,6 (optional)

            try
            {
                // Place By Location.
                PlaceByLocations result = apiInstance.GetPlaceByLocation(longitude, latitude, levelHint);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling LIAPIGeoEnrichServiceApi.GetPlaceByLocation: " + e.Message );
            }
        }
    }
}
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **longitude** | **string**| Longitude of the location. |
 **latitude** | **string**| Latitude of the location. |
 **levelHint** | **string**| Numeric code of geographic hierarchy level which is classified at six levels.Allowed values 1,2,3,4,5,6 | [optional]

### Return type

[**PlaceByLocations**](PlaceByLocations.md)

### Authorization

[oAuth2Password](../README.md#oAuth2Password)

### HTTP request headers

 - **Content-Type**: application/json, application/xml
 - **Accept**: application/xml, application/json

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)


text:
# Galactinia leiocarpa (Curr.) Le Gal, 1962 SPECIES

#### Status
SYNONYM

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

#### Published in
Bull. trimest. Soc. mycol. Fr. 78: 212 (1962)

#### Original name
Peziza leiocarpa Curr., 1864

### Remarks
null

repository: mdoering/backbone

path: /life/Fungi/Ascomycota/Pezizomycetes/Pezizales/Pezizaceae/Plicaria/Plicaria leiocarpa/ Syn. Galactinia leiocarpa/README.md

repo_name: mdoering/backbone


text:
# chitchat

Volatile, anonymous chat

## Dependencies

You need postgresql installed, specifically you need to have `libpq`.

### Ubuntu

```
sudo apt install libpq-dev
```

repository: aQaTL/chitchat

gha_language: Rust

repo_name: aQaTL/chitchat


text:
# Fotofetch

This gem allows the simple searching for and saving of images to your app. Various photo-searching API's will provide more consistent results, but this is a quick way to find images matching a query. Results can be restricted by photo dimensions and batch-saved to your directory. This gem was extracted from an app to fetch movie posters for a movie suggestion [site](http://www.nonshittymovies.com), which dynamically creates the content on each page load.

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'fotofetch'
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install fotofetch

## Basic Usage

- Initiate an instance of Fotofetch:
```ruby
@fetcher = Fotofetch::Fetch.new
```
- To fetch an image of a Tesla Model S:
```ruby
link = @fetcher.fetch_links("tesla model s")
```
- To save the link to your file directory (links must be in an array, so call .values):
```ruby
@fetcher.save_images(link.values, './')
```
The 'save_images' method takes two arguments: link(s) and the file path for where to save. File names are gerated from the previous query, so if you search for 2 images of 'red_ball', they will be saved as 'red_ball_0.jpg' and 'red_ball_1.jpg'.

## More Specific Queries
Arguments for the 'fetch_links' method are: search value (required), number of links returned (optional), and two dimension restrictions arguments (optional: width, height).

If a dimension argument is positive, it will look for pictures larger than that,
and if the number is negative, results will be restricted to those smaller than that. Note that adding dimensions restrictions to your query will slow it down.

- To find a 1 small photo of Jupiter less than 500px x 500px:
```ruby
@fetcher.fetch_links("jupiter", 1, -500, -500)
```
To find 3 large photos of Jupiter:
```ruby
links = @fetcher.fetch_links("jupiter", 3, 1500, 1500)
```
And to save those 3 large photos:
```ruby
@fetcher.save_images(links.values, './')
```
If a small or large enough image is not found, dimension restrictions will be disregarded.

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/steveoscar/fotofetch.

## License

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

#### Me
(http://www.stevenoscarolson.com)

repository: SteveOscar/fotofetch

gha_language: Ruby

repo_name: SteveOscar/fotofetch


text:
# google-dataflow-nyse-arca

This repository demonstrates how to create a DataFlow ETL job to read a CSV from GCP cloud storage, process it, and write it to
GCP BigQuery.  This particular example uses a large data set (12GB extracted), so there could be a significant cost
to running this example in your GCP environment.

## Summary
The DataFlow job will extract the records from the NYSE ARCA file and attach additional descriptions to some of the codes included in the file.
For example, the first column is the `message_type` which can be `A, M, I, D, or V`, so the job will include an additional column `message_type_descr` that describes these codes.
After you complete the steps below, it will create a BigQuery table named `eqy_arca_book_20130403_all` in the data set named `nyse_arca_java`.

## Getting started

### Prerequisites
#### 1. GCP Setup.
* [Create a GCP bucket.](https://cloud.google.com/storage/docs/creating-buckets)
* [Enabled the APIs.](https://console.cloud.google.com/flows/enableapi?apiid=dataflow,compute_component,logging,storage_component,storage_api,bigquery,pubsub,datastore.googleapis.com,cloudresourcemanager.googleapis.com)
* [Create a GCP Service Account](https://console.cloud.google.com/apis/credentials/serviceaccountkey) and download the credential to your local machine.
  * From the Service account list, select New service account.
  * In the Service account name field, enter a name.
  * From the Role list, select Project > Owner.
* [Create a BigQuery dataset.](https://cloud.google.com/bigquery/docs/datasets#create-dataset)

  `bq mk your_project_id:nyse_arca_java`

#### 2. Data Preparation
* Download the file named `EQY_US_ALL_ARCA_BOOK_20130403.csv.gz` from the [NYSE Arca's FTP site](ftp://ftp.nyxdata.com/Historical%20Data%20Samples/TAQ%20NYSE%20ArcaBook/).

TODO - add curl command to download and upload to GCP here.

* You must unzip the `.gz` file once you upload it to GCP.  Follow the [Bulk decompress Cloud Storage file template](https://cloud.google.com/dataflow/docs/guides/templates/provided-utilities#bulkdecompressgcsfiles).

* Upload the `big-query-schema.json` to Google Cloud Storage.
Upload the file with this [documentation](https://cloud.google.com/storage/docs/uploading-objects).

  `gsutil cp big-query-schema.json gs://[DESTINATION_BUCKET_NAME]/`

##### Optional
You can create a smaller file from the larger file with the following linux command and then upload this file instead.

`sed -n -e '1,10000p' EQY_US_ALL_ARCA_BOOK_20130403.csv > EQY_US_ALL_ARCA_BOOK_20130403_smallfile.csv`

#### 3. Setup your local environment.
Open your IDE (IntelliJ) and then open the terminal tab and execute the following commands.
* `export PROJECT=$(gcloud config get-value core/project)`
* `export GOOGLE_APPLICATION_CREDENTIALS=/path/to/your/credential.json`
* `export BUCKET=parent_path_to_gcp_bucket_you_created_earlier`

#### 4. From your IDE (IntelliJ) terminal tab
##### NyseArcaTransform class
* Execute the following:
```shell script
mvn clean compile
```

This creates a batch job description named `nys-arca-book-job-all-spec.json`.
```shell script
 mvn compile exec:java -Dexec.mainClass=com.swilliams11.googlecloud.dataflow.nyse.arca.NyseArcaTransform -Dexec.cleanupDaemonThreads=false -Dexec.args=" \
 --project=$PROJECT \
 --stagingLocation=gs://$BUCKET/staging \
 --tempLocation=gs://$BUCKET/temp \
 --templateLocation=gs://$BUCKET/nyse-arca-book-job-all-spec.json \
 --runner=DataflowRunner"
```
###### NYSE - 14GB file
Execute the job with the required options.  BE CAREFUL - This command assumes your are using the **14GB file** and it consumes GCP resources.

```shell script
gcloud dataflow jobs run nyse-arca-book-java-all \
 --gcs-location=gs://$BUCKET/nyse-arca-book-job-all-spec.json \
 --zone=us-central1-f \
 --parameters=JSONPath=gs://$BUCKET/big-query-schema.json,inputFilePattern=gs://$BUCKET/EQY_US_ALL_ARCA_BOOK_20130403.csv,outputTable=$PROJECT:nyse_arca_java.eqy_arca_book_20130403_all,bigQueryLoadingTemporaryDirectory=gs://$BUCKET/bq_load_temp/
```

###### NYSE - Small File (10,000 records)
Execute the following command if you created the smaller file.

```shell script
gcloud dataflow jobs run nyse-arca-book-java-all \
 --gcs-location=gs://$BUCKET/nyse-arca-book-job-all-spec.json \
 --zone=us-central1-f \
 --parameters=JSONPath=gs://$BUCKET/big-query-schema.json,inputFilePattern=gs://$BUCKET/EQY_US_ALL_ARCA_BOOK_20130403_smallfile.csv,outputTable=$PROJECT:nyse_arca_java.eqy_arca_book_20130403_all,bigQueryLoadingTemporaryDirectory=gs://$BUCKET/bq_load_temp/
```

##### NyseArcaTransform4 class

```shell script
 mvn compile exec:java -Dexec.mainClass=com.swilliams11.googlecloud.dataflow.nyse.arca.NyseArcaTransform4 -Dexec.cleanupDaemonThreads=false -Dexec.args=" \
 --project=$PROJECT \
 --stagingLocation=gs://$BUCKET/staging \
 --tempLocation=gs://$BUCKET/temp \
 --templateLocation=gs://$BUCKET/nyse-arca-book-job-all-spec.json \
 --runner=DataflowRunner"
```
###### NYSE - 14GB file
Execute the job with the required options.  BE CAREFUL - This command assumes your are using the **14GB file** and it consumes GCP resources.

```shell script
gcloud dataflow jobs run nyse-arca-book-java-all-v2 \
 --gcs-location=gs://$BUCKET/nyse-arca-book-job-all-4-spec.json \
 --zone=us-central1-f \
 --parameters=JSONPath=gs://$BUCKET/big-query-schema.json,inputFilePattern=gs://$BUCKET/EQY_US_ALL_ARCA_BOOK_20130403.csv,outputTable=$PROJECT:nyse_arca_java.eqy_arca_book_20130403_all_v2,bigQueryLoadingTemporaryDirectory=gs://$BUCKET/bq_load_temp/
```

###### NYSE - Small File (10,000 records)
Execute the following command if you created the smaller file.

```shell script
gcloud dataflow jobs run nyse-arca-book-java-all-v2 \
 --gcs-location=gs://$BUCKET/nyse-arca-book-job-all-4-spec.json \
 --zone=us-central1-f \
 --parameters=JSONPath=gs://$BUCKET/big-query-schema.json,inputFilePattern=gs://$BUCKET/EQY_US_ALL_ARCA_BOOK_20130403_smallfile.csv,outputTable=$PROJECT:nyse_arca_java.eqy_arca_book_20130403_all_v2,bigQueryLoadingTemporaryDirectory=gs://$BUCKET/bq_load_temp/
```

## Source Files
* `big_query_schema.json` is the schema that the Big Query par do function uses to create the table and insert records into the table.
* `com.swilliams11.googlecloud.dataflow.nyse.arca.NyseArcaTransform` contains the source code.
* `com.swilliams11.googlecloud.dataflow.nyse.arca.NyseArcaTransform4` contains the source code for the modified pipeline.

## Results
### DataFlow Job
#### NyseArcaTransform pipeline
This is the job graph.
![NyseArcaTransform Job Details](/images/jobsummary.png)

It took about 15 minutes to process 213M records (12GB file).
![Job Metrics](/images/jobmetrics.png)

#### NyseArcaTransform4 pipeline
This is the job graph.
![NyseArcaTransform4 Job Details](/images/nysearcatransform4_jobsummary.png)
This job took 24 minutes to complete.

## Profiling DataFlow Jobs
You can profile your DataFlow job with the following option on the command line. This will provide insight
into what functions are consuming CPU time and it allows you to determine where to focus your time on optimizing
your code.

### Enabled the Profiling API for your GCP project
```shell script
gcloud services enable cloudprofiler.googleapis.com
```

Add the following option - `--profilingAgentConfiguration='{\"APICurated\":true}'` - to the `mvn compile` command.

### Enable profiling for NyseArcaTransform pipeline
```shell script
 mvn compile exec:java -Dexec.mainClass=com.swilliams11.googlecloud.dataflow.nyse.arca.NyseArcaTransform -Dexec.cleanupDaemonThreads=false -Dexec.args=" \
  --project=$PROJECT \
  --stagingLocation=gs://$BUCKET/staging \
  --tempLocation=gs://$BUCKET/temp \
  --templateLocation=gs://$BUCKET/nyse-arca-book-job-all-spec.json \
  --runner=DataflowRunner --profilingAgentConfiguration='{\"APICurated\":true}'"
```

### Enable profiling for NyseArcaTransform4 pipeline
```shell script
mvn compile exec:java -Dexec.mainClass=com.swilliams11.googlecloud.dataflow.nyse.arca.NyseArcaTransform4 -Dexec.cleanupDaemonThreads=false -Dexec.args=" \
 --project=$PROJECT \
 --stagingLocation=gs://$BUCKET/staging \
 --tempLocation=gs://$BUCKET/temp \
 --templateLocation=gs://$BUCKET/nyse-arca-book-job-all-4-spec.json \
 --runner=DataflowRunner --profilingAgentConfiguration='{\"APICurated\":true}'"
```

## TODOs
* This Java class hard-codes the description columns into the job. These should really be dynamically added from an external file and injected into the DataFlow job with command line parameters.
  * [Apache Beam side inputs](https://beam.apache.org/documentation/programming-guide/#side-inputs)
* Finish the Date/Time implementation
* Determine if there is a faster implementation for Pojo to JSON implementation.

gha_language: Java


text:
# mofron-effect-font
[mofron](https://mofron.github.io/mofron/) is module based frontend framework.

set text font for mofron-comp-text component

format configure for each file automatically if you use local font

## Attention
 - this effect is private, this function is included in text component. so you don't need to use directly

# Install
```
npm install mofron mofron-effect-font
```

# Parameter

| Short<br>Form | Parameter Name | Type | Description |
|:-------------:|:---------------|:-----|:------------|
| ◯  | fname | mixed | string: primary font name |
| | | | undefined: call as getter |
| | | string | secondary font name (not required) |
| ◯  | path | mixed | string: path to font |
| | | | undefined: call as getter |
| | src | mixed | string: path to font |
| | | | undefined: call as getter |

repository: mofron/mofron-effect-font

repo_name: mofron/mofron-effect-font


text:
# Static S3 Boilerplate

## Description

I'm not a fan of making public buckets, and a CDN + WAF setup isn't all too expensive on AWS. So I decided to make a couple of boilerplate templates and corresponding parameter files to get your landing page, or portfolio website, or whatever it is deployed relatively securely.

## How do I deploy my site?

### Prerequisites

1. A Hosted Zone setup in Route 53 (requires buying a domain)
2. A Certificate in ACM us-east-1

Both of those steps are relatively painless to set up in the AWS console.

### Deploy your underlying infrastructure.

1. First you want to determine if you want this publicly accessible to the world or not. Given you're deploying a site to a S3 bucket which doesn't sit in a VPC, if you're setting something up in a testing environment (e.g. staging) and don't want it publicly accessible, you're going to want to use the `waf-cloudformation.yml` which sets up a Web Application Firewall that only allows access to an IP Range.

2. You need to populate your parameter file. If you're setting everything up with a WAF, you're going to want to fill in the variables in the package.json. The variables you need to populate are:
    - AppName
    - HostedZoneName (do not include the full stop at the end of your hosted zone)
    - BucketName (all lowercase characters)
    - SubDomain (e.g. www, staging, api, docs)
    - ACMCertificateID (ID of your HTTPS certificate in ACM us-east-1 to work with CloudFront)
    - Environment (optional: defaults to stage if an environment not specified)
    - IPCIDRRange (conditional: only needed when setting up your infra with a WAF)

3. Invoke the setup of your infra with:
```
yarn cfnwaf:staging
OR
yarn cfn:staging
```
4. Go grab a coffee or some food, or go and watch an episode of one of your favourite TV shows. The initial setup of all resources takes roughly 25min.

5. Once this has all been set up, you're ready to deploy your site. Copy your files to the `dist` directory.

6. Push your files to the bucket with
```
deploy:staging
```

## Cost

You're looking at some relatively cheap hosting costs for your site.

WAF Costs (in USD):
- $5 per web ACL per month
- $1 per rule per web ACL per month
- $0.60 per million web requests

CloudFront Costs:
- 1 GB Data transfer out and out to origin + HTTPS + roughly 100 invalidations === $0.10/month


text:
# Refined-Contrast-using-Computer-Vision

## Product overview

Scanned documents sometimes can have pages with low contrast and low brightness. This can create challenges while processing of documents viz. OCR, ICR, Text extraction, image-based ML/AI modelling, etc. This solution incorporates statistical models which identify the contrast between background and text in the pages of the scanned document and adjust the contrast of the low contrast pages. It then enhances the brightness and text visibility if it finds text to have lost thickness.This enables OCR / ICR engines to achieve higher accuracy and improves the subsequent text extraction pipelines.

## Product Highlight

* This solution can be used to correct contrast and brightness issues which occur while scanning a document with scanner or phone or images captured in low light.

* To correct the contrast and brightness of the pages, this solution performs operations on each pixel of the image and runs statistical models to identify the variation in pixel colors. These variations are fed to equations to calculate the correct adjustment of contrast for each pixel.

* Mphasis DeepInsights is a cloud-based cognitive computing platform that offers data extraction & predictive analytics capabilities. Need customized Machine Learning and Deep Learning solutions? Get in touch!

## Amazon Marketplace Link
The product can be found [here](https://aws.amazon.com/marketplace/pp/prodview-cy7r42ztzx7iw)


text:
# Silverstripe Cookie Consent
GDPR compliant cookie bar and consent checker

## Installation
Install the module trough composer:
```bash
composer require bramdeleeuw/cookieconsent
```

Include the popup template in your base Page.ss
```html
<% include CookieConsent %>
```

## Configuration
You can configure the cookies and cookie groups trough the yml config. You need to configure by provider, for providers the dots are converted to underscores e.g. ads.marketingcompany.com becomes ads_marketingcompany_com.

By configuring cookies trough yml you can check for consent in your code and make the necessary changes e.g. require the analytics or other cookies or skip placing them.

The texts for the configured cookies are editable trough the Site Config, here other cookies can also be added by CMS users.
For example if a site user decides to embed a Youtube video he or she can specify the cookies that are placed by Youtube.
I reccomend the following three groups to be created, these have default content, of course you are free to configure groups as you see fit.
```yaml
Broarm\CookieConsent\CookieConsent:
  cookies:
    Necessary:
      local:
        - CookieConsent
        - ShowPopUp
    Marketing:
      ads_marketingcompany_com:
        - _track
    Analytics:
      local:
        - _ga
        - _gid
```

This module comes with some default content for cookies we've encountered before. If you want to set default content for these cookies yourself that is possible trough the lang files. If you have cookie descriptions that are not in this module, contributions to the lang files are much appreciated! Translations are managed trough [Transifex](https://www.transifex.com/xd/cookie-consent).

The files are structured as such:
```yaml
en:
  CookieConsent_{provider}:
    {cookie}_Purpose: 'Cookie description'
    {cookie}_Expiry: 'Cookie expire time'
  # for cookies from your own domain:
  CookieConsent_local:
    PHPSESSID_Purpose: 'Session'
    PHPSESSID_Expiry: 'Session'
  # for cookies from an external domain:
  CookieConsent_ads_marketingcompany_com:
    _track_Purpose: 'Cookie description'
    _track_Expiry: 'Cookie expire time'
```

Then you can check for consent in your code by calling
```php
if (CookieConsent::check('Analytics')) {
    // include google analytics
}
```

You can also configure the requirement of the default js and css.
Make sure you combine at least the javascript in you bundle if you chose not to require by default!
```yaml
Broarm\CookieConsent\CookieConsent:
  include_javascript: true
  include_css: true
  create_default_pages: true
```

### Enable XHR mode
When you use static publishing, you'll want to enable XHR mode. XHR mode accepts the cookies trough an xhr request and shows/hides the consent popup with the help of some javascript.

In your yml config set `xhr_mode` to `true`
```yaml
Broarm\CookieConsent\CookieConsent:
  xhr_mode: true
```

In your javascript, you can make use of the utility class. This handles the xhr request and visibility of the popup:
```js
import CookieConsent from '../vendor/bramdeleeuw/cookieconsent/javascript/src/cookieconsent';
const consent = new CookieConsent();
consent.enableXHRMode();
```

### Include assets in your bundle
If you want to include the scss or js in your own bundle you can do that by:
```js
// Import the CookieConsent utility
import CookieConsent from '../vendor/bramdeleeuw/cookieconsent/javascript/src/cookieconsent';

const consent = new CookieConsent();

// This tool let's you check for cookie consent in your js files before you apply any cookies
if (consent.check('Marketing')) {
  // add marketing cookie
}

// If you use Google Tag Manager this tool can also push the consent into the dataLayer object
consent.pushToDataLayer();
```

For the scss you can just import the scss file
```scss
@import "cookieconsent/scss/cookieconsent";
```
Make sure the relative paths to the files match your use case.

## Default Pages
This module also sets up 3 default pages on running dev/build.
If you want to prevent that behaviour you should disable the `create_default_pages` config setting.
The pages created are a CookiePolicyPage, PrivacyPolicyPage and TermsAndConditionsPage and are filled with bare bones content for each of the page types.
_Of course it is your or your CMS users responsibility to alter these texts to make them fitting to your use case!_

### Maintainers
[Bram de Leeuw](http://www.twitter.com/bramdeleeuw)

repository: TheBnl/silverstripe-cookie-consent

gha_language: PHP

repo_name: TheBnl/silverstripe-cookie-consent


text:
# Trusted Committers

**Trusted Committers** (TC's) are members of our community who we have explicitly added to our GitHub repository. Trusted Committers have elevated rights, allowing them to send in changes directly to branches and to approve Pull Requests. (GitHub refers to these accounts as [collaborators][collaborators]).

We ask that TC's open Pull-Request when making changes, to make these changes transparent for everybody.

## What you get as a Trusted Committer:

- **WRITE** access to this repository (no need to maintain your own fork)
- More immediate impact on the roadmap and feature development of GenRMQ
- Get listed in `README.md` as a Trusted Committer, to make your involvement known to the community
- Fame and glory in the GenRMQ community :)

## What we expect from a Trusted Committer:

- Help us to drive the conversations in GitHub Issues (e.g. provide feedback to other user of GenRMQ or answer their questions)
- Review pull requests (e.g. by helping the author of the PR understand what needs to be done in order to get the PR into a mergeable shape)
- Be a role model for our [Code of Conduct](CODE_OF_CONDUCT.md)

## Adding Trusted Committers

It is our ambition to empower as many trusted Trusted Committers as possible.

When a GitHub user has made a couple of contributions to GenRMQ, we will contact them and ask them if they want to support the development of GenRMQ by becoming a Trusted Committer. We will use a GitHub issue on this repo to do that.

[collaborators]: https://help.github.com/en/articles/adding-outside-collaborators-to-repositories-in-your-organization

gha_language: Elixir


text:
## Getting Started

- Create SSH key pair for Jenkins Master and Slave communication in ~/.ssh Directory.
    ```sh
    ssh-keygen -t rsa -m PEM -C "Jenkins Slave & Master Key" -f "jenkins_slave_agent_id_rsa"
    ```

- Create SSH key pair for Jenkins Master and Docker Swarm communication in ~/.ssh Directory.
    ```sh
    ssh-keygen -t rsa -m PEM -C "Docker Swarm & Jenkins Master" -f "docker_swarm_manager_id_rsa"
    ```

- Create .env File (For [Example](./env.example))

- Add Public SSH key in [ansible public keys folder](../ansible/roles/users/files/public_keys)

- Replace [sudo users](../ansible/roles/users/defaults/main.yml).

- Build bastion image.
    ```sh
    make build-bastion
    ```

- Build jenkins master image.
    Few plugins like amazon-ecr, blueocean takes time while installation resulting in build fail. We can skip them by commenting in [file](../ansible/roles/jenkins-master/vars/plugins.yml).

    ```sh
    make build-jenkins-master
    ```

- Build jenkins slace image.
    ```sh
    make build-jenkins-slave
    ```

- Build docker swarm image.
    ```sh
    make build-docker-swarm
    ```

repository: rjsaran/infrastructure-as-code

repo_name: rjsaran/infrastructure-as-code


text:
---
title: "Film club: Don't let the pigeon drive the bus"
location: lowestoft-library
location-display-name: Lowestoft Library
start-date: 2020-03-30
start-time: 1500
link: https://www.facebook.com/events/879528742512236/
category: children
format: live
---

Don't let the pigeon drive the bus is available from our [Kanopy eLibrary service](/elibrary/kanopy/).

We'll be watching the film and chatting on our page. For more film requests or to discuss this and other films, why not join our [Kanopy Film Club Group](https://www.facebook.com/groups/LowLibKanopyFilmClub/)?

When a bus driver takes a break from his route, a very unlikely volunteer springs up to take his place — a pigeon! But you’ve never met one like this before.

Running time 7min

repository: suffolklibraries/sljekyll

repo_name: suffolklibraries/sljekyll


text:
---
title: Getting User Input using Human UI
---

<!-- intro video -->
{% include youtube_player.html id="MxhpnDY8D2Q" %}

{% include ltr/download_pkg.html archive='/static/archives/getting-input-human-ui.zip' %}

## Files

- **RAC_basic_sample_project.rvt** Standard Revit Template file is used on this example
- **write-sheet-param-humanui.gh** Grasshopper definition for this example

## Description

The example here requires the [HumanUI plugin for Grasshopper](https://www.food4rhino.com/app/human-ui). This is a plugin allowing Grasshopper to design and display dialog box interfaces. In this case the dialog interface will help edit the *Drawn by* and the *Checked by* sections of the title block.

1. Open the *A001 - Title Sheet* * in the standard *RAC_basic_sample_project.rvt*.
2. In the Rhinoceros Toolbar in Revit, select the Rhino Player icon
3. Open the **write-sheet-param-humanui.gh**

This definition will run the *Human UI* dialog immediately without showing Grasshopper.

![]({{ "/static/images/discover/user-input-humanui01.jpg" | prepend: site.baseurl }}){: class="small-image"}

Simply edit the Text filed and click on the update buttons to the right. The Titleblock will change. To see how the definition works, just open the Grasshopper canvas and open the script.

gha_language: C#


text:
---
marp: true
paginate: false
backgroundImage: linear-gradient(135deg, white, white 50%, lightblue)
style: 'section{padding-left: 110px}'
---
<!--
This presentation is written in markdown, and should be formatted using marp
-->

# Git at Ocient

![width:400px](../assets/Ocient_logo_1333x304.png)

---
<!-- These settings take effect for the remainder of the slides -->
<!-- header: '![](../assets/Ocient_symbol_75x75.png)' -->
<!-- paginate: true -->
---

# Git Experience?
- Committing
- Branching
- Pushing/Pulling
- Forking
- Rebasing
- Cherry-picking
- Stashing
- Others...

---

# What is git?

A series of layered changes (these are called commits).

```diff
diff --git a/git/git.md b/git/git.md
new file mode 100644
index 0000000..70ae540
--- /dev/null
+++ b/git/git.md
@@ -0,0 +1,277 @@
+# What is git?
+
+A series of layered changes (these are called commits).
```

---

# Why use git?
- Alternatives?
- Standard
- Allows work in parallel
- Easy to isolate changes
- Any other reasons?

---

# Commits

Here is an example.

```diff
diff --git a/git/git.md b/git/git.md
index 739be4b..a998664 100644
--- a/git/git.md
+++ b/git/git.md
@@ -60,5 +60,21 @@ index 0000000..70ae540
+Here is an example.
```

---

# Commits

Here is a better example.

```diff
diff --git a/git/git.md b/git/git.md
index d20b691..c719bfd 100644
--- a/git/git.md
+++ b/git/git.md
@@ -60,7 +60,7 @@ index 0000000..70ae540
-Here is an example.
+Here is a better example.
```

---

# Commits

What happens when you apply both commits (in this order)?
```diff
diff --git a/git/git.md b/git/git.md
index 739be4b..a998664 100644
--- a/git/git.md
+++ b/git/git.md
@@ -60,5 +60,21 @@ index 0000000..70ae540
+Here is an example.
```

```diff
diff --git a/git/git.md b/git/git.md
index d20b691..c719bfd 100644
--- a/git/git.md
+++ b/git/git.md
@@ -60,7 +60,7 @@ index 0000000..70ae540
-Here is an example.
+Here is a better example.
```

---

# Branches

What is a branch?

---

![](branches.svg)

---

# Merging

![width:500px](merge-before.png)![width:500px](merge-after.png)

---

# Ocient's Setup

- Mostly a mono-repo (https://github.com/Xeograph/xgsrc)
- Smartptr-exercise (https://github.com/Xeograph/smartptr-exercise)
- xgpackaging (deployment) (https://github.com/Xeograph/xgpackaging)
- ocient.com (https://github.com/Xeograph/www_ocient_com)
- ocient_jdbc,OcientStreamClient,... (client libraries)
- packer-dev (devops)
- sales
- ...

---

# How to Write Code (Old Way)

- Commit
- Push to **fork**
- PR from **fork**

---

# How to Write Code

- Commit
- Push to upstream/origin (depending on your naming)
- PR from branch

---

# How to Write Code (Example)

https://jira.ocient.com:8443/browse/DB-11016

![](jira.png)

---

# How to Write Code (Example)

1.  ```sh
	git status
	On branch db
	nothing to commit, working directory clean
	```
2.  ```sh
	git checkout -b user/aneben/db-11016
	Switched to a new branch 'user/aneben/db-11016'
	```
3.  ```sh
	git status
	On branch user/aneben/db-11016
	nothing to commit, working directory clean
	```

---

# How to Write Code (Example)

From `libxg/include/util/stringutil.h`
```cpp
/**
 * Returns a long corresponding to the number represented by the input string.
 * So 1G (or 1g) returns 1024*1024*1024, and 1k (or 1K) returns 1024.
 * If the input is not in a recognized format, returns an empty optional.
 * @param s the string containing a representation of a number, optionally with G, M, or K
 * @return an option containing the number in the input as a long, or nothing if the string is not
 * a recognizable number.
 */
inline std::optional<long> from_human_string(const std::string& s) {
    const static std::vector<std::pair<std::regex, long>> REGEXES{
        {std::regex("^([0-9]+)$", std::regex::icase), 1},
        {std::regex("^([0-9]+)k(i?b)?$", std::regex::icase), 1024L},
        {std::regex("^([0-9]+)m(i?b)?$", std::regex::icase), 1024L * 1024L},
        {std::regex("^([0-9]+)g(i?b)?$", std::regex::icase), 1024L * 1024L * 1024L}};
    static_assert(sizeof(long) == sizeof(int64_t));
    for (auto it = REGEXES.cbegin(); it != REGEXES.cend(); it++) {
        auto& re = it->first;
        auto factor = it->second;
        std::smatch match;
        if (std::regex_match(s, match, re)) {
            long number = std::stol(match[1]);
            return factor * number;
        }
    }
    return {};
}
```

---

# How to Write Code (Example)
```diff
diff --git a/libxg/include/util/stringutil.h b/libxg/include/util/stringutil.h
index dda1ed0..d1c91ae 100644
--- a/libxg/include/util/stringutil.h
+++ b/libxg/include/util/stringutil.h
@@ -86,33 +86,6 @@ inline std::string to_human_string(long val) {
-/**
- * Returns a long corresponding to the number represented by the input string.
- * So 1G (or 1g) returns 1024*1024*1024, and 1k (or 1K) returns 1024.
- * If the input is not in a recognized format, returns an empty optional.
- * @param s the string containing a representation of a number, optionally with G, M, or K
- * @return an option containing the number in the input as a long, or nothing if the string is not
- * a recognizable number.
- */
-inline std::optional<long> from_human_string(const std::string& s) {
-    const static std::vector<std::pair<std::regex, long>> REGEXES{
-        {std::regex("^([0-9]+)$", std::regex::icase), 1},
-        {std::regex("^([0-9]+)k(i?b)?$", std::regex::icase), 1024L},
-        {std::regex("^([0-9]+)m(i?b)?$", std::regex::icase), 1024L * 1024L},
-        {std::regex("^([0-9]+)g(i?b)?$", std::regex::icase), 1024L * 1024L * 1024L}};
-    static_assert(sizeof(long) == sizeof(int64_t));
-    for (auto it = REGEXES.cbegin(); it != REGEXES.cend(); it++) {
-        auto& re = it->first;
-        auto factor = it->second;
-        std::smatch match;
-        if (std::regex_match(s, match, re)) {
-            long number = std::stol(match[1]);
-            return factor * number;
-        }
-    }
-    return {};
-}
-
```

---

# How to Write Code (Example)
1.  ```sh
	git status
	On branch user/aneben/db-11016
	Changes not staged for commit:
  	  (use "git add <file>..." to update what will be committed)
      (use "git checkout -- <file>..." to discard changes in working directory)

         modified:   libxg/include/util/stringutil.h

    no changes added to commit (use "git add" and/or "git commit -a")
	```
2.  ```sh
	git add libxg/include/util/stringutil.h
	```

---

# How to Write Code (Example)

3.  ```sh
	git status
	On branch user/aneben/db-11016
	Changes to be committed:
	  (use "git reset HEAD <file>..." to unstage)

	    modified:   libxg/include/util/stringutil.h
	```
4.  ```sh
	git commit -m "[DB-11016] Deleted dead to_human_string() function"
	The staged content is formatted correctly.
	[user/aneben/db-11016 a17f571] [DB-11016] Deleted dead to_human_string() function
	 1 file changed, 27 deletions(-)
	```
**Notice**: I included the ticket number.
**Notice**: The commit message is understandable and represents the changes made.

	Delta compression using up to 72 threads.
	Compressing objects: 100% (19/19), done.
	Writing objects: 100% (21/21), 2.74 KiB | 0 bytes/s, done.
	Total 21 (delta 16), reused 6 (delta 2)
	remote: Resolving deltas: 100% (16/16), completed with 14 local objects.
	remote:
	remote: Create a pull request for 'user/aneben/db-11016' on GitHub by visiting:
	remote:      https://github.com/Xeograph/xgsrc/pull/new/user/aneben/db-11016
	remote:
	To git@github.com:Xeograph/xgsrc.git
     * [new branch]      user/aneben/db-11016 -> user/aneben/db-11016
	```
https://github.com/Xeograph/xgsrc/pull/10943

---

# How to Write Code (Example)

- Pull approve
- CI

---

# Git DOs and DONTs

- **DO:** Include ticket number and make commit messages descriptive
- **DO:** Keep PRs small (avoid scope creep) (review time is O(n^2))
- **DO:** Squash merge
- **DO:** Include tests in PRs
- **DONT:** Address comments commit [example](https://github.com/Xeograph/xgsrc/search?q=addressed+comments&type=Commits)
- **DONT:** Swear in commit messages [example](https://github.com/Xeograph/xgsrc/commit/292fd9b9fc3974ded4c815b8f74b332f9967abca)

---

# Git Branch Structure

- **user/<name>/<whatever>:** small fixes (default)
- **feature/<feature-name>:** larger feature projects
- **release/v<x>:** release for customers (have been very well tested)
- **staging/<name>/<whatever>:** branches created by CI
- **db:** where most active development happens

---

# Git Cheat Sheet (basics)

- `git commit -m "<commit-message>"` - create a commit op the active branch
- `git status` - show useful information
- `git checkout [-b|] <branch-name>` - checkout / checkout and create a branch
- `git branch` - list all branches
- `git log` - show all commits on branch

---

# Git Cheat Sheet (basics)

- `git pull [upstream|origin] <branch-name>` - get all commits from remote to local copy
- `git push [upstream|origin] <branch-name>` - push all commits from local to remote
- `git diff [lhs] [rhs]` - diff of two commits both sides have defaults
- `git fetch [upstream|origin]` - fetch all commits and branches from a remote
- `git stash` - save all "added" non-committed changes on a stack
- `git stash pop` - delete and apply the most recent set stashed changes

---

# Git Cheat Sheet (advanced)

- `git rebase -i`* - Rewrite history to squash and change commits (powerful command)
- `git cherry-pick <commit-sha>` - Apply a commit ontop of current commit
- `git reset --hard`* - delete all non-committed changes
- `git remote -v` - display all remotes (verbose)
- `git push ... --force`* - push to a remote overwriting commits
**IMPORTANT: Items marked with `*` can cause written code to be unrecoverable**

---

# Additional Resources
1. https://confluence.ocient.com:8443/display/devops/Git+Guide+for+Multi-Person+Projects
2. https://confluence.ocient.com:8443/display/designs/Git+Usage+Guidelines
3. https://www.atlassian.com/git/tutorials
4. Other engineers. (Git is widely used. Do you best to google an answer before asking)

repository: XanderAtOcient/presentations

repo_name: XanderAtOcient/presentations


text:
# Dirable

Dirable provides an interface for creating object hierarchies and persisting them to the filesystem. It's kinda like ActiveRecord, without the SQL database!

## Usage

Create a new object hierarchy:
```ruby
class RunningLog < Dirable::Record
  def initialize(*)
    super
    has_one('goal', Goal)
    has_many('runs', Run)
  end
end

class Goal < Dirable::Record
  def initialize(*)
    super
    has_attribute('race')
    has_attribute('date')
    has_attribute('time')
  end
end

class Run < Dirable::Record
  def initialize(*)
    super
    has_attribute('distance')
    has_attribute('time')
    has_attribute('notes')
  end
end
```

Configure the root directory and class name:

```ruby
Dirable.configure do |config|
  config.root_dir = '/tmp/running_log'
  config.root_class = RunningLog
end
```

Add and delete from many relations:
```ruby
Dirable.root.runs.add('Tempo Tuesday')
Dirable.root.runs.delete('Tempo Tuesday')
```

Access a many relation and set attributes:
```ruby
Dirable.root.runs['Tempo Tuesday'].distance = '10 miles'
Dirable.root.runs['Tempo Tuesday'].time = '1 hour'
Dirable.root.runs['Tempo Tuesday'].notes = 'Cruising!'
```

Access a one relation and set attributes:
```ruby
Dirable.root.goal.race = 'Boston Marathon'
Dirable.root.goal.date = 'April, 16th 2018'
Dirable.root.goal.time = '3 hours'
```

Everything is persisted to a directory hierarchy and Dirable will automatically pick up any updates you make to it!
```
mkdir '/tmp/running_log/runs/Long Run Sunday'
echo '16 miles' >> '/tmp/running_log/runs/Long Run Sunday/distance'
```

```ruby
Dirable.root.runs['Long Run Sunday'].distance
# 16 miles
```

## License

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

repository: chipjacks/dirable

repo_name: chipjacks/dirable