text:
# Schema Registry [Cluster Setup]
<img src="https://github.com/abhishektripathi24/platform-setup/blob/master/confluentinc-schema-registry/images/schema-registry-logo.png" width="600" height="300"/>

To know more about Schema Registry, visit https://docs.confluent.io/current/schema-registry/index.html

## Overview
From the official docs -

> Confluent Schema Registry provides a serving layer for your metadata. It provides a RESTful interface for storing and retrieving Apache Avro® schemas. It stores a versioned history of all schemas based on a specified subject name strategy, provides multiple compatibility settings and allows evolution of schemas according to the configured compatibility settings and expanded Avro support. It provides serializers that plug into Apache Kafka® clients that handle schema storage and retrieval for Kafka messages that are sent in the Avro format.

> Schema Registry lives outside of and separately from your Kafka brokers. Your producers and consumers still talk to Kafka to publish and read data (messages) to topics. Concurrently, they can also talk to Schema Registry to send and retrieve schemas that describe the data models for the messages.

## Setup
Installation of `Schema Registry via Confluent 5.4.0` on `Ubuntu 18.04.3 LTS` - [ref](https://docs.confluent.io/current/schema-registry/installation/index.html)

1. Install Java and set JAVA_HOME
    ```bash
    sudo apt update
    sudo apt install openjdk-8-jdk openjdk-8-jre
    java -version
    sudo vim /etc/environment
    JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
    JRE_HOME=/usr/lib/jvm/java-8-openjdk-amd64/jre
    source /etc/environment
    echo $JAVA_HOME
    ```

2. Download confluent binary
    ```bash
    cd /opt
    sudo wget https://packages.confluent.io/archive/5.4/confluent-5.4.0-2.12.tar.gz
    sudo tar -xzf confluent-5.4.0-2.12.tar.gz
    sudo mv confluent-5.4.0-2.12 confluent
    cd confluent
    ```

3. Update `etc/schema-registry/schema-registry.properties`
    ```properties
    kafkastore.bootstrap.servers=PLAINTEXT://<IP_ADDRESS>:9092,PLAINTEXT://<IP_ADDRESS>:9092,PLAINTEXT://<IP_ADDRESS>:9092
    ```

4. Start the process on each server
    ```bash
    ./bin/schema-registry-start etc/schema-registry/schema-registry.properties
    ```

 5. If your linux distro supports systemd, you can supervise kafka process under it. The corresponding systemd service file is present in this repo at [this](systemd) location.

 ## References
 * https://docs.confluent.io/current/schema-registry/schema_registry_tutorial.html
 * https://docs.confluent.io/current/schema-registry/develop/api.html

repository: syk-coder/platform-setup

repo_name: syk-coder/platform-setup


text:
---
layout: post
title: "Weekly meeting #74"
description: "Weekly meeting #74"
date: 2018-05-28 07:30:000
tags: [Blazor, span, dotnet, cors]
---

## Reading

* [Separating code and presentation of Blazor pages](http://gunnarpeipman.com/aspnet/blazor-code-behind/) by Gunnar Peipman
* [Building Blazor pager component](http://gunnarpeipman.com/aspnet/blazor-pager-component/) by Gunnar Peipman
* [.NET Span better performance](https://medium.com/@bnayae/net-span-t-better-performance-29b182b19dce) by bnaya eshet
* [CORS — Understanding it practically](https://itnext.io/cors-understanding-it-practically-9c401ed818cd) by Nitesh Agrawal

license: MIT

branch_name: refs/heads/master

extension: md

license_type: permissive


text:
# NodeJS API
This API was generated with Loopback Framework

## Development

Databases:

1. MongoDB.

2. PostgreSQL.

Examples:

1. FeedDetails.js, Get the detail of a feed only using the ORM, use the `waterfall` function from [async][]:, find the feed, after that the `parallel` function is used to complete the response with the detail: the hashtags, images, total likes, if is liked by the current user, find the 5 last comments, total comments, tagged users, the author, parallel functions allows us get the detail  more quickly.
2. FullTextSearchUsersAndServices.js, We use the [Full Text Search] engine and the [Unnacent] function for searchs, the searchs are ranked with the objective to get relevant results.
3. GetLinkedServices.js, A user can have many related services, this services are listed on a different endpoint. `forEach` function from [Async][] is used with a promise.
4. GetStaff.js, An user is able to have many other users, being this users his staff. The current user is validated and after that his staff is returned.
5. NoticeBoard.js, An user is able to list the main feed, his feed can be listed using his location (nearest) and/or by his favorite services, his recommended services and friends shared feeds. Each feed is formated and can have, users that share the feed, tags, the service which own the feed, the tagged users, users comments (limit 5), total likes, if is liked by the current user. The distance is calculated using the `ST_Distance` function from [PostGis][]
6. RecommendTrendingUsers.js, This endpoint is able to list the recommended services to the user that He is not following.
7. SearchSuppliers.js, The search services are filtered using the Open Street API using the current location or by the nearest distance.

[async]: https://caolan.github.io/async/
[Full Text Search]:https://www.postgresql.org/docs/9.3/static/textsearch-intro.html
[Unnacent]: https://www.postgresql.org/docs/9.3/static/unaccent.html
[PostGis]: https://postgis.net/

repository: navcas/snippets

path: /NodeJS API/readme.md

repo_name: navcas/snippets


text:
## Release 0.1.1
Fix bash script.

## Fixes
- Remove Function keyword from bash script.

## Release 0.1.0
This is the initial release of the bootstrap task.

## Features
- Bootstrap a node with puppet-agent, pointing it at a master.
- Check the CA certificate of the master.
- Set the DNS alt names for the agent.
- Set the certname with which the node should be bootstrapped.

repository: willmeek/puppetlabs-bootstrap

repo_name: willmeek/puppetlabs-bootstrap


text:
---
layout: tutorials
title: How to Submit a Single Job on Supercomputer
author: naomi
comments: true
date: 2016-08-02
---

## Objectives

After you complete this section, you should be able to:

1. Understand job submission and required parameters
2. Generate your own script for job submission
3. Submit a job script
4. SLURM commands
5. Read output and standard error files generated from script

## Job Submission

The FSL is managed by a batch scheduling system. This means that in order to use the supercomputer, users must write a script that encapsulates the workload into a non-interactive job. This script is then submitted as a job to the scheduling system. There are certain parameters required for the scheduling system:

* Either number of nodes and processors per node, or total number of processors
* Memory/RAM needed
* Expected running time (or "walltime")

Jobs are created by building a job script, usually written in bash or python, that specifies the necessary parameters described above, and then contains appropriate scripting to launch the program that will do the job's work.

## Scheduling System

The scheduling system keeps track of the current state of all resources and jobs and decides, based on conditions and policies, where and when to start jobs. Jobs are started in priority order until no further jobs are eligible to start or it runs out of appropriate resources.

When the scheduling system chooses to start a job, it assigns it one or more nodes/processors, as requested by the job, and launches the provided job script on the first node in the list of those assigned. The responsibility of taking advantage of all the requested resources is left up to the job script.

## How to Submit a Single Job on Supercomputer

### Job Script

Let's create a simple job script:

{% highlight bash %}
vi ~/scripts/class/hostname.sh
{% endhighlight %}

Copy and paste the following code:

{% highlight bash %}
#!/bin/bash

#SBATCH --time=00:05:00   # walltime
#SBATCH --ntasks=1   # number of processor cores (i.e. tasks)
#SBATCH --nodes=1   # number of nodes
#SBATCH --mem-per-cpu=100M  # memory per CPU core

# COMPATABILITY VARIABLES FOR PBS. DO NO DELETE.
export PBS_NODEFILE=`/fslapps/fslutils/generate_pbs_nodefile`
export PBS_JOBID=$SLURM_JOB_ID
export PBS_O_WORKDIR="$SLURM_SUBMIT_DIR"
export PBS_QUEUE=batch
export OMP_NUM_THREADS=$SLURM_CPUS_ON_NODE

# LOAD MODULES, SET ENVIRONMENTAL VARIABLES HERE

# INSERT CODE, AND RUN YOUR PROGRAMS HERE
hostname
{% endhighlight %}

### Submit Job

When you run batch commands, the output is sent to a text file instead of appearing on your screen. As with everything else, organization is needed in order to manage these output files. Especially if you are running a study with hundreds of participants. You'll have hundreds of output and error files!

{% highlight bash %}
mkdir ~/logfiles
{% endhighlight %}

Instead of placing the output and error file location in the job script, include them in the SBATCH command when submitting a job script:

{% highlight bash %}
sbatch \
-o ~/logfiles/output-hostname.txt \
-e ~/logfiles/error-hostname.txt \
~/scripts/class/hostname.sh
{% endhighlight %}

## SLURM Commands

* `sbatch` is used to submit jobs
* `squeue -u <username>` is used to show your queue
* `scancel <jobid>` cancels a specific job
* `scancel -u <username>` cancels all jobs for that user
* `sacct` shows current and historical job information

## *vi* versus *cat*

*Cat* is the main command to read and print out the standard output and error files. When you *just* want to display the contents of a file, use `cat`. *Cat* is the most convenient program from displaying the contents of a text file.

On the other hand, if you want to edit a text file, use *vi*, which are specifically text editors.

To check the output from your process, type:

{% highlight bash %}
cat ~/logfiles/output-hostname.txt
{% endhighlight %}

If your script ends early, type:

{% highlight bash %}
cat ~/logfiles/error-hostname.txt
{% endhighlight %}

## Class Slides


text:
# Arduino Project - 4WD CAR WITH MULTIPLE MODES
This is the first project that i will publish on GitHub. It will help me understand GitHub and help me keep track of software versions until i don't have the final product.

Features:

* This Car Chassis Kits can be a good DIY choice for you at home

* 100% Brand new and high quality

* 20 line Speed Encoder, more accurate than 6 or 10 one.

* The mechanical structure is simple, convenient installation.

* The height between two chassis can be change by different copper pillar.

* The four turn speed dc motor flexible, directional well. Quad, chronological horsepower. Chassis and stability is very easy to extend

* The car comes with speed encoder, cooperate with our speed of photoelectric, can rapidly form a speed measuring system. Can speed, range, form a closed loop system.

Specifications:

* Working Voltage: DC 3V/5V/6V

* Working Current: 100mA/100mA/120mA

* Ni-load (with wheel): 100 RPM/190 RPM/240 RPM

* Speed (no-load): 20 m/min / 39 m/min / 48 m/min

* Noise: ＜65 db

* Wheel Diameter: 66 mm(approx)

* Colors: Clear/ Black/ Red/ Blue/ Green(as pictures show)

* Dimensions(L*W*H): 25.5* 15.5* 6.5 cm(approx)

Package contents:

4 * Tires

8 * Fasteners

4 * 20 line speed encoders

2 * Smart car chassis

4 * DC gear motors

1 * Set of Screw, Nut and Copper Pillar

Picture of the project for now

Links for specific parts of the project

DC MOTOR CONTROL CODE

SERVO CONTROL CODE

gha_language: Arduino

gha_license_id: MIT


text:
# goblins

_A model of goblins economy that produces a power law distribution. In Rust._

## Overview

This repo is just a small playground that was mainly inspired by a talk with my friend [konstantin-ogulchansky](https://github.com/konstantin-ogulchansky) about his [thesis](https://github.com/konstantin-ogulchansky/hypergraphs). The thesis is about hypergraphs where I barely understand any word, but what clicked me for a moment was the idea of [power law](https://en.wikipedia.org/wiki/Power_law) (you probably heard about [Pareto principle](https://en.wikipedia.org/wiki/Pareto_principle)). So I decided to create a very simple model that would be able to produce something that also follows a power law distribution.

## Model

The basic metaphor of the model is the goblins economy. Rules are simple:
- each goblin has some gold
- at each simulation step:
  * a _random alive_ goblin receives gold (_lucky_ one)
  * a new goblin is born
  * a _random alive_ goblin dies (_unlucky_ one)

What makes this model interesting is how both lucky and unlucky goblins are chosen. Consider the following strategies:
- chances are _equal_ between all goblins ([Discrete uniform distribution](https://en.wikipedia.org/wiki/Discrete_uniform_distribution))
- chances are _weighted_, e.g., the more gold a goblin already has, the better chances he'll receive more ([_"the rich get richer"_](https://en.wikipedia.org/wiki/The_rich_get_richer_and_the_poor_get_poorer) or [Matthew effect](https://en.wikipedia.org/wiki/Matthew_effect))

Each strategy leads to different simulation results.

## Simulation

All simulations have the following common options:
- _steps_: `1 000 000`
- _probability of birth_: `1.0`
- _probability of income_: `1.0`
- _probability of death_: `0.11`
- _initial gold_: `1`
- _income formula_: `x => x + 1`

They differ in the strategies for choosing a random goblin. Consider the following table:
| Label | Lucky | Unlucky |
| --- | --- | --- |
| `A` | `Uniform` | `Uniform` |
| `B` | `Weighted` | `Uniform` |
| `C` | `Uniform` | `Weighted` |
| `D` | `Weighted` | `Weighted` |

Here are results as log log plot:

## Conclusion

Both `B` and `D` simulations are most interesting because they imitate _"the rich get richer"_ thing. However, the most notable part is probably in the difference between the two: seems like `B` produces a power law distribution (here is similar [log log plot](https://mathinsight.org/image/power_law_degree_distribution_scatter)) while `D` produces a power law distribution with _exponential cutoff_. Anyway, this means that these little goblins have something in common with populations of cities, links on the Internet, words frequencies, etc.

I have no idea how one can make a proof for this kind of stuff but that was **definitely** an interesting adventure that is now can be considered as finished.

## License

Everything here is licensed under the [MIT](https://github.com/JoshuaLight/goblins/blob/master/LICENSE) license.

repository: joshua-light/goblins

repo_name: joshua-light/goblins


text:
---
title: "deleteObject"
description: "This method will delete an existing SoftLayer_Account_Regional_Registry_Detail object."
layout: "method"
tags:
    - "method"
    - "sldn"
    - "Account"
classes:
    - "SoftLayer_Account_Regional_Registry_Detail"
aliases:
    - "/reference/services/softlayer_account_regional_registry_detail/deleteObject"
---
# [SoftLayer_Account_Regional_Registry_Detail](/reference/services/SoftLayer_Account_Regional_Registry_Detail)::deleteObject

Delete an existing detail object

## Overview
This method will delete an existing SoftLayer_Account_Regional_Registry_Detail object.

-----

### Parameters
|Name | Type | Description |
| --- | --- | --- |

### Required Headers
* authenticate
* SoftLayer_Account_Regional_Registry_DetailInitParameters

### Return Values
* boolean

gha_language: HTML

gha_license_id: NOASSERTION


text:
---
speaker: Mansimar Singh (IISc Mathematics)
date: 28th November 2022
time: 9 am
venue: Microsoft Teams (online)
title: Attaching Galois Representations to Modular Forms of weight 2
series: Thesis
series-prefix: MS
series-suffix: defence
---

The aim of this talk is to understand $\ell$-adic Galois representations and associate them to
normalized Hecke eigenforms of weight $2$. We will also associate these representations to elliptic
curves over $\mathbb{Q}$. This will enable us to state the Modularity Theorem. We will also mention
its special case which was proved by Andrew Wiles and led to the proof of Fermat's Last Theorem.

We will develop most of the central objects involved - modular forms, modular curves, elliptic curves,
and Hecke operators, in the talk. We will directly use results from algebraic number theory and
algebraic geometry.

repository: siddhartha-gadgil/DeptWeb

repo_name: siddhartha-gadgil/DeptWeb


text:
# Log4G

[![Version](https://img.shields.io/cocoapods/v/Log4G.svg?style=flat)](http://cocoapods.org/pods/Log4G)
[![License](https://img.shields.io/cocoapods/l/Log4G.svg?style=flat)](http://cocoapods.org/pods/Log4G)
[![Platform](https://img.shields.io/cocoapods/p/Log4G.svg?style=flat)](http://cocoapods.org/pods/Log4G)
[![Carthage compatible](https://img.shields.io/badge/Carthage-Compatible-brightgreen.svg?style=flat)](https://github.com/Carthage/Carthage)

Simple, lightweight logging framework written in Swift

## Context
This library is derived from the [GodEye](https://github.com/Bogon/GodEye) project which can automaticly disply Log,Crash,Network,ANR,Leak,CPU,RAM,FPS,NetFlow,Folder and etc with one line of code. Just like god opened his eyes

## Features

- [x] Log type support: `log`,`warning`,`error`.
- [x] Automaticly get log‘s file, line, function and thread.
- [x] Allow multiple delegate listeners to monitor log behavior.

## Installation

### CocoaPods
Log4G is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:

```ruby
pod 'Log4G'
```

### Carthage
Or, if you’re using [Carthage](https://github.com/Carthage/Carthage), add SwViewCapture to your Cartfile:

```
github "Bogon/Log4G"
```

## Usage
### Log a log type message

```swift
Log4G.log("message")
```

### Log a warning type message

```swift
Log4G.warning("message")
```

### Log an error type message

```swift
Log4G.error("message")
```

### Add to the log delegate listener

```swift
Log4G.add(delegate: self)
```

And implement delegate of `Log4GDelegate`:

```swift
func log4gDidRecord(with model:LogModel) {
    //Some Monitor Action
}
```

### Remove frome the log delegate listener
```swift
Log4G.remove(delegate: self)
```

## 维护者

name: Bogon

email<EMAIL_ADDRESS>
github: [Bogon](https://github.com/Bogon)

## Author

name: 陈奕龙

twitter: [@zixun_](https://twitter.com/zixun_)

email<EMAIL_ADDRESS>
github: [zixun](https://github.com/zixun)

blog: [子循(SubCycle)](http://zixun.github.io/)

## License

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


text:
# How to recreate/edit the initial-core-final mass relation plot from the COMPAS methods paper

This folder contains everything you need to reproduce (or edit!) the initial-core-final mass relation plot from the methods paper. You'll need to do the following:

1. Run `python create_fig_8_grids.py` to create a grid of stars for the plot
2. Run three different python submit files: `python pythonSubmitDefaults.py`,`python pythonSubmitRapid.py` and `python pythonSubmitMandelMueller.py` to run COMPAS for these three grids(note this is probably going to take quite a few minutes!)
3. Open `make_fig_8.ipynb` in Jupyter Lab/notebook and run the whole thing to create the figure (and learn how to change it)

For reference, the changes from the *default* pythonSubmit.py are just:

- change the output file name (to distinguish the 3 grids)
- change the logfiles definitions so that only the variables needed are included
- change grid name
- (for some) change the remnant mass prescription

repository: TeamCOMPAS/COMPAS

branch_name: refs/heads/dev

gha_language: Jupyter Notebook

repo_name: TeamCOMPAS/COMPAS


text:
## Training Scripts for distributed training

1. Partition data

Partition FB15k:

```bash
./partition.sh  ../data FB15k 4
```

Partition Freebase:

```bash
./partition.sh  ../data Freebase 4
```

2. Modify `ip_config.txt` and copy dgl-ke to all the machines

3. Run

```bash
./launch.sh \
  ~/dgl/apps/kg/distributed \
  ./fb15k_transe_l2.sh \
  ubuntu ~/mykey.pem
```


text:
---
num: "Lecture 10"
desc: "Pointer Arithmetic"
ready: true
date: 2018-08-02 11:00:00.00-7:00
---

# Pointer Arithmetic

* We’ve talked about array variables referring to the memory address of the first element in the array.
	* We can think of an array variable as a pointer!
	* We’ve seen an example where we can either pass in an array variable OR pass in a pointer when using arrays.
	* We also know that arrays must be declared with a size
		* And the size must be kept track of in order to stay within the memory bounds of the memory (avoid seg faults!).

```
// Recall
// void printArray(int* values, int size) { // can use a pointer
void printArray(int values[], int size) {
	// Note: size is passed in since we won’t know how to get the size with
	// just the array variable.

	cout << values << endl; // prints memory location of start of values[]

	for (int i = 0; i < size; i++) {
		cout << "values[" << i << "] = " << values[i] << endl;
		cout << "&values[" << i << "] = " << &values[i] << endl;
		// Note: The address values are 4 bytes away since int is 4 bytes
	}
}

int main() {
	int values[3] = { 5, 10, 15 };
	printArray(values, 3);
	return 0;
}
```

* We also know that we index arrays from [0, size – 1].
	* There is reason behind this!
	* Under-the-hood, C++ is using the index to perform pointer arithmetic!
	* When performing arithmetic to a pointer, it modifies the address by incrementing the number of bytes of the pointer’s type size.

## Example

```
int main() {
	int arr[5] = {0,1,2,3,4};
	int* x = arr;

	cout << arr << endl;
	cout << x << endl;

	cout << x + 1 << endl; // address is incremented by 1*sizeof(int)
	cout << x + 2 << endl; // address is incremented by 2*sizeof(int)
	cout << x + 3 << endl; // address is incremented by 3*sizeof(int)

	cout << *(x + 2) << endl;	// equivalent to x[2] or arr[2]
	cout << &(*(x + 2)) << endl;  // equivalent to x + 2
	return 0;
}
```

## Illustration

* The array index is the "offset" from the start of the array
* To access specific elements in the array using pointer arithmetic, the address is calculated as:

```
elementAddress = startOfArrayAddress + (i * (size of type pointer is pointing to))
```

![Array Elements](elementAddress.png)

## Example - trace the code

```
int arr[] = {10,15,20};
int* x;
x = arr;
cout << x + 1 << endl; // Address of arr[1]
cout << *x + 1 << endl; // 11
```

* x + 1 uses pointer arithmetic to calculate a memory address
* *x + 1 defeferences the array pointer and adds 1 to the first element

## Example - using [ ] and pointer arithmetic

* Assume we have a function that initializes an array:

```
void initializeArray(int* values, int size, int initialValue) {
	for (int i = 0; i < size; i++) {
		values[i] = initialValue;
		cout << values[i] << “ “;
	}
}
```

* We can also write this same algorithm using pointer arithmetic:

```
	for (int i = 0; i < size; i++) {
		*(values + i) = initialValue;
		cout << *(values + i) << " ";
	}
```

## Segmentation Faults

* If you're trying to access memory outside the range of an array, you may be accessing junk data or your program may crash with a <b>segmentation fault</b>

```
for (int i = 0; i < 1000000; i++) {
	*(values + i) = initialValue;
}
```

## Another Example - passing pointers by value / reference

```
void incrementPointer(int* p) {
	p++;
}

int main() {
	int arr[] = {10,20,30};
	int* x = arr;

	incrementPointer(x);

	cout << *x << endl; // 10
	return 0;
}
```

* Remember that even though pointers contain memory addresses, the pointer variable is a variable with its own address.
* The scenario above passes the pointer by value.
	* Any modification we make to the pointer’s address in incrementPointer is local to the incrementPointer function.

![Pointer Pass By Value](pointerValue.png)

* What can we do to actually increment the array using the incrementPointer function?

	* We can pass the pointer by reference.

```
void incrementPointer(int*& p) {
	p++;
}
```

![Pointer Pass By Reference](pointerReference.png)

	* We can pass a pointer to a pointer.

```
void incrementPointer(int** p) {
	//p++;
	*p = *p + 1;	// need to modify the original pointer’s address
}

int main() {
	int arr[] = {1,2,3};
	int* x = arr;

	incrementPointer(&x); 	// since a pointer to a pointer expects the address of
				// a pointer to an int.
	cout << *x << endl;
	return 0;
}
```

![Pointer to Pointer](pointerToPointer.png)


text:
# **flibgo**
[ *русский вариант здесь* ](README_RU.md)

### CAVEAT EMPTOR
*This software is in developement*

---

**flibgo** is a home library OPDS server

>The Open Publication Distribution System (OPDS) catalog format is a syndication format for electronic publications based on Atom and HTTP. OPDS catalogs enable the aggregation, distribution, discovery, and acquisition of electronic publications. (Wikipedia)

This **flibgo** release only supports FB2 publications, both individual files and zip archives.

OPDS-catalog is checked and works with mobile readers FBReader and PocketBook Reader

## 1-2-3 Installation
---
1. Preparing for installation

   **flibgo** is written in GO and uses MariaDB database to store the catalog, so I recommend launching **flibgo** in Docker containers to simplify installation and setup.

   Desktop installation for Windows, MacOS and Linux is described there https://www.docker.com/products/docker-desktop

2. Setup

   Copy zip-archive with **flibgo** `https://github.com/vinser/flibgo/archive/refs/heads/master.zip` or download **flibgo** with `git clone https://github.com/vinser/flibgo.git`

   In the `docker-compose.yml` file specify the folder like 'books' in which FB2 files and/or zip files with FB2s will be processed and stored.

   The folder will contain thre subfolderd:
```
books
  ├─── new   - put new FB2 files and/or zip archives with FB2 files here
  ├─── stock - library catalogue files and archives are stored here
  └─── trash - files that have been processing bugs will come here
```
   In the `docker-compose.yml` file set your local time zone if needed (TZ tag)

3. Run and Stop

   While in the folder with the docker-compose.yml file run `docker-compose up -d` command to start **flibgo** server.

   **flibgo** will once a minute process new books and add them to the catalog. OPDS catalogue will be available at `http://<your computer's ip>:8085/opds`

   Server shutdown can be done by `docker-compose down` command

## Advanced usage

   For advanced sutup see config/config.yml selfexplanatory file.

   Command `docker-compose exec app go run /flibgo/cmd/flibgo/main.go -reindex` will help to re-create the catalog on the files already processed

---

*Any comments and suggestions are welcome*

repository: anatolytkach/flibgo

repo_name: anatolytkach/flibgo


text:
# Terraform::Google::KmsCryptoKey

Allows creation of a Google Cloud Platform KMS CryptoKey. For more information see
[the official documentation](https://cloud.google.com/kms/docs/object-hierarchy#key)
and
[API](https://cloud.google.com/kms/docs/reference/rest/v1/projects.locations.keyRings.cryptoKeys).

A CryptoKey is an interface to key material which can be used to encrypt and decrypt data. A CryptoKey belongs to a
Google Cloud KMS KeyRing.

~> Note: CryptoKeys cannot be deleted from Google Cloud Platform. Destroying a
Terraform-managed CryptoKey will remove it from state and delete all
CryptoKeyVersions, rendering the key unusable, but **will not delete the
resource on the server**. When Terraform destroys these keys, any data
previously encrypted with these keys will be irrecoverable. For this reason, it
is strongly recommended that you add lifecycle hooks to the resource to prevent
accidental destruction.

## Properties

`Name` - (Required) The CryptoKey's name.
A CryptoKey’s name must be unique within a location and match the regular expression `[a-zA-Z0-9_-]{1,63}`.

`KeyRing` - (Required) The id of the Google Cloud Platform KeyRing to which the key shall belong.

`RotationPeriod` - (Optional) Every time this period passes, generate a new CryptoKeyVersion and set it as
the primary. The first rotation will take place after the specified period. The rotation period has the format
of a decimal number with up to 9 fractional digits, followed by the letter s (seconds). It must be greater than
a day (ie, 86400).

`VersionTemplate` - (Optional) A template describing settings for new crypto key versions. Structure is documented below.

### VersionTemplate Properties

`Algorithm` - (Required)  The algorithm to use when creating a version based on this template.
See the [algorithm reference](https://cloud.google.com/kms/docs/reference/rest/v1/CryptoKeyVersionAlgorithm)
for possible inputs.

`ProtectionLevel` - (Optional) The protection level to use when creating a version based on this template.
One of `SOFTWARE`, or `HSM`.

## Return Values

### Fn::GetAtt

`SelfLink` - The self link of the created CryptoKey. Its format is `projects/{projectId}/locations/{location}/keyRings/{keyRingName}/cryptoKeys/{cryptoKeyName}`.

## See Also

* [google_kms_crypto_key](https://www.terraform.io/docs/providers/google/r/kms_crypto_key.html) in the _Terraform Provider Documentation_


text:
# Messages

Messages are first-class citizens in Event Driven Architectures (I've written about this at length on my [blog](https://jameseastham.co.uk/posts/designing-a-distributed-system-3gf4)). The first part of any good system design should be to identify all the messages that are flying around in the domain.

## Messages

| Name | Description | Synchronous (S) or Asynchronous (A) |
|---|---|---|
| order.neworder | Create a new order for a customer | S |
| order.cancelorder | Cancel an order | S |
| order.orderdispatched | An order has been dispatched | A |
| order.prep | Start the preparation of an order | S |
| order.prepcomplete | The preparation of an order has completed | S |
| order.bakecomplete | The order has finished baking | S |
| menu.addnewitem | Add a new order to the menu | S |
| menu.checkstock | Check the stock of an item on the menu | S |
| payment.collectpayment | Collect the payment for an order | S |
| payment.paymentcompleted | The payment has completed | A |
| delivery.inprogress | A notification that the delivery is in progress | A |
| delivery.complete | A notification that the delivery has been completed | A |
| delivery.failed | A notification that the delivery has failed, this should include a reason | A |

## Message Flow

| Name | Message Flow |
|---|---|
| New Order Added | 1. order.neworder 2. menu.checkstock 3. payment.collectpayment 4. payment.paymentcompleted 5. order.prep |
| Order cancelled | 1. order.cancelorder |
| Order cooking | 1. order.prepcomplete 2. order.bakecomplete 3. order.orderdispatched |
| Delivery flow | 1. order.orderdispatched 2. delivery.inprogress 3. delivery.complete OR delivery.failed
| Add new menu item | 1. menu.addnewitem |

## Contexts

| Name | Description | Sends | Receives |
|---|---|---|---|
| front | Handles external HTTP requests and sits behind a load balancer |  |  |
| order-management | Handles all activities around orders and the processing of them |  |
| delivery | Manages the physical delivery and tracking of orders |  |  |
| kitchen-manager | Handles the actual creation and cooking of an order |  |
| menu-service | Stock management and menu items |  |
| payment | Payment processing |  |  |

branch_name: refs/heads/main


text:
# How to debug an actor template ?

During the developement of your actor template you will probably want to use tools like ipdb to jump into the execution of the code of the actions and inspect the state of the services. But since AYS use multiprocessing to improve the execution speed of the actions these tools don't work.

To force the execution of your action in process and thus allow utilisation of debugger you can use the `--debug` flag in your AYS command. E.g:

```python
# start writing actions code
vim actions.py
# now I want to test the new code
# call ays update to force the new code to be inserted into the database
ays update --name actor_name
# execute the action in debug mode
ays do my_action --debug

# start execution...
# ....
# ipdb breakpoint
ipdb>
```

Another useful feature of AYS is that it can auto detect when some debugging are present in the code. If `ipdb` or `IPython` is found somewhere in the code then debug mode is enabled automatically.


text:
# Welcome to Julia for healthcare modelling and data science

We have been working in healthcare data science research for over 10 years.  Our research is primarily focussed on **applied studies that support decision making** in the UK's National Health Service (NHS).

Julia is an exciting **young** programming language that focuses on ease of use and speed for computational data science.  We think Julia represents a fantastic opportunity for data science in health service delivery and we will curate our knowledge via this site.

---

## Links

* [Github repository](https://github.com/julia-healthcare/)
* [General optimisation problems in health](https://juliahealthcare.org/optimisation)
* [Running stochastic algorithms in parallel](https://juliahealthcare.org/parallel)
* [Modelling healthcare pathways using SimJulia](https://juliahealthcare.org/simjulia_index)
* [About juliahealthcare.org](https://juliahealthcare.org/about)


text:
Methodological Appendix
=======================

When using photogrammetry to create a 3D model it is essential that the visible
parts of the object remain in a constant relationship to each other. For
example, if one is creating a 3D model of a clay vase, it suffices to take many
photos from all sides and then construct a 3D model.

Using photogrammetry to make a 3D model of a book is complicated by the fact
that both sides of the book are of interest and that one needs to make 3D
models of each side of the book separately. These two 3D models can be merged
at a later point. In order to align the two 3D models it is vital that they
have common reference points. We created a common reference point by sticking a
small strip of paper into the book and making four crosses on both sides of the
paper (the crosses are aligned and at the exterior edge of the paper). This
strip of paper is inserted into the book such that the crosses are visible.
These crosses need to be clearly visible; we recommend a width of at least 3cm.

Step 1: Photography
-------------------

1. Attach camera to tripod
2. Place object on a piece of paper (on top of a mylar sheet) with clear scale markings (e.g. an indication of what 1cm is). If you have access to a turntable (a Lazy Susan works well), place everything on top of the turntable.
3. Adjust camera settings

    - Set f-stop to maximum (f. 8 to f. 12)
    - Disable flash
    - Make sure exposure is appropriate for light level.
    - Take a few test shots to ensure that all is working

4. Photograph object lying flat, rotating between shots.
    - Take 8-16 shots of object, rotating around the center of the object.
    - Raise or lower camera substantially, moving it closer or farther away as well, take another 8-16 shots, rotating around center of object.
    - Raise or lower camera substantially again, moving it closer or farther away as well, take another 8-16 shots, rotating around center of object.
    - Flip object over if you are concerned about the side that is not currently visible.
    - Repeat steps a, b, and c.

Step 2: VisualSFM
-----------------

Install a copy of the open-source software VisualSFM. On some platforms (e.g.
Linux) this step is comically difficult. There are numerous online tutorials
describing how to compile and use VisualSFM. Detailed instructions are beyond
the scope of this abstract.

For each side of the book you will need to perform the following steps.

1. Launch VisualSFM and use the menu item “Open+ Multi Images” to load all images associated with one side of the book.
2. Use the menu item “Compute Missing Matches”. This step is in some sense the essential one because it makes use of a technique which is at the core of photogrammetry, scale-invariant feature transform (SIFT). SIFT facilitates the identification of shared features in images even though the features may be visible at different scales.
3. Use the menu item “Sparse Reconstruction”
4. Use the menu item “Dense Reconstruction” and select a folder where the reconstruction will be saved.

Note: VisualSFM says that the maximum resolution it accepts for photos is
3200×2400. Most cameras take photos at a higher resolution than this. We found
that using lower-resolution images (e.g., width of 2600 pixels) does indeed
produce better results than using very-high resolution images (width of greater
than 4000 pixels). On Linux and OS X one can resize all JPG images in a
directory to a fixed width (preserving aspect ratio) with the following
one-line bash command and the ubiquitous open-source ImageMagick convert
program: ``for fn in *.JPG; do convert $fn -resize 2600 ${fn%.JPG}-lowres.jpg;
done``

Step 3: CloudCompare
--------------------

Use CloudCompare to align and merge the two point clouds (one for each book). CloudCompare
has an alignment tool that is designed for precisely this purpose. Once you have picked two sets of
matched points (at least 4 pairs) on the two clouds, CloudCompare will align
the two clouds. If the alignment is satisfactory, you may merge the clouds.

A final pass is required to remove extraneous points. This step is analogous
to cropping a photo. Use the *segment* tool for this step.


text:
# Attention

This is a work in progress so it may not work yet as is on your machine.

[![Issue Stats](http://issuestats.com/github/fable/fable-suave-scaffold/badge/issue)](http://issuestats.com/github/fable/fable-suave-scaffold)
[![Issue Stats](http://issuestats.com/github/fable/fable-suave-scaffold/badge/pr)](http://issuestats.com/github/fable/fable-suave-scaffold)

# fable-suave-scaffold

This project can be used to scaffold a Suave-based webserver with F# SPA frontend. This includes a build process that:

* compiles both server and client and runs both
* and sets up watch to recompile and reload both

In order to kickoff the process run

    > build.cmd // on windows
    $ ./build.sh  // on unix

## Requirements

* .NET/Mono
* node/npm

## Build Status

Mono | .NET
---- | ----
[![Mono CI Build Status](https://img.shields.io/travis/fable/fable-suave-scaffold/master.svg)](https://travis-ci.org/fable/fable-suave-scaffold) | [![.NET Build Status](https://img.shields.io/appveyor/ci/fsgit/fable-suave-scaffold/master.svg)](https://ci.appveyor.com/project/fsgit/fable-suave-scaffold)

## Maintainer(s)

- [@forki](https://github.com/forki)
- [@alfonsogarciacaro](https://github.com/alfonsogarciacaro)

license: Unlicense

repository: enricosada/fable-suave-scaffold

repo_name: enricosada/fable-suave-scaffold


text:
---
title: Paging
page_title: Paging - RadImageGallery
description: Check our Web Forms article about Paging.
slug: imagegallery/functionality/paging
tags: paging
published: True
position: 3
---

# Paging

RadImageGallery has built-in paging mechanism that you can use to optimise performance. When paging is enabled only the images for the current page are loaded. That can make a considerable difference especially when working with a lot of images.

In order to enable paging you need to set the **AllowPaging** property for the control to **true**. Furthermore, you can specify the page size via the **PageSize** property.

````ASP.NET
<telerik:RadImageGallery runat="server" ID="RadImageGallery1" ImagesFolderPath="~/Images" Width="600px"
    AllowPaging="true" PageSize="5">
</telerik:RadImageGallery>
````

The following image is showing the result of the code snippet above:

![](images/image-gallery-paging1.jpg)

repository: telerik/ajax-docs

gha_language: C#

repo_name: telerik/ajax-docs


text:
Don't worry, we got you covered.

# Quick usage
```
$ cd /path/to/messedup/repo
$ git clone git@github.com:pendashteh/git-recover-index.git
$ ./git-recover-index.sh
> 1 lost commit found. Processing...
> Done.
> Find recovered commits at /path/to/messedup/git-recovered
```

Now you can check out your files under `./git-recovered`. Please note that this process does not recover the file names, so yeah. Good luck!

repository: pendashteh/git-recover-index

repo_name: pendashteh/git-recover-index


text:
---
layout: page
title: -- IR-3 INCIDENT RESPONSE TESTING
parent: . 3.8 INCIDENT RESPONSE
nav_order: 3830
---

## IR-3 INCIDENT RESPONSE TESTING

Control: Test the effectiveness of the incident response capability for the system [ _Assignment: organization-defined frequency_ ] using the following tests: [ _Assignment: organization-defined tests_ ].

Discussion: Organizations test incident response capabilities to determine their effectiveness and identify potential weaknesses or deficiencies. Incident response testing includes the use of checklists, walk-through or tabletop exercises, and simulations (parallel or full interrupt). Incident response testing can include a determination of the effects on organizational operations and assets and individuals due to incident response. The use of qualitative and quantitative data aids in determining the effectiveness of incident response processes.

Related Controls: CP-3, CP-4, IR-2, IR-4, IR-8, PM-14.

Control Enhancements:

* (1) INCIDENT RESPONSE TESTING / AUTOMATED TESTING

**Test the incident response capability using [ _Assignment: organization-defined automated mechanisms_ ].**

    Discussion: Organizations use automated mechanisms to more thoroughly and effectively test incident response capabilities. This can be accomplished by providing more complete coverage of incident response issues, selecting realistic test scenarios and environments, and stressing the response capability.

    Related Controls: None.

* (2) INCIDENT RESPONSE TESTING / COORDINATION WITH RELATED PLANS

**Coordinate incident response testing with organizational elements responsible for related plans.**

    Discussion: Organizational plans related to incident response testing include business continuity plans, disaster recovery plans, continuity of operations plans, contingency plans, crisis communications plans, critical infrastructure plans, and occupant emergency plans.

    Related Controls: None.

* (3) INCIDENT RESPONSE TESTING / CONTINUOUS IMPROVEMENT

**Use qualitative and quantitative data from testing to:**
    * **(a) Determine the effectiveness of incident response processes;**
    * **(b) Continuously improve incident response processes; and**
    * **(c) Provide incident response measures and metrics that are accurate, consistent, and in a reproducible format.**

    Discussion: To help incident response activities function as intended, organizations may use metrics and evaluation criteria to assess incident response programs as part of an effort to continually improve response performance. These efforts facilitate improvement in incident response efficacy and lessen the impact of incidents.

    Related Controls: None.

References: [OMB A-130], [SP 800-84], [SP 800-115].


text:
# pandoc-mermaid-filter

Pandoc filter which converts mermaid code blocks to mermaid images.

````
```mermaid
gantt
        dateFormat  YYYY-MM-DD
        title Adding GANTT diagram functionality to mermaid
        section A section
        Completed task            :done,    des1, 2014-01-06,2014-01-08
        Active task               :active,  des2, 2014-01-09, 3d
        Future task               :         des3, after des2, 5d
        Future task2               :         des4, after des3, 5d
        section Critical tasks
        Completed task in the critical line :crit, done, 2014-01-06,24h
        Implement parser and jison          :crit, done, after des1, 2d
        Create tests for parser             :crit, active, 3d
        Future task in critical line        :crit, 5d
        Create tests for renderer           :2d
        Add to mermaid                      :1d
```
````

## Usage

Install it with pip:

```
pip install pandoc-mermaid-filter
```

And use it like any other pandoc filter:

```
pandoc tests/sample.md -o sample.pdf --filter pandoc-mermaid
```

The mermaid binary must be in your `$PATH` or can be set with the
`MERMAID_BIN` environment variable.

By setting the environment variable `PUPPETEER_CFG`, you can pass a custom
configuration file to `mermaid` (`-p` option).

## But there is ...

There are a few other filters trying to convert mermaid code blocks however
they all failed for me.

### Troubleshoot

I've had to install the mermaid CLI locally instead of globally. See https://github.com/mermaidjs/mermaid.cli/issues/16

repository: Cybratech/pandoc-mermaid-filter

repo_name: Cybratech/pandoc-mermaid-filter


text:
# oblio-game

oblio.py: A framework to collect and trade algorithms with your friends to play Oblio.

"Oblio" is a game invented by my high school Computer Science teacher (rules are described below). In our senior year all CS students, as an end-of-semester project, had to produce an algorithm to play it. A tournament was held each year, and the winning students had their names memorialized in the classroom.  As I've personally grown over the years I periodically thought back to this assignment and wondered how well my contemporary self would fare against my high school self.

A long 9-hour AMS-IAD flight equipped with a Macbook Air provided me just the opportunity to dive into this and experiment. Most of the flight was spent building this framework, and only a few hours on devising the algorithm ("SmartAlg"). My plan is for this to become a continuous project to enhance and refine my algorithms for whenever I have a few hours to kill on long-haul flights.

Playing Oblio: A talented and trained human averages about 18-20 guesses before converging on the solution. What can your algorithm do?

## To Play Oblio

 1. There exists a secret 4-digit number in which no two digits are the same.
    (e.g., "1 2 3 4" or "0 5 1 2".  "9 9 9 9" is NOT valid)

 2. Whenever you submit a guess of this secret nubmer, you get in return a  2-tuple in the form (X, Y). Y indicates the number of digits within your guess that are in the correct position, and X indicates the number of digits you guessed correctly, but are in the wrong position.

 3. Having the result (0, 4) implies you've won and guessed the secret number correctly.

## Examples

When the secret number is "3 9 4 5":

* If you guess "1 2 4 5", you'll get back (0, 2), because "4" and "5" are in the hidden number, and also in the proper spot.

* If you guess "5 4 9 3", you'll get back (4, 0), as all the digits in your guess are in the hidden number, but none in the correct spot.

* If you guess "0 1 2 8", you'll get back (0, 0). Since none of the digits in your guess are in the secret number.

* If your guess is "2 8 9 1", you'll get back (1, 0), implying you have one correct digit in your guess but it's not in the correct spot. You'll get this a lot and it's annoying.

## Usage

    $ python oblio.py [play|fight|test]

### To play Oblio manually (interactively)

    $ python oblio.py play

### To unit test (pretty minimal)

    $ python oblio.py test

### To fight two algorithms

    $ python oblio.py <AlgClassName> <OtherAlgClassName>

(Ensure both of these exist in the algorithms directory and in the algorithms/__init__.py file)

### To get metrics on random inputs for each algorithm

    $ python metrics.py

(Make sure to add yours in the source)

repository: billvb/oblio-game

repo_name: billvb/oblio-game


text:
---
layout: post
title : "COFO::Cofo Educational Round 144"
subtitle: "cofo round"
type: "codeforce div 2"
ps: true
cofo: true
round: true
text: true
author: "beenpow"
post-header: true
header-img: "https://positive.b-cdn.net/wp-content/uploads/Leaving-the-Comfort-Zone-Appendix.png"
order: 1
date: "2023-03-01"
---

# COFO::Cofo Edu Round #144
- [Link : COFO::Cofo Edu round 144)](https://codeforces.com/contest/1796)
- solved : 2
  - A : 00:08
  - B : 00:38
  - C : 3 try
  - rank : 3583
  - score : 2solved

## Problem A : Typical Interview Problem

- level : not yet decided
- tag : implementation, strings

### point
- Let's say there are some consecutive integers
  - If the current integer is divided by 3, append F
  - If the current integer is divided by 5, append B
- 10 characters are given, find if it is achievable by doing above operation

### Design
- Since LCM(3, 5) is 15, [1, 15] is repeated which is 'FBFFBFFB'
- So we can simple check if the given string can be achievable by repeating above pattern

#### Big O(time)
- O(N)

### Code

```cpp
#include<bits/stdc++.h>
#define fi first
#define se second
#define sz(x) (int)x.size()
#define all(x) x.begin(), x.end()
#define rep(i, a, b) for(int i = (a); i <(b); i++)
#define r_rep(i, a, b) for(int i = (a); i >(b); i--)
typedef long long ll;
using namespace std;

void solve() {
    int n; cin >> n;
    string s = ""; cin >> s;
    string t = "FBFFBFFBFBFFBFFBFBFFBFFBFBFFBFFB";
    rep(i, 0, sz(t) - sz(s)) {
        if (t.substr(i, sz(s)) == s) {
            cout << "YES\n";
            return;
        }
    }
    cout << "NO\n";
}
int main(){
    ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);

    int tc; cin >> tc; while(tc--)
        solve();
    return 0;
}
```

## Problem B : Asterisk-Minor Template

- level : not yet decided
- tag : implementation, strings

### Point
- string a and b are given,
- Find an asterisk-minor template such that both a and b match it

### Design
- There's simple logic for this problem
- If a[0] and b[0] are same, we can print like a[0] + *
- If a.back() and b.back() are same, we can print like * + a.back()
- Otherwise, there has to be a substring of length 2 at least, so we can make * + XY + *

#### Big O(time)

- O(|a| * |b|)
### Code

```cpp
#include<bits/stdc++.h>
#define fi first
#define se second
#define sz(x) (int)x.size()
#define all(x) x.begin(), x.end()
#define rep(i, a, b) for(int i = (a); i <(b); i++)
#define r_rep(i, a, b) for(int i = (a); i >(b); i--)
typedef long long ll;
using namespace std;

void solve() {
    string a, b; cin >> a >> b;
    if (a[0] == b[0]) cout << "YES\n" << a[0] <<"*\n";
    else if (a.back() == b.back()) cout << "YES\n*" << a.back() << "\n";
    else {
        rep(i, 0, sz(a) - 1) {
            rep(j, 0, sz(b) - 1) {
                if (a[i] == b[j] && a[i+1] == b[j+1]) {
                    cout << "YES\n*" << a[i] << a[i+1] << "*\n";
                    return;
                }
            }
        }
        cout << "NO\n";
    }
}

int main(){
    ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);

    int tc; cin >> tc; while(tc--)
        solve();
    return 0;
}
```

## Problem C : Maximum Set

- level : 1600
- tag : binary search, math

### Point
- l and r are given
- A set of positive integers S is called beautiful, if every two members in it can be divisable by either of them
- Find the maxium size of a beautiful set, and how many are they in the range of l and r

### Design
- If you test with test case 4, you will get the idea of this problem
- When you select the first number of a set, now you either muliply 2 or 3
- Especially, 3 can be at most once
  - Since, multiplying 3 and 3 in a row means, multiplying 9 and it can be substituted by 2 * 2 * 2, then the size increase
- And We can get the maximum count by multiplying 2 from l
- Then all we need to do is
  - 1. Find the maximum number between l and r, that makes the number * 2^(maximum count) is equal to or less than r
  - 2. Find the maximum number between l and r, that makes the number * 2^(maximum count - 1) * 3 is queal to or less than r
- And add them to the answer
  - For 2, it should be multiplied by maximum size, because 3 can be multiplied on any indices

#### Big O(time)
- O(logN)

### Code

```cpp
#include<bits/stdc++.h>
#define fi first
#define se second
#define sz(x) (int)x.size()
#define all(x) x.begin(), x.end()
#define rep(i, a, b) for(int i = (a); i <(b); i++)
#define r_rep(i, a, b) for(int i = (a); i >(b); i--)
typedef long long ll;
using namespace std;

ll bs(ll le, ll ri, ll mul) {
    ll fri = ri;
    while(le <= ri) {
        ll mid = (le + ri) >> 1;
        if (mid * mul > fri)
            ri = mid - 1;
        else {
            le = mid + 1;
        }
    }
    return ri;
}
void solve() {
    ll l, r; cin >> l >> r;
    ll mxSize = 0, ans = 0;

    while( (l  << mxSize) <= r)
        mxSize++;
    mxSize--;

    ll till = bs(l, r, (1 << mxSize) );
    ans += (till - l) + 1;

    if (mxSize >= 1) {
        till = bs(l, r, (1 << (mxSize - 1)) * 3);
        ans += ((till - l) + 1) * mxSize;
    }
    cout << mxSize + 1 << " " << ans << '\n';
}
int main(){
    ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);

    int tc; cin >> tc; while(tc--)
    solve();
    return 0;
}
```

gha_language: JavaScript


text:
# jquery-routing
Object for SPA routing in jquery

route - object variable

Methods:
* route.redirect(htmlfilename) - method for getting a file at a specific path and output to the page;
* route.attach_module(htmlfilename, elementid) - method for getting a file at a specific and outputting it to a specific div;

repository: KValexander/jquery-routing

repo_name: KValexander/jquery-routing


text:
---
layout:     post
title:      Linux清理Cached内存
subtitle:
description: ""
date:       2018-07-13
author:     Jason
header-style: text
catalog: true
category: Linux
tags: [Android, Linux, 内存管理]
---

Kernels 2.6.16 and newer provide a mechanism to have the kernel drop the page cache and/or inode and dentry caches on command, which can help free up a lot of memory. Now you can throw away that script that allocated a ton of memory just to get rid of the cache...

To use /proc/sys/vm/drop_caches, just echo a number to it.

To free pagecache:
```bash
echo 1 > /proc/sys/vm/drop_caches
```
To free dentries and inodes:
```bash
echo 2 > /proc/sys/vm/drop_caches
```
To free pagecache, dentries and inodes:
```bash
echo 3 > /proc/sys/vm/drop_caches
```
This is a non-destructive operation and will only free things that are completely unused. Dirty objects will continue to be in use until written out to disk and are not freeable. If you run "sync" first to flush them out to disk, these drop operations will tend to free more memory.

参考网站：
* [Drop_Caches](https://linux-mm.org/Drop_Caches)


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.1.0 - 2018-05-27
[Source](https://github.com/DigitalDiceworks/natural-locomotion/tree/v0.1.0)

### Added
- Locomotion Hub for a centralized place of events and methods
- Natural Input to handle input vectors
- Modifier Handler to handle modifier events
- Translation Movement as an example of a simple movement component
- Rigidbody Movement as an example of a simple movement component
- Grip Input as an example of the standard input vector algorithm
- Hub Connector to easily connect the Locomotion Hub to children game objects
- Basic movement sample scene to show a simple movement scene with translation movement
- Physics movement sample scene to show physics based movement
- Translation camera rig prefab for easy starting
- Rigidbody camera rig prefab for easy starting with physics

repository: DigitalDiceworks/ddw-locomotion-system

repo_name: DigitalDiceworks/ddw-locomotion-system


text:
# playback-server

A tool to serve holojam line frames over the Internet using WebSockets
or plain old HTTP.

## Installation

You're going to need [leiningen](http://leiningen.org).

## Usage

For testing/running undaemonized use `lein run`.

## Options

Short | Long                  | Default         | Description
------|-----------------------|-----------------|-------------
-d    | --directory DIRECTORY | recorded_frames | Path to frame data directory.
-p    | --port PORT           | 8080            | Port number.
-w    | --webbrowser          |                 | Open a webbrowser to the main page (using Python).
-h    | --help                |

## License

```
The MIT License (MIT)

Copyright (c) 2015 Will Field-Thompson

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: WFT/holojam-playback-server

repo_name: WFT/holojam-playback-server


text:
[Back](README.md)

## GET /v1/auth/validate/:token
Validates a user token.

## Also See
* [GET /v1/auth/login](./api-login-v1.md)
* [GET /v1/auth/logout](./api-logout-v1.md)

### JSON Request

N/A

### JSON Response

Returns `isValid` with true or false, indicating the status of the supplied token.

```javascript
{
  "statusCode": 200,
  "statusMessage": "OK",
  "statusDescription": "Request succeeded without error",
  "result": {
    "isValid": true
  }
}
```

```javascript
{
  "statusCode": 200,
  "statusMessage": "OK",
  "statusDescription": "Request succeeded without error",
  "result": {
    "isValid": false
  }
}
```

```javascript
{
  "statusCode": 200,
  "statusMessage": "OK",
  "statusDescription": "Request succeeded without error",
  "result": {
    "isValid": false,
    "reason": "jwt malformed"
  }
}
```

```javascript
{
  "statusCode": 503,
  "statusMessage": "Service Unavailable",
  "statusDescription": "The server is currently unable to handle the request due to a temporary overloading or maintenance of the server. The implication is that this is a temporary condition which will be alleviated after some delay",
  "result": {
    "reason": "Unavailable auth-svcs instances"
  }
}
```

Status Code | Response String
--- | ---
200 | Success as determined in result block
409 | Data conflict. Issued when account already exists using the supplied phone number
500 |	Internal service error: ```{"error": ""}```
503 | Service Unavailable. Returned by the API gateway when a service instance can't be reached.

[Back](README.md)

repository: cjus/auth-svcs

repo_name: cjus/auth-svcs


text:
# Debugging
### REST Client

There are many REST clients around. The Chrome Advanced Rest Client is very good.

To test your setup try to access via `GET` [http://localhost:8000/api/device/1](http://localhost:8000/api/device/1) with a custom `Authorization` header with a value
`Token CHANGE_ME`, where you need to replace the token with a value you get from the admin
  interface `Token` model for your user account.
That user account needs to be in the groups that the relevant view (here `ep.apiviews.MeasurementList` specifies as its `required_groups` list.

You should be returned a list of measurements.

# Django Restframework

As you can see in the apiview import statement, the above fw is used to render DB models.
```
from rest_framework.authentication import SessionAuthentication
from rest_framework.decorators import api_view, authentication_classes, permission_classes
from rest_framework.permissions import IsAdminUser
```

It is advised to use this for additional APIs.
There is a lots of documentation [here](http://www.django-rest-framework.org/).

repository: dschien/energy-aggregator

repo_name: dschien/energy-aggregator


text:
+++
City = "Detroit"
Year = "2016"
title = "Metrics are Infra, Metrics are Code: Yelp’s time series data at scale"
type = "talk"

+++

**Speaker**: Zach Musgrave, Yelp

It’s 2016, and “measure absolutely everything” is the new normal. Servers are
cheap, and data is abundant. Time series data drives engineering and business
decisions, and systems enabling such high-scale collection must scale along
with the rest of the organization.

Over the years, Yelp accumulated many ways of generating metrics, monitoring,
doing analytics, and alerting. In the past year, a dedicated metrics team
formed to integrate and maintain all the tools as a platform for the wider
engineering organization - providing monitoring as a service. To achieve this,
principles from the Infrastructure as Code movement become essential: ephemeral
servers managed within version control, distributed configuration management
via CI/CD pipelines, and aggressive containerization of federated resources via
PaaS techniques.

Join us to hear about auto-scaling stateful aggregation systems that don’t want
to auto-scale. Listen in for tools that work across vendors, libraries
supporting in-house innovation, and a strong push toward self-service metrics
for all our internal users.

“Who monitors the monitors?” We do.

#### Speaker bio ####

Zach Musgrave is the Tech Lead for Yelp’s Metrics team, which provides the
instrumentation, monitoring, and alerting platforms for Yelp’s Engineering and
Operations teams. From graduate school onwards, Zach has worked in performance
optimization: from individual systems and code paths to cluster wide service
performance for thousands of machines. At Yelp, he’s also worked on large scale
deployment infrastructure, Hadoop operations, and key management. Back in the
day, Zach was an English major.

repository: vjanelle/devopsdays-web

repo_name: vjanelle/devopsdays-web


text:
# Sample to extend SAP Cloud for Customer with user propagation

## Overview

This sample provides details on how a user propagation flow can be achieved when extending SAP Cloud for Customer(C4C) using SAP BTP, Kyma runtime. A similar configuration is applicable when extending other SAP Solutions such as S4.

The flow uses SAP Identity Authentication Service (IAS) as an external identity provider with user federation. However, any external identity provider would also work as long as it supports SAML 2.0.

The user propagation relies on the exchange of the JWT token received in Kyma for an OAuth2 token that can be authenticated by SAP Cloud for Customer. For this, the [Destination Service](https://help.sap.com/viewer/cca91383641e40ffbe03bdc78f00f681/Cloud/en-US/7e306250e08340f89d6c103e28840f30.html) is used.

Trust is established between SAP Cloud for Customer and Destination Service. The extension deployed in Kyma runtime makes an [API call](https://api.sap.com/api/SAP_CP_CF_Connectivity_Destination/resource) to the destination service passing the JWT token. Destination Service after validating the token responds along with other details an opaque OAuth2 token for the logged-in user. This OAuth2 token is then used to make calls to the SAP Cloud for Customer ODATA APIs.

## Flow

![c4c-sso-kyma-identity-propagation](assets/identity-propagation-flow.svg)

1. User signs in to C4C with a single ID and password (SSO).
2. C4C redirects the user to IAS for authentication.
3. User signs in to IAS.
4. User is signed in to C4C with SAML bearer assertion.
5. User accesses the frontend. The frontend can be a mesh inside C4C or a standalone app hosted on Kyma or somewhere else. The frontend redirects the user to IAS for automatic login. Along with the autologin request, the frontend receives the bearer token.
6. The frontend makes an API call to Kyma with the bearer token.
7. Kyma API Gateway verifies the token with IAS.
8. API Gateway forwards calls to a Function/microservice along with the bearer token. **Token forwarding is made possible by adding an attribute to the Kyma API rule.**
9. Microservice/Function does the token exchange via the Destination Service. The Destination Service calls C4C and performs the OAuth2 SAML bearer assertion flow.
10. Microservice/Function makes a call to C4C with the OAuth2 token it got from the Destination Service, preserving the logged-in user's identity.

>> **NOTE:** The flow does not use Application Gateway when calling C4C from the Kyma runtime. Instead, it calls the APIs directly.

## Prerequisites

- SAP BTP, Kyma runtime instance
- SAP Cloud for Customer tenant
- SAP Identity Authentication Service tenant
- OAuth 2.0-based authentication between IAS, SAP BTP, and C4C requires the same user ID to exist in both IAS and C4C.

## Configuration

### Single sign-on

Set up single sign-on (SSO) using IAS with C4C. Refer to the [official documentation](https://help.sap.com/viewer/abfba1342cfb4832ab722fa041f6c4b7/CLOUD/en-US/f1e6f23267b542ce9a906823c70dc583.html) for details.

### User propagation

Configure user propagation between C4C and Kyma runtime.

[This blog](https://blogs.sap.com/2017/11/14/configuring-oauth-2.0-between-sap-hybris-cloud-for-customer-and-sap-cloud-platform/) was used as a reference. It was written for Neo, but some steps are also applicable for Kyma runtime.

You will end up creating a Destination Service in SAP BTP. It will be later on used by the microservice to do the token exchange.

- Download the `Trust` certificate from **Subaccount** --> **Destinations** --> **Download Trust**.
  ![download-trust](assets/download-trust.png)

- Log on to your C4C system as an administrator. Go to **ADMINISTRATOR** --> **Common Tasks**. Choose **Configure OAuth 2.0 Identity Provider** and select **New OAuth2.0 Provider**.

  - Get the issuing entity name from the certificate. You can use OpenSSL to view certificate details.

      ```shell
      openssl x509 -in {cert path} -text -noout
      ```

  - Upload the certificate.
    ![new-oauth2-provider](assets/new-oauth2-provider.png)

- Register an Oauth2 Client in C4C.
  ![register-oauth-client](assets/register-oauth-client.png)

- Create a destination in SAP BTP. Under your subaccount, go to **Connectivity** --> **Destinations**.
  ![http-destination](assets/http-destination.png)

  Configure these additional properties:

    ```shell
    scope : UIWC:CC_HOME
    x_user_token.jwks_uri : "Provide URI of the JSON web key set"
    ```

### Identifier used by the Destination Service to get the token

The Destination Service uses whatever is specified in the `userIdSource` property. If not specified, it would require either `user_name` or `email` depending upon the `nameIdFormat`
In this example, `user_name` is mapped to the **Login name** attribute.

![assertion-atributes](assets/assertion-attributes.png)

## Components for the sample

Create Namespace

```shell script
kubectl create ns identity-propagation
kubectl label namespaces identity-propagation istio-injection=enabled
```

### httpbin

httpbin is a service that returns all the request headers to the `/headers` endpoint.

It is used for demonstrating and verifying that the token is forwarded from the API Gateway to the microservice.

- Deploy httpbin.

    ```shell
    kubectl -n identity-propagation apply -f https://raw.githubusercontent.com/istio/istio/master/samples/httpbin/httpbin.yaml
    ```

- Expose it with an [API rule](k8s/apirule-httpbin.yaml). The API rule is configured to forward headers, such as `Bearer Token`, to the microservice.
  [api-rule-forward-headers](assets/apirule-forward-headers.png)

  - Update `jwks_urls` and `trusted_issuers` with the IAS tenant.

  - Deploy the API rule.

      ```shell
      kubectl -n identity-propagation apply -f k8s/apirule-httpbin.yaml
      ```

### Extension

The second microservice is the one that implements the extension logic and where the user propagation happens.

- It receives the JWT token that is forwarded from the API Gateway.
- The token is used to do a token exchange by making API Call to the Destination Service.
- A call is made to C4C to create a task with the exchanged token that contains the user context.
- The task is created with the logged-in user as the processor, not a static user.

**Token Exchange**

The token exchange is done by making API calls to destination service. The configuration has been done in SAP, BTP in previous steps and an instance has been created on Kyma Service Catalog. The created instance provides the necessary credentials and call details (OAuth URL, API enpoint)

The token exchange call looks like below:

```shell
curl --location --request GET '{uri-in-destination-service-instance-in-kyma-service-catalog}/destination-configuration/v1/destinations/{destination-name-in-BTP}' \
  --header 'X-user-token: {JWT-token-to-be-exchanged}' \
  --header 'Authorization: Bearer {OAuth-token}'
```

You can get the OAuth token by using the credentials provided in destination service instance created in Kyma Service Catalog.
Use the `URL + /oauth/token ` as the token endpoint and client id and client secret as credentials.

![destination-service-get-token](assets/destination-service-get-token.png)

#### Setup

- Create a Destination Service instance in the Kyma Service Catalog. This will be used to get the credentials to make the call to the Destination Service.

  ![create instance](assets/create-destination-instance.png)

- Create credentials for the instance.

  ![kyma destination service instance](assets/destination-service-kyma-instance.png)

- Deploy the extension with user propagation.

  - Update `DESTINATION_NAME` in [`deployment.yaml`](c4c-extension-with-user-context/k8s/deployment.yaml) with the name of the destination created in SAP BTP.

  - Deploy the extension.

      ```shell
        kubectl apply -f c4c-extension-with-user-context/k8s/deployment.yaml
      ```

- Bind the extension to the Destination Service instance.
  ![bind instance](assets/bind-application.png)

- Expose it with an [API rule](c4c-extension-with-user-context/k8s/api-rule.yaml). Similarly to `httpbin`, the API rule is configured to forward headers, such as `Bearer Token`, to the microservice.

  - Update `jwks_urls` and `trusted_issuers` with the `SAP Cloud Identity` tenant.

  - Deploy the API rule.

      ```shell
        kubectl -n identity-propagation apply -f c4c-extension-with-user-context/k8s/apirule.yaml
      ```

### Angular app

It simulates the SSO flow and makes API calls to the extensions deployed to the Kyma runtime.

The app automatically logs the user in after they have been signed into C4C through SSO. It is registered in the IAS as an application.
![angular-app-registeration](assets/angular-app-configuration.png)

The app makes a call to the httpbin service to the `/headers` URI path. The httpbin service replies with all the HTTP headers received.

![angular home](assets/angular-app-home.png)

It makes another call to create a C4C task for the logged-in user.

![angular create c4c task](assets/create-task.png)

#### Set up the angular app

Follow these steps:

- Update the [deployment file](k8s/angular-app.yaml). Provide values for `HTTP_BIN`, `OIDC_URL`, `OIDC_CLIENT_ID` and `C4C_EXT_URL`.

  - `OIDC_CLIENT_ID` is the Client Id for the registered application in SAP Identity Authentication Service tenant.

- Deploy the app:

    ```shell
    kubectl -n identity-propagation apply -f k8s/angular-app.yaml
    ```

- Expose the app using an API Rule:

    ```shell
    kubectl -n identity-propagation apply -f k8s/apirule-angular-app.yaml
    ```

- Access the app at `https://sample-angular-app.{kyma-cluster-domain}`.`

### UI5 App

It is another sample app in case you want to try out the example with UI5 instead of angular. The flow remains the same.

- Modify the config.json to match your configuration

**Running locally**

- To run locally, within the folder `ui5-example-app` run the commands to install, build the dependencies, and start the application

    ```shell
    npm install
    ```

    ```shell
    npm run build-all
    ```

    ```shell
    npm run start
    ```

- App will be available at `http://localhost:8080/index.html`

**Docker**

- To build and push the docker image run the following commands from the folder `ui5-example-app`

    ```shell
    docker build -t {your-docker-account}/kyma-identity-propagation-ui5 -f Dockerfile .
    docker push {your-docker-account}/kyma-identity-propagation-ui5
    ```

- To run the image locally, adjust the values of the parameters in the `webapp/config.js` file and mount it into the image:

    ```shell
    docker run --mount type=bind,source=$(pwd)/webapp/config.json,target=/usr/share/nginx/html/config.json -p 8080:80 -d {your-docker-account}/kyma-identity-propagation-ui5:latest
    ```

- App will be available at `http://localhost:8080/`

**Deploying to Kyma**

- Create the configmap from the file `ui5-example-app/webapp/config.json`

    ```shell
    kubectl create configmap kyma-identity-propagation-ui5 --from-file=webapp/config.json -n identity-propagation
    ```

- Apply the deployment and the apirule found in the `k8s` folder

    ```shell
    kubectl apply -f ui5-app.yaml -n identity-propagation
    ```

    ```shell
    kubectl apply -f apirule-ui5-app.yaml -n identity-propagation
    ```

## Takeaways

- It is possible to build in the Kyma runtime the extensions and flows that require user propagation. This feature has been requested by various customers.
- Although the sample is built for SAP Cloud for Customer, a similar approach can be applied to other SAP Solutions, such as SuccessFactors.
- The approach requires an extension to build the logic required to fetch the token.
- The flow does not make the call via Application Gateway but directly calls the SAP Cloud For Customer APIs with the token it got from the Destination Service.

repository: remi-sap/kyma-runtime-extension-samples

repo_name: remi-sap/kyma-runtime-extension-samples


text:
# Radical README
A CLI README generator for github projects

### Username:

athomik79

### Project Title:

Nosql Workout Tracker

### Link to Deployed project
[Workout Tracker App](https://intense-shore-21076.herokuapp.com/?id=5ede7894cd35c80017cc786a)

### Description:

A workout tracker app built with node.js, express, and MongoDB

### Installation:

Install the required dependencies. Connect to MongoDB and use the seed data to seed the DB. Run the project using the server.js file.

### Usage:

Add a new workout by clicking on the "New Workout" button. Choose the type of exercise and specify the input. Add the expercise using the "Add Exercise Button". Click the "Complete Button once you have added you r exercise. To continue adding to the workout, click the "Continue Workout" button. View your logged workouts by clicking on the "Dashboard" button.

![Home](https://github.com/athomik79/Nosql-Workout-Tracker/blob/master/public/img/screenshot_1_300.png)

![Add1](https://github.com/athomik79/Nosql-Workout-Tracker/blob/master/public/img/screenshot_2_300.png)

![Added](https://github.com/athomik79/Nosql-Workout-Tracker/blob/master/public/img/screenshot_3_300.png)

![Continue](https://github.com/athomik79/Nosql-Workout-Tracker/blob/master/public/img/screenshot_4_300.png)

![Updating](https://github.com/athomik79/Nosql-Workout-Tracker/blob/master/public/img/screenshot_5_300.png)

![Dashboard](https://github.com/athomik79/Nosql-Workout-Tracker/blob/master/public/img/screenshot_6_300.png)

### License:

MIT

### Contributing:

athomik79

### Tests:

n/a

### Questions:

Does it work?


text:
# Http Recording

Http Recording allows, when a method is being tested, for any http requests made as part of that method call to be recorded and verified.

**Supported in netstandard2.1 and up**

## Usage

Call `HttpRecording.StartRecording();` before the method being tested is called.

The perform the verification as usual:

```cs
[Fact]
public async Task TestHttpRecording()
{
    HttpRecording.StartRecording();

    var sizeOfResponse = await MethodThatDoesHttpCalls();

    await Verifier.Verify(
            new
            {
                sizeOfResponse,
            })
        .ModifySerialization(settings =>
        {
            //scrub some headers that are not consistent between test runs
            settings.IgnoreMembers("traceparent", "Date");
        });
}

static async Task<int> MethodThatDoesHttpCalls()
{
    using var client = new HttpClient();

    var jsonResult = await client.GetStringAsync("https://httpbin.org/json");
    var xmlResult = await client.GetStringAsync("https://httpbin.org/xml");
    return jsonResult.Length + xmlResult.Length;
}
```
snippet source | anchor

The requests/response pairs will be appended to the verified file.

```txt
{
  target: {
    sizeOfResponse: 951
  },
  httpCalls: [
    {
      Uri: https://httpbin.org/json,
      RequestHeaders: {},
      ResponseHeaders: {
        Access-Control-Allow-Credentials: true,
        Access-Control-Allow-Origin: *,
        Connection: keep-alive,
        Server: gunicorn/19.9.0
      },
      ResponseContentHeaders: {
        Content-Length: 429,
        Content-Type: application/json
      },
      ResponseContentString:
{
  "slideshow": {
    "author": "Yours Truly",
    "date": "date of publication",
    "slides": [
      {
        "title": "Wake up to WonderWidgets!",
        "type": "all"
      },
      {
        "items": [
          "Why <em>WonderWidgets</em> are great",
          "Who <em>buys</em> WonderWidgets"
        ],
        "title": "Overview",
        "type": "all"
      }
    ],
    "title": "Sample Slide Show"
  }
}
    },
    {
      Uri: https://httpbin.org/xml,
      RequestHeaders: {},
      ResponseHeaders: {
        Access-Control-Allow-Credentials: true,
        Access-Control-Allow-Origin: *,
        Connection: keep-alive,
        Server: gunicorn/19.9.0
      },
      ResponseContentHeaders: {
        Content-Length: 522,
        Content-Type: application/xml
      },
      ResponseContentString:
<!--  A SAMPLE set of slides  -->
<slideshow title="Sample Slide Show" date="Date of publication" author="Yours Truly">
  <!-- TITLE SLIDE -->
  <slide type="all">
    <title>Wake up to WonderWidgets!</title>
  </slide>
  <!-- OVERVIEW -->
  <slide type="all">
    <title>Overview</title>
    <item>Why <em>WonderWidgets</em> are great</item>
    <item />
    <item>Who <em>buys</em> WonderWidgets</item>
  </slide>
</slideshow>
    }
  ]
}
```
snippet source | anchor

## Explicit Usage

The above usage results in the http calls being automatically added snapshot file. Calls can also be explicitly read and recorded using `HttpRecording.FinishRecording()`. This enables:

 * Filtering what http calls are included in the snapshot.
 * Only verifying a subset of information for each http call.
 * Performing additional asserts on http calls.

For example:

```cs
[Fact]
public async Task TestHttpRecordingExplicit()
{
    HttpRecording.StartRecording();

    var sizeOfResponse = await MethodThatDoesHttpCalls();

    var httpCalls = HttpRecording.FinishRecording().ToList();

    // Ensure all calls finished in under 5 seconds
    var threshold = TimeSpan.FromSeconds(5);
    foreach (var call in httpCalls)
    {
        Assert.True(call.Duration < threshold);
    }

    await Verifier.Verify(
            new
            {
                sizeOfResponse,
                // Only use the Uri in the snapshot
                httpCalls = httpCalls.Select(_ => _.Uri)
            });
}
```
snippet source | anchor

Results in the following:

```txt
{
  sizeOfResponse: 951,
  httpCalls: [
    https://httpbin.org/json,
    https://httpbin.org/xml
  ]
}
```
snippet source | anchor

repository: nirzaf/Verify

repo_name: nirzaf/Verify


text:
---
excerpt: "Frequently asked questions"
exclude_from_search: true
image:
    teaser: /icons/Algorithmia_FAQs.png
layout: article
redirect_from:
  - /basics/algo-dev-faq/
  - /basics/platform-faq/
show_related: false
title: "FAQs"
---

      {% assign platform_tag = site.data.tags["platform-faq"] %}

{{platform_tag.name}}

Algorithmia is a platform for sharing the world's algorithmic knowledge in a way that is scalable, composable, easy-to-integrate, and always live. We want to place the cutting edge of algorithms technology in the hands of every developer, researcher, and business. Find quick answers to common questions about the platform below.

      Jump to {{platform_tag.name}}

      {% assign algo_dev_tag = site.data.tags["algo-dev-faq"] %}

{{algo_dev_tag.name}}

With the Algorithmia platform, you can get your algorithms in to the hands of developers, researchers, and businesses. In the Algorithm Developer FAQs, you'll get fast answers to your algorithm development questions.

      Jump to {{algo_dev_tag.name}}

      {% assign faq_tags = "platform-faq|algo-dev-faq" | split:"|" %}
      {% assign faq_pages = site.pages | where: "categories", "faqs" %}
      {% for tag in faq_tags %}
        {% assign tagged_pages = faq_pages | where: "tags", tag %}
        {% assign tag_info = site.data.tags[tag] %}

{{tag_info.name}}

        	{% for post in tagged_pages %}
        		{% include faq-list-item.html %}
        	{% endfor %}

      {% endfor %}

repository: algorithmiaio/dev-center

branch_name: refs/heads/develop

gha_language: CSS

repo_name: algorithmiaio/dev-center


text:
## Sends and Receives

### Tuple space
- Concrete, technical explanation of the tuple space

### Sends
- Content that can be sent
- Difference between one-tuple and single process in the syntax
- Persistent sends
- Send a process (receive a name)

### Receives
- Patterns in a `for`
- Persistent send
- Contracts as sugar for a persistent send w/specific type of pattern
- Single send
- (send a process) Receive a name

repository: rchain-drone/rchain

gha_language: Scala

repo_name: rchain-drone/rchain


text:
Fantasy Name Generator
======================

Names can be generated through the Markov Process.

(http://www.doctornerve.org/nerve/pages/interact/markhelp.htm)
A Markov analysis looks at a sequence of events, and analyzes the tendency of one event to be followed by another. Using this analysis, you can generate a new sequence of random but related events, which will look similar to the original.

A Markov process is useful for analyzing dependent random events - that is, events whose likelihood depends on what happened last. It would NOT be a good way to model a coin flip, for example, since every time you toss the coin, it has no memory of what happened before. The sequence of heads and tails are not inter-related. They are independent events.

https://gillesleblanc.wordpress.com/2012/10/01/algorithm-to-generate-random-names/

Just stringing random letters together would give you something like "dwrtkpzxmq" and wouldn't be as interesting.

A better technique to building names is by parsing text files to create probability tables. These can determine the probability of a letter following another letter. Something like A has a 40% change of being followed by M, and 24% change of being followed by o

repository: jmeline/fantasyNameGen

repo_name: jmeline/fantasyNameGen


text:
# Achievements

![The team on the third floor of the convention center at the 2018 Jamboree](/images/jamboree/defenestration.jpg)

_Virginia iGEM about to throw Ryan out the third floor of the Hynes Convention Center._

## 2018 Jamboree

Virginia iGEM Nominated during the Awards Ceremony

✔ Virginia iGEM received a software nomination for `igem-wikibrick`, our Wiki Build Tool!
✔ We also won a bronze metal this year for our work with Quorus, reaching all bronze and gold requirements and missing one silver. Maybe next year!

## Collaborations

Marc Goy talking to Nick about the project while Joseph stands petrified in fear

✔ We met many of the teams we contacted over the course of the 10 month competition at the Jamboree!
✔ Mentoring of [RMHS Maryland](http://2018.igem.org/Team:RMHS_Maryland), helping them to establish a more rigid team structure and exchanging of parts, strains and assistance on the Wiki and Model.
✔ A member of [BioIQS-Barcelona](http://2018.igem.org/Team:BioIQS-Barcelona), Marc Goy, came and met us in person, and shared some code with us that will be integrated into future versions of the build tool, making it even better for next year's teams!

## Project

Ryan explaining our models to one of the judges

Ryan explaining our models to one of the judges

✔ [20 new biobricks](/Parts.html) related to synthetic quorum sensing and tuning of quorum response

- Created a library of lsr operon and quorum sensing parts unique to the iGEM Registry
  - Created a functional AI-2 sensitive plasmid
  - Created various functional T7 regulated plasmids
- Characterized quorum activation trends of lsrK, ydgG, and luxS genes through measurement of sfGFP expression
- Developed of a functional model to predict the behavior of our synthetically optimized lsr operon
- Reduced the bimodality and variance of the population by increasing expression of YdgG and LsrK

✔ 3 models - [activation](/Activation.html), [growth](/Growth.html) and [financial](/Application.html), exploring different practical aspects of synthetic quorum sensing. In the process, we became the first Virginia iGEM team to use one of our school's high power computing clusters.
✔ A working proof-of-concept for the Quorus synthetic quorum sensing system
✔ [A discussion packet](/Public_Engagement.html) for an impartial public forum on GMOs
✔ [A tool](/Software.html) for creating and quickly building iGEM Wikis which eliminates many of the pitfalls of iGEM's Mediawiki interface
✔ [A tool](/Software.html) for scraping and filtering information from many iGEM Wikis of past, present and future years.

## Events

✔ Pizza and Pipettes: A public seminar introducing interested members of the University to basic lab procedure and the real implications of synthetic biology.
✔ Synthetic Biology Summercamp: A collaboration with a prior Virginia iGEM alumni and the Charlottesville Albermarle Technical Education Center.

## The Real Achievements

![Free lobster](/images/jamboree/restaurant.jpg)

_Getting free lobster out of Professor Kozminski_


text:
## 1.1 Think About Time Reflection

The time management and productivity methods I focused in on were Tiny Habits (Fogg) and Time Boxing.

In Phase 0, I’ve decided to practice Time Boxing (setting a pre-determined amount of time in which to complete a task and stopping once the time is up) by setting up timers on my desktop for 25min (work), 5min (breaks), and 10min (reflections), and giving myself a certain number of “cycles” to complete the task. I’m using it right now to make sure I limit myself to 10min for writing this reflection! I will also think about some tiny habits I can form by using Dr. Fogg’s "After (existing behavior), I will (new tiny habit)” approach, and make sure I celebrate my small victories ("I’m awesome!!") :-)

Currently, I make lots of lists…long term goals, daily goals, to do lists. I’ve found over the years that they are useful for looking back to see whether I’ve made progress on a particular goal. But for daily time management, lists haven’t been effective. I need to break my time down into smaller segments, combined with giving myself limits in advance, as I described previously. I think this will be winning combo for me.

## 1.2 The Command Line Reflection

1. A shell is an interface that allows users to directly communicate with the computer's operating system using commands. Bash is a shell for Unix-based environments.
2. The most challenging part was switching between shells (Windows vs. Linux) and remembering which commands work for each. Since I am developing in a virtual environment, I wanted to practice for both environments.
3. Yes. All commands worked successfully.
4. I would say the most important commands are cd (change directory), ls (list directory) and cat (output file to screen). These commands allow for basic navigation and viewing, which is a good place to start.
5. Commands:
pwd - print working directory
ls - list directory
mv - move file or directory
cd - change directory
../ - use with cd to go up one level to the parent directory
touch - create empty file
mkdir - make directory
less - output file to screen one page at a time
rmdir - remove directory
rm - remove file
help - view help (manual) pages for a command

## 1.4 Forking and Cloning Reflection

To create a new repo:
- Log in to your GitHub account and click the ``+`` symbol (top right)
- Select “New Repo” from the dropdown menu
- Fill in the repo name, choose settings (public vs. private, license type, etc.), and click “Create Repo”

To fork a repo:
- On GitHub, navigate to the repo that you want to fork
- On the top right, click “Fork”
- Choose the user profile where the forked repo should be placed

To clone a repo:
- On GitHub, navigate to the repo that you want to clone
- Find the box labeled “HTTPS” and copy the link
- In your terminal, navigate to the folder where you want to clone the repo
- Type “git clone ``<insert HTTPS link>``" and hit enter

You fork a repo (vs. creating a new one) so that the repo will automatically include all of the existing project files, rather than being initialized as an empty git project.

A challenge I had was that when I installed git it was automatically configured to use an existing username/email from an old GitHub account I had previously set up via my desktop. I learned how to update the config file and changed my username & email to match my current account.

gha_language: Ruby


text:
# Introduction

This library is a small layer above [**brightway2**](https://brightway.dev/), designed for the definition of **parametric inventories**
with fast computation of LCA impacts, suitable for **monte-carlo** analyis.

**lca-algebraic** provides a set of  **helper functions** for :
* **compact** & **human readable** definition of activites :
    * search background (tech and biosphere) activities
    * create new foreground activites with parametrized amounts
    * parametrize / update existing background activities (extending the class **Activity**)
* Definition of parameters
* Fast computation of LCAs
* Computation of monte carlo method and global sensivity analysis (Sobol indices)

# Installation

If you already have Anaconda & Jupyter installed, you can install the library with either **pip** or **conda** :

## Conda

> conda install -c oie-minesparistech lca_algebraic

## PIP

> pip install lca_algebraic

## Pre-packaged installer for Windows

Alternatively, you can download and execute [this installer](https://github.com/oie-mines-paristech/lca_algebraic/releases/download/1.0.0/incer-acv-model-installer.exe). It will setup a full anaconda environment with **Jupyter**,
**Brightway2** and **LCA Algebraic**.

# Usage & documentation

Please refer to the [sample notebook (Markdown)](./example-notebook.md) [(or here as ipynb)](./example-notebook.ipynb).

The full API is [documented here](https://oie-mines-paristech.github.io/lca_algebraic/doc/).

# Licence & Copyright

This library has been developed by [OIE - MinesParistech](http://www.oie.mines-paristech.fr), for the project *INCER-ACV*,
lead by [ADEME](https://www.ademe.fr/).

It is distributed under the **BSD licence**.

# Principles

The main idea of this libray is to move from **procedural definition** of models (slow and prone to errors) to a **declarative / purely functionnal** definition of parametric models (models as **pure functions**).

This enables **fast computation of LCA impacts**.
We leverage the **power of symbolic calculus** provided by the great libary [SymPy](https://www.sympy.org/en/index.html).

We define our model in a **separate DB**, as a nested combination of :
* other foreground activities
* background activities :
    * Technical, refering **ecoinvent DB**
    * Biopshere, refering **brightway2** biosphere activities

The **amounts** in exchanges are expressed either as **static amounts**, or **symbolic expressions** of pre-defined **parameters**.

Each activity of our **root model** is defined as a **parametrized combination** of the **foreground activities**, which can themselves be expressed by the **background activities**.

When computing LCA for foreground models, the library develops the model as a combination of **only background activities**. It computes **once for all** the impact of **background activities** and compiles a **fast numpy** (vectorial) function for each impact, replacing each background activity by the **static value of the corresponding impact**.

By providing **large vectors** of **parameter values** to those numpy functions, we can compute LCA for **thousands of values** at a time.

![](https://oie-mines-paristech.github.io/lca_algebraic/doc/lca-algebraic.png)

# Compatibility with brightway2

Under the hood, the activities we define with **lca-algebraic** are standard **brightway2** activities.
The amounts of exchanges are stored as **float values** or **serialized as string** in the property **formula**.

Parameters are also stored in the **brightay2** projets, making it fully compatible with **brightway**.

Thus, a model defined with **lca-algebraic** is stored as a regular **bw2** projet. We can use **bw2** native support for [parametrized dataset](https://2.docs.brightway.dev/intro.html#parameterized-datasets) for computing LCAs, even if much more slower than the method explain here.


text:
# Maternal to Zygotic Transition in Xenopus laevis is Regulated by miRNA Family 427

**Introduction**

[Computational Genomics](https://en.wikipedia.org/wiki/Computational_genomics) research at the University of Pittsburgh with [Dr. Miler Lee](https://www.biology.pitt.edu/person/miler-lee) and students to understand [Maternal-to-Zygotic transition](https://en.wikipedia.org/wiki/Maternal_to_zygotic_transition) in [Xenopus laevis](https://en.wikipedia.org/wiki/African_clawed_frog). The project involved [Differential Gene Expression Analysis](https://www.ebi.ac.uk/training/online/course/functional-genomics-ii-common-technologies-and-data-analysis-methods/differential-gene) in R and prior file manipulation in Linux.

**Files**

:open_file_folder: `Paper/Maternal to Zygotic Transition in Xenopus Laevis.pdf`

Final research paper which includes background, methods, figures and explanation.

:open_file_folder: `Paper/Supplementary Documentation.pdf`

File containing all the **Bash and R** commands used to pull meaningful insight from the NGS data.

:open_file_folder: `Presentation/Research Presentation.pptx`

PowerPoint presentation given which goes through results and significance of work. The presentation is filled with few words since most of the information was given orally.

:open_file_folder: `Presentation/Research Presentation.pdf`

PDF file of presentation given to those who wanted to take notes.

:open_file_folder: `Laevis Files/`

Contains **placeholders** of all files used during analysis. This is **provided to show files and file types created in the** `Supplementary Documentation.pdf`. This may also give a novice some understanding of what **files they would need to deal with in case they replicated this analysis.**

**Contact Information**

![interests](https://avatars1.githubusercontent.com/u/38919947?s=400&u=49ab1365a14fac78a91e425efd583f7a2bcb3e25&v=4)

Yogindra Raghav (YogiOnBioinformatics)

<EMAIL_ADDRESS>


text:
# PayPal Workshop for SheHacks
Modified version from PayPal Internal Training

# Installation
You need to set Babel as the environment by creating a file `.babelrc` in your root folder(after `npm install`), then add below snippet
```
{
  "presets": ["env"]
}
```

```
npm install
npm start
```
Open browser at [localhost:8080](localhost:8000/" target="_blank)

# PayPal Sandbox Account:
1.	Go to the developer portal  - https://developer.paypal.com/
2.	If you have a live PayPal account, sign in using those credentials. If not create a new account and login. You will manage all your PayPal development related work from this portal.
3.	After successfully logging in Click on “Dashboard” tab. Under “Dashboard” tab click “Accounts” under Sandbox and then click “Create Account” on the right hand side of the page.
4.	For a Seller Account, set the account type to “Business”, enter any email address (can be fake) and also enter a simple password which will be easy to remember (eg: 123456789).
5.	Click on “Create Account”.
6.	You now also have to create a buyer account, so repeat step 3 and in step 4 select “Personal” instead of business and enter a high amount like 5000 in the balance and click create account.
You now have two sandbox accounts, one seller and one buyer.
Sandbox API credentials
After creating sandbox seller account, you will need the seller API credentials to plug it in the code and make API calls to PayPal servers.
Here are the steps to get the API credentials,
1.	Login to https://developer.paypal.com/
2.	Click on the “Dashboard” tab at the top
3.	Click on “Sandbox Accounts” on the left hand side
4.	Click on your seller account, under that click on “Profile”
5.	Under “Profile”, click on API credentials.

# Braintree Sandbox Account:
Braintree Sandbox Accounts can be created from this [link](https://www.braintreepayments.com/sandbox) here. As discussed all you will need is a valid email address to sign up for an account. Please share the sandbox account ID once you have created an account. The API Credentials for your account can be obtained as detailed in this [article](https://articles.braintreepayments.com/control-panel/important-gateway-credentials)