text:
# Flat win rate
Source: GauntletWinRate.hx
Can be considered either constructed or draft

| Win rate | Average gauntlets | Average packs won |Infinite rate|
|----------|-------------------|-------------------|-------------|
| 25%      | 6                 | 0                 |0%           |
| 40%      | 7                 | 1                 |0%           |
| 46%      | 9                 | 2                 |0%           |
| 50%      | 10                | 3                 |0%           |
| 60%      | 17                | 8                 |0%           |
| 62%      | 19                | 10                |0%           |
| 65%      | 23*               | 14*               |1%           |
| 70%      | 37*               | 28*               |5%           |
| 75%      | 61*               | 58*               |18%          |
| 80%      | 104*              | 119*              |46%          |
| 80.6%    | 109*              | 128*              |50%          |
| 85%      | 160*              | 234*              |78%          |
| 90%      | 234*              | 368*              |95%          |

Based on 100,000 iterations each

*Script triggered an infinite loop failsafe cutoff at least once, supressing the eventual value this could have been

# Skill percentile
Source: GauntletMMR.hx
Specifically models draft, takes matchmaking ramp into account

| Skill percentile | Average gauntlets | Average packs won | Flat winrate |
|------------------|-------------------|-------------------|--------------|
| 25th             | 5                 | 0                 |12%           |
| 4th              | 5                 | 0                 |33%           |
| 46th             | 6                 | 0                 |44%           |
| 50th             | 8                 | 1                 |52%           |
| 53rd             | 11                | 2                 |54%           |
| 55th             | 12                | 4                 |58%           |
| 57th             | 17                | 7                 |60%           |
| 60th             | 22                | 15                |65%           |
| 62nd             | 36                | 37                |70%           |
| 65th             | 44                | 52                |73%           |
| 70th*            | 196               | 353               |83%           |
| 75th*            | 447               | 804               |84%           |
| 80th*            | 711               | 1393              |92%           |
| 85th***          | 2319              | 4628              |94%           |

Based on 10,000 iterations each with the following parameters:
- 1000 players in match-making pool
- Standard deviation of 15 skill points
- Quadratic algorithm for match resolution (method "1")

This script doesn't have an infinite loop failsafe cutoff because I wanted to see how high the eventual values could get.

\*Based on 1,000 iterations because the script was taking super long at this high a skill percentile.
\*Based on 100 iterations because wow.

repository: larsiusprime/artifactscripts

repo_name: larsiusprime/artifactscripts


text:
---
date: 2015-04-05T19:35:03Z
categories: [xubuntu, linux]
summary: Have a laptop that refuses to wake up after falling asleep? Try this!
title: Inhibiting Sleep on Xubuntu 14.04
url: /2015/04/05/inhibiting-sleep-on-xubuntu-14-04/
---

My work laptop ships with proprietary encryption software that encrypts the disk drive (a self-encrypting drive) when turned off or in sleep mode. This works perfectly fine on Windows 7, but having rid my laptop of Windows in favour of Xubuntu, I soon realised that a day-to-day Linux desktop is for masochists.

When the computer is set to sleep mode, the disk drive locks and Xubuntu doesn't know how to unlock it when it wakes back up. Instead of the disk unlocking, I get a ton of ATA error messages about a missing disk, the laptop locks up and needs to be power cycled. To save me from myself, I removed the "Sleep" and "Hibernate" (can't remember if this was already disabled) options from the logout menu, but there was still a chance that I might close the lid and lose hours of work.

To disable the lid-close event from doing anything, you can make the following changes to `/etc/systemd/logind.conf`.

    HandleSuspendKey=ignore
    HandleHibernateKey=ignore
    HandleLidSwitch=ignore
    #Ignore ALL THE THINGS

This tip is courtesy StackOverflow user [John Törnblom](http://askubuntu.com/users/205327/john-t%C3%B6rnblom) and this answer for [Ubuntu 13.04](http://askubuntu.com/questions/362667/xubuntu-13-10-disabling-suspend-on-lid-being-closed).

Apart from the die-when-wake-up-from-sleep issue, I can highly recommend Xubuntu 14.04 as a daily desktop operating system for work. Heck, even PulseAudio does the right things with Bluetooth speakers & headsets and works as you'd expect.

license: MIT

repository: ritesh/blog-source

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: ritesh/blog-source


text:
# Mixin.ts
A typescript library which allows a class to extend multiple classes.

## Import
`import { mixin } from "mixin.ts"`

## Usage

```ts
let className = mixin([classToInheritFrom1, classToInheritFrom2,...])
```

*classes can be written as TypeScript classes or just functions*
```ts
// function
function Car () {}
Car.prototype.drive = (name: string) => {
    console.log(`This ${name} can drive very fast`);
}
Car.prototype.model = "Toyota";

// TypeScript class
class Lorry {
    carry(weight:number) {
        console.log(`This vehicle can carry ${weight} kg`);
    }
}

// Truck contains methods and properites from both Car and lorry
const Truck = mixin([Car,Lorry]);

Truck.drive("truck"); // This truck can drive very fast
Truck.carry(10); // This vehicle can carry 10 kg

console.log(Truck.model) // Toyota
```

By default, `mixin` returns an instance of the created class. To return the created class or function itself, pass `true` as the second argument to `mixin`.

```ts
const Truck = mixin([Car,Lorry],true);
const truck = new Truck();
truck.drive("new truck"); // This new truck can drive very fast
truck.carry(100); // This vehicle can carry 100 kg
```

## Install Choices
- `npm install mixin.ts`
- [download the zip](https://github.com/alfmoh/mixin.ts/archive/master.zip)
- [clone the repo](https://github.com/alfmoh/mixin.ts.git)

## License

(The MIT License)

[MIT License](https://alfmo.mit-license.org/)

gha_language: TypeScript


text:
#Google ReCAPTCHA ver.2 backend client

[![SensioLabsInsight](https://insight.sensiolabs.com/projects/cbc2c849-3910-4316-bac2-9977c4eda736/big.png)](https://insight.sensiolabs.com/projects/cbc2c849-3910-4316-bac2-9977c4eda736)
[![Latest Stable Version](https://poser.pugx.org/dario_swain/re-captcha-library/v/stable.svg)](https://packagist.org/packages/dario_swain/re-captcha-library)
[![Build Status](https://travis-ci.org/DarioSwain/ReCaptchaLibrary.svg?branch=master)](https://travis-ci.org/DarioSwain/ReCaptchaLibrary)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/DarioSwain/ReCaptchaLibrary/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/DarioSwain/ReCaptchaLibrary/?branch=master)
[![Code Coverage](https://scrutinizer-ci.com/g/DarioSwain/ReCaptchaLibrary/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/DarioSwain/ReCaptchaLibrary/?branch=master)
[![License](https://poser.pugx.org/dario_swain/re-captcha-library/license.svg)](https://packagist.org/packages/dario_swain/re-captcha-library)

You can find full documentation about Google reCAPTCHA API v2 [here](http://developers.google.com/recaptcha/intro).

##Installation

You can install this package with [Composer](http://getcomposer.org/).
Add lines below in your composer.json file:

``` json
{
    "require": {
        "dario_swain/re-captcha-library": "2.0.*"
    }
}
```

or you can use ```composer require``` like here:

``` bash
composer require dario_swain/re-captcha-library 2.0.*
```

##Usage Example

####Displaying the widget:

```html
<html>
    <head>
        <script src='https://www.google.com/recaptcha/api.js'></script>
    </head>
    <body>
        <form method="post">
            <div class="g-recaptcha" data-sitekey="{RECAPTCHA SITE KEY}"></div>
            <br>
            <input type="submit" name="submit" value="Submit">
        </form>
    </body>
</html>
```

More about client integration you can find in [official docs](https://developers.google.com/recaptcha/docs/display).

####Verifying the user's response:

``` php
<?php

    $privateKey = 'RECAPTCHA PRIVATE KEY'; //You Google API private key
    $clientIp = $_SERVER['REMOTE_ADDR']; //Client IP Address
    $gReCaptchaResponse = $_POST['g-recaptcha-response']; //Google reCAPTCHA response

    $reCaptchaClient = new Client($privateKey);

    try {
        $success = $reCaptchaClient->validate($gReCaptchaResponse, $clientIp);

        if ($success) {
            //Submit form
        }

    } catch(ValidationException $e) {
        $validationError = $e->getMessage();
    }

```

**Simple work example you can find in ```examples/index.php```.**

##Custom Client

You can change reCaptcha standard HTTP client to custom client implementation. In this case you can use
```DS\Library\ReCaptcha\Http\Client\ClientInterface``` object. Also you can use any PSR7 comparability HTTP client like

``` php
<?php
    class ProxyClient implements ClientInterface
    {
        {@inheritdoc}
        public function send(RequestInterface $request);
        {
            //Your business logic
        }
    }

    ...

    $proxyHttpClient = new ProxyClient();
    $reCaptchaClient = new Client($privateKey, $proxyHttpClient);

	$reCaptchaClient->validate($gReCaptchaResponse, $clientIp);

```

##Guzzle integration

Instead of standard HTTP client you can use more advanced HTTP client like [Guzzle](https://github.com/guzzle/guzzle).
Now ReCaptchaLibrary support ```3.*```, ```4.*```, ```5.*``` and ```6.*``` versions of ```guzzlehttp/guzzle```

Guzzle client example:

```php

    use DS\Library\ReCaptcha\Http\Client\Guzzle\GuzzleClient;

    $reCaptchaGuzzleClient = new GuzzleClient(); //Guzzle client will be detected automatically

    //Also you can manually create and initialize Guzzle Client
    $guzzle = new \GuzzleHttp\Client($configuration);
    $reCaptchaGuzzleClient = new GuzzleClient($guzzle);

    $reCaptchaClient = new Client('PRIVATE KEY', $reCaptchaGuzzleClient);
    $reCaptchaClient->validate($gResponse);
```

#Copyright

Copyright (c) 2015 Ilya Pokamestov<EMAIL_ADDRESS>

repository: CodeLingoBot/ReCaptchaLibrary

repo_name: CodeLingoBot/ReCaptchaLibrary


text:
### What is otclient?

Otclient is an alternative Tibia client for usage with otserv. It aims to be complete and flexible,
for that it uses LUA scripting for all game interface functionality and configurations files with a syntax
similar to CSS for the client interface design. Otclient works with a modular system, this means
that each functionality is a separated module, giving the possibility to users modify and customize
anything easily. Users can also create new mods and extend game interface for their own purposes.
Otclient is written in C++11 and heavily scripted in lua.

For a server to connect to, you can build your own with the [forgottenserver](https://github.com/otland/forgottenserver)
or connect to one listed on [otservlist](https://otservlist.org/).

repository: ricardofagodoy/adventurer

repo_name: ricardofagodoy/adventurer


text:
waterwall
=========

iptables firewall and traffic shaper framework

What is this?
-------------
I've been hand-writing iptables scripts in .sh files for years. Been fun, indeed!

No plans to try other solutions claiming  to "make iptables easy", though.

iptables are easy once you've learnt them (take a few months to learn, years to forget).
Anything else I have to learn and spend extra time on makes it hard.

I know it is the same for others, and that's why we are here.

So I made this framework to organise a bit better my iptables scripts, using as standard iptables language as possible.

Who is this for?
----------------
Sysadmins, iptables fans, people who'd like to have a more structured approach in their firewall scripts.

Features
--------
The idea is to write fairly well performing firewall scripts, reduce redundancy in rules and tests against packets.

We achieve this first by making a decisional tree that is easy to follow for both the writer and reader.

It`s a framework, so there is a little bit of abstraction, as in any framework. Possibly a bit less than the average, here.

The way we try to achieve the above is by calling the chains with the highest traffic first.

For instance, if your host processes 80% UDP traffic, we create a UDP chain and process that before any SCTP chain.

If your UDP traffic is then broken down into 50% SIP, create a SIP chain and call it first, followed by other less-likely chains.

Planned Features
----------------
* nftables support
* A pre-determined decisional tree is a bit too much of a static configuration, isn't it?
If the project proves popular, a second stage would be a self-balancing feature that checks the actual statistics (iptables -s) and moves the chains across.
* Adding specific filters. There are a few in modules/ folder. It should be easy to add other ones.
* Adding traffic shaping and QoS filters. (have base code, needs converting and reorganising)
* Port knocking chains to help creating hidden services easily (have the code already, just need to port here)

Status
------
Initial, but working.

Warnings
--------
I'm a JavaScript native speaker, and I had considered writing it with Node.js (Ok, ok, I hear you yelling, so I refrained and just used BASH).

So I had to learn BASH tricks like UPVAR, etc to make this work. If you find them awful blame me, or please advise in better solutions.

Usage
-----
git clone ...

cd waterwall

(configure your chains, see below)

sudo waterwall.sh

Configuration
-----
Edit your config/default.sh file and set appropriate values. Comments should explain. If they don't, I've made a poor job :)

Add your own chains into modules/your\_module.sh

How it works
------------
waterwall.sh sets up the root chains for mangle, nat, filter/prerouting, input, output, postrouting, etc.

Each of those are BASH functions which attempt to mimic the actual iptables execution flow. They call other functions for subchains.

Each function sets up the actual chain just as if it was running it.

```
# set up the INPUT chain for the filter table
filter_input() {
	# initialisation
	log ${FUNCNAME}
	module_init ${FUNCNAME} $* || return
	local TABLE=filter
	local CHAIN=INPUT

	# set up sub-chains. The business logic goes here
	filter_input_internet
	filter_input_lan
	filter_input_vpn
	filter_input_wifi
}
```
And the following is a subchain, calling other subchains. The ones with the highest expected traffic are called first, to minimise test conditions

```
filter_input_internet() {
	log ${FUNCNAME}
	module_init ${FUNCNAME} $* || return
	local INTERFACE=$IF_INTERNET

	iptables46 -t $TABLE -A $PARENTCHAIN -i $INTERFACE -j $CHAIN

	## INCLUDES
	filter_input_internet_icmp
	filter_input_internet_tcp
	filter_input_internet_udp
	filter_input_internet_other
	## END INCLUDES

	iptables46 -t $TABLE -P INPUT DROP
}
```

Your filter for the TCP inbound traffic coming from your upstream connection (internet) may look like this:

```
filter_input_internet_tcp() {
	log ${FUNCNAME}
	module_init ${FUNCNAME} $* || return
	local PROTOCOL=tcp

	iptables46 -t $TABLE -A $PARENTCHAIN -p $PROTOCOL -j $CHAIN

	# business logic: call the http chain first, then the voip chain
	http_filter
	voip_filter
	# etc...
}
```

repository: Skaumo/waterwall

repo_name: Skaumo/waterwall


text:
[![Build Status](https://travis-ci.org/johnpryan/tavern.svg?branch=master)](https://travis-ci.org/johnpryan/tavern)

A static site generator for blogs, written in Dart.

## Features

- [x] Markdown and Mustache templating
- [x] Support for tags and a tag index page.
- [x] Compatibility with dart2js
- [x] Compatibility with other Dart transformers (e.g. Polymer, SASS)
- [x] Support for including a tag list in any page
- [ ] Base URL configuration (similar to [how it works in Jekyll][1])
- [ ] Site, post, and template generation tool
- [ ] Support for configuring post metadata in a separate YAML file
- [x] Support for sitemap.xml and rss/atom
- [ ] Support for multiple languages
- [ ] Support for archived posts

## Examples

See the [examples](/example) folder.

## Getting Started

Start with a normal dart project with the following structure:

    web/
      index.md
      templates/
        index.html
    pubspec.yaml

and in your pubspec:

    name: my_awesome_blog
    dependencies:
      browser: any
      tavern: any
    transformers:
    - tavern

In `index.md`, add some metadata and markdown:

    ---
    title: Hello World!
    category: Random
    tags: ['code', 'dart']
    template: index
    ---

    foo

the `templates/index.html` will be associated your page.  Templates use Mustache
bindings and can use any metadata specified in the markdown file.  For example:

```
<html>
<head>
    <link rel="stylesheet" href="/style.css">
</head>
<body>
<div class="content">
    <h1>{{title}}</h1>
    <div id="content">
        {{{content}}}
    </div>
</div>
</body>
</html>
```

## Running and Building

Tavern uses Pub; simply use `pub serve` and `pub build` to test and deploy your
blog.

## Tags

Tavern supports tagging articles and viewing articles associated with that tag:

For an index of tags, add a `tag_index.html` template and use the `tags`
metadata in your template:

        {{#tags}}

{{name}}

        {{/tags}}

For "tag pages" (To list all pages associated with a tag) add a `tag_page.html`
template and use the `posts` metadata:

        {{#posts}}

{{name}}

        {{/posts}}

## Other Transformers (e.g. Polymer)

Tavern leverages Dart's asset transformer, and can be used with other transformers.
It is recommended that other transformers be run *after* Tavern:

```
transformers:
- tavern
- polymer:
    entry_points:
      - web/index.html
```

## Relative Paths / baseurl
Tavern desn't *yet* have support for configuring and updating the base url.  For
now it is recommended to use relative and absolute paths:

```
<a href="/tags/index.html"</a>
<a href="../../styles.css"</a>
```

Any templates that should assume they are at their final position when
referencing CSS, Dart, JS. For example, `web/templates/index.html` should assume
it has been already moved to the location of the markdown file using it (e.g.
`web/index.md`)

[1]: https://byparker.com/blog/2014/clearing-up-confusion-around-baseurl/


text:
---
layout: post
title:  "Come to Our Intro Meeting!"
date:   2020-08-23 22:34:20
categories: Events
---

Please come to our introduction meeting on **Tuesday, September 8th at 3 pm**. We will discuss details on how the club will be run virtually this year, including competitions, lunch contests, and weekly meetings.

Attend through Zoom at [irvingtonmath.club/intromeeting2020](http://irvingtonmath.club/intromeeting2020).

We hope to see you there!

gha_language: HTML

gha_license_id: MIT


text:
# Welsh Resources

In this directory are all of the Welsh language resources used to either evaluate a semantic tagger or resources used by the semantic tagger.

## Evaluation Resources

### Original Gold Standard Dataset

The gold standard dataset was released within the following [GitHub repository](https://github.com/CorCenCC/welsh_pos_sem_tagger), with the paper [Leveraging Pre-Trained Embeddings for Welsh Taggers](https://aclanthology.org/W19-4332.pdf), this original Gold standard dataset can be found in [./original_gold_standard_data.txt](./original_gold_standard_data.txt). The Part Of Speech (POS) tags that are used within the Gold Standard dataset are from the [CorCenCC basic POS tagset (see table 1)](https://aclanthology.org/L18-1623.pdf).

#### Format and statistics

The dataset is 611 sentences and contains 14,876 tokens. Each sentence is on one line, each token is separated by a whitespace, each token contains the `token`, `POS tag`, and `USAS tag` separated by a `|`. Below we show the first sentence of the dataset:

```txt
A|Rha|Z5 fydd|B|A3+ rhywfaint|E|N5/N5.1- o|Ar|Z5 'r|YFB|Z5 arian|E|I1 hwn|Rha|A3+ yn|U|Z5 cael|B|A9 ei|Rha|Z8 ddefnyddio|B|A1.5.1 i|Ar|Z5 sicrhau|B|A7+ bod|B|A3+ modd|E|X4.2 defnyddio|B|A1.5.1 tocynnau|E|Q1.2 rhatach|Ans|I1.3- yn|Ar|Z5 Lloegr|E|Z2 yn|Ar|Z5 ogystal|Ans|Z99 ag|Ar|Z5 yng|Ar|Z5 Nghymru|E|Z2 ?|Atd|PUNCT
```

#### Differences to the original gold standard dataset

The original gold standard dataset that is within the following [GitHub repository](https://github.com/CorCenCC/welsh_pos_sem_tagger), is slightly different to the one in this repository. The differences are the following, of which these changes were done as we believe these to be POS tag errors that came about when mapping CorCenCC POS tagset to the [core POS tagset that is used by the USAS multilingual lexicon](https://aclanthology.org/N15-1137.pdf). The core POS tagset is best shown in [table 5 of the paper Towards A Welsh Semantic Annotation System](https://aclanthology.org/L18-1158.pdf)

1. The POS tag `pron.demd` was changed to `Rha`
2. The POS tag `pron.demg` was changed to `Rha`
3. The POS tag `pron.demb` was changed to `Rha`
4. The POS tag `unk` was changed to `Gw`

### Enhanced Gold Standard Dataset

The enhanced gold standard dataset, [./enhanced_gold_standard_data.txt](./enhanced_gold_standard_data.txt), contains additional data for each token. Instead of just having the `token`, `POS tag`, and `USAS tag` separated by a `|`. It now contains the following:

1. `token` - same as before
2. `lemma` - lemma that has come from the [CyTag tagger](https://github.com/CorCenCC/CyTag).
3. `core POS tag` - The core POS tag that is used by the USAS multilingual lexicon, this is found through the mapping of basic CorCenCC POS tags to core USAS POS tags, see the [Mapper of basic CorCenCC POS tags to core USAS POS tags section below for more details.](#mapper-of-basic-corcencc-pos-tags-to-core-usas-pos-tags)
4. `basic POS tag` - same as before, but was called the `POS tag`
5. `enriched POS tag` - this has come from running the [CyTag tagger](https://github.com/CorCenCC/CyTag). As this tag has been predicted it may be different to the `basic POS tag`, as the basic tag is gold standard.
6. `USAS tag` - same as before

To re-create this dataset run the following:

``` bash
python convert_welsh_gold_to_text.py # This creates a file called txt_gold_standard_data.txt which contains just the tokenised text.
mkdir -p ./output
sudo chmod -R 777 ./output
docker run --rm -v $(pwd)/txt_gold_standard_data.txt:/tmp/text_file.txt -v $(pwd)/output:/usr/nobody/CyTag-1.0/outputs ghcr.io/ucrel/cytag:1.0.4 -f xml -n example -i /tmp/text_file.txt # Runs the CyTag tagger on the txt_gold_standard_data.txt file.
# Extract XML output from running the CyTag tagger
sudo chown $(id -u):$(id -g) ./output/example/example.xml
sudo mv ./output/example/example.xml ./cytag_output.xml
sudo rm -rf ./output
python create_enhanced_dataset.py
rm txt_gold_standard_data.txt
rm cytag_output.xml
```

### Mapper of basic CorCenCC POS tags to core USAS POS tags

To map between the basic CorCenCC POS tags to the core USAS POS tags we have created a JSON file that contains these mappings, [./basic_cy_tags_to_core_tags.json](./resources/basic_cy_tags_to_core_tags.json). This mapping is based off table A.1 in [Leveraging Pre-Trained Embeddings for Welsh Taggers](https://aclanthology.org/W19-4332.pdf).

Another way of mapping from the CorCenCC POS tags to the core USAS POS tags would be through the rich/enriched tagset rather than the basic. This was not done as the basic POS tags in the Gold dataset are hand annotated, whereas the rich POS tags would be predicted. However for the interested reader the rich to USAS core POS tags mapper can be found in [table 6 of the paper Towards A Welsh Semantic Annotation System](https://aclanthology.org/L18-1158.pdf).

## Semantic Tagger Resources

The only resource that is used by the Semantic tagger is the single word semantic lexicon, which is within the [./semantic_lexicon_cy.usas.txt](./semantic_lexicon_cy.usas.txt). This lexicon is formatted in TSV format like so:

|lemma/word | POS label |  Semantic Labels/USAS labels  |
|-----------|-----------|-------------------------------|
|apig	    |      noun	|          M6 N2 X9.2+          |

Whereby you can find the semantic labels of a lexeme (lemma, pos label) by looking up that lexeme in the lexicon. The lexeme may result in more than one semantic label as shown above, the most likely semantic label is the first label in the space separated list of labels, in the case above this would be `M6`, for more information on the [USAS tagset see the section in the main README.](../../README.md#usas-tagset)

In the [single word semantic lexicon for Welsh](https://github.com/UCREL/Multilingual-USAS/blob/master/Welsh/semantic_lexicon_cy.usas), some of the lemmas are not lower cased, of which all of these are a type of noun. Some of these names are multi word expression but with a `_` to combine the two words together, in total across all POS tags there are 94 of these, a good example is for the word `Friday` which in the lexicon is `dydd_Gwener`.

repository: UCREL/pymusas

branch_name: refs/heads/main

gha_language: Python

repo_name: UCREL/pymusas


text:
# 2-Cars
This is a game I made in python using pygame. It is very similar to the android game 2 Cars.

![](gameplay.gif)

## How To Play
Press Space to start the game.
Use the left arrow key to toggle the left car between lanes 1 and 2.
Use the right arrow key to toggle the right car betwen lanes 3 and 4.

## Rules
Avoid all the squares and take all the circles in all the lanes using both the cars as the speed progressively increases.
Score is equal to the number of circles you take.


text:
## Example Kubernetes YAML files based on deployment modes

You can deploy CloudWatch Agent into Kubernetes Cluster for some various functionality: StatsD, CloudWatch EMF, AWS SDK Metrics, etc.

For each of these features, you can deploy the CloudWatch Agent in one or more of the following deployment modes:
* Sidecar - CloudWatch Agent works at the Pod level. Reasons for choosing this mode include but are not restricted to:
  * You expect a dedicated CloudWatch Agent for your Pod.
* Daemonset - CloudWatch Agent works at the Node level. Reasons for choosing this mode include but are not restricted to:
  * You expect CloudWatch Agent to serve for all Pods within a Node.
  * You expect CloudWatch Agent to collect metrics for each Node.
  * You expect CloudWatch Agent to be scaled according to the number of Node automatically.
* Service - CloudWatch Agent works at the Cluster level. Reasons for choosing this mode include but are not restricted to:
  * You expect CloudWatch Agent to serve for all Pods within a Cluster.
  * You expect an centralized endpoint within a cluster for your application to access.
  * You expect an application outside the cluster to be able to access to CloudWatch Agent.

You can choose the mode that is most suitable for you.

This folder contains example Kubernetes YAML files for various functionality based on deployment modes.

The following subfolders contain example Amazon ECS task definition files based on the deployment modes:

* [sidecar](sidecar)
* [service](service)
* [daemonset](daemonset)

gha_language: Shell


text:
---
title: polish your resume
currentMenu: assignments
---

For this assignment, you are required to create a final draft of your resume and submit it in Canvas. A LaunchCode coach will then look over your resume and provide feedback. If we feel it's necessary, we will invite you to a personal coaching session to provide additional advice.

## Creating a Final Resume Guidelines

Use your rough draft as a starting point. Remember to create the 5 sections as outlined in the workshop.
1. Header
2. Technical Skills
3. Projects
4. Education
5. Work Experience

Formatting Guidelines: Stick with no less than 11pt font for the body, no more than 14pt for section headers, no less than .5" top/bottom margins, no less than .65" left/right margins, avoid using columns - keep it linear and reading left to right.

Submit your resume in Word or Google Docs format so we can make suggestions easily within the document.

## Verify your Social Presence

Triple check that all links and accounts are in working order. Make sure your LinkedIn matches your resume (we will be doing a deeper dive into LinkedIn in another workshop as well). Clean up your GitHub and start working on those README files for your projects.

repository: LaunchCodeEducation/liftoff-all-in

repo_name: LaunchCodeEducation/liftoff-all-in


text:
# BLS

Meros uses BLS12-381, with G1 for Signatures and G2 for Public Keys, along with ZCash's serialization standard (which Ethereum has adopted for Eth 2.0). Signatures and Public Keys are always compressed and therefore 48 and 96 bytes, respectively.

### Hash To G1

Messages are converted to a hash via using SHAKE256 to produce a 48-byte value. Then, the hash is converted to a G1 via [Milagro's map function](https://github.com/apache/incubator-milagro-crypto-c/blob/develop/src/ecp.c.in#L365).

repository: bitcoinsfacil/Meros

gha_license_id: NOASSERTION

repo_name: bitcoinsfacil/Meros


text:
---
title: "Getting Started - Developing with Java and Respoke"
shortTitle: "Getting Started"
date: 2014-10-15
template: article.jade
showInMenu: "true"
menuOrder: 10
meta:
    keywords: "respoke, Java, webrtc"
    description: "Guide on how to get started developing with Java and Respoke."
---

### Java Library
# Getting Started

## Overview

The Respoke Java library provides a convenient way for Node developers to interface with Respoke for
non-browser-to-browser communication tasks. Good examples of non-browser-to-browser communication tasks include
authentication.

## Install Respoke Java

Install Respoke as a local application dependency using [Maven](http://search.maven.org/#search%7Cga%7C1%7Crespoke):

    <dependency>
        <groupId>com.digium.respoke</groupId>
        <artifactId>respoke-java</artifactId>
        <version>1.0.0</version>
    </dependency>

Install Respoke's Java Library to your project using [Gradle](https://gradle.org/).

    dependencies {
    	compile "com.digium.respoke:respoke-java:1.0.0"
    }

## Create Respoke

Finally, create an instance of Respoke:

    import com.digium.respoke.*;

    Respoke client = new Respoke();

That's it! Now we're ready to start using all this Respoke server library has to offer.

repository: respoke/docs

gha_language: JavaScript

repo_name: respoke/docs


text:
`nsq-reception-acker`
=====================
**Status**: Alpha. Not used in production.

Similar to [`nsq_to_nsq`](http://nsq.io/components/utilities.html#nsq_to_nsq),
but also published an acknowledgement to a topic that a message has been
received.

Usecase
-------
Imagine you have an elastic environment where NSQ message loss isn't
acceptable. NSQ doesn't come with any message replication so you need to build
around that yourself.

One way to replicate messages is to have the publisher connect to two different
`nsqd`s and publish each message to both of them. There are two problems with
this approach: 1) It doesn't use the NSQ best-practise of always publishing to
`localhost` `nsqd` and 2) it requires hardcoding addresses to `nsqd`s in the
publisher which means we are not using `nsqlookupd` for discovery.

Instead, the approach that `nsq-reception-acker` takes is that messages are
published once to a topic on `localhost` and `nsq-reception-acker`, running on
a separate VM than the publisher, is consuming messages from that topic. For
each message it consumes, it deserializes its envelope (see below) and 1)
forwards the actual payload (`payload`) to `payload-destination` and 2) also
triggers an acknowledgement message (`message-id`) being sent to a separate
topic (`acknowledgement-topic`). Finally, the initial publisher is subscribed
to `acknowledgement-topic` and to make sure that `N` numbers of
`nsq-reception-acker` have received a copy of the original message.

Envelope Message Format
-----------------------
Each message sent to `nsq-reception-acker` must be JSON formatted and contain
the following fields:

 * **`payload-destination`**: The topic to which the `payload` string should be
   sent to.
 * **`payload`**: The message body to be sent to `payload-destination`.
 * **`acknowledgement-topic`**: The topic to which the acknowledgement should be
   sent.
 * **`message-id`**: The message body that should be sent to the
   `acknowledgement-topic`.

repository: JensRantil/nsq-reception-acker

repo_name: JensRantil/nsq-reception-acker


text:
---
title: Install
subtitle: All the dependencies
children:
    - ./linux
    - ./windows
    - ./macos
    - ./android
    - ./ios
    - ./wasm
---

Gio is designed to work with very few dependencies. It depends only on the
platform libraries for window management, input and GPU drawing.

Currently Gio targets the latest released version of [Go](https://golang.org/dl)
in module mode. Earlier versions of Go and `GOPATH` mode might work, but no
effort is made to keep them working.

For desktop builds using `go` tool works directly. For mobile and some
additional desktop feature support, Gio uses a separate tool `gogio`.

To install the latest version of the tool use:

``` sh
go install gioui.org/cmd/gogio@latest
```

For the platforms some additional dependencies may be necessary.

    Linux
    Windows
    macOS
    Android
    iOS / tvOS
    WebAssembly

## App Icon

The `gogio` tool will use the `appicon.png` file in your main package directory,
if present, as the app icon.

## Cross Compilation

Gio can be cross-complied for platforms other than the current OS, but this requires an appropriate cross-compiler for any native code integrations. Cross-compilation is most easily achieved from Linux, and the Linux instructions can be followed within a container or VM from other platforms.

### From Linux

- `macOS`: a cross-compiler like [osxcross](https://github.com/tpoechtrager/osxcross) as well as the macOS SDK (see link for instructions).
- `Windows`: no special compiler is needed, as we don't use CGo for Windows support.

license: MIT,Unlicense

repository: gioui/giouiorg

detected_licenses: MIT Unlicense

gha_language: Go

repo_name: gioui/giouiorg


text:
DEEP Open Catalogue: Object Detection and Classification
==============================

[![Build Status](https://jenkins.indigo-datacloud.eu/buildStatus/icon?job=Pipeline-as-code/DEEP-OC-org/obj_detect_pytorch/master)](https://jenkins.indigo-datacloud.eu/job/Pipeline-as-code/job/DEEP-OC-org/job/obj_detect_pytorch/job/master)

**Author:** Silke Donayre Holtz

**Project:** This work is part of the [DEEP Hybrid-DataCloud](https://deep-hybrid-datacloud.eu/) project that has received funding from the European Union’s Horizon 2020 research and innovation programme under grant agreement No 777435.

This is a plug-and-play tool for object detection and classification using deep neural networks (Faster R-CNN ResNet-50 FPN Architecture) that were already pre-trained on the [COCO Dataset](http://cocodataset.org/#home). The code uses the Pytorch Library, more information about it can be found at [Pytorch-Object-Detection](https://pytorch.org/docs/stable/torchvision/models.html#object-detection-instance-segmentation-and-person-keypoint-detection).

This module works on uploaded pictures and gives as ouput the rectangle coordinates (x1,y1) and (x2,y2) were the classificated object is located with its respective probability.

For training, transferred learning is used. Transferred learning focuses on storing knowledge gained while solving one problem and applying it to a different but related problem. To achieve it, the output layer of the pre-trained model is removed and a new one with the new number of outputs is added. Only that new layer will be trained. An example of it is provided an implemented in this module.

The model requires a new dataset with the classes that are going to be classified and detected. In this case the [Penn-Fudan Database for Pedestrian Detection and Segmentation](https://www.cis.upenn.edu/~jshi/ped_html/) was used to detect pedestrians.

To try this in the module, the two dataset folders (Images and masks) must be placed in the `obj_detect_pytorch/dataset/` folder. More information about the code and the structuring of the custom dataset can be found at [Torchvision Object Detection Finetuning](https://pytorch.org/tutorials/intermediate/torchvision_tutorial.html).

Project Organization
------------

    ├── LICENSE
    ├── README.md              <- The top-level README for developers using this project.
    ├── data
    │   └── raw                <- The original, immutable data dump.
    │
    ├── docs                   <- A default Sphinx project; see sphinx-doc.org for details
    │
    ├── models                 <- Trained and serialized models, model predictions, or model summaries
    │
    ├── notebooks              <- Jupyter notebooks. Naming convention is a number (for ordering),
    │                             the creator's initials (if many user development),
    │                             and a short `_` delimited description, e.g.
    │                             `1.0-jqp-initial_data_exploration.ipynb`.
    │
    ├── references             <- Data dictionaries, manuals, and all other explanatory materials.
    │
    ├── reports                <- Generated analysis as HTML, PDF, LaTeX, etc.
    │   └── figures            <- Generated graphics and figures to be used in reporting
    │
    ├── requirements.txt       <- The requirements file for reproducing the analysis environment, e.g.
    │                             generated with `pip freeze > requirements.txt`
    ├── test-requirements.txt  <- The requirements file for the test environment
    │
    ├── setup.py               <- makes project pip installable (pip install -e .) so obj_detect_pytorch can be imported
    ├── obj_detect_pytorch    <- Source code for use in this project.
    │   ├── __init__.py        <- Makes obj_detect_pytorch a Python module
    │   │
    │   ├── dataset            <- Scripts to download or generate data
    │   │   └── make_dataset.py
    │   │
    │   ├── features           <- Scripts to turn raw data into features for modeling
    │   │   └── build_features.py
    │   │
    │   ├── models             <- Scripts to train models and then use trained models to make
    │   │   │                     predictions
    │   │   └── deepaas_api.py
    │   │
    │   └── tests              <- Scripts to perfrom code testing + pylint script
    │   │
    │   └── visualization      <- Scripts to create exploratory and results oriented visualizations
    │       └── visualize.py
    │
    └── tox.ini                <- tox file with settings for running tox; see tox.testrun.org

--------

 **Requirements:**

- This project has been tested in Ubuntu 18.04 with Python 3.6.5. Further package requirements are described in the `requirements.txt` file.
- It is a requirement to have [Pytorch>=1.3.0 installed](https://pytorch.org/get-started/locally/).

Project based on the cookiecutter data science project template. #cookiecutterdatascience

## Workflow

### Test

You can test the posenet module on a number of tasks: predict a single local image file (or url) or predict multiple images (or urls).

#### Running the API

To access this package's complete functionality (both for training and predicting) through an API you have to install the [DEEPaaS](https://github.com/indigo-dc/DEEPaaS) package:

```bash
git clone https://github.com/indigo-dc/deepaas
cd deepaas
pip install -e .
```

and run `deepaas-run --listen-ip <IP_ADDRESS>`.
From there you will be able to run training and predictions of this package  using `model_name=posenetclas`.


text:
# final

> A Vue.js project

## Build Setup

``` bash
# install dependencies
npm install

# serve with hot reload at localhost:8080
npm run dev

# build for production with minification
npm run build

# build for production and view the bundle analyzer report
npm run build --report
```

For a detailed explanation on how things work, check out the [guide](http://vuejs-templates.github.io/webpack/) and [docs for vue-loader](http://vuejs.github.io/vue-loader).

Our plan for our application was to create a tool that could be used to hold datasets pertaining to politics and also to run basic graphs to try and find visual patterns among the data entries. We wanted it to be a tool that users can use to get more familiar with the political sphere. At the moment, users can use google location to find the members of congress within a given state or their current state. They can then add specific members to their favorites to keep track of them. Another introductory feature that we have open to all users of the app is a basic analysis of the political ideologies of the members of congress. Then, users and admins are able to upload their own dataset to and are able to plot different variables from their dataset to try and see if any variables are correlated.

Zuzu Tang zt26, Harry Wang hyw2

Date started: 4/14/18

Date completed: 4/30/18

Hours spent: 55

Students discussed assignment with: None

Commit at: 10:46 am was to change a two lines where a variable was written as "accesss" instead of "access".

Resources:
*https://www.w3schools.com/html/html5_geolocation.asp
*https://vuejs.org/v2/guide/class-and-style.html
*https://developers.google.com/maps/documentation/geocoding/intro#ReverseGeocoding
*https://vuejs.org/v2/guide/conditional.html
*https://www.npmjs.com/package/vue-tweet-embed
*https://plot.ly/feed/

Assets (code, images, or sounds): None used

Bugs: None

Extra credit: N/A

Total technologies used: d3.js, Google Maps API, Node, Vue, Twitter API, vis.js, Plotly

Built-in datasets used from:
*https://www.govtrack.us/
*https://www.kaggle.com/mrpantherson/isp-contributions-to-congress-1

Frameworks used:
Vue was definitely a framework we wanted to use especially as it was the most familiar one and would help us develop an application efficiently.
We used a combination of different libraries for data visualization and graphing because we both used different libraries when doing our explore projects and became familiar with our separate libraries. We tried our best to overlap where we could. The remaining packages that we used were because they had extensive documentation and were more maintained regularly: i.e. Google Maps API.

gha_language: Vue


text:
# v0.2.0

* Add nfs_export LWRP, thanks Michael Ivey from Riot Games for the contribution
* Update README documentation, and add CHANGELOG

# v0.1.0

* Re-factor NFS cookbook
* Add edge cases for RHEL6, thanks Bryan Berry for reporting and testing
* Filter-branched into cookbook-nfs repo

# v0.0.6

* Add NFS export support
* Update documentation
* First community site release

## v0.0.4

* Initial version with RHEL/CentOS/Debian/Ubuntu support
* Thanks to Glenn Pratt for testing on Debian family distros

repository: cayblood/cookbook-nfs

repo_name: cayblood/cookbook-nfs


text:
# golang-bbs
Yet another old-school BBS written by Golang

## Settings
golang-bbs reads following envvars
* GOLANG_BBS_WORKDIR
* GOLANG_BBS_TMPLDIR
* PORT

### GOLANG_BBS_WORKDIR
A working directory which golang-bbs stores data files.
If not set, automatically set to cwd.

### GOLANG_BBS_TMPLDIR
A directory which contain 'template' dir. Please note that this is NOT template directory it self, but its parent directory.
If not set, automatically set to cwd.

### PORT
A port number which golang-bbs will listen to.
If not set, automatically set to 8080.

repository: yyatsuo/golang-bbs

repo_name: yyatsuo/golang-bbs


text:
## Running Julia online: JuliaBox
The easiest way to start using Julia is via the online [JuliaBox](http://www.juliabox.com) service.
This provides an online version of the [Jupyter notebook](http://www.jupyter.org), which we will be using throughout. Use `Shift-Enter` to execute a cell.

An alternative is [CoCalc](http://www.cocalc.com), which allows simultaneous editing of notebooks by several people.

## Installing Julia and Jupyter locally
To install Julia and Jupyter locally on your own machine, do the following.

[Note that it is *not* necessary to install Anaconda separately; Julia will do this automatically for you.]

1. Download and install the stable version of Julia (0.6.2) from [here](http://www.julialang.org/downloads) for your operating system.

    [If possible, please also download and install a "nightly build" from [here](https://julialang.org/downloads/nightlies.html), since we will be looking at some differences between the current stable version, 0.6.2, and the soon-to-be-released 1.0 version.]

2. Run the copy of Julia that you just installed.

    Execute the following commands within the Julia terminal ("REPL") environment, where you will see a `julia> ` prompt.

3. If you use Linux, first type:
```jl
julia> ENV["JUPYTER"] = ""
```

4. Now install the IJulia package, which will automatically install Jupyter (using `miniconda`):
```
julia> Pkg.add("IJulia")
```

5. Open the notebook as follows.
```jl
julia> using IJulia
julia> notebook()
```
By default, new notebooks will be created in your home directory. Navigate to a different directory to save them in your preferred location.

6. Install some of the packages that we will use during the course (you will need an internet connection)
```jl
julia> packages = split(
    """Plots GR PlotlyJS Interact
    BenchmarkTools
    DataFrames Query
    JLD2 Distributions StatPlots
    Optim JuMP
    ProfileView
    TreeView StaticArrays Revise
    DifferentialEquations
    MappedArrays
    Documenter PkgDev
    ForwardDiff
    """)

julia> for package in packages
    Pkg.add(package)
end
```
## Get up to speed with basic Julia syntax

If you have had little exposure to Julia, please work through [this video tutorial](https://youtu.be/4igzy3bGVkQ) to get up to speed with basic Julia syntax, in particular the notebooks 1 through 8 (up to and including "Plotting"). The notebooks are available directly in JuliaBox, or [here](https://github.com/JuliaComputing/JuliaBoxTutorials/tree/master/intro-to-julia).

We suggest that you bookmark, download or even print out the following two "cheat sheets" with summaries of basic Julia syntax:
- a [one-page summary by Steven Johnson](https://github.com/stevengj/1806/blob/master/julia/Julia-cheatsheet.pdf)

- a [more extensive summary](https://juliadocs.github.io/Julia-Cheat-Sheet)

There is an ever-growing list of resources for learning Julia available on the [learning page](http://www.julialang.org/learning) of the Julia homepage; in particular, check out the [QuantEcon lectures](https://lectures.quantecon.org/jl).

## Julia IDE: Juno

There are two IDEs (Integrated Development Environments) available for Julia: Juno, based on the [Atom editor](https://atom.io/), and a Julia plug-in for the Visual Studio Code editor.

Please download Atom and install the `uber-juno` package; this will give you a Julia development environment. More info is available at the [Juno IDE homepage](http://junolab.org/).

## Questions and comments
Please contact<EMAIL_ADDRESS>if you have any further questions and comments


text:
---
layout: post
title: "Nothin But ReSharper - Remote (June 28th, 2010)"
comments: true
date: 2010-06-04 09:00
categories:
- training
---
This is an announcement of a brand new 1 day remote course. One of many "micro" courses that are about the be published and added to the Nothin But * line of courses.
 Overview
Nothin But ReSharper is a one day deep dive into the R# visual studio plugin, that can accelerate you development in ways that you are probably unaware of if you have not seen it in action. In this session you will learn how to take advantage of R# to enable you to accomplish the following taks inside the ide much faster:

 Micro Code Generation

 Refactoring

 Code Navigation

 Code Analysis

 Prerequisites

 The only real prerequisites for this course are the following:

 Basic knowledge of C#

 Existing experience with Visual Studio

 Hardware/Software Requirements

 You will need to make sure that you have a configuration that will allow you to work effectively in a remote training venue. An ideal configuration would be as follows:

 Dual Monitor Setup

 HeadSet w/ microphone

 GoToMeeting Client

 Windows 7/XP/Vista

 Visual Studio 2010

 ReSharper 5.1

With only a day required to participate, and at a cost of $300, it is a great way to get yourself out of a comfort zone for a short period of time, participate from your own location, collaborate/discuss with people from all around the world, and get some awesome learning time in!!

My thought with this, and the other, micro courses is to allow people to get deep dives into specific tools/technologies/approaches, without the battering that usually ensues from a full blown week of 5 12 hour days.
To register for the course go here: [http://nbdnresharperremotejune.eventbrite.com/](http://nbdnresharperremotejune.eventbrite.com/)
[Develop With Passion](http://www.developwithpassion.com)!!

extension: markdown


text:
# Super Galactic Age Calculator

This app determines a user’s age based on a planet’s solar years.

## Created
Epicodus JavaScript Week 1 8/03/2018
Hisato Kawaminami

## Installation
Clone from:
https://github.com/hisatokawaminami/super_galactic_age_calculator.git

### Basic Setup

* Follow the steps below to set up your files.

```
$ install npm
```

```
$ karma init

 ```

 ```
 To run tests: $ npm test
 ```

## Specifications

1. Take a person’s age in years and convert it into seconds.

2. Take two dates and determine the difference, in seconds, between the two. (This way a user can enter a birthdate and the application can compare the birthdate against the current time to come up with an accurate age.)

3. Return the age of a human in Mercury years. (A Mercury year is .24 Earth years.)

4. Return the age of a human in Venus years. (A Venus year is .62 Earth years.)

5. Return the age of a human in Mars years. (A Mars year is 1.88 Earth years.)

6. Return the age of a human in Jupiter years. (A Jupiter year is 11.86 Earth years.)

7. Determine how many years a user has left to live on each planet

8. If a user has already surpassed the average life expectancy, return the number of years they have lived past the life expectancy.

### Technologies Used

* JaveScript
* HTML
* NPM

### Support and Contact Details
If you encounter any bugs or would like to make suggestions regarding this project, please feel free to contact<EMAIL_ADDRESS>

### License

This project is distributed under the MIT License

repository: hisatokawaminami/api-chain

repo_name: hisatokawaminami/api-chain


text:
---
title: Data Binding
page_title: Data Binding
description: Check our "Data Binding" documentation article for the RadChart {{ site.framework_name }} control.
slug: radchart-features-data-binding
tags: data,binding
published: True
position: 1
---

# Data Binding

##

__RadChart__ supports data binding to various data sources and services. Moreover, __RadChart__ can be used in two modes:

* [Automatic Series Mappings]({%slug radchart-populating-with-data-data-binding-with-automatic-series-binding%}) - simply set __ReadChart.ItemsSource__ and __RadChart__ will automatically create the needed series mapping. Use automatic data series mapping when you have simple data.

* [Manual Series Mapping]({%slug radchart-populating-with-data-data-binding-with-manual-series-mapping%}) - use manual series mapping for more complex business objects or when you want more control.

For more information take a look at the [Data Binding Support Overview]({%slug radchart-populating-with-data-data-binding-support-overview%}) topic.

## See Also

 * [Populating with Data Overview]({%slug radchart-populating-with-data-overview%})

 * [Data Binding Support Overview]({%slug radchart-populating-with-data-data-binding-support-overview%})

 * [Data Binding with Automatic Series Mappings]({%slug radchart-populating-with-data-data-binding-with-automatic-series-binding%})

 * [Data Binding with Manual Series Mapping]({%slug radchart-populating-with-data-data-binding-with-manual-series-mapping%})

 * [Data Binding to Nested Collections]({%slug radchart-populating-with-data-data-binding-to-nested-collections%})

 * [Data Binding to Many Chart Areas]({%slug radchart-populating-with-data-data-binding-to-many-chart-areas%})

repository: telerik/xaml-docs

repo_name: telerik/xaml-docs


text:
# Simple BBS
    It is a bulletin board system

## Features

* A BBS system
* Only use TCP
* User can create a simple posts
* User can create categories
* User can view posts
* All data will be pure String, to make TCP traffic analysis

# Messaging API
    All data is a JSON-like, raw data is pure strings

The structure of the JSON is:

* An action
* The action data params
* Close

## Actions

* Create: means create a new post

```ruby
# Create requires a data with a new post
# The owner will be the current user name
# Category w'll be created by default if not exists
{
  action: 'create',
  what: 'post',
  data: {
    title: "Something",
    body: "Mussum ipsum cacilds, vidis litro abertis. Consetis adipiscings elitis. Pra lá , depois divoltis porris, paradis. Paisis, filhis, espiritis santis. Mé faiz elementum girarzis, nisi eros vermeio, in elementis mé pra quem é amistosis quis leo. Manduma pindureta quium dia nois paga. Sapien in monti palavris qui num significa nadis i pareci latim. Interessantiss quisso pudia ce receita de bolis, mais bolis eu num gostis.",
    category: "lol"
  }
}

# Also is possible create only the category
{
  action: 'create',
  what: 'category',
  data: {
    name: "Marmotas"
  }
}
```

* Delete: means delete a post, if you are a admin or owner

```ruby
# Delete requires a data with a post id to delete
{
  action: 'delete',
  what: 'post',
  data: {
    post_id: '1'
  }
}

{
  action: 'delete',
  what: 'category',
  data: {
    category: 'Marmotas'
  }
}
```

* Show: means show the posts, by filter or all

```ruby
# To show users, if you are an admin
{
  action: 'show',
  what: 'users'
}

# To show all categories
{
  action: 'show',
  what: 'categories'
}

# To show posts, a filter can be used, default is all
# Owner an category are opcional
{
  action: 'show',
  what: 'posts'
  data: {
    user: "",
    category: ""
  }
}
```

* Status of server

```ruby
{
  action: 'status'
}
```

* Ends the connection

```ruby
{
  action: 'marmota'
}
```

## Using TELNET
    String line commands

* `{"action": "marmota"}`
* `{"action": "show", "what": "users" }`
* `{"action": "show", "what": "categories" }`
* `{"action": "show", "what": "posts","data": { "category": "marmotagem"}}`
* `{"action": "show", "what": "posts","data": {}}`
* `{"action": "create", "what": "post", "data": { "title": "Something", "body": "Mussum ipsum cacilds, vidis litro abertis.", "category": "marmotas" }}`
* `{"action": "create", "what": "category", "data": { "name": "Marmotas" }}`
* `{"action": "delete", "what": "category", "data": { "category": "Marmotas" }}`
* `{"action": "delete", "what": "post", "data": { "post_id": 1 }}`

## Basic flow

1. Establish the TCP connection
2. Server will ask the username
3. Client tells its name
4. Client/Server interacts with actions
5. Close the connection when `marmota` is received

## Go!

1. Clone the source
2. go to project path (`cd ~path~/simple-bbs/`)
3. run de blundler (`bundle install`)
4. Edit the db configs (`db\database.yml`)
5. Create your db
6. Run the migrations (`rake migrate`)
7. Run the server
8. Have fun

## Contributing

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request

repository: gnomex/simple-bbs

repo_name: gnomex/simple-bbs


text:
---
layout: post
title: AWS RoboMaker-Day 2
date: 2020-04-04 9:12:00 -0500
categories: [tutorial]
tags: [aws, robotics]
---

# ToDo Items From [Day 1](RoboMaker-Do1)

1. Need to learn more about how to do two-way interactions with the Dynamixel servos.
2. Learn how to bundle ROS *robot* and *simulation* packages.
3. Find if there are more videos for the [Build Cloud-Connected Robots](#BuildCloudRobot)

# Bundling ROS *robot* and *simulation* packages.

(https://medium.com/better-programming/build-a-static-website-with-jekyll-and-automatically-deploy-it-to-aws-s3-using-circle-ci-26c1b266e91f)

repository: bstankie/BJS-Blog-chirpy

repo_name: bstankie/BJS-Blog-chirpy


text:
# learning-aurelia-js
My work on learning Auerlia JavaScript framework

1. `npm install`
2. Open `config.js` and fix `paths` by changing `jspm_packages/(...)` to `../jspm_packages/(...)` for both `github` and `npm`
3. `npm start`

repository: nkoder/learn-aurelia-js

repo_name: nkoder/learn-aurelia-js


text:
# bloodhound-promises

Promises with extra features.

## Installation

```bash
npm install bloodhound-promises
```

### Additional Commands

#### run unit tests

```bash
npm test
```

#### verify against the Promise/A+ specification test suite

```bash
npm run verify
```

#### generate documentation in the `docs/` folder

```bash
npm run docs
```

#### generate UMD bundle in the `dist/` folder

```bash
npm run build
```

## Why Promises

Promises are fantastic. They encapsulate a long-running operation into a simple object that invokes callbacks based on the operation's success or failure.

## Why Bloodhound

Bloodhound wraps (but will not modify) your favorite Promise implementation. This means you can continue to use the Promise library you like best, but now with extra syntactic sugar that makes writing Promise code a bit easier.

Here are some benefits of using Bloodhound:

### Scheduling

Because Bloodhound uses the wrapped Promise's own microtask scheduler, you never have to worry about timing issues between Bloodhound and your chose Promise implementation.

For example:

```javascript
import asBloodhound from 'bloodhound-promises';

const unmodified = Promise.resolve();
const bloodhound = asBloodhound(Promise).resolve();

unmodified.then(() => console.log('called 1'));
bloodhound.then(() => console.log('called 2')); // our callback
unmodified.then(() => console.log('called 3'));
```

Output:

```bash
> "called 1"
> "called 2"
> "called 3"
```

### Original Promise Unmodified

Bloodhound doesn't modify the Promise implementation it wraps. This ensures that your legacy and 3rd-party code remains unaffected. You can also get access to a new instance of your original promise at any time by calling `unwrap()`.

### Explicit Promise Chains

Promise implementations have no deterministic way to know when a promise chain has ended. This makes it impossible to know when to announce an unhandled rejection. Bloodhound adds a special chain terminator method called `done()` that indicates the promise chain has ended and it is safe to announce any unhandled rejections.

Basically, the golden rule of promises is:

> If you don't return the promise, you must call done().

Calling `done()` is what tells Bloodhound to throw any unhandled rejections so you
know if there is an error in your application. Without this feature, your app could end up in an inconsistent state.

Let's look at an example:

```javascript
import asBloodhound from 'bloodhound-promises';

const BloodhoundPromise = asBloodhound(Promise);

function getUserData(userId) {
    return new BloodhoundPromise(function(resolve, reject) {
        // do real stuff here and
        // call resolve(...) when done
    });
}

function getFeatureSwitches() {
    return new BloodhoundPromise(function(resolve, reject) {
        // do real stuff here and
        // call resolve(...) when done
    });
}

BloodhoundPromise.all([
    getUserData(),
    getFeatureSwitches()
]).done();
```

What does the code do? Both `loadMessages` and `loadAppData` return a promise that will resolve once their data calls complete. Because the promises are being returned, we do not call `done()` -- after all, we need these promises for our call to `BloodhoundPromise.all`, so we can't end the chain just yet.

Then, we wrap our promises in a call to `BloodhoundPromise.all`, a static method that returns a promise which is only resolved if all child promises resolve.

Finally, we call `done()`, which waits until the promise is either resolved or rejected to check for unhandled exceptions. If one of our data calls failed, an error will be thrown at this point. Otherwise, the error might be swallowed.

### Easy Configuration

Bloodhound is configurable.

#### custom handler for any unhandled rejections

When `done()` is called on a rejected promise, Bloodhound's default behavior is to throw that rejection reason in a new stack frame. You can change this behavior:

```javascript
BloodhoundPromise.config.setErrorHandler(function handler(reason) {
    myTrackingLibrary.logError(reason);
});
```

#### callback for asynchronous operations

Sometimes you want to know that an asynchronous operation has occurred so you can perform change detection. Frameworks like AngularJS need this information to ensure that bindings are updated correctly.

```javascript
angular.module('myapp', ['ng'])
    .run(['$rootScope', function checkForChanges($rootScope) {
        function checkChanges() {
            $rootScope.$applyAsync();
        }
        BloodhoundPromise.config.setAsyncNotifier(checkChanges);
    }]);
```

### Promise Interop

Bloodhound works with any Promise implementation.

```javascript
import Q from 'q';
import when from 'when';
import * as Bluebird from "bluebird";
import asBloodhound from 'bloodhound-promises';

const BloodhoundPromise = asBloodhound(Promise);

BloodhoundPromise.resolve('xyz')
    .then(() => Q('abc'))
    .then(() => when.resolve('def'))
    .then(() => Bluebird.resolve('ghi'))
    .then(console.log); // 'ghi'
```

## Copyright

Copyright (c) 2019 Paychex, Inc.

repository: paychex/bloodhound-promises

repo_name: paychex/bloodhound-promises


text:
# General Information:

The writer continues to use parallelism in each of these verses, conveying a single idea using two different statements to emphasize security with regard to the natural world, the homestead, and one’s descendants. (See: [[figs-parallelism]])

repository: mandolyte/uw-obsidian

repo_name: mandolyte/uw-obsidian


text:
---
ENTRYTYPE: inproceedings
added: 2020-06-23
authors:
- Dirk Beyer
- Thomas Lemberger
booktitle: 2019 34th IEEE/ACM International Conference on Automated Software Engineering (ASE)
doi: 10.1109/ASE.2019.00105
layout: paper
number: ''
pages: 1074-1077
read: true
readings:
- 2020-06-23
title: 'TestCov: Robust test-suite execution and coverage measurement'
volume: ''
year: 2019
notes:
- Test competition
- KLEE verifier
- Fuzz testing
- FQL
papers:
- beyer:hvc:2017
---

TestCov is a tool that measures the coverage of a test suites
and generates a reduced test suite.
It is used in the [Test competition] and can work with
all the tools that compete in that competition.

The input is a test suite (in the test suite interchange format (XML)),
a program and a specification of the coverage criterion (in [FQL]).

The tool is based on BenchExec and provides containerization (like Docker)
using Cgroups, etc.
so that program runs are isolated from each other.
The containerization has another benefit: it uses an in-memory filesystem
that is faster than a standard filesystem and so speeds up program execution.

The [testcov](https://gitlab.com/sosy-lab/software/test-suite-validator)
tool inserts instrumentation to measure block, branch and condition
coverage as well as calls to an error function.

{% include links.html %}

repository: alastairreid/RelatedWork

gha_language: TeX

repo_name: alastairreid/RelatedWork


text:
---
layout: default
---

# 1997-06-20 - It's not over

## Header Data

From<EMAIL_ADDRESS>(Anonymous)

To<EMAIL_ADDRESS>Message Hash: 4583aaffdf12007eacf898ff817769c3590f2670380f96de5b18cc58e3d8fcba

Message ID<EMAIL_ADDRESS>Reply To: _N/A_

UTC Datetime: 1997-06-20 22:17:40 UTC

Raw Date: Sat, 21 Jun 1997 06:17:40 +0800

## Raw message

```
{% raw  %}From<EMAIL_ADDRESS>(Anonymous)
Date: Sat, 21 Jun 1997 06:17:40 +0800
To<EMAIL_ADDRESS>Subject: It's not over
Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

Let's cut all the doom and gloom here.  The bill isn't passed yet.  It's
got to go through at least one and possibly two more committees before
it reaches the senate floor, where we'll have another chance to defeat it.

Even then the house has to pass similar legislation.  That will be yet another
chance.

When Clipper was proposed, a wave of anger and opposition swept forth.
The same thing needs to happen now.  This fatalism is self defeating.

Either you're part of the solution or you're part of the problem.  People who
say there's no use fighting, who give up, who oppose the efforts of the
crypto lobbying groups in the name of ideological purity, are not part of
the solution.  They have no right to complain if this law passes.  By
sitting aside and carping at the efforts of those who are trying to stop this
kind of legislation, they are only helping to bring it about.

There is no reason this new bill should be any more acceptable or more
successful than Clipper was.  We only have to fight it.

{% endraw %}
```

## Thread

+ Return to [June 1997](/archive/1997/06)

+ Return to "[Declan McCullagh <declan@pathfinder.com>](/authors/declan_mccullagh_declan_at_pathfinder_com_)"
+ Return to "["John W. Noerenberg" <jwn2@qualcomm.com>](/authors/john_w_noerenberg_jwn2_at_qualcomm_com_)"
+ Return to<EMAIL_ADDRESS>(Anonymous)](/authors/nobody_at_replay_com_anonymous_)"
+ Return to "[Tim May <tcmay@got.net>](/authors/tim_may_tcmay_at_got_net_)"

+ 1997-06-20 (Sat, 21 Jun 1997 06:17:40 +0800) - It's not over -<EMAIL_ADDRESS>(Anonymous)_
  + 1997-06-20 (Sat, 21 Jun 1997 07:41:49 +0800) - [Re: It's not over](/archive/1997/06/928d86aa0541cd168a4437e9c969387e386731341a7473c8a4ca14ce52cfdbfe) - _Declan McCullagh<EMAIL_ADDRESS>  + 1997-06-21 (Sat, 21 Jun 1997 08:28:49 +0800) - [Re: It's not over](/archive/1997/06/db807facaeca011b41b04e9dc45fd5e17408ae1a5591bcbc7e94992693171d02) - _Tim May<EMAIL_ADDRESS>  + 1997-06-21 (Sat, 21 Jun 1997 10:46:39 +0800) - [Re: It's not over](/archive/1997/06/1252e3b28a85ba22715f13a5c0b1382eadca6e6513162a31b729ec5c61e0b0f5) - _"John W. Noerenberg"<EMAIL_ADDRESS>  + 1997-06-21 (Sat, 21 Jun 1997 11:03:19 +0800) - [Re: It's not over](/archive/1997/06/e0cd2cf8ec7a61ffe211cca2c72e6a6ca5f7ef0877762b99834c15f34106335d) - _Tim May<EMAIL_ADDRESS>    + 1997-06-21 (Sat, 21 Jun 1997 13:26:50 +0800) - [Re: Derisive comments](/archive/1997/06/e9d47c4acf053602aa91bdc50709b013157f13ed7e0fd280bc21c899633693ef) - _Tim May<EMAIL_ADDRESS>


text:
# snakerf

A mediocre ~~collection of RF/analog circuits scripts~~ Python package someday when I get around to [releasing](https://packaging.python.org/tutorials/packaging-projects/) it as one. If you can still read this line in the README, please don't judge the actual software content of this repository too much.

The intent of this package is to:
- Facilitate the design of VHF/UHF digital radio systems
- Fill a perceived gap in [scikit-rf](http://scikit-rf.org), which abstracts RF circuits into matrices of S/X/Y/Z parameters and is poorly suited to tasks like designing matching networks (it _can_, and they have example code showing how, but that doesn't mean it's well suited to the task)
- Make up for (LT)Spice's poor handling of scattering parameters and general clunkiness
- Stop rewriting the same code repeatedly and then losing/forgetting about it/losing access to the iPython server it ran on
- Maintain my employability

## Things that currently "work":
- Flaky 2-port modeling, including "arbitrary" networks of passive components and _very_ flaky transmission lines
- Approximately modeling microstrips and striplines at sufficiently low frequencies
- Creating time domain representations of FSK, PSK, MSK, and QAM modulated signals
- Modeling additive white Gaussian noise and non-white background environmental noise
- Converting between time-domain voltages and voltage/power spectra
- Converting between decibels and linear quantities
- Generating [Gold codes](https://en.wikipedia.org/wiki/Gold_code) up to length 2^15 + 1 (after which my laptop started throwing memory errors; your mileage may vary)
- Demodulators for FSK, PSK, and QAM

## Real goals
- Demodulator for MSK
- Mixer/amplifier modeling with noise
- Tool for designing filters using purchaseable component values
- Clean interface to simulate an entire signal path and model BER performance
- Actual thorough test code
- Sustained commit streak

## Aspirational goals
- Cython accelerated math
- More nuanced transmission line modeling i.e. 2.5D simulation
- Parametrically generating RF structures for PCBs
- Mixer/amplifier nonlinearity modeling
- Simulate FHSS
- Playing nicely with scikit-rf
- Importing/exporting SPICE netlists
- This code actually being useful to someone else

## Known issues
- "Power" spectra are very easy to use incorrectly; considering some significant restructuring
- Despite now having lots of little functional blocks, interfaces between different pieces of code are currently bad
- There's some evidence that noise modeling isn't quite right, possibly for subtle numerical reasons
- Modulation should use Gray code

repository: SMaldonado/snakerf

repo_name: SMaldonado/snakerf


text:
# View device information

The [`ffx target`][ffx-target] commands can retrieve various types of
information from Fuchsia devices.

## Concepts

The [`ffx target list`][ffx-target-list] command prints the list of all
Fuchsia devices connected to the host machine. This command is often used
to quickly scan the following information of connected Fuchsia devices:

* A device name
* A device's product type
* A device's state
* A device's IP address

The [`ffx target show`][ffx-target-show] command, unlike `ffx target list`,
targets only a single Fuchsia device and prints much detailed information
about the device. To do so, `ffx target show` requires that `ffx` can
establish a [SSH connection][ssh-connection] to the target device. Below
is some of the information you can obtain from `ffx target show`:

* The board name of the target device
* The version of the Fuchsia product running on the target device
* The product configuration on the target device

Lastly, the [`ffx target snapshot`][ffx-target-snapshot] command
generates a ZIP archive file that captures the current state
of the target device. A snapshot from a device contains a generous
amount of information helpful for debugging.

## Get the list of devices

To get the list of all connected Fuchsia devices,
run the following command:

```posix-terminal
ffx target list
```

This command prints output similar to the following:

``` none {:.devsite-disable-click-to-copy}
$ ffx target list
NAME                      SERIAL       TYPE       STATE      ADDRS/IP                                             AGE     RCS
fuchsia-5254-0063-5e7a    <unknown>    Unknown    Unknown    [<IP_ADDRESS>, fe80::7594:7308:4168:9fb1%brqemu]    0m8s    N
```

## Get detailed information from a device

To get the detailed information of your target Fuchsia device,
run the following command:

```posix-terminal
ffx target show
```

This command prints output similar to the following:

``` none {:.devsite-disable-click-to-copy}
$ ffx target show
Target:
    Name: "fuchsia-4102-0ba9-8a3b"
    SSH Address: "[fe80::ae21:e7fa:8e1f:6c46%17]:22"
Board:
    Name: "<BOARD_NAME>"
    Revision: "<REVISION_NUMBER>"
    ...
Device:
    Serial number: "<SERIAL_NUMBER>"
    ...
Product:
    ...
    Build date: "<DATE>"
    Build name: "<BUILD>"
    ...
    Model: "<MODEL>"
    Name: "<NAME>"
    ...
Update:
    Current channel: "<CHANNEL>"
    Next channel: "<CHANNEL>"
Build:
    Version: "<VERSION>"
    Product: "<PRODUCT>"
    Board: "<BOARD>"
    Commit: "<DATE>"
...
```

## Generate a snapshot from a device

To generate a snapshot from your target Fuchsia device,
run the following command:

```posix-terminal
ffx target snapshot
```

This command generates a ZIP archive file and prints its location,
for example:

``` none {:.devsite-disable-click-to-copy}
$ ffx target snapshot
Exported /tmp/snapshots/20210616_183136/snapshot.zip
```

By default, the command stores the archive file in the `/tmp` directory of
the host machine. To change this directory,
run `ffx target snapshot --dir <PATH_TO_DIR>`.

<!-- Reference links -->

[ffx-target]: https://fuchsia.dev/reference/tools/sdk/ffx#target
[ffx-target-list]: https://fuchsia.dev/reference/tools/sdk/ffx#list_17
[ffx-target-show]: https://fuchsia.dev/reference/tools/sdk/ffx#show_8
[ffx-target-snapshot]: https://fuchsia.dev/reference/tools/sdk/ffx#snapshot
[ssh-connection]: ./create-ssh-keys-for-devices.md

repository: gnoliyil/fuchsia

repo_name: gnoliyil/fuchsia


text:
# Vocab Scraper

Just a tool to automate finding definitions for large amounts of words and converting them to formatted JSON output.

Personally used for importing new words into [Lexicogn](https://github.com/evad1n/lexicogn)

## Features

- Populate definitions for a list of words, in JSON output
- Combine multiple files (txt/json) into a single list of unique words

Can be used interactively or as a library

## Functions

The define package contains methods for scraping definitions for a word from various sites. These can easily be turned into deployable serverless functions for an on-demand custom dictionary API.


text:
# bOTL.py
bOTL Object Transformation Language v3

This is a python implementation of bOTL v3

You can read the [bOTL specification] (https://medium.com/@emlynoregan/botl-object-transformation-language-35ed297c6671).

Usage:
Just grab the file bOTL.py and use it like this:

    import bOTL

    source = {"name": "Freddo"}
    transform = "#$.name"
    result = bOTL.transform(source, transform)

    # result: "Freddo"

Also make sure you've installed or otherwise have available JSONPath RW by kennknowles:
[JSONPath RW](https://github.com/kennknowles/python-jsonpath-rw)


text:
---
layout: post
title: "Kubernetes secrets, base64, and newline"
date: 2022-11-17 00:48:38 +00:00
comments: true
categories:
---

When creating a k8s secret manually, using command like this you need to provide `base64` encoded secret. Never forget to use `-w 0` when encoding the string.

```
kubectl apply -f - <<EOF
apiVersion: v1
kind: Secret
metadata:
  name: github
type: Opaque
data:
  access_token: ACCESS_TOKEN
EOF
```

Recently I forgot the `-w 0` in `base64` command and spent too much time troubleshooting it. It seems to be a common issue:
https://superuser.com/questions/1225134/why-does-the-base64-of-a-string-contain-n

Yes, I logged the access token from the app to validate it. I used `%v` qualifier to do it and access token was the last argument. Looking back I should have used `%q` instead or have it in the middle of the log string. But I didn't. So I resolved it a hard way.

I ended up logging the headers of http requests. Here is how I did it.

First, implement the logging round tripper:

```
// This type implements the http.RoundTripper interface
type LoggingRoundTripper struct {
	Proxy http.RoundTripper
}

func (lrt LoggingRoundTripper) RoundTrip(req *http.Request) (res *http.Response, e error) {
	fmt.Printf("Sending request to: %v\n", req.URL)
	fmt.Printf("With headers: %+v\n", req.Header)

	return lrt.Proxy.RoundTrip(req)
}
```

Then use the http client configured with the above round tripper with `oauth2` client:

```
// Use the custom HTTP client when requesting a token.
httpClient := &http.Client{
  Transport: LoggingRoundTripper{http.DefaultTransport},
}

ctx := context.Background()

ctx = context.WithValue(ctx, oauth2.HTTPClient, httpClient)

ts := oauth2.StaticTokenSource(
  &oauth2.Token{AccessToken: access_token},
)
tc := oauth2.NewClient(ctx, ts)

client := github.NewClient(tc)
```

Interestingly, the fact that this is working may not be aligned with the documentation: https://pkg.go.dev/golang.org/x/oauth2#NewClient. Docs says:

> Note that if a custom *http.Client is provided via the Context it is used only for token acquisition and is not used to configure the *http.Client returned from NewClient.

Apparently it is already reported: https://github.com/golang/oauth2/issues/324. Maybe this post will be irrelevant soon. But it is working now.

repository: SergeyKanzhelev/apmtips

gha_language: CSS

repo_name: SergeyKanzhelev/apmtips


text:
RemoveBinObj
============

Powershell script to remove the bin and obj folders in the current directory tree.

Usage
=====
- Add the powershell script (RemoveBinObj.ps1) to a folder in your oath
- Open Command Prompt and navigate to your solution directory (or project directory)
- Execute "Powershell RemoveBinObj.ps1"
- The script will show you the *preview* list of files that will be removed if you proceed.
- After that, when you are prompted to proceed, type "y" to proceed or "n" to exit without proceeding.

repository: arsalan/RemoveBinObj

repo_name: arsalan/RemoveBinObj


text:
# 分布式

## 1. Edit conflic

描述：The conflict occurs when an editor gets a copy of a shared document file, changes the copy, and attempts to save the changes to the original file, which has been altered by another editor after the copy was obtained.

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

问题场景：分布式版本控制系统(git,Mercurial)，分支冲突

解决方案：git 是分布式的文件版本控制系统，在分布式环境中时间是不可靠的，git是靠`三路合并算法`进行合并的

问题场景：用户余额修改，并发修改

解决方案：锁 or CAS

Ref:

- https://juejin.cn/post/7004643157279244325
- https://zhuanlan.zhihu.com/p/149287658

## 2. Embarrassingly parallel（完全并行）

描述：In [parallel computing](https://en.wikipedia.org/wiki/Parallel_computing), an **embarrassingly parallel** workload or problem (also called **embarrassingly parallelizable**, **perfectly parallel**, **delightfully parallel** or **pleasingly parallel**) is one where little or no effort is needed to separate the problem into a number of parallel tasks.[[1\]](https://en.wikipedia.org/wiki/Embarrassingly_parallel#cite_note-1) This is often the case where there is little or no dependency or need for communication between those parallel tasks, or for results between them.

A common example of an embarrassingly parallel problem is 3D video rendering handled by a [graphics processing unit](https://en.wikipedia.org/wiki/Graphics_processing_unit), where each frame (forward method) or pixel ([ray tracing](https://en.wikipedia.org/wiki/Ray_tracing_(graphics)) method) can be handled with no interdependency.[[3\]](https://en.wikipedia.org/wiki/Embarrassingly_parallel#cite_note-ChalmersReinhard2011-3) Some forms of [password cracking](https://en.wikipedia.org/wiki/Password_cracking) are another embarrassingly parallel task that is easily distributed on [central processing units](https://en.wikipedia.org/wiki/Central_processing_unit), [CPU cores](https://en.wikipedia.org/wiki/CPU_core), or clusters.

## 3. Failure semantics（错误语义）
A list of types of errors that can occur:

- An omission error is when one or more responses fails.

- A crash error is when nothing happens. A crash is a special case of omission when all responses fail.
- A Timing error is when one or more responses arrive outside the time interval specified. Timing errors can be early or late. An omission error is a timing error when a response has infinite timing error.
- An arbitrary error is any error, (i.e. a wrong value or a timing error).
- When a client uses a server it can cope with different type errors from the server.
  - If it can manage a crash at the server it is said to assume the server to have crash failure semantics.
  - If it can manage a service omission it is said to assume the server to have omission failure semantics.
- Failure semantics are the type of errors that are expected to appear.
Should another type of error appear it will lead to a service failure because it cannot be managed.

## 4. Fallacies of distributed computing（分布式计算语境中的谬论）

描述：The fallacies of distributed computing are a set of assertions made by L Peter Deutsch and others at Sun Microsystems describing false assumptions that programmers new to distributed applications invariably make.

谬论：
1. The network is reliable;
2. Latency is zero;
3. Bandwidth is infinite;
4. The network is secure;
5. Topology doesn't change;
6. There is one administrator;
7. Transport cost is zero;
8. The network is homogeneous; ps：[Heterogeneous network](https://en.wikipedia.org/wiki/Heterogeneous_network)

## 5. Happened-before （事件顺序，因果一致性）
描述：In computer science, the happened-before relation is a relation between the result of two events, such that if one event should happen before another event, the result must reflect that, even if those events are in reality executed out of order (usually to optimize program flow). This involves ordering events based on the potential causal relationship of pairs of events in a concurrent system, especially asynchronous distributed systems. It was formulated by Leslie Lamport.[1]

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

问题场景：

![02](/Users/yongchang.zhang/Downloads/02.jpg)

解决方案：逻辑时钟，向量时钟，[混合逻辑时钟](http://yang.observer/2020/12/16/hlc/)

Ref：

- https://writings.sh/post/logical-clocks
- https://yang.observer/2020/07/26/time-lamport-logical-time/
- https://blog.xiaohansong.com/lamport-logic-clock.html

## 6. Leader election

问题场景：狭义拜占庭问题（假设将军中没有叛军，信使的信息可靠但有可能被暗杀的情况下，将军们如何达成一致性决定？）

解决方案：Raft，Bully，ZooKeeper Atomic Broadcast

Ref:

- https://zhuanlan.zhihu.com/p/85680181
- https://www.cnblogs.com/moonyaoo/p/12952580.html
- https://catkang.github.io/2017/06/30/raft-subproblem.html

## 7. Quantum Byzantine agreement（量子拜占庭协议）

问题场景：[检测的拜占庭协议](http://www.infocomm-journal.com/cjnis/article/2016/2096-109x/2096-109x-2-11-00030.shtml)

解决方案：每个将军都有不被其他将军所知的数字列表，并且自己拥有的数字列表与其他将军手中的列表之间有合适的关联关系。因此，解决拜占庭问题可以简化为解决生成和安全分发这些列表的问题。利用量子协议就能检测分发的安全性

## 8. Race condition

Handling race conditions in distributed systems is tricky. It all depends on how you want your system to behave.

Is it alright to have eventual consistency or strong consistency is a must?
Do you want your system to be more available or consistent if a resource is unavailable?

Some of the ways to handle race conditions are:

1. Distributed locks: But remember, pessimistic locking down a resource will have a significant impact on the latency of your system.
2. Sharding: For an instance you have a counter variable which multiple threads are updating every second. Instead of pessimistic locking down that variable.
Shard it. There will be multiple copies of that variable across various nodes. Individual threads will update the variable & eventually all the updates across nodes will be summed up.
3. Implementing a high performance queue: Queue all the requests for a resource. Let the requests access the resource in a first in first out fashion.

## 9. Self-stabilization

描述：Self-stabilization is a concept of fault-tolerance in distributed systems. Given any initial state, a self-stabilizing distributed system will end up in a correct state in a finite number of execution steps.

A system is self-stabilizing if and only if:

1. Starting from any state, it is guaranteed that the system will eventually reach a correct state (convergence).
2. Given that the system is in a correct state, it is guaranteed to stay in a correct state, provided that no fault happens (closure).

A system is said to be randomized self-stabilizing if and only if it is self-stabilizing and the expected number of rounds needed to reach a correct state is bounded by some constant k.

## 10. Distributed serializability

描述：Distributed serializability is the serializability of a schedule of a transactional distributed system (e.g., a distributed database system)；Distributed serializability is a major goal of [distributed concurrency control](https://en.wikipedia.org/wiki/Distributed_concurrency_control) for correctness

问题背景：全局事务，多个本地事务一起成功或一起失败

解决方案：原子协议，Distributed transactions imply a need for an [atomic commit](https://en.wikipedia.org/wiki/Atomic_commit) protocol to reach consensus among its local sub-transactions on whether to commit or abort.