text:
# Blue-Green Deployment

*Adapted from [Routing and Managing Traffic with Blue/Green Deployment](https://github.com/knative/docs/blob/master/serving/samples/blue-green-deployment.md)*

## Setup and Context

First run the GKE cluster setup and Knative install, found [here](https://github.com/crcsmnky/kubecon-knative/blob/master/README.md).

Then switch to the `blue-green` directory and set your cluster context for `kubectl`:

```bash
$ cd kubecon-knative/blue-green/
$ kctx gke_kubecon-na-2018_us-west1-c_knative-demo
```

## Deploying Rev 1 (Blue)

The following steps deploy a sample application that displays "App v1" on a blue background.

```bash
$ kubectl apply -f blue-green-config-v1.yaml
$ kubectl apply -f blue-green-route-100.yaml
```

To view the sample app, grab the external IP:

```bash
$ export IP_ADDRESS=$(kubectl get svc knative-ingressgateway --namespace istio-system --output 'jsonpath={.status.loadBalancer.ingress[0].ip}')
```

Then, set the hostname:

```bash
$ export HOST_URL=blue-green-demo.default.example.com
```

Finally, use `curl` to access the deployed app:

```bash
$ curl -H "Host: ${HOST_URL}" http://${IP_ADDRESS}
```

## Deploying Rev 2 (Green)

The following steps update the previous deployment with a sample application that display "App v2" on a green background.

```bash
$ kubectl apply -f blue-green-config-v2.yaml
$ kubectl apply -f blue-green-route-100-0.yaml
```

Rev 2 of the sample application is now staged, but traffic is still going to Rev 1.

Using `curl` you'll see that "App v1" on a blue background is still the default:

```bash
$ curl -H "Host: ${HOST_URL}" http://${IP_ADDRESS}
```

To see "App v2" on a green background, use the following:

```bash
$ curl -H "Host: v2.${HOST_URL}" http://${IP_ADDRESS}
```

This approach lets you validate Rev 2 without directing all traffic to it.

## Migrating Traffic from Rev 1 to Rev 2

First, deploy a new route configuration that splits the traffic 50/50 between Rev 1 and Rev 2:

```bash
$ kubectl apply -f blue-green-route-50-50.yaml
```

Use `curl` a few times to see the traffic split:

```bash
$ curl -H "Host: ${HOST_URL}" http://${IP_ADDRESS}
```

## Routing All Traffic to Rev 2

Finally, deploy a new route configuration that sends 100% of the traffic to Rev 2:

```bash
$ kubectl apply -f blue-green-route-0-100.yaml
```

Use `curl` a few times to verify that all traffic is going to Rev 2:

```bash
$ curl -H "Host: ${HOST_URL}" http://${IP_ADDRESS}
```

With all inbound traffic being directed to the second revision of the application, Knative will soon scale the first revision down to 0 running pods and the blue/green deployment can be considered complete. Using the named `v1` route will reactivate a pod to serve any occassional requests intended specifically for the initial revision.

## Clean Up

```bash
$ kubectl delete route blue-green-demo
$ kubectl delete configuration blue-green-demo
```

repository: crcsmnky/kubecon-knative

repo_name: crcsmnky/kubecon-knative


text:
# mipsel-ecoff-toolchain
A cross compiler toolchain for the Sony Playstation [Net Yaroze](https://en.wikipedia.org/wiki/Net_Yaroze). The Net Yaroze SDK (included) uses the mipsel-ecoff target which has long since been considered obselete in GCC and therefore requires a much older version of GCC. Compiling these older versions of Binutils/GCC is achieved by using a modern version of GCC to compile an intermediate version of GCC that allows stepping backwards to the desired version (e.g. GCC v8.2.1 -> GCC v3.3.4 -> GCC v2.95.2). The final cross compiler is then able to cross compile the defunct combination of 32-bit MIPS (LE) and the ECOFF file object format used with the Net Yaroze SDK.

# Building

If a `PREFIX` isn't given, it simply defaults to `$PWD/yaroze`.

```
./mipsel-ecoff-toolchain PREFIX=$PWD/yaroze
```

This will make folders during the build process: `{build,sources,stamps}`. These can be cleaned up also using `make clean`.

Originally, I was building this toolchain in a docker container, but ultimately found it not necessary on the OSes I was working with (Ubuntu and Arch Linux). However, others have had success building this toolchain on a different OS/platform using docker. For example, [docker-yaroze](https://github.com/Davermouse/docker-yaroze) has compiled Net Yaroze executables successfully on macOS. I'm unfamiliar with the docker environment on Windows, but the capability to run linux containers should be roughly the same (probably through WSL). In any case, it's worth giving a look if you are needing to build on a non-linux OS.

# Compiling the sample

The sample project is one included with the Net Yaroze SDK and can be used to verify that the toolchain is working:

```
cd <PREFIX>/mipsel-ecoff/sample/sjiscode
make
```

Should produce a binary that looks like this:

```
$ file main
main: MIPSEL ECOFF executable (paged) not stripped - version 2.11
```

# Running executables

Since Net Yaroze executables are not PSX-EXE files (PS1 executable format) they cannot be loaded into an emulator or CD iso builder. The Net Yaroze Boot Disk (DTL-S3035) runs a program that listens for serial I/O commands and loads the entire Net Yaroze SDK into memory. At this point, SIOCONS.EXE can be used to load the Net Yaroze executable at the correct starting address and the serial command to execute whats loaded into memory can then be sent. It is possible to prebuild a PSX-EXE that loads a bare Net Yaroze executable in a similar way by combining it with the SDK into a single PSX-EXE file. To do this, I've adapted the [https://github.com/gwald/Yarexe](https://github.com/gwald/Yarexe) tool (itself also a combination of the work of others) into [eco2exe](https://github.com/ChrisRx/psxsdk#eco2exe) over in the repo I currently keep assorted psx/ny dev tools. I adapted it with the hopes that it will be slightly more portable and maintainable as a Go project.

With a valid PSX-EXE it can now be ran in emulators that can load the PSX-EXE format (mednafen, NO$PSX) or a PSX CD image can be made with something like [https://github.com/Lameguy64/mkpsxiso](https://github.com/Lameguy64/mkpsxiso).

# Resources

 * [PSXDEV](http://www.psxdev.net/) - the community here is great and has collected a lot of helpful info about PSX development
 * [Net Yaroze For Linux](http://www.cebix.net/downloads/yarlinux.pdf)

license: MIT

branch_name: refs/heads/master

extension: md

license_type: permissive


text:
Nine members of the LeBaron family were slaughtered in the Mexican border state of Sonora on Monday while traveling in a convoy from the Mormon La Mora religious settlement, where they lived.
Heartbroken dad Adrián LeBaron's has now revealed that two of his nephews were also killed 10 years ago.
His daughter Rhonita Maria LeBaron and four grandchildren, including six-month-old twins, were shot dead in the latest attack.
Mothers Dawna Langford and Christina Langford Johnson were also killed, along with Ms Langford's two sons, aged three and 11.

Mr LeBaron's nephew, Eric, was kidnapped by cartel members in 2009, although he was released after the family refused to pay a £776,400 ransom, Mail Online reports.
Two other nephews, Benjamin and Luis, were killed months later after Benjamin spoke out about Eric's kidnapping - and Luis tried to protect his brother from the gang.
Mr LeBaron told Mail Online that the cartels 'killed innocent people to teach fear'.

He added: "It is not an attack against our community, what we have here is a protest.
"They are making a statement and I do not know towards who. However, they killed my daughter with that purpose.
"Just as in 2009, we did not want to pay a ransom, we have never accepted when they harass you, when they extort you. I do not tell that group, I'm telling any group that exists in our Mexico that we do not give in."
A relative, Julian LeBaron, called the incident a massacre and said some family members were burned alive.
In a text message to Reuters he wrote that four boys, two girls and three women were killed.
Several children who fled the attack were lost for hours in the countryside before being found, he said.
He added that it was unclear who carried out the attack, although the Mexican government believes drug cartels were responsible.

Mexican Security Minister Alfonso Durazo said the nine may have been victims of mistaken identity.
But the LeBaron extended family has often been in conflict with drug traffickers in Chihuahua and a relative of the victims said the killers surely knew who they were targeting.
Alex LeBaron said: "We've been here for more than 50 years. There's no-one who doesn't know them. Whoever did this was aware. That's the most terrifying."
All of the dead were US citizens, he told Reuters, and most also held dual citizenship with Mexico.
They were attacked while driving on backroads in a convoy of cars containing the women along with 14 children, he said.
Some were heading for Tucson airport to collect relatives.
A video posted on social media showed the charred and smoking remains of the bullet-riddled vehicle ambushed by the gunmen.

license: Unlicense

repository: dsadlollioygjmzvcxv/tdc-exported

repo_name: dsadlollioygjmzvcxv/tdc-exported


text:
# Dumb simple mechanics

Just a place for me to dump simple mechanics implemented quickly in Godot

## Card Deck Exchange

This mechanic allows players to move cards and parent them to new locations.

![deck](card-deck-exchange/deck.gif)

## Simple network server

This mechanic hosts a server for multiple clients to connect to and set their
name.

![screen](game-server/game-network-demo.gif)

## Location Navigated map

Forget what this one was suppose to be ¯\\_(ツ)_/¯

![screen](location-navigated-map/location-map.gif)

## Window Player Controller

This mechanic controls the player as they move the window around.

![mechanic](window-player-control/mechanic.gif)

repository: AngelOnFira/dumb-simple-mechanics

repo_name: AngelOnFira/dumb-simple-mechanics


text:
# Express Note Taker

## Description

Note taking application in the web browser using express.js to create, save and delete notes

## Table of Contents

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

## Installation

Node.js is required to use this application.

First clone the repository onto your system then run in the root directory
```
npm i --production
```

## Usage

After installation is finished run
```
node dev/server.js
```
to start the Express server

the server is listening 'localhost:3000' by default

Once to the home page you can press the 'Get Started' button to get redirected to '/notes'. Once on the 'notes' page you will be able to create, delete and save notes as well as update them to the file 'db.json' in the /dev/db/ folder

## License

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

## Contributers

Myself

## Questions

<EMAIL_ADDRESS>

branch_name: refs/heads/main


text:
## Travel Dashboard

# Commands
* $`gatsby develop`
* $`gatsby build` // builds and deploys to a gh-pages branch
* $`npm run-script deploy`

repository: lb-/travel-dashboard

repo_name: lb-/travel-dashboard


text:
# Financial system

Go back to the [[Economic_Glossary]]

The firms and institutions that together make it possible for money to make the world go round. This includes financial markets, securities exchanges, banks, pension funds, mutual funds, insurers, national regulators, such as the Securities and Exchange Commission (SEC) in the United States, central banks, governments and multinational institutions, such as the imf and world bank.

path: /Economics/Glossary/Financial System.Md

filename: Financial System.Md


text:
# TLS-SSL-client-server-openssl
Client and Server TCP using TLS/SSL with C++ (OPENSSL)

## Files
Final source code have a password. (.7z)

hint : pseudoOW+pseudo@mail+mygraphiccard(m)+*

Contain client and server have a password.(.zip)

hint (Brand): keyboard+myandroidphone+computer

## Installation
Generate your certificate.

Link openssl with Visual Studio.

Use RawCap with wireshark to listen on the loopback.

## Capture
 Client - Server dialogue

![alt tag](https://github.com/Erozbliz/TLS-SSL-client-server-openssl/blob/master/Capture/dialogue%20client%20serveur%202.JPG?raw=true)
Wireshark TLS1.2

![alt tag](https://github.com/Erozbliz/TLS-SSL-client-server-openssl/blob/master/Capture/wireshark1.JPG)

repository: Erozbliz/TLS-SSL-client-server-openssl

repo_name: Erozbliz/TLS-SSL-client-server-openssl


text:
# WEB DEVELEOPMENT ASSIGNMENT - IPLAY

<img src="https://media.giphy.com/media/np3C1COrXYqzK/giphy.gif" alt="Webbutvecklare" width="100%">

> If you for some reason do not recognize the guys in the gif you should really watch this video by Lonely Island because it is hilarious... Mm yes...
https://www.youtube.com/watch?v=CEVdca9U9LM

## Assignment:
Improve and redesign http://www.iplay.global/
to help IPlay get more people to download their app.

## About the project
This project was built using WordPlate which is a modern WordPress stack built with Composer. It simplifies the fuzziness around WordPress development.
https://wordplate.github.io/docs/introduction

### Side note:
For this project to work as intended you need to create pages named the following in your wordpress backoffice:
- About
- Athletes
- Fans
- Feature Roadmap
- Press
- Contact

## Creators:
- _Viktor Lassing (Digital Designer)_
- _William Martinsson (Digital Designer)_
- _Linn Tunberg (Web Developer)_
- _Albert Norberg (Web Developer)_
---
_YRGO, GÖTEBORG 2018_


text:
# Runtime

The Hemlock runtime provides many of the services which are typically provided
by a time-sharing operating system. Hemlock's actors are isolated from each
other such that a misbehaving actor cannot typically dominate compute/memory
resources. Computation is round-robin time-sliced so that compute-intensive
actors cannot starve other actors. Automatic memory management (garbage
collection) enables strong memory access safety, and Configurable per actor
memory limits keep individual actors from unintentionally dominating memory
usage.

- [XXX Executors](executors.md) schedule actors, multiplex I/O, and drive
  incremental garbage collection for the global heap.
- [XXX Work stealing](work_stealing.md) can automatically distribute
  long-running pure computation when there are fewer runnable actors than there
  are executors.
- [XXX Messaging](messaging.md) between actors is the only mechanism for
  communication, though messages can refer to the global heap.
- [Automatic memory management](memory.md) which utilizes various garbage
  collection technologies is highly scalable and provides strong memory safety.
  Each actor has an isolated heap that requires negligible synchronization with
  the rest of the system. The global heap enables multi-actor collaboration on
  arbitrarily large data structures.

gha_language: OCaml

gha_license_id: NOASSERTION


text:
pastelib v0.6.1
========

A Python library for interfacing with various pastebins; forked from the now-defunct lodgeitlib with permission.

At the moment, I am just making available the source code of the old lodgeitlib. I intend to work on it
in the near future, however, and put it back on PyPI.

Lodgeitlib is documented here: https://pythonhosted.org/lodgeitlib/index.html

According to the author, he removed the package from PyPI because the pocoo.org pastebin (the main implementation
of lodgeit at the time) became defunct. However, there are several pastebins still around that use spacepaste,
a successor to lodgeitlib (including bpaste.net), and I am using the software in a personal project, so I'm forking
it and making it publicly available once again.

The source is still under the MIT license, as the original was.

Credits:
--------

* Ben Rosser<EMAIL_ADDRESS>Author of fork
* Sebastian Wiesner<EMAIL_ADDRESS>Original Author


text:
---
layout: post
title: Spotlight
subtitle: How to create shortcuts to the app in the Spotlight menu?
comments: true
readtime: true
hidden: true
---

Supporting this Apple feature is very useful and improves user experience.

<img src="../assets/img/my-vocabulary/spotlight/spotlight.png" width="300" class="center">

### Create a Spotlight item

When the user answers a question at the translation's quiz, that translation can be stored in Spotlight so it can be reviewed easily.

```swift
/// Updates a translation in CloudKit and adds it to Spotlight.
/// - Parameter translation: The translation that will be updated.
func update(_ translation: Translation) {
    let translationID = translation.objectID.uriRepresentation().absoluteString
    let attributeSet = CSSearchableItemAttributeSet(contentType: .text)
    attributeSet.title = translation.translationInput
    attributeSet.contentDescription = translation.translationOutput
    let searchableItem = CSSearchableItem(
        uniqueIdentifier: translationID,
        domainIdentifier: "com.serg-ios.MyVocabulary",
        attributeSet: attributeSet
    )
    CSSearchableIndex.default().indexSearchableItems([searchableItem])
    save()
}
```

Please, note that this is a very basic Spotlight item, they are much more customizable but I decided to use only the fields `title` and `contentDescription`.

The `uniqueIdentifier` identifies univocally the item, note that an `NSManagedObjectID` is being used to make the translation retrievable from the `NSManagedObjectContext` once the user has selected the Spotlight item. I didn't implement this though, I decided to provide the default action (launching the app).

### Delete Spotlight data

The `domainIdentifier` groups all the items that have this field in common, so they can be deleted together at once.

An item can be deleted individually too, but I didn't implement this. All Spotlight items are removed at once when the user deletes all the imported translations.

```swift
/// Delete all the objects of a specific type from iCloud and removes all Spotlight data.
/// - Parameter objectType: The type of the objects that will be removed.
func deleteAll(_ objectType: NSManagedObject.Type) {
    let fetchRequest: NSFetchRequest<NSFetchRequestResult> = objectType.fetchRequest()
    let batchDeleteRequest = NSBatchDeleteRequest(fetchRequest: fetchRequest)
    _ = try? container.viewContext.executeAndMergeChanges(using: batchDeleteRequest)
    CSSearchableIndex.default().deleteSearchableItems(withDomainIdentifiers: ["com.serg-ios.MyVocabulary"])
}
```

### Attach a NSManagedObject to  a CSSearchableItem

[Here](/2021-03-21-my-vocabulary-spotlight/), an **uniqueIdentifier** was attached to the `CSSearchableItem`, so it could be retrievable when the app is open through Spotlight.

The reverse operation has to be made, this time from ID to object.
```swift
/// Tries to obtain a stored translation with its object ID.
/// - Parameter uniqueIdentifier: The object ID of the managed object, a translation in this case.
/// - Returns: The translation that has that object ID.
func translation(with uniqueIdentifier: String) -> Translation? {
    guard let url = URL(string: uniqueIdentifier),
          let id = container.persistentStoreCoordinator.managedObjectID(forURIRepresentation: url) else {
        return nil
    }
    return try? container.viewContext.existingObject(with: id) as? Translation
}
```

See how to obtain this ID when the [app opens](/2021-03-25-my-vocabulary-open-the-app/).

---


text:
---
templateKey: blog-post
title: Meetup Report - January 2020 - AWS Cloud Trends 2020 (re:Invent recap)
date: 2020-01-04T15:04:10.000Z
description: Meetup Report - January 2020 - AWS Cloud Trends 2020 (re:Invent recap)
tags:
  - aws
  - awsugkochi
  - meetup
  - awscloud
  - kochi
  - reinvent2019
  - reinventrecap
---

![acdkochi2020](/img/awsugkochi-meetup-jan-2020-team.png)

AWSUGKOCHI has conducted our first meetup event in 2020 in style with AWS re:invent recap session by [Suman Debnath](https://www.linkedin.com/in/suman-d), Principal Developer Advocate - Amazon Web Services (AWS)

---

AWS User Group India is conducting re:invent recap roadshows across all major cities in India, Bangladesh, and Sri Lanka. Here are the event details. Try to attend one near your city. It's fun and informative.

![acdkochi2020](/img/awsugkochi-meetup-jan-2020-events.png)

The event started with an Introduction by [Abhilash Nair](https://www.linkedin.com/in/hiabhilash/), Co-Organizer of [AWS User Group Kochi](https://awsugkochi.in). Abhilash is one of the team members who traveled to USA for re:invent conference. He shared his re:invent experience with the attendees also showcased the Deepracer.

![acdkochi2020](/img/awsugkochi-meetup-jan-2020-meetup.png)

Suman Debnath also shared his re:invent experience and walked us through the latest  announcements and features in Compute, Storage, Database & Analytics, Security, Networking, Developers, Regions, and Availability zones and AI/ML

He also demonstrated the AWS Deep Composer and Deepens with the audience. One of our members also tried his musical skills with the Deep Composer. Here are the few items discussed during the session.

- Amazon EC2 Inf1 Instances (Inferentia)
- Amazon Graviton Processor
- Amazon Graviton2 Based Instances (M6g, C6g, R6g)
- Amazon Braket (Fully Managed Service - Quantum Computing)
- AWS Nitro Enclaves (Additional isolation to further protect highly sensitive data within EC2 instances)
- AWS Compute Optimizer
- Savings Plans
- Amazon EKS for AWS Fargate
- EC2 Image Builder
- Amazon S3 Access Points
- EBS Direct APIs for snapshots
- Amazon Managed Apache Cassandra Service
- Amazon Aurora Machine Learning Integration
- Amazon RDS Proxy
- UltraWarm for Amazon Elasticsearch Service
- Amazon Redshift RA3 instances with Managed Storage
- Amazon Detective
- Amazon IAM Access Analyzer
- AWS Transit Gateway for Inter-Region Peering
- Provisioned Concurrency on AWS Lambda
- AWS Outposts
- Local Zones
- AWS Wavelength ...

![acdkochi2020](/img/awsugkochi-meetup-jan-2020-demo.png)

Full presentation is available [here](https://speakerdeck.com/debnsuma/aws-re-invent-re-cap-2019), Please go through in details Build Cool Stuffs and Send us feedback.

The event concluded with a Thanks note by [Dijeesh Padinharethil](https://www.linkedin.com/in/dijeesh-padinharethil/), Co-Organizer AWS User Group Kochi. He also announced few event plans in 2020.

![acdkochi2020](/img/awsugkochi-meetup-jan-2020-thanks.png)

Here are few upcoming events organized/supported by AWSUGKOCHI

- Innovator's Summit.
- Deep racer Competition
- AWS DevOps Hackathon
- AWS Community Day 2020

Of course, we had a traditional Kerala Style gift for Suman Debnath as a token of thanks from the AWSUGKOCHI Community.

We have also distributed a few gifts to 3 lucky winners and AWS Badges,  stickers to all participants.

![acdkochi2020](/img/awsugkochi-meetup-jan-2020-gifts.png)

Thanks to

- [Suman Debnath](https://www.linkedin.com/in/suman-d/) for the wonderful informative session
- [Rashmi Nambiar](https://www.linkedin.com/in/rashminambiar/) for all the help, guidance, co-ordinations and gifts.
- [Dijeesh Padinharethil](https://www.linkedin.com/in/dijeesh-padinharethil/) for organizing the event
- [Arun Nair](https://www.linkedin.com/in/arun-nair-a2916449/) for arranging the venue
- All the attendees for spending your weekend with us.

We are looking forward to meeting you all in our upcoming events. [Here](https://photos.app.goo.gl/gYXHoPepVyTB2ky1A) is our photo gallery for this event.

## Join the community

Join the AWSUGKOCHI community by navigating to our [Website](https://awsugkochi.in/about)

Help us to grow this community, please share this page to your colleagues and friends - Thank you.

<link href="//cdn-images.mailchimp.com/embedcode/slim-10_7.css" rel="stylesheet" type="text/css">

<form action="https://awsugkochi.us20.list-manage.com/subscribe/post?u=b4c4469413422365d2a2e5cf6&id=d4837b9a16" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>

	Subscribe to our monthly meetup alerts
	<input type="email" value="" name="EMAIL" class="email" id="mce-EMAIL" placeholder="email address" required>

<input type="text" name="b_b4c4469413422365d2a2e5cf6_d4837b9a16" tabindex="-1" value="">

<input type="submit" value="Subscribe" name="subscribe" id="mc-embedded-subscribe" class="button">

</form>

repository: awsugkochi/awsugkochi

gha_language: JavaScript

gha_license_id: MIT

repo_name: awsugkochi/awsugkochi


text:
# pdfkit-basics

## Overview

This is a single-view XCode project for displaying simple PDFKit implementations.

## How To Use

Open the project in XCode and open the **ViewController.m** file, then locate the **viewDidLoad** function. Initially only one function is called:

```
[self displaySimplestLayout];
```

To run any particular example, comment out all function commands besides the one you want to display.

repository: andrewhoyer/pdfkit-objc-examples

repo_name: andrewhoyer/pdfkit-objc-examples


text:
---
title: Watermark
page_title: Watermark
slug: radwordsprocessing-concepts-watermark
tags: watermark
published: True
position: 6
---

# Watermark

Watermarks are text or pictures that appear behind document content and often identify the document status, for example by marking it as Draft.

## Watermark Overview

The class representing a watermark is __Watermark__ and exposes the following properties:

* __WatermarkType:__ The type of the watermark, described with the [WatermarkType](https://docs.telerik.com/devtools/document-processing/api/Telerik.Windows.Documents.Flow.Model.Watermarks.WatermarkType.html) enumeration.
	* __Image:__ Watermark containing an image.
	* __Text:__ Watermark containing text.

* __ImageSettings:__ Determines the settings of the watermark if it is of type __Image__. Derives from __WatermarkSettingsBase__ and exposes a property of type __ImageSource__ specifying the source of the image.

* __TextSettings:__ Determines the settings of the watermark if it is of type __Text__. Derives from __WatermarkSettingsBase__ and exposes additional properties __Text__, __FontFamily__ and __Color__ specifying the appearance of the text.

__WatermarkSettingsBase__ is the base class for text and image watermark settings and defines the appearance of the watermark on a page. It exposes the following properties:

* __Width:__ The width of the watermark.
* __Height:__ The height of the watermark.
* __Angle:__ The angle of the watermark towards the horizontal direction.

## Create a Watermark

Creating a watermark through the constructor of the class requires to pass as a parameter an object of type __TextWatermarkSettings__ or __ImageWatermarkSettings__, depending on the type of watermark you want to create.

__Example 1__ demonstrates the creation of a text watermark.

#### __[C#] Example 1: Create text watermark__

{{region cs-radwordsprocessing-concepts-watermark_0}}

	TextWatermarkSettings settings = new TextWatermarkSettings()
	{
	    Angle = 12,
	    Width = 200,
	    Height = 300,
	    Opacity = 0.4,
	    FontFamily = new FontFamily("Verdana"),
	    ForegroundColor = Colors.Red,
	    Text = "DRAFT"
	};

	Watermark textWatermark = new Watermark(settings);
{{endregion}}

Creating image watermark is very similar to creating a text one. __Example 2__ shows how to create an image watermark.

#### __[C#] Example 2: Create image watermark__

{{region cs-radwordsprocessing-concepts-watermark_1}}

	Watermark imageWatermark = new Watermark(new ImageWatermarkSettings()
	{
	    Angle = 45,
	    Width = 50,
	    Height = 75,
	    ImageSource = new Telerik.Windows.Documents.Media.ImageSource(imageStream, "png")
	});
{{endregion}}

## Set Watermark

Watermarks are preserved in the header of the section to which the watermark is applied. More information on __Header__ elements and how you can use them is available in the [Headers and Footers]({%slug radwordsprocessing-model-headers-footers%}) article.

__Example 3__ demonstrates how you can add the watermark created in __Example 1__ to a __RadFlowDocument__ by creating a __Header__ for its first __Section__.

#### __[C#] Example 3: Add watermark to header__

{{region cs-radwordsprocessing-concepts-watermark_2}}
	Header header = document.Sections.First().Headers.Add(HeaderFooterType.Default);
	header.Watermarks.Add(textWatermark);
{{endregion}}

>tipBy default, if header is omitted for a __Section__ other than the first one, it is inherited from the previous __Section__. The watermark set in __Example 3__ will be implicitly inherited by all sections following the first one since watermarks are preserved in the header.

There is another way to set a watermark in a document - through the [RadFlowDocumentEditor]({%slug radwordsprocessing-editing-radflowdocumenteditor%}) class. __RadFlowDocumentEditor__ exposes two overloads of the __SetWatermark()__ method that provide a simplified way to set a watermark.

__Example 4__ demonstrates how to set the watermark created in __Example 2__ through __RadFlowDocumentEditor__ to the first page of a section. The method will create the __Header__ element for you, and you only need to specify its type.

#### __[C#] Example 4: Set watermark with RadFlowDocumentEditor__

{{region cs-radwordsprocessing-concepts-watermark_3}}
	Section section = editor.Document.Sections.AddSection();
	editor.SetWatermark(imageWatermark, section, HeaderFooterType.First);
{{endregion}}

## See Also

 * [Headers and Footers]({%slug radwordsprocessing-model-headers-footers%})
 * [RadFlowDocumentEditor]({%slug radwordsprocessing-editing-radflowdocumenteditor%})

repository: telerik/document-processing-docs

repo_name: telerik/document-processing-docs


text:
---
path: '/impacts/species/keystone'
title: 'Loss of Keystone Species'
---

<content-header icon="coral_hardbottom" title="Loss of Keystone Species">
</content-header>

<!-- https://www.flickr.com/photos/evergladesnps/9099546623/ -->

![Mangrove photo](9099546623_6308aca42b_k.jpg 'Mangrove in Ten Thousand Islands. Photo, D.Grimes (NPS).')

A keystone species is a species that has a disproportionately large effect on its environment relative to its abundance. Such species play a critical role in maintaining the structure of an ecological community, affecting many other organisms in an ecosystem and helping to determine the types and numbers of various other species in the community.

### Examples of keystone species in Florida include:

<profile-snippet id="129">
The gopher tortoise is considered a keystone species for the sandhill community in that it “engineers” the habitat of many other species. Species that have been reported using gopher tortoise burrows include at least 36 amphibians and reptiles, 19 mammals, seven birds, and more than 300 species of invertebrates. Climatic changes that impact gopher tortoise abundance or survival, such as alterations to fire regimes, will impact a large suite of associated species.
</profile-snippet>

<profile-snippet id="320">
The species that create worm reefs and coral reefs are also considered to be keystone species. Coral reef systems composed of species such as Oculina provide habitat for many recreational and commercially important species, such as scallop, shrimp, grouper, snapper, and amberjack. Changes in circulation patterns, wave actions, sea surface temperatures, and ocean acidification may impact the coral and worm reef species and, in turn, the species that depend upon their structure as habitat.
</profile-snippet>

<profile-snippet id="301">
The American alligator is considered to be a keystone species of the Everglades ecosystem and wetlands systems throughout Florida, creating important habitat for other species and aiding in ecological processes. The deep holes that they create in the wetland systems retain water during the dry season, providing habitat for a variety of other species. Climate changes, particularly those changes impacting hydrological processes, can cause changes in the alligator’s range or nesting; multiple other species would also be impacted.
</profile-snippet>

<hr class="divider" />

### What's next?

[Learn about impacts to habitats and ecosystems from changes in climate in Florida.](/impacts/habitats)

repository: consbio/pflcc-cae

repo_name: consbio/pflcc-cae


text:
rake - Rapid Automatic Keyword Extraction
=========================================

An efficient Python implementation of the Rapid Automatic Keyword Extraction (RAKE)
algorithm as described
in: Rose, S., Engel, D., Cramer, N., & Cowley, W. (2010).
_Automatic Keyword Extraction from Individual Documents_. nn M. W. Berry & J. Kogan - (Eds.), Text Mining: Theory and Applications: John Wiley & Sons.

Different versions of this algorithm have been floating around GitHub for
quite a while. This version attempts to improve its efficiency while preserving
the essence of the original algorithm.
The source code was originally released under the MIT License.

### Stop Words
There are three builtin options for stop word lists: 'smart', 'google', and 'nltk'.
The default stop word list is 'google'. The 'nltk' and 'google' stop words are
very similar.
The 'smart' stop words contain articles and some verbs. The
results resemble those when noun chunks are considered for keywords. All
stop word lists are represented as optimized regular expressions.

## License
Copyright (c) 2013 - 2019 - Chris SKiscim

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

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

 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

repository: iamjoshbinder/gamechanger-ml

repo_name: iamjoshbinder/gamechanger-ml


text:
---
topic: "APIs: Free"
desc: "Some APIs that offer free access"
category_prefix: "APIs: "
indent: true
---

Here is a list of some APIs that offer free access tiers that you can try to use in your applications:

| Name | Purpose | Link |
|------|---------|-------|
| fixer.io | Currency Conversion | [fixer.io](https://fixer.io) |
| github api v3 | access to github repos/orgs/users | [developer.github.com/v3](https://developer.github.com/v3/)
| iex | stock trading  | <https://iextrading.com/developer/> |

gha_language: Ruby


text:
---
layout: post
title:  "Back in the saddle"
---

Hi y'all! After some time away on mental health leave (which you can read more
about [here] if you're curious), I'm fully back to work at the Mozilla Rust
team. I won't be returning to Lang Team or Async work, but will instead be
working full-time on compiler engineering. The first goal is to work with Zoxc
and others to help ship parallel rustc. After that, there's tons to do on the
trait system. I'm very excited about focusing on some actual Rust programming.

[here]: http://aturon.github.io/personal/2019/06/24/survivor-skills/

I wanted to take this opportunity to thank Mozilla, which has been very
accommodating and understanding with my need to take some time, and especially
to thank my dear friend Niko, who quietly and competently took on the workload
around this transition.


text:
# Changelog

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

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

## [0.2.3] 2020-07-07

### Changed

- Dependencies clean up

## [0.2.2] 2020-01-14

### Fixed

- Fix `Asn1RawDer` behind Application/Context tags issue [#14](https://github.com/Devolutions/picky-rs/issues/14).

## [0.2.1] 2020-01-10

### Added

- `Asn1RawDer` wrapper for user-provided raw DER.

## [0.2.0] 2019-12-23

### Added

- Add `from_reader_with_max_len` deserialization function to limit how many bytes can be read at most.

### Changed

- `from_reader` function has a default limit of 10240 bytes before returning a truncated data error.
    Uses `from_reader_with_max_len` to change the limit.

### Fixed

- Fix various crash found by fuzzing.

repository: joechrisellis/picky-rs

repo_name: joechrisellis/picky-rs


text:
# Pipeline templates for Gitops

The Service domains are implemented as microservices. These pipeline templates will allow
us to configure GitHooks so that we can push changes in a continous fashion.

![A typical CI/CD Process](img/cicd.png)

## Setup pipeline scripts

+ Create a new project.
```
oc new-project pipelines
```

+ Install the Openshift pipelines operator.

![Openshift pipelines operator](img/openshift_pipelines_operator.png)

+ Install the scripts for task, pipeline and trigger.
```
oc create -f service-domain-task.yaml
oc create -f service-domain-pipeline.yaml
oc create -f service-domain-triggers.yaml
oc expose svc/el-service-domain-listener
```
+ This should create a listener, and a route as below
```
http://el-service-domain-listener-pipeline.apps.cluster-002d.002d.example.opentlc.com/
```
+ We will now add this route to the git repository. For this navigate to the repository and add a webhook.
For example on github, navigate to service domain repository->Settings->Webhooks->Add Webhook.

![webhook](img/webook.png)

Add the Webhook Url as the listener url and choose the content type as application/json.

+ Now do a commit on the repository and push the changes, the changes should kick off the tekton build on openshift.

repository: apetroni/mercury

repo_name: apetroni/mercury


text:
## Welcome to "Support COVID Victim Families" app!

### Sneak Peak
https://www.youtube.com/embed/fgExdyJmDuQ

### How the flutter app structure is built?
I followed MVC sturcture with the help of ScopedModel to share model(s) object across the whole app.
### How to contribute:
Repo is a git flow based code, thus better to follow git flow structure.
### How to install:
Just pull and run `flutter install` after you have your device or emulator is up.


text:
---
title: Exploring Unity ML Agents - Move to Goal
summary: An exploratory project to take a look at Unity's ML Agent module.
tags:
- Personal
- AI
date: "2022-02-03"

# Optional external URL for project (replaces project detail page).
external_link: ""

image:
  caption: ""
  focal_point: Center

links:
- icon: github
  icon_pack: fab
  name: Github
  url: https://github.com/AmritAmar/UnityMLAgents_MoveToGoal
url_code: ""
url_pdf: ""
url_slides: ""
url_video: ""

# Slides (optional).
#   Associate this project with Markdown slides.
#   Simply enter your slide deck's filename without extension.
#   E.g. `slides = "example-slides"` references `content/slides/example-slides.md`.
#   Otherwise, set `slides = ""`.
#slides: example
---

I only recently learned about [Unity's ML Agents Library](https://github.com/Unity-Technologies/ml-agents) - an open-source project to enable Unity projects to serve as environments for reinforcement learning algorithms. This is pretty cool because when I first started using Unity for AI, I had to implement the neural network itself and I used genetic algorithms to train my agents. With this project, training autonomous agents has never been easier with provided implementations of common RL algorithms along with a python interface to train! This project was done using [PPO](https://openai.com/blog/openai-baselines-ppo/).

The first step was setting up my environment. I created a new Unity project and then created a virtual environment to get all the python dependencies, which included pytorch and mlagents. Everything worked pretty smoothly - I was able to use my RTX 3080 for training. I then imported the Unity ML Agents module through Unity, it was super simple. After that, I created a basic environment modelled after Unity's own example: Move to Goal.

![](m2g_1.png)

It's a simple setup - an environment with a simple cube agent and a sphere goal surrounded by walls. The agent's motive is simple: move to the goal without touching the wall. I created a script for the agent called "MoveToGoalAgent" and, to my surprise, it turns out that you don't need to inherit from MonoBehavior, but rather Agents. After reading through the docs, there were 4 key things I had to handle:

1. Observation (what does the agent see to make a decision)
2. Decision (the decision itself - handled by the library)
3. Action (how the decision translates to environment actions)
4. Reward (do we reward the agent for the actions it took)

![](m2g_2.png)

While I thought about several ways to implement the observation, I decided to stick to providing the agent's location and the goal's location, which is a total of 6 inputs. The ml-agents library gives you the option of using continuous or discrete values for outputs. For this project, 2 continuous variables were enough to specify movement in the x or z directions. After testing passing and failing cases, I trained the environment in parallel with 9 separate instances.

![](m2g_3.gif)

It's pretty cool to see how they train over time. The red indicates that the agent failed (by hitting a wall) in the last iteration while green indicates the agent got to the goal. After about 2 minutes, I saw greens across the boards. However, ML isn't just about training specific tasks - it's about effectively training behaviours. My agent only knew how to get to the goal in one way. Move the goal elsewhere and it all went downhill.

![](m2g_4.gif)

It's interesting to see how the position of the goal is actively affecting the neural network. To solve this, I randomized the starting and ending positions of the goal and the agent. I then re-trained the neural network and after a few minutes, loaded the trained neural network into Unity.

![](m2g_5.gif)

It worked really well! There were some boards that had issues during the validation but overall I think it was a success! I am looking forward to using this library for more complex RL tasks.

repository: AmritAmar/academic-kickstart

repo_name: AmritAmar/academic-kickstart


text:
---
layout:     post
title:      HN Vimmy Bot Now Tweets Hacker New Discussion Link Along With Story Link
date:       2016-05-16 08:04:54
summary:    By popular demand, HN Vimmy Bot will now Tweet the Hacker News discussion link
categories: HN-Vimmy-Bot Product
---

By popular demand, HN Vimmy Bot will now Tweet the Hacker News discussion link along with the link to the story. This means you will get all the great Vim tweets you got before, only from now on it will be accommodated with a link to the associated Hacker News discussion thread. No more searching for that discussion link, now it's right in the tweet.

> YOU ASKED FOR IT, NOW IT'S HERE

Monday afternoon a short 20 minute Twitter poll was conducted to gauge the interest of including a discussion link. The results were unanimous, the message was clear, followers of HN Vimmy Bot overwhelmingly supported the purposed measures.

Should HN Vimmy Bot serve HN discussion link with story link? Downside is there is no preview on story link
— HN Vimmy Bot (@HN_Vimmy_Bot) May 16, 2016

This is wonderful news for all of HN Vimmy Bots followers, their voices were heard and now HN Vimmy Bot will better suit the needs of his followers.

Are you interested in Vim Stories on Hacker News? Be sure to follow HN Vimmy Bot on Twitter.

Follow @hn_vimmy_bot

Read more about HN Vimmy Bot [here](/hn-vimmy-bot)

gha_language: SCSS


text:
# android-web-socket-demo

Most of the code was taken from the article at https://stfalcon.com/en/blog/post/android-websocket -
specifically from the Github repo mentioned in the article. I had to make some tweaks to get it to run in Android Studio.

The key element of the demo is how to make a secure web socket connection. This one works with a Mattermost server, like the one at
https://enrico.teaches-yoga.com

repository: BRH-Enrian/android-web-socket-demo

repo_name: BRH-Enrian/android-web-socket-demo


text:
# ember-cli-profitwell

[![Greenkeeper badge](https://badges.greenkeeper.io/sutori/ember-cli-profitwell.svg)](https://greenkeeper.io/)

This addon inserts the [ProfitWell][profit-well] script into the
`<head>` of the page for you.

## Installation

```
ember install ember-cli-profitwell
```

After installing the addon, you **MUST** provide a configuration value for your
authentication token.

## Configuration

You can configure some of the variables used in the inserted script.

```javascript
// config/environment.js

ENV['ember-cli-profitwell'] = {
  enabledEnvironments: ['production'], // default
  authToken: 'YourAuthToken'           // required, no default
};
```

[profit-well]: https://www.profitwell.com

## Usage

The addon exposes a `profitwell` service through which you can set the email of
the current logged in user.

```javascript
// some component/controller/route

profitwell: Ember.inject.service(),

onLogin(userEmail) {
  this.get('profitwell').setUserEmail(userEmail);
}

...
```

repository: sutori/ember-cli-profitwell

repo_name: sutori/ember-cli-profitwell


text:
## Announce

Growl-inspired alerts and message.

## Development

__Install Dependencies__

npm
```sh
$ npm install
```

bower
```sh
$ bower install
```

## Include
Javascript
```
<script src="announce.min.js"></script>
```

CSS
```
<link rel="stylesheet" href="announce.min.css"/>
```

## Usage

``` javascript
var announce = new Announce({
    position: 'bottom-right',
    timeout: true,
    timeoutDelay: 3000
});

announce.post({
  message: 'This is an announcement!',
  type: 'notice'
});

announce.post({
  message: 'This is a warning!',
  type: 'warning',
  dismiss: true
});
```

[Demo and API Documentation](https://thatguyhughesy.github.io/announce/)

## Contributing

Contributions of any kind are encouraged. If you would like to contribute in any way, please check out the [guidelines for contributing](CONTRIBUTING.md).

## License
Copyright © 2016 Conor Hughes - [MIT License](LICENSE)

repository: ThatGuyHughesy/announce

repo_name: ThatGuyHughesy/announce


text:
[![Build Status](https://travis-ci.com/robertgrzonka/deem.svg?branch=master)](https://travis-ci.com/robertgrzonka/deem) [![codecov](https://codecov.io/gh/robertgrzonka/deem/branch/master/graph/badge.svg)](https://codecov.io/gh/robertgrzonka/deem) [![All Contributors](https://img.shields.io/badge/all_contributors-1-orange.svg?style=flat-square)](#contributors)

## Table of Contents

## the Idea

`deem` is more like editor, but I like to call it in a more _fancy_ way. What I need was a tool which will show me how my text will look like with different styles including colors, font weights oraz font sizes. Firstly written in pure JavaScript, but then became my sandbox.

## Contributors

>

Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):

| [
robertgrzonka](https://robert.theguys.sh)
[💻](https://github.com/robertgrzonka/deem/commits?author=robertgrzonka "Code") |
| :---: |

This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. [Contributions of any kind welcome](CONTRIBUTING.md)!

## License

MIT © [robertgrzonka](https://robert.theguys.sh)

repository: robertgrzonka/deem

repo_name: robertgrzonka/deem


text:
---
title: Create a System Versioning Database with MariaDB + NodeJS + Express + Supertest + Mocha + Chai (Part 3)
date: "2019-05-22"
---

##Learning Objective

By the end of this tutorial, you will learn
- Part 1: [what is system versioning and how to modularize your set up environment for readability and testability](../system-versioning-part-1/)
- Part 2: [how to implement system versioning test cases with NodeJS, Express and MariaDB](../system-versioning-part-2/)
- **Part 3: [how to implement testing frameworks with Supertest, Mocha and Chai](../system-versioning-part-3/)**

##Prerequisites

Before you follow this article, make sure you have followed [Create a System Versioning Database with MariaDB + NodeJS + Express + Supertest + Mocha + Chai (Part 1)](../system-versioning-part-1/) + [(Part 2)](../system-versioning-part-2/).

##What is Testing?
Testing is the process of evaluating the system to check whether it produces expected result as being laid out in the requirements.

Note that TDD principle is not being laid out in this tutorial due to the fact that the focus of the tutorial is not on TDD itself. But I strongly encourage anyone to adapt TDD principle when writing your own codes.

##Types of testing
There are many types of software engineering testing such as unit testing, integration testing, functional testing,system testing, stress testing, performance testing, usability testing, and acceptance testing. However we will be using integration testing for our usecase.

Integration testing is a level of software testing where individual parts or units are combined and tested as a group. The purpose of using integration testing is to expose faults in the interaction between integrated units if they exist.

##Testing Tools
There are three testing libraries we need for our use case.
1. Supertest: required for testing API calls.
2. Mocha: A testing framework that enables you to test functions in a specified order, and logs their results in the terminal accordingly. It also provides structure to the tests by batching them into test suites or test cases.
3. Chai: An assertion library that is often used along side Mocha. It provides the base component of tests cases which are assertion. Assertions are tied to particular values and will fail if the expected value does not meet the actual value.

Before we begin, let's install the modules required for testing
```
npm i supertest mocha chai--save-dev
```

After installing, create directory called `test` and inside the directory create a file and name it `index.js`. Thie file will be the place where we write our tests.

First, we need to make some functions available, such as the exported `app.js` , Chai and Supertest by :

```
'use strict'

const app = require('../app')
const chai = require('chai')
const request = require('supertest')

```

Let chai expect api to be a constant we are going to use regularly later to enforce DRY, and write the tests.

Generally, a test suite is a collection of all tests relating to a single functionality or behaviour. A test case is a single description of the expected behaviour that either passes or fails. Test suites are batched within the `describe` keyword and test cases are include in the `it` keyword. This follows a design pattern for Behaviour-Driven Development(BDD). You can read more about it [here](https://stackoverflow.com/questions/16206894/does-has-special-meaning-in-mocha).

Let's write our first API test to test the `/obj` endpoint. If this endpoint works correctly, it should return status code 200 to indicate success. That is how our routes.js file was implemented (See [Part 2](../system-versioning-part-2/)).

```
'use strict'

const app = require('../app')
const chai = require('chai')
const request = require('supertest')
const expect = chai.expect

const data = (task) => {
  for (let i in task) {
    return {
      value: task[i],
      key: i
    }
  }
}

describe('API Integration tests', () => {
  let task = {'mykey': 'value1'}
  const initialData = data(task)
    it('should post a new key-value pair', (done) => {
      request(app)
        .post('/obj')
        .send(task)
        .end((err, res) => {
          expect(res.statusCode).to.equal(200)
          expect(res.body).to.have.property('key', initialData.key)
          expect(res.body).to.have.property('value', initialData.value)
          expect(res.body.timestamp).to.be.a('number')
          done()
        })
    })
})
```

The `describe` here is actually from Mocha test framework. I simply name the test as `API Integration tests` but you can use other name, just to be sure it reflects the purpose of the test. Here I declared a task object with the original key value pair I plan to begin the test with, and I assigned it as an argument inside the `data` function which I declared outside of the test suites. This function will be useful for me across the tests as I need to always return the object and the key.

Since request() needs the HTTP server so we pass our express app as an argument here . Then in `post` function , we specify the route endpoint. We use the send function to send `task` as the body. Within the `.end()` callback, we leverage on chai assertion methods to test whether the status returns 200. We also check for whether the returned results contain both key with name: `mykey` and value:`value1`. Lastly we also check whether there is a timestamp field that returns a number.

Right so far so good. But how do we run the test? Remember in [Part 1](../system-versioning-part-1/) where you have set up the test environment with modularity? In Part 1, you have set up the testing port as well. But you hae not set up the script to run it. Here is how we are going to  do it.

Open your package.json, and add make the change:

```
"scripts": {
  "start": "NODE_ENV=development nodemon app.js",
  "build": "NODE_ENV=production nodemon app.js",
  "test": "NODE_ENV=test mocha"
}
```
Now you can run the test by running the following command in your terminal:
```
npm run test
```

In your terminal, you can see:
![](./assets/test1.png)

Let's continue writing more testcases for both endpoints:

```
'use strict'

const app = require('../app')
const chai = require('chai')
const request = require('supertest')
const expect = chai.expect

const data = (task) => {
  for (let i in task) {
    return {
      value: task[i],
      key: i
    }
  }
}

describe('API Integration tests', () => {
  let task = {'mykey': 'value1'}
  const initialData = data(task)
    it('should post a new key-value pair', (done) => {
      request(app)
        .post('/obj')
        .send(task)
        .end((err, res) => {
          expect(res.statusCode).to.equal(200)
          expect(res.body).to.have.property('key', initialData.key)
          expect(res.body).to.have.property('value', initialData.value)
          expect(res.body.timestamp).to.be.a('number')
          done()
        })
    })
    it('should get an object', (done) => {
      request(app)
        .get(`/obj/testkey`)
        .end((err, res) => {
          expect(res.statusCode).to.equal(200)
          expect(res.body).to.have.property('value', initialData.value)
          done()
        })
    })
    it('should update an existing key with a new value', (done) => {
      task = {'mykey': 'value2'}
      const updatedData = data(task)
      request(app)
        .post('/obj')
        .send(task)
        .end((err, res) => {
          expect(res.statusCode).to.equal(200)
          expect(res.body).to.have.property('key', updatedData.key)
          expect(res.body).to.have.property('value', updatedData.value)
          expect(res.body.timestamp).to.be.a('number')
          task = res.body
          done()
        })
    })
    it('should return another key value pair with the new value', (done) => {
      request(app)
        .get(`/obj/testkey`)
        .end((err, res) => {
          expect(res.statusCode).to.equal(200)
          expect(res.body).to.have.property('value', task.value)
          done()
        })
    })
    it('should get the value updated on the specified timestamp', (done) => {
      request(app)
        .get(`/obj/testkey?timestamp=${task.timestamp}`)
        .end((err, res) => {
          expect(res.statusCode).to.equal(200)
          expect(res.body).to.have.property('value', 'value2')
          done()
        })
    })
    it('should get the most recent value if the specified timestamp is before the most updated one', (done) => {
      request(app)
        .get(`/obj/testkey?timestamp=${task.timestamp - 0.00001}`)
        .end((err, res) => {
          expect(res.statusCode).to.equal(200)
          expect(res.body).to.have.property('value', 'value1')
          done()
        })
    })
})
```

Run the test file with npm test command again and you will see an output like the following:

![](./assets/testfull.png)

You can checkout the fullcode at my [Github](https://github.com/tonystaark/MariaDBsystemVersioning)

repository: tonystaark/blog

repo_name: tonystaark/blog


text:
<script>{
	"title": "jQuery Foundation Code of Conduct - Committee",
	"pageTemplate": "page-conduct.php"
}</script>

The Code of Conduct Committee deals with violations in the [jQuery Foundation Code of Conduct](/conduct/).

Committee Members:

* Chair: Corey Frang
* Anne-Gaelle Colom
* Sarah Frisk
* John Resig
* Adam Sontag

You can contact [conduct@jquery.org](mailto:conduct@jquery.org). For more details please see the [Reporting Guidelines](/conduct/reporting/).

gha_language: HTML


text:
# Create PNDA cluster

![](../images/breadcrumbs-create.jpg)

## Introduction

With the target platform fully prepared, the PNDA software staged and the YAML configuration completed, the final step is to invoke the PNDA CLI to create the cluster.

## Create PNDA

#### Install CLI dependencies

On the client machine, install the pip packages required by the CLI.

```
cd cli
sudo pip install -r requirements.txt
```

#### CLI invocation

An example CLI invocation -

```
cd cli
pnda-cli.py create -e <cluster_name> -s <key_name> -f standard -o 2 -n 3 -k 2 -z 3
```

The options shown select the standard flavor, 2 openTSDB instances, 3 hadoop datanodes, 2 kafka brokers, and 3 zookeeper nodes. If you need to operate within the default EC2 instance quota of 20 instances then you can reduce this to 1 kafka and 1 zookeeper instance or use the pico flavor.

```
pnda-cli.py create -e <cluster_name> -s <key_name> -f standard -o 1 -n 1 -k 1 -z 1
pnda-cli.py create -e <cluster_name> -s <key_name> -f pico -n 1 -k 1
```

Note that CLI parameter -s refer to the key configured in the previous phase. For example, if the keypair in AWS is 'pnda' then the local private key file should be named 'pnda.pem' and you should pass '-s pnda' to the CLI.

A small cluster typically takes around 30 minutes to fully provision while a larger cluster can take 50 minutes.

# [Home](../OVERVIEW.md)

| [Home](../OVERVIEW.md) | [Prepare](PREPARE.md) | [Mirror](MIRROR.md) | [Build](BUILD.md) | [Stage](STAGE.md) | [Configure](CONFIGURE.md) | [Create](CREATE.md) |
| --- | --- | --- | --- | --- | --- | --- |

repository: TharanyaS/pnda-guide

repo_name: TharanyaS/pnda-guide


text:
CRC Any
====================

[![CI](https://github.com/magiclen/crc-any/actions/workflows/ci.yml/badge.svg)](https://github.com/magiclen/crc-any/actions/workflows/ci.yml)

To compute CRC values by providing the length of bits, expression, reflection, an initial value and a final xor value. It has many built-in CRC functions.

## Usage

You can use `create_crc` associated function to create a CRC instance by providing the length of bits, expression, reflection, an initial value and a final xor value. For example, if you want to compute a CRC-24 value.

```rust
use crc_any::CRC;

let mut crc24 = CRC::create_crc(0x0000000000864CFB, 24, 0x0000000000B704CE, 0x0000000000000000, false);

crc24.digest(b"hello");

assert_eq!([71, 245, 138].to_vec(), crc24.get_crc_vec_be());
assert_eq!("0x47F58A", &crc24.to_string());
```

To simplify the usage, there are several common versions of CRC whose computing functions are already built-in.

 * crc3gsm
 * crc4itu
 * crc4interlaken
 * crc5epc
 * crc5itu
 * crc5usb
 * crc6cdma2000_a
 * crc6cdma2000_b
 * crc6darc
 * crc6gsm
 * crc6itu
 * crc7
 * crc7umts
 * crc8
 * crc8cdma2000
 * crc8darc
 * crc8dvb_s2
 * crc8ebu
 * crc8icode
 * crc8itu
 * crc8maxim
 * crc8rohc
 * crc8wcdma
 * crc10
 * crc10cdma2000
 * crc10gsm
 * crc11
 * crc12
 * crc12cdma2000
 * crc12gsm
 * crc13bbc
 * crc14darc
 * crc14gsm
 * crc15can
 * crc15mpt1327
 * crc16
 * crc16ccitt_false
 * crc16aug_ccitt
 * crc16buypass
 * crc16cdma2000
 * crc16dds_110
 * crc16dect_r
 * crc16dect_x
 * crc16dnp
 * crc16en_13757
 * crc16genibus
 * crc16maxim
 * crc16mcrf4cc
 * crc16riello
 * crc16t10_dif
 * crc16teledisk
 * crc16tms13157
 * crc16usb
 * crc_a
 * crc16kermit
 * crc16modbus
 * crc16_x25
 * crc16xmodem
 * crc17can
 * crc21can
 * crc24
 * crc24ble
 * crc24flexray_a
 * crc24flexray_b
 * crc24lte_a
 * crc24lte_b
 * crc24os9
 * crc30cdma
 * crc32
   * It also called `crc32b` in `mhash`.
 * crc32mhash
   * `mhash` is a common library which has two weird versions of CRC32 called `crc32` and `crc32b`. `crc32` and `crc32mhash` in this module are `crc32b` and `crc32` in mhash respectively.
 * crc32bzip2
 * crc32c
 * crc32d
 * crc32mpeg2
 * crc32posix
 * crc32q
 * crc32jamcrc
 * crc32xfer
 * crc40gsm
 * crc64
 * crc64iso
 * crc64we
 * crc64jones

For instance,

```rust
use crc_any::CRC;

let mut crc64 = CRC::crc64();

crc64.digest(b"hello");

assert_eq!([64, 84, 74, 48, 97, 55, 182, 236].to_vec(), crc64.get_crc_vec_be());
assert_eq!("0x40544A306137B6EC", &crc64.to_string());
```

After getting a CRC value, you can still use the `digest` method to continue computing the next CRC values.

## Heapless Support

To make sure this crate will not use heap memory allocation, you can disable the default features.

```toml
[dependencies.crc-any]
version = "*"
default-features = false
```

After doing that, the `get_crc_vec_be` and `get_crc_vec_le` methods can not be used. But if you still need this crate to return a `Vec` without dynamic allocation, you can enable the `heapless` feature to make the `get_crc_heapless_vec_be` and `get_crc_heapless_vec_le` methods available.

```toml
[dependencies.crc-any]
version = "*"
default-features = false
features = ["heapless"]
```

## Crates.io

https://crates.io/crates/crc-any

## Documentation

https://docs.rs/crc-any

## License

[MIT](LICENSE)

repository: magiclen/crc-any

gha_language: Rust

repo_name: magiclen/crc-any


text:
# Smart Energy Group

[![Circle CI](https://circleci.com/gh/johnf/smart_energy_group.svg?style=svg)](https://circleci.com/gh/johnf/smart_energy_group)
[![Coverage Status](https://coveralls.io/repos/github/johnf/smart_energy_group/badge.svg?branch=master)](https://coveralls.io/github/johnf/smart_energy_group?branch=master)

Ruby library for talking to the Smart Energy Group API.

Documentation for the API can be found at https://smartenergygroups.com/api

## Installation

Add this line to your application's Gemfile:

``` ruby
gem 'smart_energy_group'
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install smart_energy_group

## Usage

In order to use smart_energy_group in your application you need to use

``` ruby
require 'smart_energy_group/client'
```

First step is to create a Smart Energy Group client using your Smart Energy Group assigned site_token

``` ruby
seg = SmartEnergyGroup::Client.new(site_token)
```

You can then push data points

``` ruby
seg.send_data(
  'home',
  :temperature => [20.5, 60.0],
  :power       => [1023.6, 500.9]
)
```

If you don't have consecutive channels that you want to send you can pass an
array like so

``` ruby
seg.send_data(
  'home',
  :power       => { 1 => 1023.6, 5 => 500.9 }
)
```

The send_data operation accepts the following options

| Option      | Description |
| ----------- | ----------- |
| power       | Power stream with the unit of watts |
| energy      | Energy stream with the unit prefixed to kilowatt hours |
| amps        | Current stream with the unit of amps |
| channel     | Power stream identified with the Phase based on the channel number, with the same settings as a normal power stream |
| temperature | Temperature stream with default units of Celcius |
| voltage     | Voltage stream with the units being volts |
| state       | Switch state stream to determine if a switch is on or off |
| seconds     | Seconds stream representitive of an elapsed time in seconds |
| heartbeat   | Boot Event stream to determine if your device has booted and also records a heartbeat to check things are still ticking |
| pule        | Count of pulses output from a device |

**Note::** The above will raise an error until you put the site into Discovery mode on the SEG website.

## Development

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

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

## Contributing

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

## License

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


text:
---
layout: default
---

# 1994-03-02 - Re: Dorothy Denning

## Header Data

From: "Perry E. Metzger"<EMAIL_ADDRESS>To<EMAIL_ADDRESS>(Theodore Ts'o)

Message Hash: 3a876e119f82566ff40b5c8a5d7ecf8f6c261530d3c75c1a8ee6e14ffa8401a3

Message ID<EMAIL_ADDRESS>Reply To<EMAIL_ADDRESS>UTC Datetime: 1994-03-02 12:34:22 UTC

Raw Date: Wed, 2 Mar 94 04:34:22 PST

## Raw message

```
{% raw  %}From: "Perry E. Metzger"<EMAIL_ADDRESS>Date: Wed, 2 Mar 94 04:34:22 PST
To<EMAIL_ADDRESS>(Theodore Ts'o)
Subject: Re: Dorothy Denning
In-Reply-To<EMAIL_ADDRESS>Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

Theodore Ts'o says:
> I can imagine that back then, the Catholic church must have been deeply
> opposed to letting the "hoi polloi" access to books, and access to
> learning.  Think of how it would disrupt the social order!!!

Don't look back to the Catholics, Ted. The Russians and Chinese
restricted access to printing presses, because they knew that they
would permit the overthrow of the government.

Dorothy and all the rest are Statists. They are no different from the
Russians and the rest. The Communists wanted to restrict access to
printing presses because they felt them to be a danger to their
society, and Denning and the rest want to restrict cryptography for
exactly the same reason. They have no love for the constitution --
they believe in "balancing" constitutional rights, "giving up" rights
for "security" and all the rest. They THINK they have love for the
constitution. They THINK they are patriots. In fact, they are no
different in ANY of the arguments they make from fascists or
communists. If Denning knew how much of what she said sounds exactly
like stuff coming out of Pravda from the 1960s, she'd probably either
flip or go into denial. I used to read translations of Pravda a lot
as an original source for researching Soviet history. Her stuff also
bears an uncanny resemblence to public statements made by Nazi leaders
at various times about dangerous things the public couldn't get their
hands on, and how various rights needed to be restricted in order to
"protect" the public.

> The important point that you make is that the cat really *is* out of the
> bag; I am just concerned that the government, in a futile attempt to try
> to stuff the cat back in, does perhaps fatal damage to all of our civil
> rights in its desperation.

People forget about the fact that rights are not just a nicety, the
way Denning thinks. They are critical to our survival. The U. S. is
not a nice place that happens to grant rights because it has a
benevolent government -- it has a benevolent government and is a nice
place because it grants rights. This crucial distinction is lost on
those who would trade rights for safety -- the Dennings of the world
believe safety is a commodity that may be purchased with rights.

John Gilmore has noted that once you have replaced all a government's
mechanisms with mechanisms that would be needed for a fascist
government to run the country, fascism can be achived by a mere change
in attitude by the governors. Denning and the rest don't grok that.
They think "this is America; it can never happen here." My relatives
who perished in the holocaust all said "this is Germany; the land of
Goethe and Schiller; one of the greatest intellectual centers on
earth; how can this happen here?" People never ask the distinction
that made the U.S. government stable where others fall every few
decades. They just assume it to be a fact of nature -- that they can
play with the basis of that fact all they like without making the fact
itself disappear. Cause and effect do not work that way.

> Look at how civil forfeiture has been used
> to completely strip someone of his properties, without any due process.
> Look at the RICO act, and the truely scary things that you can do with
> it; it was originally applied against the Big Bad Mob, but it's turning
> out to have much broader applications.

 They could immediately determine who their
enemies were talking to at will. They could trace all economic
transactions at will. (They want to be able to do that, too -- look at
FinCen, also an idea "to protect us".) In short, this is a major tool
that they would want.  It looks so much like the premises behind the
East German or Bulgarian phone network ran on that we should ask
ourselves WHY.

> So if the cat really is out of the bag, then the government should give
> up on this ill-conceived Clipper abortion as soon as possible.

It is, of course, already way too late for them to do anything. The
damage they can do before they realize this might, however, be
extreme.

Perry

{% endraw %}
```

## Thread

+ Return to [March 1994](/archive/1994/03)

+ Return to "["Alan (Miburi-san) Wexelblat" <wex@media.mit.edu>](/authors/alan_miburisan_wexelblat_wex_at_media_mit_edu_)"
+ Return to "["Perry E. Metzger" <pmetzger@lehman.com>](/authors/perry_e_metzger_pmetzger_at_lehman_com_)"
+ Return to<EMAIL_ADDRESS>(Robert Cain)](/authors/rcain_at_netcom_com_robert_cain_)"
+ Return to<EMAIL_ADDRESS>(Theodore Ts'o)](/authors/tytso_at_athena_mit_edu_theodore_tso_)"
+ Return to<EMAIL_ADDRESS><EMAIL_ADDRESS>+1-510-484-6204)](/authors/wcs_at_anchor_ho_att_com_bill_stewart_at_pleasantonca_ncr_com_15104846204_)"

+ 1994-03-01 (Tue, 1 Mar 94 15:56:51 PST) - [Re: Dorothy Denning](/archive/1994/03/a975ccb07a1ae3e240189c0cb64df6589b6ad236c5c031012a90fe3e3f4457e9) -<EMAIL_ADDRESS><EMAIL_ADDRESS>+1-510-484-6204)_
  + 1994-03-02 (Tue, 1 Mar 94 20:09:35 PST) - [Re: Dorothy Denning](/archive/1994/03/3ccdde14a74c1557edef3cb3ca18ba8d3b286d4a5f463f7c9c3d029e597bf6b9) -<EMAIL_ADDRESS>(Robert Cain)_
    + 1994-03-02 (Tue, 1 Mar 94 21:29:19 PST) - [Re: Dorothy Denning](/archive/1994/03/7c85733ac381d8b753e650cb860a549e42ca7bdc48b14f42f34579791389b130) -<EMAIL_ADDRESS>(Theodore Ts'o)_
      + 1994-03-02 (Wed, 2 Mar 94 04:34:22 PST) - Re: Dorothy Denning - _"Perry E. Metzger"<EMAIL_ADDRESS>    + 1994-03-02 (Wed, 2 Mar 94 09:54:39 PST) - [Dorothy Denning](/archive/1994/03/c14bfc8d75f9bad1aba306b0e54a3ec6fa73b3b106106daee342a51ae4c4a581) - _"Alan (Miburi-san) Wexelblat"<EMAIL_ADDRESS>


text:
Neo M8N GPS Receiver - C++ Library
==================================

This library provides the ability to stream NMEA sentences from the Neo M8N
GPS receiver over a serial (UART) interface. It also provides parsing of
the sentences into useful structures.

Currently, parsing has been implemented for the following sentence types:
* GGA (summarised position info)
* GSV (GPS satellite info)

Although this library should technically work on any POSIX operating system,
it has only been tested on a Raspberry Pi, running Raspbian OS.

# Usage

The class is constructed with the serial device as the only argument.
Callbacks can then be registered to handle the data. The actual streaming to
the callbacks happen when the blocking `Read` method is called. This can
be done in a separate thread.

```cpp
...
neom8n::NeoM8N neoM8N("/dev/ttySC0");
// one or more callbacks can be registered to handle the sentences
neoM8N.RegisterCallback("process_data", [&](char *data) {
    std::string s(data);
    try {
        auto type = neom8n::GetSentenceType(s);
        switch (type) {
            case neom8n::GGA_TYPE: {
                auto gga = neom8n::GGA(s);
                cout << "Lat: " << gga.Latitude << gga.NorthSouthIndicator << endl;
                cout << "Lon: " << gga.Longitude << gga.EastWestIndicator << endl;
                break;
            }
            case neom8n::GSV_TYPE: {
                auto gsv = neom8n::GSV(s);
                cout << "Message #" << gsv.MessageNumber << " of " << gsv.NumberOfMessages << endl;
                cout << "Number of satellites: " << gsv.NumberOfSatellites << endl;
                break;
            }
            default: {
                cerr << "type '" << neom8n::SentenceTypeToString(type) << "' not supported yet" << endl;
                break;
            }
        }
    } catch (const exception &e) {
        cerr << "could not determine sentence type: " << e.what() << endl;
        cerr << "SENTENCE: " << s << endl;
    }
});

// execute the blocking read function in a separate thread
std::thread gpsThread([](neom8n::NeoM8N *neoM8N) -> void {
    neoM8N->Read();
}, &neoM8N);
```
# Running the unit tests

The [Catch2](https://github.com/catchorg/Catch2) unit testing framework is utilised in
this library. The header file is included as part of the source.

The test executable must first be compiled:
```cpp
cmake -DCMAKE_BUILD_TYPE=Debug ./
make -j 16
```

Then to run the test:
```cpp
./neom8n_test
```

# Building the library

Assuming the library will be cross compiled for another architecture:
```c++
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=<PATH_TO_TOOLCHAIN_FILE> --target neom8n ../
make -j 16
```


text:
# SnapOperationQueue

***Currently work in progress, not yet fit for consumption***

SnapOperationQueue is made to resemble NSOperationQueue and has options to quickly rearrange the queued priorities

In Snapsale we make A LOT of network requests to our backend. At the same time, it is easy to navigate from screen to screen. When we go from one screen to another, we do not want the currently visible screen to have its data arrive late because we were executing network requests for a screen that is no longer visible. The information on the screen that is no longer visible is still relevant: the user will probably go back. But it should be deprioritized to what the currently visible screen needs. Similarly, when scrolling a scroll view, what is visible on screen should take priority of what has been scrolled off screen.

Of course, there are situations where an operation that has not yet been performed yet is no longer needed, and should be cancled. Also, there are situations where an operation should have the highest priority no matter what is visible on screen.

SnapOperationQueue wraps four queues with the following priorities:
  .Highest
  .High
  .Normal
  .Low

.Highest and .Low don't rearrange. When operations with dependent operations rearrange, they are put in the queue that matches the highest priority in its set of dependencies.

An operation is added with an identifier, a priority (defaults to .High) and a group identifier. The group identifier would typically be your view controller identifier. Then, on viewDidDisappear, it would call queue.setGroupPriorityTo(.Low, forId: groupId). Remember to wrap groupIds in a StringRepresentable enum. When the view controller reappears, it would call queue.setGroupPriorityTo(.High, forId: groupId)

Uses [PSOperations][0], a maintained version of Apple's WWDC'15 sample code. It is good, and you should use it instead of NSOperation

[0]: https://github.com/pluralsight/PSOperations

repository: niklassaers/SnapOperationQueue

repo_name: niklassaers/SnapOperationQueue


text:
### We 💜 contributions

While we love contributions, we also need to ensure that our library is of great quality. Thus we require you to follow some simple guidelines when you're submitting your contributions.

### Reporting Issues and Asking Questions

Before opening an issue, please search the [issue tracker](https://github.com/oesukam/drc-data-js/issues) to make sure your issue hasn’t already been reported.

### Development

Visit the [issue tracker](https://github.com/oesukam/drc-data-js/issues) to find a list of open issues that need attention.

Fork, then clone the repo:

```
git clone https://github.com/oesukam/drc-data.git
```

#### Branch Naming

Branches created should be named using the following format:

```
{type}-{2-3 word summary separated with hyphen}
```

Type:

- feat: For new features
- bug: Fixing bugs
- chore: Refactoring, improving the code or the documentation

Example:

```
chore-improve-readme
```

#### Testing

To run tests:

```
npm run test // Will run tests once
```

To continuously watch and run tests, run the following:

```
npm run test:watch
```

#### Linting

To Lint

```
npm run lint
```

#### Quality insurance

The `build` command should handle it but always run the `lint` command to ensure we are all developing with the same code standards.

#### Submitting a Pull Request

For non-trivial changes, please open an issue with a proposal for a new feature or refactoring before starting on the work. We don’t want you to waste your efforts on a pull request that we won’t want to accept.

On the other hand, sometimes the best way to start a conversation _is_ to send a pull request. Use your best judgement!

1. Open a new issue in the [Issue tracker](https://github.com/oesukam/drc-data-js/issues)
1. Fork the repo
1. Create a new feature branch based off the `master` branch
1. Create breaking test(s) before implementing any fixes or functionality
1. Make your changes
1. Submit a pull request, referencing any issue that it resolves

#### PR Description Template
[Template](./.github/pull_request_template.md)

## Contributor Code of Conduct

[Code of Conduct](./CONTRIBUTOR_CONVENANT.md) is adapted from [Contributor Covenant, version 2.0](http://contributor-covenant.org/version/2/0)

Thank you, we 💜 your contributions!

repository: oesukam/drc-data-js

gha_language: TypeScript

repo_name: oesukam/drc-data-js


text:
# BMPickerModal

BMPickerModal is an iOS drop-in class that displays a UIPicker or a
UIDatePicker as modal view or in a popover controller on the iPad. Used
to let the user select from a list of data or pick a date without leaving the
current screen. Closures allow easy customisation.

## Requirements

Built in Swift 4 for iOS 10.0+. All devices supported. can be used in both
Swift and in ObjectiveC projects.

## Adding BMPickerModal To Your Project

### Cocoapods

CocoaPods is the recommended way to add BMPickerModal to your project.
As BMPickerModal is written in Swift, you need to add the `use_frameworks!`
option to your podfile.

```
pod 'BMPickerModal'
```

### Usage

Import the module to your project.

```Swift
import BMPickerModal
```

#### Creating

Create an optional stored property for your `BMPickerModal`. Then instantiate the control,
when the your view is already added to the window. This is needed for the control to be
added properly.

```Swift
class SomeClass {
  var datePickerModal: BMPickerModal?

  override func viewDidAppear(_ animated: Bool) {
    super.viewDidAppear(animated)

    self.datePickerModal = BMPickerModal()
    self.datePickerModal?.mode = .datePicker

    self.datePickerModal?.show { selectedDate in
      print(selectedDate)
      // Do something with the date here
    }
  }
}
```

Available modes:
* `.datePicker` - Default
* `.picker`

#### Showing On The iPhone

```Swift
datePickerModal?.show { selectedDate in
  print(selectedDate)
  // Do something with the date here
}
```

**Checking whether the control is visible**

```Swift
let visible: Bool = self.datePickerModal?.isVisible
```

#### Showing On The iPad

`selection`: Closure to be executed when date/data is selected
`sourceView`: View to show from
`sourceRect`: CGRect to align to
`inViewController`: ViewController used to present the modal

```Swift
self.datePickerModal?
  .showInPopover({ (selectedDate) -> Void in
    let theNewDate = selectedDate as! NSDate
  },
  sourceView: self.view,
  sourceRect: cell!.frame,
  inViewController: self)
```

**Checking whether the control is shown in a popover**

```Swift
let inPopover: Bool = self.datePickerModal.shownInPopover
```

#### Dismissing

```Swift
self.datePickerModal?.dismiss()
```

You can add custom actions to the dismissal event by defining the onDismiss
closure.

```Swift
self.datePickerModal?.onDismiss = {
  // do stuff when dismissed
}
```

#### Customising the DatePicker

Access the UIDatePicker view and cusomise as per the Apple documentation.

```Swift
self.datePickerModal?.datePicker.datePickerMode = UIDatePickerMode.date
```

#### Customising the Picker

Set the `pickerDataSource` NSArray property for filling the UIPickerView.

repository: blackmirror-media/BMPickerModal

branch_name: refs/heads/develop

gha_language: Shell

repo_name: blackmirror-media/BMPickerModal


text:
## Overview
This is a generated connector for [Xero Files API v2.16.1](https://developer.xero.com/documentation/api/files/overview) OpenAPI specification.
The Files API provides access to the files, folders, and the association of files within a Xero organisation. It can be used to upload/download files, manage folders and associate files to invoices, contacts, payments etc.

## Prerequisites

Before using this connector in your Ballerina application, complete the following:

* Create a [Xero](https://developer.xero.com/app/manage) account
* Obtain tokens by following [this guide](https://developer.xero.com/documentation/getting-started-guide/)

## Quickstart

To use the Xero Files connector in your Ballerina application, update the .bal file as follows:

### Step 1: Import connector
First, import the `ballerinax/xero.files` module into the Ballerina project.
```ballerina
import ballerinax/xero.files;
```

### Step 2: Create a new connector instance
Create a `files:ClientConfig` with the `access token` obtained, and initialize the connector with it.
```ballerina
files:ClientConfig clientConfig = {
    auth: {
        token: <ACCESS_TOKEN>
    }
};
files:Client baseClient = check new Client(clientConfig);
```

### Step 3: Invoke connector operation
1. You can get all the files by providing Xero tenant identifier as parameter.

    ```ballerina
    files:Files response = check baseClient->getFiles(<Xero_Identifier_For_Tenant>);
    ```

2. Use `bal run` command to compile and run the Ballerina program.

repository: gabilang/ballerinax-openapi-connectors

repo_name: gabilang/ballerinax-openapi-connectors


text:
# MoviesList

> A challenge to practice React componentization and typescript with a movies list.

![movies-list](https://user-images.githubusercontent.com/15898299/111241224-760fa180-85db-11eb-8b43-bb1f5a7bd59a.png)

## Built With

- Typescript
- React

## Setup

- Clone this repository with: `git clone https://github.com/flpfar/ignite-challenge-02.git`
- Navigate to the project folder `cd ignite-challenge-02`
- Run `yarn install`
- Run `yarn dev`
- Access through `http://localhost:8080/`

## 👤 Author

### Felipe Rosa (@flpfar)

[Github](https://github.com/flpfar) | [Twitter](https://twitter.com/flpfar) | [Linkedin](https://www.linkedin.com/in/felipe-augusto-rosa)

## Acknowledgements

- This project is the second challenge from Rocketseat's Ignite program.


text:
ms-teams-gitlab-mr-notifier
========================

This repository is a simple implementation of WebHook to notify team in [MS Teams](https://products.office.com/en-us/microsoft-teams/group-chat-software) channel if there is Merge Request in [GitLab](https://about.gitlab.com/).

Prerequisite
------------------------

* GCP account as implementation is based on [Google Cloud Functions](https://cloud.google.com/functions/) with [Python 3](https://www.python.org/download/releases/3.0/) runtime
* [Python 3](https://www.python.org/download/releases/3.0/) and [Flask](http://flask.pocoo.org/)

Deployment
------------------------

    gcloud beta functions deploy gitlab_merge_request_notify --runtime python37 --trigger-http --region europe-west1 --memory=128

repository: webdizz/ms-teams-gitlab-mr-notifier

repo_name: webdizz/ms-teams-gitlab-mr-notifier


text:
---
layout: "github"
page_title: "GitHub: github_user_external_identity"
description: |-
  Get a specific organization member's SAML/SCIM linked external identity
---

# github_user_external_identity

Use this data source to retrieve a specific organization member's SAML or SCIM user
attributes.

## Example Usage

```hcl
data "github_user_external_identity" "example_user" {
  username = "example-user"
}
```

## Argument Reference

The following arguments are supported:

- `username` - (Required) The username of the member to fetch external identity for.

## Attributes Reference

- `login` - The username of the GitHub user
- `saml_identity` - An Object containing the user's SAML data. This object will
  be empty if the user is not managed by SAML.
- `scim_identity` - An Object contining the user's SCIM data. This object will
  be empty if the user is not managed by SCIM.

---

If a user is managed by SAML, the `saml_identity` object will contain:

- `name_id` - The member's SAML NameID
- `username` - The member's SAML Username
- `family_name` - The member's SAML Family Name
- `given_name` - The member's SAML Given Name

---

If a user is managed by SCIM, the `scim_identity` object will contain:

- `scim_username` - The member's SCIM Username. (will be empty string if user is
  not managed by SCIM)
- `scim_family_name` - The member's SCIM Family Name
- `scim_given_name` - The member's SCIM Given Name

repository: integrations/terraform-provider-github

extension: markdown

gha_language: Go

repo_name: integrations/terraform-provider-github


text:
#Lesson 6: Right into the danger zone
Goal: Understand how your system behaves under edge-cases, when concurrency and database limits are hit.

###Step 1:
What happens when you ask for more lambdas than your account limit supports?
In Cloud Watch, add lambda throttling to your dashboard, then attempt to invoke a very short duration, very high load scenario.
By default, AWS gives you 100 concurrent Lambdas, so try something higher than 2500 RPS.

###Step 2:
In your sample serverless architecture, keep track of API Gateway Throttled requests (429 errors) and DynamoDB read/write limits.  These two can be the source of challenges.

###Step 3:
Remember, when you've starting something too big, to remove your Lambda function use:
```sh
$ slsart remove
```

url: https://raw.githubusercontent.com/frankyuyong/serverless-artillery-workshop/33d20d263d8b1bd5c71a8ea3a762fcd3b17d8c81/Lesson6: Right into the danger zone/README.md


text:
## Surrogate Authentication

Authenticate on behave of another person.

1. Go to https://cas.example.org:8443/cas/login
2. Login using the following 2 methods:
    - GUI mode: `+surrogate-admin` as , `Mellon` as password. Then select your surrogate target.
    - preselection mode: `surrogate-admin+surrogate-user` as username, `Mellon` as password.
3. You should be logined to another account using your `surrogate-admin` account

Documentation: https://apereo.github.io/cas/6.3.x/installation/Surrogate-Authentication.html

repository: NgSekLong/SelectUrCAS

gha_language: PHP

repo_name: NgSekLong/SelectUrCAS


text:
# 0.0.5 - 2021/06/04

* Added support for settings using user ID as key
    * 5e Dark Mode uses this approach

# 0.0.4 - 2021/05/22

* Fix workflow action
* Updated version compat to 0.8.5
* Fixed button title setter
* Fixed yellow button background with df settings clarity

# 0.0.3 - 2021/03/12

* Added playlist volume sync buttons. Works with standard UI and Furnace module.

# 0.0.2- 2021/03/10

* Added button styling
* Added option to sync entire module client-settings at once
* Fixed syncing for settings that use a period in their settings key

# 0.0.1- 2021/03/09

* Initial Release

repository: Norc/fvtt-SocketSettings

repo_name: Norc/fvtt-SocketSettings


text:
# A Python wrapper for [Segment's Config API](https://segment.com/docs/config-api/)

A minimal wrapper for Segment's config API.

The library is designed as a [Fluent interface](https://en.wikipedia.org/wiki/Fluent_interface) around the REST API. It consists of models that are designed execute API calls within the scope of parent models.

## Installation

```
pip install segment-config-api
```

## Usage

```python
import os
from segment_config_api.api import SegmentConfigApi

access_token = os.getenv('SEGMENT_CONFIG_API_ACCESS_TOKEN') # Or hard-coded or whichever way you want to access it
api = SegmentConfigApi(access_token)
```

### Workspaces

```python
# List all workspaces
api.workspaces.list()

# Get a workspace
api.workspace('myworkspace').get()
```

More API details [here](https://reference.segmentapis.com/?version=latest#7a63ac88-43af-43db-a987-7ed7d677a8c8)

### Integrations Catalog

```python
# List all sources
catalog = api.integrations_catalog

catalog.sources.list()

# Get a specific source
catalog.source('customerio').get()

# List all destinations
catalog = api.integrations_catalog

catalog.destinations.list()

# Get a specific destination
catalog.destination('customerio').get()
```

More API details [here](https://reference.segmentapis.com/?version=latest#7a63ac88-43af-43db-a987-7ed7d677a8c8)

### Sources

```python
# Sources are scoped on a workspace level.
workspace = api.workspace('myworkspace')
sources = workspace.sources

# List all sources
sources.list()

# Create a new source
payload = {...}
sources.create(payload)

# Get a specific source by name
workspace.source('js').get()

# Get schema config
sc = workspace.source('js').get_schema_config

#Update schema config
payload = {...}
workspace.source('js').update_schema_config(payload)

# Delete a source
workspace.source('js').delete()
```

More API details [here](https://reference.segmentapis.com/?version=latest#5a852761-54d5-46da-8437-6e14e63449f3)

### Destinations

```python
# Destinations are scoped on the source level
workspace = api.workspace('myworkspace')
destinations = api.source('js').destinations

# List all destinations at this source
destinations.list()

# Create a new destination for this source
payload = {}
destinations.create(payload)

# Get a specific destination by name
ga = workspace.source('js').destination('google-analytics')
ga.get()

# Update a destination
payload = {...}
ga.update(payload)

# Delete a destination
ga.delete()
```

More API details [here](https://reference.segmentapis.com/?version=latest#39ce0439-0969-48c3-ba49-b22a46c41060)

### Tracking Plans

```python
# Tracking plans are scoped on the workspace level
workspace = api.workspace('myworkspace')
tracking_plans = workspace.tracking_plans

# List all the tracking plans
tracking_plans.list()

# Create a tracking plan
payload = {...}
tracking_plans.create(payload)

# Get a specific tracking plan by plan_id
plan = workspace.tracking_plan('rs_123')
plan.get()

# Update a tracking plan
payload = {...}
plan.update(payload)

# Create tracking plan source connection
plan.create_source_connection('workspaces/myworkspace/sources/js')

# Batch create source connections
source_names = [...]
plan.batch_create_source_connection(source_names)

# List source connections
plan.list_source_connections()

# Delete source connection
plan.delete_source_connection('workspaces/myworkspace/sources/js')

# Delete a tracking plan
plan.delete()
```

More API details [here](https://reference.segmentapis.com/?version=latest#c4647e3c-fe1b-4e2f-88b9-6634841eb4e5)

### Event Delivery Metrics

```python
# Event delivery metrics are scoped on a destination level
ga = api.workspace('myworkspace').source('js').destination('google-analytics')

metrics = ga.event_delivery_metrics

# List all the timeseries metrics
payload = {...}
metrics.list_timeseries(payload=payload) #payload is optional

# Get a timeseries metric
metrics.get_timeseries('time_to_success_p95')

# Batch get a timeseries metric, no need to add the full path prefix to metrics names, we'll do it for you
metrics.batch_get_timeseries(['successes', 'retried_502'])

# Get summary metrics
metrics.get_summary()

# Batch get summary metrics (on a workspace level)
ws = api.workspace('myworkspace')
pairs = ['workspaces/myworkspace/sources/js/destinations/google-analytics']
# Or let the api wrapper build your path
pairs = [ws.source('js').destination('google-analytics').model_path]

ws.batch_get_summary_metrics(pairs)
```

More API details [here](https://reference.segmentapis.com/?version=latest#51d89077-efd7-429b-85d4-155ac2cd07aa)

### Destination Filters

```python
# Destination Filters are scoped on a destination level
ga = api.workspace('myworkspace').source('js').destination('google-analytics')
destination_filters = ga.destination_filters

# List all filters for a destination
destination_filters.list()

# Create a destination filter
payload = {...}
destination_filters.create(payload)

# Get a specific filter
filter = ga.destination_filter('df_123')
filter.get()

# Update a filter
payload = {...}
filter.update(payload)

# Delete a filter
filter.delete()

# Preview a filter - This is scoped on the api level
payload = {
    "filter": {
        "if": "all",
            "actions": [
                {
                    "type": "blacklist_fields",
                    "fields": {
                        "properties": {
                            "fields": ["name", "age"]
                        }
                    }
                }
            ],
            "enabled": True
        },
        "input": "{ \"userId\": \"6592\", \"properties\": { \"name\": \"Bob Smith\", \"age\": \"40\", \"order\": \"129\" } }"
}
api.destination_filters.preview(payload)
```

More API details [here](https://reference.segmentapis.com/?version=latest#6c12fbe8-9f84-4a6c-848e-76a2325cb3c5)

### Deletion and Surpression

```python
# Regulations are scoped on a workspace level
ws = api.workspace('myworkspace')
regulations = ws.regulations

# List all regulations for a workspace
regulations.list()

#List regulations based on status
regulations.list(regulation_types='Suppress_With_Delete')

# Create a regulation
payload = {...}
regulations.create(payload)

# Get a specific regulation on it's regulation_id
regulation = ws.regulation('1KQVncbOPeRGjRcpuOHdnhDwPn7')
regulation.get()

# Delete a regulation (It has to be in an `initialized` state)
regulation.delete()

# Create a regulation on a source
payload = {...}
ws.source('js').regulations.create(payload)

# Delete an Object from a cloud source
payload = {...}
ws.source('js').regulations.delete(payload)

# List suppressed users on a workspace level
ws.suppressed_users.list()
```

More API details [here](https://reference.segmentapis.com/?version=latest#57a69434-76cc-43cc-a547-98c319182247)

### IAM

```python
# Roles are scoped on a workspace level
ws = api.workspace('myworkspace')
roles = ws.roles

# List all roles for a workspace
roles.list()

# List role policies
roles.policies.list()

# Get a specific regulation on it's regulation_id
regulation = ws.regulation('1KQVncbOPeRGjRcpuOHdnhDwPn7')
regulation.get()

# Delete a regulation (It has to be in an `initialized` state)
regulation.delete()

# Create a role policy (scoped on the api level)
payload = {...}
api.role_policies(role_name).create(payload)

# Delete role policy
api.role_policy(policy_name).delete()

# Invites are scoped on the workspace level
invites = ws.invites

# List all invites
invites.list()

# Create an invite
payload = {...}
invites.create(payload)

# Delete an invite
ws.invite('123').delete()
```

More API details [here](https://reference.segmentapis.com/?version=latest#57a69434-76cc-43cc-a547-98c319182247)

## What's missing

- Unit/Integration tests. The library hasn't been fully tested end-to-end. If you find any bugs, please file an issue!
- Pagination helpers. Right now you still have to manually retrieve and pass through the `page_token` to do pagination. Ideally there would be a set of nice iteratort functions to automatically do that for you.