text:
---
layout: post
title: First and second order chaos
subtitle: Degrees of chaos in Sapiens
tags: misc
thumbnail: https://gyanl.com/assets/thumbs/chaos.png
---

I was reading Sapiens by Yuval Noah Harari, and one of the concepts the author mentions caught my attention. According to Harari, there are two main classifications of chaos.

![Abstract art of circles in different colors](https://gyanl.com/assets/chaos-halftone.jpg)

#### First Order Chaos
*An unpredictable phenomenon that doesn’t respond to predictions.*

For eg. The weather is a chaotic system. It can't be predicted with total accuracy because of the huge number of variables involved. However, the weather does not change based on the predictions about it.

#### Second Order Chaos
*An unpredictable phenomenon that responds to predictions about itself.*

For eg. stocks and politics—if someone predicts that a certain stock will rise 20% tomorrow, then people will react to the prediction. This can cause demand and hence the price to go up today, which can make the prediction incorrect.

Second order chaos is, in a sense, the opposite of a self fulfiling prophecy. By making a prediction, people will react to the prediction and make it not come true.


text:
# Unity-RayMarcher
 A custom RayMarcher in Unity's new Post Processing v3 stack

 ![Fractalship](https://i.imgur.com/n6mEKTM.png)

 This project is made with custom shaders and is utilizing Unity's Post Processing stack.

 Raymarching is a technique a bit like traditional raytracing where the surface function is not easy to solve (or impossible without numeric iterative methods). In raytracing you   just look up the ray intersection, whereas in ray marching you march forward (or back and forth) until you find the intersection, have enough samples or whatever it is you're trying to solve. So when you have complicated surfaces like fractals or non-euclidean geometry, raymarching is the way to go.

Below are some of my experiments with using ray marching to render signed distance functions in Unity:

 - A Spacebulb

 - A Glowbox

 - A Shadedbox

 - A Fractalship

 - Blobthingies
 ** Simple geometric (with some displacement) scene showcasing some boolean operators

 - FractalFPS ???
 ** I also managed to add some physics using the same signed distance fields that the gpu calculates in the shader but this time in the cpu.

 Bonus: Here is a cool visualization of a mandelbulb fractal with some cool music: https://www.youtube.com/watch?v=_0YLEfMZloU ...wait for it... :)

license: MIT

repository: Trippasch/Unity-RayMarcher

branch_name: refs/heads/main

extension: md

license_type: permissive

repo_name: Trippasch/Unity-RayMarcher


text:
# PyRayTracer

[![Travis][buildstatus_image_travis]][travisci]
[![Code Health](https://landscape.io/github/Gjacquenot/PyRayTracer/master/landscape.png)](https://landscape.io/github/Gjacquenot/PyRayTracer)

Preliminary code for ray tracing with Python and VTK

Works with:

- Python 2 with VTK 5 and VTK 6
- Python 3 with VTK 5 and VTK 6

[buildstatus_image_travis]: https://travis-ci.org/Gjacquenot/PyRayTracer.svg?branch=master
[travisci]: https://travis-ci.org/Gjacquenot/PyRayTracer

repository: JaapVerheggen/PyRayTracer

branch_name: refs/heads/master

repo_name: JaapVerheggen/PyRayTracer


text:
# AMP Linter

[![npm version](https://badge.fury.io/js/%40ampproject%2Ftoolbox-linter.svg)](https://badge.fury.io/js/%40ampproject%2Ftoolbox-linter)

## Overview

A [linter](<https://en.wikipedia.org/wiki/Lint_(software)>) for AMP documents:
reports errors and suspicious constructions such as images missing or
incorrectly sized, missing CORS headers, or invalid metadata.

## Usage

Command-line (local build):

```sh
# from the amp-toolbox root
$ npm install
$ npm run build # generates packages/linter/dist/cli.js
$ cd packages/linter
$ node dist/cli.js https://amp.dev/
```

Command-line (from npm):

```sh <!-- markdownlint-disable MD014 -->
$ npx @ampproject/toolbox-cli lint https://amp.dev/
```

Node:

```js
const fs = require("fs");
const linter = require("@ampproject/toolbox-linter");
const cheerio = require("cheerio");

const body = fs.readFileSync("amp-dev.html");
const context = {
  $: cheerio.load(body),
  headers: {},
  url: "https://amp.dev/"
};

linter.MetaCharsetIsFirst(context).then(console.log);
```

## `dump-signedexchange`

One test has a dependency on the `dump-signedexchange` go binary. If this is
available ([installation
instructions](https://github.com/WICG/webpackage/tree/master/go/signedexchange#installation))
at additional check of the `application/signed-exchange` response will be
performed.

## Development

### Commands/Scripts

These scripts can be invoked in the usual way by `npm run XXX` if `npm install`
is run in this directory. They can also be invoked from the `amp-toolbox` root
directory without installing locally by `lerna run --scope '*/toolbox-linter' XXX`. (lerna sets the `PATH` so that the required binaries are available.)

#### `build`

Populates the `dist` directory with the appropriate `*.js` and `*.d.ts` files.
Note that tests are _not_ included. This script is intended to be used when
building the npm package.

#### `lint`

Checks the code for lint errors using prettier.

### Running tests

The unit tests run in the context of toolbox project.
```
# Run all linter tests
npm run test:node -- packages/linter

# Run linter network tests
npm run test:node -- packages/linter/tests/network.test.ts
```

### Suggested Development Workflow

1. Create stub rule in `rules/`, that always "fails". e.g. it always returns
   `qqqqqq`. It should extend the `Rule` class.
1. Write tests in `tests/network.test.ts` (If HTTP requests are required). If not
   then create a directory in `tests/local/MyNewTest-1` that contains a
   `source.html` (AMP HTML source) and add your test in `tests/local.test.ts`.
1. Run the test using `npm run test:node -- packages/linter` in the toolbox root.
   If the fixtures can't be found, they will be generated automatically
   (via real network requests). Hopefully your test will fail.
1. Fix the implementation, and re-run the test.

repository: ampproject/amp-toolbox

gha_language: HTML

repo_name: ampproject/amp-toolbox


text:
# Employee-Tracker

![APM](https://img.shields.io/apm/l/open)

## Screenshot

![Screenshot](./schema.png)

## Mock-Up
[Video](https://drive.google.com/file/d/1o0fKHqqxdNf531AJW_9SMIExZeGzPvBT/view)

    # Table of Content:
    *[Description](#description)
    *[Installation](#installation)
    *[Usage](#usage)
    *[License](#license)
    *[Contribution Guidelines](#contribution)
    *[Test](#test)
    *[Questions](#question)

## Description:
Developers are often tasked with creating interfaces that make it easy for non-developers to view and interact with information stored in databases. Often these interfaces are known as **C**ontent **M**anagement **S**ystems. The challenge is to architect and build a solution for managing a company's employees using node, inquirer, and MySQL.

## Installation:
npm inquirer, npm mysql, and npm console.table

## Usage:
As a business owner, I want to be able to view and manage the departments, roles, and employees in my company. So, that I can organize and plan my business.

## License:
MIT

## Contribution:
Pull requests are welcome.  For major changes, please open an issue first to discuss what you would like to change.

## Test:
npm run seed.js

## Questions:

For any questions about my Team Profile Generator you can go to my Github page at the following link:
![Github Profile](https://github.com/tmgorogers/Team-Profile-Generator)

For additional questions please reach out to my email<EMAIL_ADDRESS>

repository: tmgorogers/Employee-Tracker

repo_name: tmgorogers/Employee-Tracker


text:
Multiple Producer Single Consumer FIFO

A C implementation of a MPSC FIFO, this implementation
is wait free/thread safe. This algorithm is from Dimitry
Vyukov's non intrusive MPSC code here:
  http://www.1024cores.net/home/lock-free-algorithms/queues/non-intrusive-mpsc-node-based-queue

The fifo has a head and tail, the elements are added
to the head of the queue and removed from the tail.
To allow for a wait free algorithm a stub element is used
so that a single atomic instruction can be used to add and
remove an element. Therefore, when you create a queue you
must pass in an areana which is used to manage the stub.

A consequence of this algorithm is that when you add an
element to the queue a different element is returned when
you remove it from the queue. Of course the contents are
the same but the returned pointer will be different.

Prerequisites:
 (meson)[https://github.com/mesonbuild/meson]

Build:
```
mkdir build
cd build
meson ..
ninja
```

Test:
```
./test/testmpscfifo
```

repository: winksaville/c-mpscfifo

repo_name: winksaville/c-mpscfifo


text:
# TSLint Rules of Hooks

[![Downloads badge](https://img.shields.io/npm/dw/tslint-react-hooks.svg?style=flat)](https://www.npmjs.com/package/tslint-react-hooks)
[![Version badge](https://img.shields.io/npm/v/tslint-react-hooks.svg?style=flat)](https://www.npmjs.com/package/tslint-react-hooks)
[![License badge](https://img.shields.io/npm/l/tslint-react-hooks.svg?style=flat)](https://github.com/Gelio/tslint-react-hooks/blob/master/LICENSE.md)
[![GitHub stars badge](https://img.shields.io/github/stars/Gelio/tslint-react-hooks.svg?style=social)](https://github.com/Gelio/tslint-react-hooks)
[![Build Status](https://dev.azure.com/vorenygelio/vorenygelio/_apis/build/status/Gelio.tslint-react-hooks?branchName=master)](https://dev.azure.com/vorenygelio/vorenygelio/_build/latest?definitionId=3&branchName=master)

![Demo](https://i.imgur.com/SGHlOvF.png)

A TSLint rule that enforces the [Rules of Hooks](https://reactjs.org/docs/hooks-rules.html) for
React hooks.

The rule is based on an [ESLint plugin for react hooks](https://github.com/facebook/react/blob/master/packages/eslint-plugin-react-hooks/README.md).

## Features

- detects using React hooks inside potentially-conditional branches:
  - if statements
  - short-circuit conditional expressions (`&&`, `||`)
  - ternary expressions
  - loops (`while`, `for`, `do ... while`)
  - functions that themselves are not custom hooks or components
- detects using React hooks in spite of an early return
- support for detecting hooks from namespaces other than `React` (e.g. `MyHooks.useHook`) (**optional**)

## Installation

First, install [the rule](https://www.npmjs.com/package/tslint-react-hooks):

```sh
npm install tslint-react-hooks --save-dev
```

Then, enable the rule by modifying `tslint.json`:

```js
{
  "extends": [
    // your other plugins...
    "tslint-react-hooks"
  ],
  "rules": {
    // your other rules...
    "react-hooks-nesting": "error"
  }
}
```

To use report rule violations as warnings intead of errors, set it to `"warning"`.

## Options

While the rule works fine out-of-the-box, it can be customized. To specify options, use the
following syntax when modifying `tslint.json`:

```js
{
  "extends": [
    // your other plugins...
    "tslint-react-hooks"
  ],
  "rules": {
    // your other rules...
    "react-hooks-nesting": {
      "severity": "error", // "error", "warning", "default" or "off"
      "options": {
        // options go here
      }
    }
  }
}
```

### Available options

- `"detect-hooks-from-non-react-namespace"` - when set to `true`, violations will be also reported
  hooks accessed from sources other than the `React` namespace (e.g. `MyHooks.useHook` will be
  treated as a hook).

  By default, only direct calls (e.g. `useHook`) or calls from `React` namespace (e.g.
  `React.useState`) are treated as hooks.

Have an idea for an option? [Create a new issue](https://github.com/Gelio/tslint-react-hooks/issues/new).

## Workarounds

For some arrow functions/function expressions, the rule has no way to determine whether those are a
component, a hook, both of which could contain hook calls, or a regular function that should not
contain hook calls.

```ts
const withHoc = <TProps extends object>(Component: ComponentType<TProps>) => (
  props: TProps,
) => {
  const [state] = useState();
  return <Component {...props} />;
};
```

The workaround in those cases is to use a **named function expression**:

```ts
const withHoc = <TProps extends object>(Component: ComponentType<TProps>) =>
  function WrappedComponent(props: TProps) {
    const [state] = useState();
    return <Component {...props} />;
  };
```

Naming the function like a component (in _PascalCase_) unambiguously lets the rule treat the
function as a component.

## False positives and not-covered cases

There are some cases that seem hard to analyze and may result in false positives or false negatives.

In such cases, disable the rule for a specific line using the following comment:

```ts
// tslint:disable:react-hooks-nesting
useEffect(() => {});
```

### Looping over static arrays

The rule may report false positives, for example in:

```ts
function MyComponent() {
  const array = [1, 2, 3];

  array.forEach(value => {
    React.useEffect(() => console.log(value));
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [A hook cannot be used inside of another function]
  });
}
```

The `useEffect` hook will be called unconditionally and the call-order will be the same between
renders.

### Using renamed hooks (that do not start with _use_)

The rule only treats functions that start with _use_ as hooks. Therefore, renaming the hook will
result in avoiding the rule:

```ts
const renamedUseState = React.useState;

function MyComponent() {
  const [state, setState] = renamedUseState(0);
}
```

### Unconditional nesting

Unconditional nesting, for example:

```tsx
function MyComponent() {
  if (true) {
    const variableThatCannotBeLeaked = useContext(SomeContext);
    useEffect(() => {
      console.log(variableThatCannotBeLeaked);
    });
  }

  return <div>Text</div>;
}
```

is treated as conditional nesting. It seems hard to verify if the condition is in fact a constant,
therefore such a situation will always result in a rule violation.

In situations where such an `if` statement was used to create an additional block scope, use the
block scope directly:

```tsx
function MyComponent() {
  {
    const variableThatCannotBeLeaked = useContext(SomeContext);
    useEffect(() => {
      console.log(variableThatCannotBeLeaked);
    });
  }

  return <div>Text</div>;
}
```

## Development

After pulling the repository, make sure to run

```sh
npm install
```

The source code for the rule is located in the `src` directory.

For more information about the developing custom TSLint rules, take a look at
[TSLint's documentation](https://palantir.github.io/tslint/develop/custom-rules/).

### Testing the rule

Run

```sh
npm run test
```

to compile the rule and run automatic TSLint tests.

They are located in the `test` directory.

## Author

The author of this rule is Grzegorz Rozdzialik.

repository: Gelio/tslint-react-hooks

gha_language: TypeScript

gha_license_id: MIT

repo_name: Gelio/tslint-react-hooks


text:
# ember-cli-pegjs

An [ember-cli](https://github.com/stefanpenner/ember-cli) addon for generating [PegJS](https://github.com/dmajda/pegjs) parser from grammar file.

## Installation

```bash
npm install --save-dev ember-cli-pegjs
```

## Usage

By default this addon will generate a parser for every file with the _pegjs_ extension, the generated parser
extension is _js_ and will be located in the same folder as the grammar file.

The parser is exported as an ES6 module and can be simply imported as any other Ember CLI file.

You can control how the parser code is exported by specifying options using the pegOptions config property:
```
var app = new EmberApp({
  ...
  pegOptions: {
    wrapper: function (src, parser) {
      return 'var Parser = ' + parser + ";\nvar parse = Parser.parse, SyntaxError = Parser.SyntaxError;\nexport {SyntaxError, parse};\nexport default parse;";
    }
  }
});
```

repository: indexiatech/ember-cli-pegjs

gha_language: JavaScript

repo_name: indexiatech/ember-cli-pegjs


text:
# compgeo
Some cool computational geometry algorithms drawn in a window

### BUILD:
* This requires java, git, and maven to download and build.  On debian linux (including ubuntu), run "sudo apt-get install openjdk-8-jdk git maven" get install the necessary code to compile and run this app.
* Get the code with the command "git clone https://github.com/ants280/compGeo.git" (url is from the "Clone and download" button near the top of this page).
* Run "mvn package" to build the code.  It places a jar file in /target named something like compGeo-VERSION.jar.
* Run "mvn clean" to delete the built code.
### RUN:
* Run the jar file created in the build step or run "mvn package exec:java" from the command line.
### ABOUT:
* https://en.wikipedia.org/wiki/Graham_scan
* https://en.wikipedia.org/wiki/Bezier_curve
* https://en.wikipedia.org/wiki/Voronoi_diagram
* https://en.wikipedia.org/wiki/Delaunay_triangulation

## Screenshot
![screenshot](screenshot.png)

## License
Project is licensed under the [MIT license](LICENSE).

gha_language: Java


text:
# Baking App
Baking App is an app for Udacity’s resident baker-in-chief, Miriam, to share her recipes with the world. The user can select a recipe and
see video-guided steps for how to complete it.

It is a project during Udacity's Android Developer Nanodegree Program.

Through this project I learnt to:

use MediaPlayer/Exoplayer to display videos.

handle error cases in Android.

handle unexpected input in my data

add a widget to my app experience.

leverage a third-party library in myr app.

use Fragments to create a responsive design that works on phones and tablets.

The recipe listing (the JSON file which contains the recipes' instructions, ingredients, videos and images) is located here: https://d17h27t6h515a5.cloudfront.net/topher/2017/May/59121517_baking/baking.json.

And some sample mocks are located here: https://d17h27t6h515a5.cloudfront.net/topher/2017/March/58dee986_bakingapp-mocks/bakingapp-mocks.pdf

 App's screenshots


text:
# goq

[![Go Report Card](https://goreportcard.com/badge/github.com/pureugong/goq)](https://goreportcard.com/report/github.com/pureugong/goq)
[![MIT license](https://img.shields.io/badge/license-MIT-brightgreen.svg)](https://opensource.org/licenses/MIT)
![GitHub release (latest by date)](https://img.shields.io/github/v/release/pureugong/goq)

`goq` is a simple queue manager library

## Installation

If using go modules.

```sh
go get -u github.com/pureugong/goq
```

## Getting Started

```golang
// 1. init goq manager
manager := goq.NewManager(ctx, 1, nil)

// 2. init goq workers
manager.InitWorkers(10, func() goq.Worker {
    return NewWorkerSample()
})

// 3. enqueue tasks
for i := 0; i < 100; i++ {
    manager.Enqueue(i)
}

// 4. wait
manager.Wait()

```

## License

Released under the [MIT License](https://github.com/pureugong/goq/blob/master/LICENSE)

repository: pureugong/goq

repo_name: pureugong/goq


text:
# Madrid Metro

## Preparation of .zim input files.

In the ZimInput directory,

* `00_StaticTypes.zim`

describes the global attributes of the system. The rest of the input
files are

* `_01_Stations.zim`
* `_02_Tracks.zim`
* `_03_Paths.zim`
* `_04_Schedules.zim`
* `_05_Demand.zim`

which are all generated by the command
```
$ ./01_Make_Whole_System_and_Demand.sh
```
This reads the `Madrid_Public_Data/*007*csv` files and produces the description of the
metro system in terms of zboxen.

## Output

`out` is currently a symbolic link. Before running the simulation,
either change it to a directory or point it at one.

In turn, within the `07_Calibration` and `08_Simulation_Results` directories,
`out` symlinks link to the above `06_Madrid_Metro/out`.

## Running the simulation

For example:

```
$ ./02_Run_Simulation.sh z=30
```


text:
    OctoDash is a simple, but beautiful dashboard for OctoPrint. Please read the instructions carefully!

    OctoDash is a User Interface for OctoPrint, it utilizes the OctoPrint API but tries to use modern design principles in order to fully enable the power of your Raspberry Pi attached to your 3D Printer. OctoDash works best with a Touchscreen and will support almost all functions that OctoPrint offers just in a nicer format. Give it a try!

## Table of Contents

- [Table of Contents](#table-of-contents)
- [Installation](#installation)
  - [Nightly Builds](#nightly-builds)
- [Update](#update)
- [Tips and Tricks](#tips-and-tricks)
- [Demo](#demo)
- [Screenshots](#screenshots)
- [Get in contact](#get-in-contact)
- [Troubleshooting](#troubleshooting)
- [Bugs and more](#bugs-and-more)
- [Contributing](#contributing)
- [License](#license)

## Installation

```
bash <(wget -qO- https://github.com/UnchartedBull/OctoDash/raw/main/scripts/install.sh)
```

_Execute this command as the user that logs in on the display (usually `pi`) and not as `root` or with `sudo`._ For more options and information have a look at the [wiki](https://github.com/UnchartedBull/OctoDash/wiki/Installation).

No Keyboard? [No Problem](https://github.com/UnchartedBull/OctoDash/wiki/Setup-&-Settings#setup-without-keyboard).

Having issues during the installation? Please have a look at the [Troubleshooting Guide](https://github.com/UnchartedBull/OctoDash/wiki/Troubleshooting) first.

### Nightly Builds

Thanks to M1dn1ghtN1nj4 nightly builds are available here: https://sites.google.com/view/m1dn1ght-3d/downloads/unofficial-octodash-builds?authuser=0. They should be stable, still not recommended for production.

## Tips and Tricks

- OctoDash supports printing from your Raspberry and from the printers SD card, if configured in OctoPrint (v1.5.0 and up)
- You can let OctoDash push out and pull in the filament during a filament change, if you setup your feed length correctly (v1.5.0 and up)
  - You can also use your printers filament change progress, just enable this in the settings (the printer needs to support M600)
- If you're using FilamentManager add the color (in HEX format) to the end of the name, like "Vendor black (#000000)", this color will then be shown in the filament selection menu
- You can adjust the look of OctoDash by adjusting the `~/.config/octodash/custom-styles.css` file and adding your own CSS rules (v2.0.0 and up)
- OctoDash supports .ufp package and PrusaSlicer preview images (v1.5.0 and up)
  - To get the best results, you should use a square aspect ration, like `256x256`
- You can also show the thumbnails during print, if you press on the percentage inside the progress ring (v1.5.0 and up)
- You can press multiple arrows directly after another in the control view. All actions will be executed in series, even if the prior didn't finish
- The six actions on the right in the control view can be customized. They can either send GCode commands to your printer, restart OctoPrint or your Pi and even open iFrames so you can view your camera
- You can adjust the temperatures and fan speed in the home screen by pressing on their icons, if you want to set them to zero, just tap the value once (v1.4.1 and up)
- OctoDash will start in your host's language if it is supported. You can start OctoDash in a different supported language by starting it with `LANG=fr_FR.UTF-8 octodash`. Currently supported languages are: `fr_FR.UTF-8`, english will be used if your requested language isn't available

## Demo

If you want to see OctoDash in action, here is an awesome video from Nick on [YouTube](https://youtu.be/YI_c-DY6zU4) there is also a video available from Chris Riley, which also shows the installation process on [YouTube](https://youtu.be/kwo3HMBnqC4)

## Screenshots

More Screenshots can be found [here](https://github.com/UnchartedBull/OctoDash/tree/main/screenshots).

## Get in contact

We now have a Discord server as well. Feel free to join and ask your support & development questions over there: https://discord.gg/gTasZTz.

## Troubleshooting

If you encounter an issue, while using OctoDash please have a look at the [wiki](https://github.com/UnchartedBull/OctoDash/wiki/Troubleshooting) first! If your issue is not covered please open an issue!

## Bugs and more

If you find a bug, please open an issue, so I can have a look at it. Please also add the steps to reproduce and the .gcode file (if applicable). Thank you!

## Contributing

See [CONTRIBUTING.md](https://github.com/UnchartedBull/OctoDash/blob/main/CONTRIBUTING.md).

## License

The project is licensed under the Apache 2.0 License. [More Information](https://github.com/UnchartedBull/OctoDash/blob/main/LICENSE.md).

repository: UnchartedBull/OctoDash

repo_name: UnchartedBull/OctoDash


text:
# Tested Packge With Phpanony - Clock
This is Test Package To get Date And clock

#installation

Run This Command On Your Composer
` composer require clock/clockprov:dev-master `

after completed to download package
open your app.php file from this path `config/app.php`

put this to  provider array  line

```php
Clock\ClockProv\ClockProvider::class,

```

and this aliases array from package

```php
'Clock'     => Clock\ClockProv\ClockFacdecs::class,

```

now please run this command on your composer ` php artisan vendor:publish `

##usage

to use this package clock
```php
 Clock::clock();

```

or if You want use Map

```php
Clock::map();
```

repository: arabnewscms/clock-clockprov

repo_name: arabnewscms/clock-clockprov


text:
# Assignment solution

## 1) Create appropriate images for both apps (two separate images!)
## 5) Re-build the images - this time with names and tags

- Node app

  - Dockerfile
    ```
    FROM node:16-alpine3.11

    WORKDIR /app

    COPY package.json /app

    RUN npm install

    COPY . .

    EXPOSE 3000

    CMD ["node", "server.js"]
    ```

  - Command
    ```
    docker build -t ex-node .
    ```

- Python app

  - Dockerfile
    ```
    FROM python:3.9.5-alpine3.13

    WORKDIR /app

    COPY . /app

    CMD ["python", "bmi.py"]
    ```

  - Command
    ```
    docker build -t ex-python .
    ```

## 2) Launch a container for each created image
## 3) Re-create both containers and assign names to both

- Node app
  ```
  docker run --name ex-node -p 3000:3000 -d ex-node
  ```

- Python app
  ```
  docker run --name ex-python -it ex-python
  ```

### 4) Clean up (remove) all stopped (and running) containers

- Node app
  ```
  docker stop ex-node
  docker rm ex-node
  ```

- Python app
  ```
  docker stop ex-python
  docker rm ex-python
  ```

### 6) Run containers ensuring that they are removed automatically when stopped
- Node app
  ```
  docker run --name ex-node -p 3000:3000 -d --rm ex-node
  ```

- Python app
  ```
  docker run --name ex-python -it --rm  ex-python
  ```

repository: alaindet/learn-docker

repo_name: alaindet/learn-docker


text:
# Coastal Image Labeler

[![Documentation](https://img.shields.io/badge/Documentation-Click%20Me-brightgreen)](
https://uncg-daisy.github.io/Coastal-Image-Labeler/)
[![Last Commit](https://img.shields.io/github/last-commit/UNCG-DAISY/Coastal-Image-Labeler)](
https://github.com/UNCG-DAISY/Coastal-Image-Labeler/commits/master)
[![DOI](https://zenodo.org/badge/226252747.svg)](https://zenodo.org/badge/latestdoi/226252747)
[![Actions Status1](https://github.com/UNCG-DAISY/Coastal-Image-Labeler/workflows/Unit%20Tests/badge.svg)](https://github.com/UNCG-DAISY/Coastal-Image-Labeler/actions)
[![Actions Status2](https://github.com/UNCG-DAISY/Coastal-Image-Labeler/workflows/Deploy%20Docusaurus/badge.svg)](https://github.com/UNCG-DAISY/Coastal-Image-Labeler/actions)

### It's a labeling tool!

![Labeler](https://github.com/UNCG-DAISY/Coastal-Image-Labeler/blob/master/docs/static/img/labeler.gif)

Labeled images are important for supervised machine learning. The Coastal Image Labeler is focused on easily accommodating multiple users labeling the same images to ensure
consensus for (potential ambiguous) discipline-specific labels. This tool allows us to crowdsource the development of a labeled image dataset that is relevant for coastal
scientists.

The labeler is deployed here: [https://coastalimagelabeler.science/](https://coastalimagelabeler.science/). You can log on and start labeling post Hurricane images collected by [NOAA NGS](https://storms.ngs.noaa.gov/).

You can check out the Coastal Image Labeler documentation for more info:
[![Documentation](https://img.shields.io/badge/Documentation-Click%20Me-brightgreen)](
https://uncg-daisy.github.io/Coastal-Image-Labeler/)

### Code of Conduct

We hope to foster an inclusive and respectful environment surrounding the contribution and discussion of our project.
Make sure you understand our [**Code of Conduct**](https://uncg-daisy.github.io/Coastal-Image-Labeler/docs/code_of_conduct).

### Projects using the Labeler:

#### Papers:

An Active Learning Pipeline to Detect Hurricane Washover in Post-Storm Aerial Images: [![Earth ArXiv Preprint
DOI](https://img.shields.io/badge/%F0%9F%8C%8D%F0%9F%8C%8F%F0%9F%8C%8E%20EarthArXiv-doi.org%2F10.31223%2FX5JW23-%23FF7F2A)](https://doi.org/10.31223/X5JW23)

Labeling Poststorm Coastal Imagery for Machine Learning: Measurement of Interrater Agreement: https://doi.org/10.1029/2021EA001896

#### Data Releases:

Labels for Hurricane Florence imagery: 343 images, labeled via consensus, [available via figshare](https://doi.org/10.6084/m9.figshare.11604192.v1).

Labels for Hx Florence, Hx Michael and Hx Isaias imagery:
- v1 (300 images; 2.1k labels): [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.4272064.svg)](https://doi.org/10.5281/zenodo.4272064)
- v1.1 (900 images; 4.5k labels): [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.4541480.svg)](https://doi.org/10.5281/zenodo.4541480)
- v1.2: (1500 images; 6.2k labels) : [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.4694325.svg)](https://doi.org/10.5281/zenodo.4694325)
- v1.3: (1500 images; 6.2k labels; 100 image quadrants (smaller scale) w/ 400 labels): [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.4967050.svg)](https://doi.org/10.5281/zenodo.4967050)
- v1.4: (1500 images; 6.2k labels; 100 image quadrants (smaller scale) w/ 400 labels; 100 images labeled by noncoastal experts - 400 labels): [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.5172799.svg)](https://doi.org/10.5281/zenodo.5172799)
- v2.0: (4250 images; 10.2k labels; 100 image quadrants (smaller scale) w/ 400 labels; 100 images labeled by noncoastal experts - 400 labels): [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.7217621.svg)](https://doi.org/10.5281/zenodo.7217621)

You can merge these labels with post-storm images, which can be downloaded from [NOAA NGS](https://storms.ngs.noaa.gov/) or using [this nifty python command line downloading tool](https://github.com/UNCG-DAISY/psi-collect). We are using these labeled images to [detect washover](https://github.com/UNCG-DAISY/WashoverML).

repository: UNCG-DAISY/Coastal-Image-Labeler

repo_name: UNCG-DAISY/Coastal-Image-Labeler


text:
# Remote transport

Sends a JSON POST request with `LogMessage` in the body to the specified url.

```js
log.transports.remote.level = 'warn';
log.transports.remote.url = 'https://example.com/myapp/add-log'
log.warn('Some problem appears', { error: e });
```

The code above produces the following HTTP request (json is formatted
for clarity in the example):

```
POST /myapp/add-log HTTP/1.1
Content-Length: 300
Content-Type: application/json
Host: example.com
Connection: close

{
  "client": { "name": "electron-application" },
  "data": [
    "Some problem appears",
    {
      "error": {
        "constructor": "Error",
        "stack": "Error: test\n    at App.createWindow ..."
      }
    }
  ],
  "date":<PHONE_NUMBER>989,
  "level": "warn",
  "variables": { "processType": "browser" }
}
```

## Options

#### `client` {object}

Default: `{ name: 'electron-application' }`

It's just an additional field which will be appended to JSON body for each
request.

#### `depth` {object}

Default: `6`

Sometimes logging very complex object can produce a huge POST body. To reduce
request size set depth option to exclude nested objects which are deeper than
`depth`.

#### `level` {LogLevel | false}

Default: `false`

Filter log messages which can be sent via the transport.

#### `makeBodyFn` {({ logger, message, transport }) => string}

A callback which makes a POST body from a message

#### `processErrorFn` {({ error, logger, message, request, transport }) => void}

A callback called on request error

#### `requestOptions` {module:http.RequestOptions}

Default: `{}`

Customize options used by
[`http.request()`](https://nodejs.org/api/http.html#http_http_request_options_callback)

#### **`url`** {string}

Default: `undefined`

Endpoint URL.

repository: megahertz/electron-log

repo_name: megahertz/electron-log


text:
Rspec generate doc
===

This gem help you to generate simple documentation api from Rspec tests.

Installation
============

Add this line to your application's Gemfile:

```ruby
gem 'rspec_generate_doc'
```

And then execute:

    $ bundle

Usage
=====

**Configure**
``` ruby
# spec/rails_helper.rb
...
require 'rspec_generate_doc'
..
RspecGenerateDoc.configure do |config|
  config.docs_dir = 'path/to/docs/dir' # default: "#{Rails.root}/docs"
  config.locale = :ru # default: I18n.default_locale
  config.action_decorator = My::Cool::ActionDecorator # default: RspecGenerateDoc::Decorators::Action
  config.parameter_decorator = My::Cool::ParameterDecorator # default: RspecGenerateDoc::Decorators::Parameter
  config.template_file = '/path/to/my/template.api.erb' # default:  "#{File.dirname(__FILE__)}/templates/slate.md.erb"
  config.file_prefix = 'prefix_to_file_name_' # default:  '_'
  config.file_suffix = '_suffix_to_file_name' # default:  ''
end
```

Example use

``` ruby
# spec/controllers/user_controller_spec.rb
...
let(:api_params) do
  {
    id: { name: 'alternative id name', description: 'user id', required: true },
    email: { description: 'user email', required: 'if not id' }
  }
end
...
```
*keys description:*
id | email - Parameter name.
name - Parameter name. Default parameter key name.
description - description parameter. Default parameter key name.
required - is parameter required? If the value type is boolean it will be translated to default language. If the value type is string then return it value.

*skip add to api description*

``` ruby
...

context 'this case will be skipped' do
  let(:skip_this) {true}
  it(expect(true).to be true)
end
...
```

*alternative name to file and menu*
``` ruby
require 'rails_helper'

RSpec.describe UserController, type: :controller, api_name: 'alternative_name' do
...
```
**result**

After tests completed file *_user_controller.md* will be created in docs folder.  In format to Slate

Copyright
=========

Copyright (c) 2016 Igor Kutyavin aka Jokius

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.

gha_language: Ruby


text:
---
layout: page
title: Music and Science – Guide to Empirical Music Research (Book)
permalink: /book/
published: true
---

Book titled _Music and Science – Guide to Empirical Music Research_ will be published in 2023 by [Routledge](https://www.routledge.com).

It is aimed as an introductory text to music undergraduates, postgraduates, and students in related disciplines.

All the code and data used in the book is available via Jupyter notebooks at [https://tuomaseerola.github.io/emr/](https://tuomaseerola.github.io/emr/)


text:
# HomeKitAccessory

A C# implementation of the Apple [HomeKit protocol](https://developer.apple.com/support/homekit-accessory-protocol/)
for accessories

## Getting Started

### Requirements

HomeKitAccessory requires [.NET Core 3.1](https://dotnet.microsoft.com/download),
and requires [libsodium](https://doc.libsodium.org) to be installed for your platform.

On Macos with [Homebrew](https://brew.sh), run
```
brew install libsodium
```
You will also need to add /usr/local/lib to the LD search path:
```
export LD_LIBRARY_PATH=/usr/local/lib
```

### Building

Check out the code using
```
git clone https://github.com/agaskill/homekitaccessory.git
```
Change to the working directory
```
cd homekitaccessory
```
And build the solution
```
dotnet build
```

## Using HomeKitAccessory

HomeKitAccessory uses [NLog](https://nlog-project.org) for logging, so be sure to add that as a dependency
and configure it first according to your logging requirements.

Next you will need to load or create a pairing database
```c#
var pairingDb = new PairingDatabase();
pairingDb.LoadOrInitialize();
```
which will create or load a file named pairingdb.json in the working directory.  More secure
alternatives can be created by implementing the interface `IPairingDatabase`.

You will need to create an instance of `IBonjourProvider`.  Two implementations are included:
- `DnsSdBonjourProvider` works on macos and runs the `dns-sd` utility as a subprocess.
- `MockBonjourProvider` does nothing but write to the console what it _would_ provide as
  arguments to `dns-sd`

Example:
```c#
var bonjourProvider = new Net.DnsSdBonjourProvider();
```

You will need to create an instance of IUserStore to look up valid SRP verifiers.  Again
two implementations are provided:
- `DynamicSetupCodeUserStore` generates a new setup code for each pairing, and provides for displaying
  it to the user in whatever means are appropriate
- `StaticSetupCodeUserStore` is appropriate for a device that does not have any interface and instead
  uses an embedded setup code

Example:
```c#
var userStore = new Pairing.DynamicSetupCodeUserStore(code => Console.WriteLine("*** {0} ***", code));
```

Lastly you need to populate ServerInfo with how the accessory should appear on the network: name,
model, category type, port number.  Refer to the [HomeKit protocol specification](https://developer.apple.com/support/homekit-accessory-protocol/)
for appropriate category values.

Example:
```c#
var serverInfo = new ServerInfo
{
    Name = "MyTestDevice9",
    Model = "TestDevice",
    CategoryId = 1,
    Port = 5002
};
```

Finally the server instance can be created:
```c#
var server = new Server(pairingDb, serverInfo, bonjourProvider, userStore);
```

### Defining Accessories

Before running the server, all accessories need to be defined and registered.
Accessories definitions are outside the scope of this readme and should be
referred to the protocol specification.

### Implementing Accessories

Implementations of standard services like the Accessory Information service are provided, but
most functionality will require implementing service interfaces and registering them in the
service definition.

See the included TestAccessory project for an example of defining a simple switch service
and registering it as an accessory.

repository: wadimk/homekitaccessory

repo_name: wadimk/homekitaccessory


text:
# Porthor

[![NuGet](https://img.shields.io/nuget/v/Porthor.svg)](https://www.nuget.org/packages?q=Porthor)
[![GitHub issues](https://img.shields.io/github/issues/NicatorBa/Porthor.svg)](https://github.com/NicatorBa/Porthor/issues)
[![GitHub license](https://img.shields.io/github/license/NicatorBa/Porthor.svg)](https://github.com/NicatorBa/Porthor/blob/master/LICENSE)

**What's Porthor?**

Porthor is an API gateway middleware for ASP.NET Core 2.0. It offers an easy to use way to register APIs from other sources to your application. You can also protect your API by using ASP.NET Core policy-based authorization.

## Getting started

- **Update your `.csproj` file** to reference `Porthor` package

- **Configure Porthor service** in `Startup`:

```csharp
public class Startup
{
    public void ConfigureServices(IServiceCollection service)
    {
        // Register the Porthor services
        // with your gateway configuration
        services.AddPorthor()
            // Enable checking if user is authenticated by default
            // Can be overridden for certain resources with their property `AllowAnonymous`
            .AddAuthenticationValidation()

            // Protect your API with policiy-based authorization
            .AddAuthorizationValidation()

            // Activate query string checking
            // Offers a more strict way to handle query params for resources
            .AddQueryStringValidation()

            .AddContentValidation(options =>
            {
                // Enable content body validation for POST and PUT methods
                options.Enabled = true;
                // Register content validator for specific media type
                options.Add<JsonValidator>(MediaType.Application.Json);
                options.Add<XmlValidator>(MediaType.Application.Xml);
            });
        });
    }

    public void Configure(IApplicationBuilder app)
    {
        // Minimal configured resource
        // HttpMethod: supported Http request method
        // FrontendPath: your application api endpoint
        // BackendUrl: endpoint where the request is to be redirected
        var routingRule = new RoutingRule {
            HttpMethod = HttpMethod.Get,
            FrontendPath = "api/samples",
            BackendUrl = "http://example.org/api/v1/samples"
        }

        // Use Porthor with predefined resource
        app.UsePorthor(new[] { routingRule });
    }
}
```

## Roadmap

- [ ] Transformation of JSON on request/response
- [ ] Web UI to register, update and delete resource routes
- [ ] Wiki & API documentation

repository: NicatorBa/Porthor

gha_language: C#

repo_name: NicatorBa/Porthor


text:
# Cyber Defense 2200

A space shooter video game made during AGDG 2017, for the "GAMES MADE QUICK???"
game jam (https://itch.io/jam/games-made-quick). Fully software rendered, and thus,
possibly not very fast on any given machine. Mostly fixed point math, and with 8-Bit
RGB332 colour palette. Rasterizer ripped out from what was originally a demo running on
a microcontroller.

Release binaries for windows and 64bit ubuntu can be found on http://halcy.itch.io/cyber-defense-2200 .
Source code (terrible) can be found on https://github.com/halcy/cyberdefense2200 .

Controls are relatively simple and explained in game. The normal mode is fairly hard,
so an easier mode can be toggle on by pressing "p" on the menu screen. Cute robot art at the end if you manage to beat it!

Credits:
* halcy: Code, music, in-game art
* SaltyTuna: Title card / menu art


text:
# Premiere

This is a fully functional and powerful app developed with rich UI designed for movie buffs as part of Udacity's nano degree program. The app provides the user with top rated and popular movies with their ratings and trailers.

## Features

* Discover the most popular, the most rated or the highest rated movies
* Save favorite movies locally to view them even when offline
* Watch trailers
* Read reviews

## Screens

![alt tag](http://s18.postimg.org/a26th6nuh/DFG_2015_12_23_10_30_07.png)

![alt tag](http://s3.postimg.org/gub6o3b2r/DFG_2015_12_23_10_29_51.png)

## Work with the Source code

In order to build this successfully, you'll need to obtain your own API key, which is available [here!](https://www.themoviedb.org/documentation/api?language=en)
You'll need to replace your key in `Premiere/app/src/main/java/nanodegree/premiere/Keys/Key.java`
```
public class Key
{
    private static final String PRECIOUS = "XXXXXXXXXXXXXX"; // <-- Replace your key here

    public String getKey()
    {
        String pass = PRECIOUS;
        return pass;
    }

}
```

## Libraries

* [Apache HTTP](https://hc.apache.org/httpcomponents-client-4.3.x/android-port.html)
* [GSON](https://github.com/google/gson)
* [Google design support library](https://developer.android.com/training/material/design-library.html)
* [Picasso](http://square.github.io/picasso/)

## Android Developer Nanodegree
[![udacity][1]][2]

[1]: https://raw.githubusercontent.com/cahergil/shareablefotos/master/pm/nanodegree-logo.png
[2]: https://www.udacity.com/course/android-developer-nanodegree--nd801

## License

    Copyright 2015 Shaheen A Kader

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

repository: shaheenkdr/Premiere

repo_name: shaheenkdr/Premiere


text:
# Robotic Arm Control App

A React web/desktop application to control a custom-built 6-axis robotic arm.

Demo available at: https://calvang.github.io/Robotic_Arm_Control_App/

<img src="images/render2.png" alt="image-20210108214619733" style="zoom: 20%;" />

## Controls

This application provides two methods of controlling the robotic arm: manual control and automatic. The manual control mode allows the user to navigate the arm using keyboard bindings while the automatic mode uses inverse kinematics to move the end effector of the arm to a specific point.

## Submodules

This project is a submodule for the larger [Personal Robotic Arm] project.

- [Kinematics Python Module](https://github.com/calvang/kinematics)

To build it alone, you must clone this repository and initialize submodules:

```bash
git submodule update --remote --recursive
```

You can also use the above command to update all submodules to the most recent commits. To update a single specific submodule:

```bash
cd kinematics_engine/kinematics
git fetch
git merge origin/master
```


text:
---
title: Waiting for coroutines
date: "2020-04-26"
published: true
tags: [kotlin, coroutines]
series: Kotlin coroutines
cover_image: blog-card.png
---

Coroutines allow you to execute tasks asynchronously without blocking the calling thread, such as the main thread. Great, but sometimes you will need to wait for all of these tasks to finish. In this post, we will look at how to wait for a coroutine to finish using `join`.

Note, `async`/`await` will not be covered here as I will cover that in a later post. For now, read the [Kotlin docs - Concurrent using async](https://kotlinlang.org/docs/reference/coroutines/composing-suspending-functions.html#concurrent-using-async) if that is what you are interested in.

## How to get a job

No, you didn't misread the heading, I _will_ show you how to get a job:

```kotlin
runBlocking {
  val job: Job = launch {
    delay(2000)
    println("and it seems to work!")
  }
  print("This is your first coroutine, ")
}
```

There, you now have a job. I have solved the world's employment problems...

Ok, seriously, a `Job` is returned when you start a coroutine. In fact, from what I understand anyway, the words job and coroutine are interchangeable in this context. Really, they are the same thing, as seen below:

```kotlin
@InternalCoroutinesApi
public abstract class AbstractCoroutine<in T>(
    /**
     * The context of the parent coroutine.
     */
    @JvmField
    protected val parentContext: CoroutineContext,
    active: Boolean = true
) : JobSupport(active), Job, Continuation<T>, CoroutineScope
```

`AbstractCoroutine` implements the `Job` interface. So a coroutine is a job.

## What to do once you have a job

You can control a coroutine through the functions available on the `Job` interface. Here are some of the functions (there are many more):

- `start`
- `join`
- `cancel`

Further `Job` operations will be explored in future posts.

## Waiting for a coroutine

To wait for a coroutine to finish, you can call `Job.join`.

`join` is a __suspending function__. Meaning that the coroutine calling it will be suspended until it is told to resume. At the point of suspension, the executing thread is released to any other available coroutines (that are sharing that thread or thread pool).

Below is a short example:

```kotlin
runBlocking {
  val job: Job = launch(context = Dispatchers.Default) {
    println("[${Thread.currentThread().name}] Launched coroutine")
    delay(100)
    println("[${Thread.currentThread().name}] Finished coroutine")
  }
  println("[${Thread.currentThread().name}] Created coroutine")
  job.join()
  println("[${Thread.currentThread().name}] Finished coroutine")
}
```

In the snippet above, a coroutine is launched, and a `Job` is returned. `join` is then called on the created job/coroutine to wait for it to finish before resuming.  This leads to the following output:

```kotlin
[main] Created coroutine
[DefaultDispatcher-worker-1] Launched coroutine
[DefaultDispatcher-worker-1] Finished coroutine
[main] Finished coroutine
```

The main thread is blocked while it waits for the job/coroutine to finish. Note, that the main thread is used by `runBlocking`, while the child is launched using one of the default thread pools.

Just like futures and threads, many coroutines can be created and waited for through the use of `join`. This is also made slightly easier by the convenient `joinAll` extension function:

```kotlin
runBlocking {
  val jobs: List<Job> = (1..5).map {
    launch(context = Dispatchers.Default) {
      println("[${Thread.currentThread().name}] Launched coroutine: $it")
      delay(100)
      println("[${Thread.currentThread().name}] Finished coroutine: $it")
    }
  }
  println("[${Thread.currentThread().name}] Created all coroutines")
  jobs.joinAll()
  println("[${Thread.currentThread().name}] Finished all coroutines")
}
```

Something similar to the following would be output:

```kotlin
[DefaultDispatcher-worker-1] Launched coroutine: 1
[DefaultDispatcher-worker-2] Launched coroutine: 2
[DefaultDispatcher-worker-3] Launched coroutine: 3
[DefaultDispatcher-worker-4] Launched coroutine: 4
[main] Created all coroutines
[DefaultDispatcher-worker-5] Launched coroutine: 5
[DefaultDispatcher-worker-1] Finished coroutine: 1
[DefaultDispatcher-worker-4] Finished coroutine: 4
[DefaultDispatcher-worker-2] Finished coroutine: 3
[DefaultDispatcher-worker-3] Finished coroutine: 5
[DefaultDispatcher-worker-5] Finished coroutine: 2
[main] Finished all coroutines
```

I wonder if you can guess what `joinAll`'s implementation looks like. I don't have any way to hide text, so I'll just assume you actually guessed. I have added it below:

```kotlin
public suspend fun Collection<Job>.joinAll(): Unit = forEach { it.join() }
```

## Joining is not always required

Joining all jobs running inside a coroutine is not a requirement to ensure their completion is waited for. By using the `coroutineScope` builder (a function), you can create a parent/child relationship between coroutines. More precisely, the `coroutineScope` builder will only progress once all of the coroutines inside it have completed. This is effectively doing a `joinAll` on all the jobs inside the `coroutineScope`.

The example below _attempts_ to show this:

```kotlin
runBlocking {
  val jobs: List<Job> = (1..2).map { parentNumber ->
    // This coroutine is joined on inside [runBlocking] to allow the last [println]
    launch(context = Dispatchers.Default) {
      // The [coroutineScope] block cannot be left until the 2 corountines launched inside have finished
      coroutineScope {
        println("[${Thread.currentThread().name}] Launched parent: $parentNumber")
        (1..2).map { childNumber ->
          launch {
            println("[${Thread.currentThread().name}] Launched child: $parentNumber - $childNumber")
            delay(100)
            println("[${Thread.currentThread().name}] Finished child: $parentNumber - $childNumber")
          }
        }
      }
      println("[${Thread.currentThread().name}] Finished parent: $parentNumber")
    }
  }
  println("[${Thread.currentThread().name}] Created all coroutines")
  jobs.joinAll()
  println("[${Thread.currentThread().name}] Finished all coroutines")
}
```

Which outputs something like this:

```kotlin
[DefaultDispatcher-worker-1] Launched parent: 1
[main] Created all coroutines
[DefaultDispatcher-worker-2] Launched parent: 2
[DefaultDispatcher-worker-3] Launched child: 2 - 1
[DefaultDispatcher-worker-4] Launched child: 1 - 1
[DefaultDispatcher-worker-5] Launched child: 1 - 2
[DefaultDispatcher-worker-3] Launched child: 2 - 2
[DefaultDispatcher-worker-2] Finished child: 2 - 1
[DefaultDispatcher-worker-3] Finished child: 2 - 2
[DefaultDispatcher-worker-5] Finished child: 1 - 2
[DefaultDispatcher-worker-1] Finished child: 1 - 1
[DefaultDispatcher-worker-2] Finished parent: 2
[DefaultDispatcher-worker-1] Finished parent: 1
[main] Finished all coroutines
```

Each _parent_ coroutine had to wait until their _children_ finished. This was enabled by using `coroutineScope`, ensuring each coroutine launched inside it had completed before moving on.

I only touched on this subject to show that joining is not the only way to wait for jobs to finish. For some more information, have a look at the [Kotlin docs - Scope builder](https://kotlinlang.org/docs/reference/coroutines/basics.html#scope-builder).

## Summary

Sometimes you will want to wait for several coroutines to complete before moving on. This behaviour can be achieved using `join` and `joinAll` provided by the `Job` interface. Doing so will suspend the calling coroutine until the joined jobs have concluded. Similar behaviour can also be obtained via the `coroutineScope` builder, ensuring that all jobs launched within it have ended before continuing.

----

If you enjoyed this post or found it helpful (or both) then please feel free to follow me on Twitter at [@LankyDanDev](https://twitter.com/LankyDanDev) and remember to share with anyone else who might find this useful!

repository: lankydan/lankydanblog-jamstack

repo_name: lankydan/lankydanblog-jamstack


text:
---
title: "Free videos that teach CSS Grid"
description: "Videos about grid by Wes Bos"
---

## Free videos that teach CSS Grid

It was wondering why this really awesome video set was going to be free, but I found out that Firefox actually sponsored it. The videos will be up on youtube soon which will be super awesome that learning grid will be accessible to many more people.

[www.cssgrid.io](https://cssgrid.io/)

extension: markdown


text:
Given a linked list, swap every two adjacent nodes and return its head.

You may  **not**  modify the values in the list's nodes, only nodes itself may be changed.

**Example:**

Given `1->2->3->4`, you should return the list as `2->1->4->3`.

repository: gurfinkel/leetCode

path: /problems/Swap Nodes in Pairs/swapPairs.md

repo_name: gurfinkel/leetCode


text:
# OS_Design_Proj
CS630 Group Project

Setting up environments
- need to install two tools
  1. QEMU, an x86 emulator
  2. compiler toolchain

# 1. QEMU
Need to download the MIT version of QEMU using Git

(1.0) install linux 64 on Win 10 requires [changing BIOS option] (https://www.laptopmag.com/articles/access-bios-windows-10):

1.1 Install Git:
```
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install git
```

1.2 clone QEMU from MIT repo
`git clone http://web.mit.edu/ccutler/www/qemu.git -b 6.828-2.3.0`

1.3 install libraries
```
sudo apt-get install libsdl1.2-dev
sudo apt-get install libtool-bin
sudo apt-get install libglib2.0-dev
sudo apt-get install libz-dev
sudo apt-get install libpixman-1-dev
```

1.4 configure (linux)
```
cd qemu
./configure --disable-kvm [--prefix="/home/**YOUR_USERNAME**/qemu" --target-list="i386-softmmu x86_64-softmmu"
```

1.5 `make && make install`

# 2. Compiler toolchain
For linux machine, these should be readily available.
type command in VM Linux terminal:

`objdump -i`   should print a table with 2nd line = `elf32-i386`

`gcc -m32 -print-libgcc-file-name`   should print a directory start with `/user/lib` and end with `/libgcc.a`


text:
# Print Kicker

[Download Package](https://github.com/c0der4t/printkicker/releases/tag/1.2)

![GitHub](https://img.shields.io/github/license/c0der4t/printkicker?style=for-the-badge)

Interface that calls the kick command on a printer with the given kick string.

Use with command line calls to integrate into existing software or use as a standalone testing utility

## Features

- Supports command line calls
- Auto RDP printer correction, i.e Full RDP Support
- IQRetail Integration provided
- Easy to use
- Small Package Size

## Usage/Examples

### Command Line

The command line call accepts 3 arguments:

- Full Printer Name of Target Printer
- Full Kick String in Format : 000-000-000-000-000
- [optional] Debug Mode

If arg #3 is set to 'debug' additional pop ups will appear while the interface processes requests to assist with testing and setup

#### Structure
```batch
powershell start-process ''exePath'' -ArgumentList {"""printername"""; "kickstring"; "debug"} -WindowStyle Hidden
```

#### Full Example
```batch
powershell start-process ''C:\Users\Public\Documents\IQPrinterKicker\IQPrinterKicker.exe'' -ArgumentList {"""EPSON Slip (redirected 257)"""; "027-112-048-055-121"; "debug"} -WindowStyle Hidden
```

#### Full Example (no debug)
```batch
powershell start-process ''C:\Users\Public\Documents\IQPrinterKicker\IQPrinterKicker.exe'' -ArgumentList {"""EPSON Slip (redirected 257)"""; "027-112-048-055-121"; ""} -WindowStyle Hidden
```

### Integration into IQRetail

```pascal

{Copy and paste the following code into any IQ report.
Once added to a report, you can call the kick function in the report using : IQPrintKickPlugin;
Remember to change the following values:
IQPrinterKick_InstallPath = The location of the IQPrinterKick.exe
KickString = The Kickstring for your printer
DebugMode = If set to debug additional messages will be presented informing you of what the system is doing}

procedure IQPrintKickPlugin;
const
IQPrinterKick_InstallPath = 'C:\Users\Public\Documents\IQPrinterKicker\IQPrinterKicker.exe';
KickString = '027-112-048-055-121';
DebugMode = '';
var
qryTerminalSetup : TfrxDBI4Query;
sTargetPrinter,sTempBatFileName : string;
begin
   if <Original> then
   begin

   qryTerminalSetup := TfrxDBI4Query.Create(nil);
   qryTerminalSetup.SQL.Clear;
   with qryTerminalSetup.SQL do
   begin
   Add('SELECT *');
   Add('FROM "' + <ProgramPath> + 'Companys\TERMINALSETUP' + '"');
   ADD('WHERE TerminalNo = ' + inttostr(<Till>)  + ' and Company = ' + IQQuoteString(<CurrentCompany>));
   end;
   qryTerminalSetup.ExecSQL;
   sTargetPrinter := qryTerminalSetup.FieldByName('PosPrinterPort').AsString;

   sTempBatFileName := IQGetUniqueTableName('temp') + '.bat';
   qryTerminalSetup.SQL.Clear;
   with qryTerminalSetup.SQL do
   begin
   ADD('@echo off');
   ADD('powershell start-process ''' + IQPrinterKick_InstallPath + ''' -ArgumentList {"""' + sTargetPrinter + '"""; "' + KickString + '"; "' + DebugMode + '"} -WindowStyle Hidden');
   Add('del ' + sTempBatFileName + '.vbs');
   Add('del ' + sTempBatFileName );
   end;
   qryTerminalSetup.SQL.SaveToFile(sTempBatFileName) ;

   qryTerminalSetup.SQL.Clear;
   with qryTerminalSetup.SQL do
   begin
   ADD('Set WshShell = CreateObject("WScript.Shell") ');
   ADD('WshShell.Run chr(34) & "' + sTempBatFileName + '" & Chr(34), 0');
   ADD('Set WshShell = Nothing');
   end;
   qryTerminalSetup.SQL.SaveToFile(sTempBatFileName + '.vbs') ;

   IQExecute(sTempBatFileName + '.vbs')

   end; //Is Original
end;

```

## Preview

![App Screenshot](https://www.ekronds.co.za/img/PrinterKicker/TestPage.PNG)

## Contributing

Contributions are always welcome 🙂

## Authors

|  [Montè Ekron (c0der4t)](https://www.github.com/c0der4t)          | [Follow me on Twitter](https://twitter.com/EkronMonte)
:-------------------------:|:-------------------------:


text:
# whosonfirst-www-iamhere

![](images/whosonfirst-www-iamhere.png)

`whosonfirst-www-iamhere` is a small web application for displaying coordinates based on the position of the map. Plus Who's on First data, optionally.

## Usage

### Running locally - in "simple" mode

There is one thing you need to run `whosonfirst-www-iamhere` locally in "simple" mode. Simple mode just means a map with live-updating information about its position.

* An HTTP file server for the `whosonfirst-www-iamhere` itself. This is because some browsers are super conservative about what can and can't run on `localhost` (aka your local machine) and what can be served from a `file://` URL (aka your hard drive) the [tangram.js](https://github.com/tangrams/tangram) maps need to be "served" from an actual web server. A very simple HTTP file server is included in this repository and discussed more in detail below.

### Running locally - SURPISE!!

Surprise! There is also a second moving piece, which is a local (Javascript) settings file that you will need to configure by hand. Conveniently there is a sample versions which can simply rename if you want to use all the default settings.

### Running locally - in "fancy" mode

There are four separate components to running `whosonfirst-www-iamhere` locally in "fancy" mode. Fancy mode means a map with live-updating information about its position that will reverse-geocode those coordinates and display their corresponding Who's On First polygons. Optionally, you can also enable searching for a specific place using the [Mapzen Search API](https://mapzen.com/projects/search).

They are:

* An HTTP file server for the `whosonfirst-www-iamhere` itself. This is because some browsers are super conservative about what can and can't run on `localhost` (aka your local machine) and what can be served from a `file://` URL (aka your hard drive) the [tangram.js](https://github.com/tangrams/tangram) maps need to be "served" from an actual web server.  _This is discussed further below._

* An HTTP file server (that can set `CORS` headers) for the serving Who's On First data. _This is discussed further below._

* The [go-whosonfirst-pip](https://github.com/whosonfirst/go-whosonfirst-pip) point-in-polygon server used to query the data.  _This is discussed further below._

* A copy of the [whosonfirst-data](https://github.com/whosonfirst/whosonfirst-data) repository. You don't actually need all of the data. You just need all of the files listed in the CSV file(s) that the point-in-polygon server needs to load in folder organized in the standard Who's On First `123/456/7/1234567.geojson` tree structure.

### Running locally - the details

#### mapzen.whosonfirst.config.js

In the `www/javascript` folder there is a file called `mapzen.whosonfirst.config.js.sample`. Make a copy of it called `mapzen.whosonfirst.config.js`. That's it. Unless you need or want to tailor anything to your needs. Available knobs include:

* Specifying a different endpoint for the point-in-polygon server
* Specifying a different endpoint for the Who's on First data server
* Specifying a [Pelias API key](https://mapzen.com/projects/search) if you want to enabled geocoding
* Specifying a different endpoint for the Pelias (Mapzen Search) API (for example if you're running your own instance)
* Toggling whether or not to display verbose logging in the web application

The `mapzen.whosonfirst.config.js` file is explicitly excluded from being checked-in to the `whosonfirst-www-iamhere` repository.

#### wof-pip-server

This is a small application written in the `Go` programming language that exposes point-in-polygon functionality over an HTTP API and is part of the [go-whosonfirst-pip](https://github.com/whosonfirst/go-whosonfirst-pip/) repository. Pre-compiled binary versions of `wof-pip-server` are available for three operating systems (OS X, Linux and Windows) in the [bin](bin) directory.

```
$> ./bin/osx/wof-pip-server -port 8080 -cors -data /usr/local/mapzen/whosonfirst-data/data /usr/local/mapzen/whosonfirst-data/meta/wof-neighbourhood-latest.csv /usr/local/mapzen/whosonfirst-data/meta/wof-marinearea-latest.csv
```

By default everything in this repository assumes the point-in-polygon server is running on port `8080`. If you change that you will need to update the `mapzen.whosonfirst.pip.endpoint` setting in config file, described below.

#### data server

This can be anything you want it to be, really, just as long as the data is returned with the `CORS` headers enabled.

We have written a small HTTP-based static webserver in the `Go` programming language called `wof-fileserver` that is part of the [go-whosonfirst-fileserver](https://github.com/whosonfirst/go-whosonfirst-fileserver) repository. Pre-compiled binary versions of `wof-fileservers` are available for three operating systems (OS X, Linux and Windows) in the [bin](bin) directory.

```
$> ./bin/osx/wof-fileserver -port 9999 -path /usr/local/mapzen/whosonfirst-data/data/ -cors
```

By default everything in this repository assumes the point-in-polygon server is running on port `9999`. If you change that you will need to update the `mapzen.whosonfirst.data.endpoint` setting in config file, described below.

#### file server

This can be anything you want it to be. (It doesn't even have to set `CORS` headers.) We have written a small HTTP-based static webserver in the `Go` programming language called `wof-fileserver` that is part of the [go-whosonfirst-fileserver](https://github.com/whosonfirst/go-whosonfirst-fileserver) repository.  Pre-compiled binary versions of `wof-fileservers` are available for three operating systems (OS X, Linux and Windows) in the [bin](bin) directory.

```
$> ./bin/osx/wof-fileserver -port 8001 -path /usr/local/mapzen/whosonfirst-www-iamhere/www/
```

## See also

* https://github.com/whosonfirst/whosonfirst-data
* https://github.com/whosonfirst/go-whosonfirst-pip
* https://github.com/whosonfirst/go-whosonfirst-fileserver
* https://github.com/whosonfirst/go-whosonfirst-howto

repository: riordan/whosonfirst-www-iamhere

repo_name: riordan/whosonfirst-www-iamhere


text:
---

wordpress_id: 195
origin: http://pseudoweb.net/2009/08/26/vim-key-bindings/
layout: post
title: Vim Key Bindings
wordpress_url: http://pseudoweb.net/?p=195
location: San Luis Obipos, CA
time: 10:42:12

---
Hey there kiddos,

I use Vim daily, and as such, I've picked up some key bindings which I think make the program just a little more perfect.

" Because we like our line numbers sometimes...
:nnoremap <C-N><C-N> :set invnumber<CR>

" But we don't always wanna wrap
:nnoremap <C-w><C-w> :set invwrap<CR>

" And all the cool kids need to paste
:nnoremap <C-p><C-p> :set invpaste<CR>

" Use the space key to open and close code folds
:vnoremap <space> zf<CR>
:nnoremap <space> zd<CR>

When reading this, remember that the vim configuration file uses " for comments.

So first off I set Ctrl+n to turn line numbers on and off. All you need to do is tap Ctrl+n twice and line numbers will disappear or reappear. This becomes helpful when trying to switch between reading code and needing to copy something into your Instant Messenger.

The next thing I set is Ctrl+w to turn line wrapping on and off. I find line wrapping very annoying, but being able to hit Ctrl+w twice and get the entire line on the screen has proven useful when reading poorly formatted Readme.txts or mysql dumps.

The third binding is something I learned of recently and have fallen in love with. Basically, if you tap Ctrl+p twice before pasting text from an external source (lets say a website or something) vim inserts the text as it looks, instead of trying to do auto-formatting. This is especially useful if posting code with comments in it.

The final key binding lets me open and close code folds by just using spacebar. This is pretty sweet and useful when you need to ignore blocks of text at the same time. You can learn more about code folding with this writeup by Dr. Michael McGuffin or with a simple Google search.

Oh yeah, before I forget. nmap is a binding in normal mode, vmap is a binding for visual mode, and imap is a binding for insert mode. The letters "nore" in-between the mode specifier and map make it so we don't check for recursive mappings. This is useful here because we are binding the space bar and our bindings have spaces in them.

Anyway, hope this was useful, or at least informative.
/Nat

repository: icco/natnatnat

gha_language: CSS

repo_name: icco/natnatnat


text:
# mandatendatabank-consumer

Consumer service to sync mandatendatabank data from external sources based on diff files generated by [loket-mandatarissen-producer](http://github.com/lblod/loket-mandatarissen-producer). At regular intervals the consumer checks for new diff files and ingests the data found in the files. All data is ingested in the same graph.

The service is based on a PoC application which can be found [here](http://github.com/redpencilio/app-poc-diff).

## Tutorials
### Add the service to a stack
Add the service to your `docker-compose.yml`:

```
  mandatendatabank-consumer:
    image: lblod/mandatendatabank-consumer
    environment:
      SYNC_BASE_URL: 'https://api.loket.lblod.info # replace with link to Loket API
```

Change the `SYNC_BASE_URL` to the application hosting the producer server.

## Reference
### Configuration
The following environment variables are required:
* `SYNC_BASE_URL`: base URL of the stack hosting the producer API (e.g. http://loket.lblod.info/)

The following environment variables are optional:
* `SYNC_FILES_PATH (default: /sync/mandatarissen/files)`: relative path to the endpoint to retrieve names of the diff files from
* `DOWNLOAD_FILES_PATH (default: /files/:id/download)`: relative path to the endpoint to download a diff file from. `:id` will be replaced with the uuid of the file.
* `MU_APPLICATION_GRAPH (default: http://mu.semte.ch/application)`: target graph in which all data will be ingested
* `INGEST_INTERVAL (in ms, default: 60000)`: interval at which the consumer needs to sync data
* `START_FROM_DELTA_TIMESTAMP (ISO datetime, default: now)`: timestamp to start sync data from (e.g. "2020-07-05T13:57:36.344Z")

### Model
#### Used prefixes
| Prefix | URI                                                       |
|--------|-----------------------------------------------------------|
| dct    | http://purl.org/dc/terms/                                 |
| adms   | http://www.w3.org/ns/adms#                                |
| ext    | http://mu.semte.ch/vocabularies/ext                       |

#### Sync task
##### Class
`ext:SyncTask`
##### Properties
| Name       | Predicate        | Range           | Definition                                                                                |
|------------|------------------|-----------------|-------------------------------------------------------------------------------------------------------------------------------|
| status     | `adms:status`    | `adms:Status`   | Status of the sync task, initially set to `<http://lblod.data.gift/mandatendatabank-consumer-sync-task-statuses/not-started>` |
| created    | `dct:created`    | `xsd:dateTime`  | Datetime of creation of the task                                                                                |
| creator    | `dct:creator`    | `rdfs:Resource` | Creator of the task, in this case the mandatendatabank-consumer `<http://lblod.data.gift/services/mandatendatabank-consumer>` |
| deltaUntil | `ext:deltaUntil` | `xsd:dateTime`  | Datetime of the latest successfully ingested sync file as part of the task execution                                          |

#### Sync task statuses
The status of the sync task will be updated to reflect the progress of the task. The following statuses are known:
* http://lblod.data.gift/mandatendatabank-consumer-sync-task-statuses/not-started
* http://lblod.data.gift/mandatendatabank-consumer-sync-task-statuses/ongoing
* http://lblod.data.gift/mandatendatabank-consumer-sync-task-statuses/success
* http://lblod.data.gift/mandatendatabank-consumer-sync-task-statuses/failure

### Data flow
At regular intervals, the service will schedule a sync task. Execution of a task consists of the following steps:

1. Retrieve the timestamp to start the sync from
1. Query the producer service for all diff files since that specific timestamp
2. Download the content of each diff file
3. Ingest each diff file in the `MU_APPLICATION_GRAPH`

If one file fails to be ingested, the remaining files in the queue are blocked since the files must always be handled in order.

The service makes 2 core assumptions that must be respected at all times:
1. At any moment we know that the latest `ext:deltaUntil` timestamp on a task, either in failed/ongoing/success state, reflects the timestamp of the latest delta file that has been completly and successfully consumed
2. Maximum 1 sync task is running at any moment in time

### API
```
POST /ingest
```

Schedule and execute a sync task.

The endpoint is triggered internally at frequent intervals and should normally not be triggered by an external party.

repository: lblod/mandatendatabank-consumer

repo_name: lblod/mandatendatabank-consumer


text:
Git Guidelines and Best Practices
=================================

Date Created: 2018-05-30
Last Modified: 2018-05-30

## Summary

This document describes the conventions and best practices applicable to Agents Title project repositories.

Agents Title uses master or "trunk" development -- where the code for production is kept in the master branch and is pull request/merged to. The other branches are used for staging and development.

### Table of Contents

- [Git Branching](#git-branching)
- [Development Flow](#development-flow)

## Git branching

Source code is currently hosted on [Github](http://github.com/agentstitle/). The following branches are used in each project:

- dev-* (name for the feature and developer: `dev-kt-newdatabase`)
- stage
- master (or prod) <- has branch protection and requires PRs

## Development flow

1. Make all your changes in a dev branch.
2. Pull request (PR) into stage branch (do code review in PR) and perform end-to-end integration testing.
3. Pull request from dev into master, force a review and approvals before deployment.
4. **Squash-merge** into master with good release notes and new version.
5. Delete merged dev branch.
6. Delete stage branch.
7. Create new stage branch from master.

**NOTE:** Always branch from the master branch for your new branches.

## Tools

* [Github Desktop](https://desktop.github.com/)
* [Git Commandline](https://git-scm.com/)

repository: agentstitle/development-standards

repo_name: agentstitle/development-standards


text:
# Setting up custom Cfn resource stack with AWS CloudFormation

## Deploy steps

1. Install the AWS Command Line Interface. More information at https://aws.amazon.com/cli/.

2. Open your command shell and navigate to the directory containing the *customCfnTemplate.yaml* file.

3. If you don't have any AWS S3 bucket available, you have to create one running the following command:

    ```bash
    aws s3 mb s3://<YOUR BUCKET NAME>
    ```

    Observe that the bucket name must be unique across all existing bucket names in Amazon S3 and must not contain uppercase or space characters.

4. Run the following command to package the local artifacts that the AWS CloudFormation template references:

    ```bash
    aws cloudformation package --template-file customCfnTemplate.yaml --s3-bucket <YOUR BUCKET NAME> --output-template-file customCfnTemplate.package.yaml
    ```

5.

repository: pswillies/CloudFormationCustomResources

repo_name: pswillies/CloudFormationCustomResources


text:
# @twind/core [![MIT License](https://flat.badgen.net/github/license/tw-in-js/twind)](https://github.com/tw-in-js/twind/blob/main/LICENSE) [![Latest Release](https://flat.badgen.net/npm/v/@twind/core?icon=npm&label&cache=10800&color=blue)](https://www.npmjs.com/package/@twind/core) [![Github](https://flat.badgen.net/badge/icon/tw-in-js%2Ftwind%23core?icon=github&label)](https://github.com/tw-in-js/twind/tree/main/packages/core)

Utility-first CSS without any build step right in the browser or any other environment like Node.js, deno, workers, ...

- 📖 Study [the documentation](https://twind.style)
- 🤖 Try [the playground](https://twind.run)
- 🧭 Explore [the examples](https://twind.style/examples)
- 📓 Consult [the API reference](https://twind.style/packages/@twind/core)
- 📜 Read [the changelog](https://github.com/tw-in-js/twind/tree/main/packages/core/CHANGELOG.md)

## 📖 Documentation

The full documentation is available at [twind.style](https://twind.style).

## 💬 Community

For help, discussion about best practices, or any other conversation that would benefit from being searchable use [Github Discussions](https://github.com/tw-in-js/twind/discussions).

To ask questions and discuss with other Twind users in real time use [Discord Chat](https://chat.twind.style).

## 🧱 Contribute

See the [Contributing Guide](../../CONTRIBUTING.md) for information on how to contribute to this project.

## 📜 Changelog

The Changelog for this package is [available on GitHub](https://github.com/tw-in-js/twind/tree/main/packages/twind/CHANGELOG.md).

## ⚖ License

The [MIT license](https://github.com/tw-in-js/twind/blob/main/LICENSE) governs your use of Twind.

repository: tw-in-js/twind

repo_name: tw-in-js/twind


text:
# Office Add-ins code samples

Office Add-ins code samples are provided in this repo to help you learn, study, and build great Office Add-ins!

## Getting started

The following samples show how to build the simplest Office Add-in with only a manifest, HTML web page, and a logo. They will help you understand the fundamental parts of an Office Add-in. For additional getting started information, see our [quick starts](https://learn.microsoft.com/office/dev/add-ins/quickstarts/excel-quickstart-jquery) and [tutorials](https://learn.microsoft.com/search/?terms=tutorial&scope=Office%20Add-ins).

* [Excel "Hello world" add-in](Samples/hello-world/excel-hello-world)
* [Outlook "Hello world" add-in](Samples/hello-world/outlook-hello-world)
* [PowerPoint "Hello world" add-in](Samples/hello-world/powerpoint-hello-world)
* [Word "Hello world" add-in](Samples/hello-world/word-hello-world)

### Completed tutorials

The following sample is the completed version of the [Excel add-in tutorial](https://learn.microsoft.com/office/dev/add-ins/tutorials/excel-tutorial).

| Name           | Description  |
| -------------- | ------------ |
| [Tutorial: Create an Excel task pane add-in](https://learn.microsoft.com/office/dev/add-ins/tutorials/excel-tutorial) | This sample shows how to create an Excel add-in with a task pane and command ribbon buttons. The add-in shows how to create and sort a table, make a chart, freeze a row, protect a worksheet, and display a dialog box. |

## Blazor WebAssembly

| Name           | Description  |
| -------------- | ------------ |
| [Create a Blazor WebAssembly Excel add-in](https://github.com/OfficeDev/Office-Add-in-samples/tree/main/Samples/blazor-add-in/excel-blazor-add-in) | Uses .NET Blazor technologies to build an Excel add-in. |
| [Create a Blazor WebAssembly Word add-in](https://github.com/OfficeDev/Office-Add-in-samples/tree/main/Samples/blazor-add-in/word-blazor-add-in) | Uses .NET Blazor technologies to build a Word add-in. |
| [Create a Blazor WebAssembly Outlook add-in](https://github.com/OfficeDev/Office-Add-in-samples/tree/main/Samples/blazor-add-in/outlook-blazor-add-in) | Uses .NET Blazor technologies to build an Outlook add-in. |

## Auth, Identity and Single Sign-on (SSO)

All of the following samples show how to access and work with a user's Microsoft Graph data using the Microsoft identity platform.

| Host | Auth approach | Platform | Name |
| ---- | ------------- | -------- | ---- |
| Outlook add-in | SSO | ASP.NET server |[Use SSO in an Outlook Add-in with ASP.NET](Samples/auth/Outlook-Add-in-SSO)|
| Outlook add-in | SSO | Node.js server |[Use SSO with event-based activation in an Outlook add-in](Samples/auth/Outlook-Add-in-SSO-events)|
| Office Add-in | SSO | ASP.NET server |[Use SSO in an Office Add-in with ASP.NET](Samples/auth/Office-Add-in-ASPNET-SSO)|
| Excel add-in | SSO | Node.js server |[Use SSO in an Office Add-in with Node.js](Samples/auth/Office-Add-in-NodeJS-SSO)|
| Excel add-in | MSAL | React SPA |[Use MSAL.js for auth and Microsoft Graph in an Excel add-in](Samples/auth/Office-Add-in-Microsoft-Graph-React)|
| Excel add-in | MSAL | ASP.NET server |[Use MSAL.NET for auth and Microsoft Graph in an Excel add-in](Samples/auth/Office-Add-in-Microsoft-Graph-ASPNET)|
| Outlook add-in | MSAL | ASP.NET server |[Use MSAL.NET for auth and Microsoft Graph in an Outlook add-in](Samples/auth/Outlook-Add-in-Microsoft-Graph-ASPNET)|

## Office

| Name           | Description  |
| -------------- | ------------ |
| [Save custom settings in your Office Add-in](Samples/office-add-in-save-custom-settings) | Shows how to save custom settings inside an Office Add-in. The add-in stores data as key/value pairs, using the JavaScript API for Office property bag, browser cookies, web storage (localStorage and sessionStorage), or by storing the data in a hidden div in the document. |

## Outlook

| Name           | Description  |
| -------------- | ------------ |
| [Use Outlook event-based activation to encrypt attachments, process meeting request attendees and react to appointment date/time changes](Samples/outlook-encrypt-attachments) | Shows how to use event-based activation to encrypt attachments when added by the user. Also shows event handling for recipients changed in a meeting request, and changes to the start or end date or time in a meeting request. |
| [Use Outlook event-based activation to indicate external recipients](Samples/outlook-tag-external) | Uses event-based activation to run an Outlook add-in when the user changes recipients while composing a message. The add-in also uses the appendOnSendAsync API to add a disclaimer.|
| [Use Outlook event-based activation to set the signature](Samples/outlook-set-signature) | Uses event-based activation to run an Outlook add-in when the user creates a new message or appointment.|
| [Use Outlook Smart Alerts](Samples/outlook-check-item-categories/) | Uses Outlook Smart Alerts to verify that required color categories are applied to a new message or appointment before it's sent.|
| [Verify the sensitivity label of a message](Samples/outlook-verify-sensitivity-label/) | Uses the sensitivity label API in an event-based add-in to verify and apply the **Highly Confidential** sensitivity label to applicable outgoing messages. |

## Excel

| Name           | Description  |
| -------------- | ------------ |
| [Data types explorer](Samples/excel-data-types-explorer) | Builds an Excel add-in that allows you to create and explore data types in your workbooks. Data types enable add-in developers to organize complex data structures as objects, such as formatted number values, web images, and entity values. |
| [Open in Teams](Samples/excel-open-in-teams) | Creates a new Excel spreadsheet in Microsoft Teams containing data you define.|
| [Insert an external Excel file and populate it with JSON data](Samples/excel-insert-file)  | Insert an existing template from an external Excel file into the currently open Excel file. Then retrieve data from a JSON web service and populate the template for the customer. |
| [Create custom contextual tabs on the ribbon](Samples/office-contextual-tabs) | This sample shows how to create a custom contextual tab on the ribbon in the Office UI. The sample creates a table, and when the user moves the focus inside the table, the custom tab is displayed. When the user moves outside the table, the custom tab is hidden. |
| [Use keyboard shortcuts for Office add-in actions](Samples/excel-keyboard-shortcuts) | Shows how to set up a basic Excel add-in project that utilizes keyboard shortcuts. |
| [Custom function sample using web worker](Excel-custom-functions/web-worker) | Shows how to use web workers in custom functions to prevent blocking the UI of your Office Add-in. |
| [Use storage techniques to access data from an Office Add-in when offline](Samples/Excel.OfflineStorageAddin) | Demonstrates how you can implement localStorage to enable limited functionality for your Office Add-in when a user experiences lost connection. |
| [Custom function batching pattern](Excel-custom-functions/Batching)| Batch multiple calls into a single call to reduce the number of network calls to a remote service.|

## Word

| Name           | Description  |
| -------------- | ------------ |
| [Get, edit, and set OOXML content in a Word document with a Word add-in](Samples/word-add-in-get-set-edit-openxml)| Shows how to get, edit, and set OOXML content in a Word document.|
| [Load and write Open XML in your Word add-in](Samples/word-add-in-load-and-write-open-xml) | Shows how to add a variety of rich content types to a Word document using the **setSelectedDataAsync** method with **ooxml** coercion type.|

## Shared JavaScript runtime

Check out these samples if you want to take advantage of the [shared runtime](https://learn.microsoft.com/office/dev/add-ins/develop/configure-your-add-in-to-use-a-shared-runtime) for your Office Add-in.

| Date               | Name           | Description  |
| ------------------ | -------------- | ------------ |
[Share global data with a shared runtime](Samples/excel-shared-runtime-global-state) | Shows how to set up a basic project that uses the shared runtime to run code for ribbon buttons, task pane, and custom functions in a single browser runtime. |
| [Manage ribbon and task pane UI, and run code on doc open](Samples/excel-shared-runtime-scenario) | Shows how to create contextual ribbon buttons that are enabled based on the state of your add-in. |

## Additional samples

| Name           | Description  |
| -------------- | ------------ |
| [Use a shared library to migrate your Visual Studio Tools for Office add-in to an Office web add-in](Samples/VSTO-shared-code-migration) | Provides a strategy for code reuse when migrating from VSTO Add-ins to Office Add-ins. |
| [Integrate an Azure function with your Excel custom function](Excel-custom-functions/AzureFunction) | Learn how to integrate Azure functions with custom functions to move to the cloud or integrate additional services. |
| [Dynamic DPI code samples](Samples/dynamic-dpi) | A collection of samples for handling DPI changes in COM, VSTO, and Office Add-ins. |

## Learn more

To learn more about Office Add-ins, see the [Office Add-ins documentation](https://aka.ms/office-add-ins-docs).

## Questions and feedback

* Did you experience any problems with a sample? [Create an issue](https://github.com/OfficeDev/Office-Add-in-samples/issues/new/choose) and we'll help you out.
* We'd love to get your feedback about the samples. Go to our [Office samples survey](https://aka.ms/OfficeSamplesSurvey) to give feedback and suggest improvements.
* For general questions about developing Office Add-ins, go to [Microsoft Q&A](https://learn.microsoft.com/answers/topics/office-js-dev.html) using the office-js-dev tag.

## Join the Microsoft 365 Developer Program

Get a free sandbox, tools, and other resources you need to build solutions for the Microsoft 365 platform.

* [Free developer sandbox](https://developer.microsoft.com/microsoft-365/dev-program#Subscription) Get a free, renewable 90-day Microsoft 365 E5 developer subscription.
* [Sample data packs](https://developer.microsoft.com/microsoft-365/dev-program#Sample) Automatically configure your sandbox by installing user data and content to help you build your solutions.
* [Access to experts](https://developer.microsoft.com/microsoft-365/dev-program#Experts) Access community events to learn from Microsoft 365 experts.
* [Personalized recommendations](https://developer.microsoft.com/microsoft-365/dev-program#Recommendations) Find developer resources quickly from your personalized dashboard.

## Community

The Office Add-ins code samples are a community-driven effort that helps developers extend, build, and provision customizations for the Office platform. The source is maintained on this GitHub repo where anyone can participate. You can provide contributions to the samples, reusable components, and documentation. Office Add-ins code samples is owned and coordinated by Office engineering teams, but the work is done by the community for the community.

Please read the [Contribute](https://github.com/OfficeDev/Office-Add-in-samples/blob/main/CONTRIBUTING.md) page to learn how to be an active part of this community.

## Code of conduct

This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode<EMAIL_ADDRESS>with any additional questions or comments.

repository: ElizabethSamuel-MSFT/PnP-OfficeAddins

repo_name: ElizabethSamuel-MSFT/PnP-OfficeAddins


text:
# HTTP Status Codes

When a responses comes back from the server, it is accompanied by something called an HTTP Status Code. This status code, lets us know if we were successful, and if so what happened, or alternatively, if something went wrong, and if so, where it went wrong.

It's ok to just use `100`, `200`, `300`, `400`, or `500`! All the other codes are just more specific versions of these, so if you are just starting out(and even if you aren't!), these are totally adequate.

The status codes are organized by number, with each "hundred" meaning something different:

- `5xx` Server Error: The server messed up!

![status_code_500](/img/status_500.gif)

- `4xx` Client Error: The client tried to do something incorrectly or tried to do something that was not possible

![status_code_400](/img/status_400.gif)

- `3xx` Redirection: The server is changing the Request-URI

![status_code_300](/img/status_300.gif)

- `2xx` Success: It worked!

![status_code_200](/img/status_200.gif)

- `1xx` Information

![status_code_100](/img/status_100.gif)

repository: saisai/open-web-fundamentals

repo_name: saisai/open-web-fundamentals


text:
[![Travis](https://img.shields.io/travis/binarysound/colorado.svg)]()

# COLORADO

Why Colorado? Cause it's beautiful! :)

# Development

We use [rollup.js](https://github.com/rollup/rollup) for bundling. It's included in `devDependencies`, so you can just forget about it and run yarn scripts. (`test`, `build`, ...)

```bash
yarn
yarn run test
yarn run build
```

repository: binarysound/colorado

repo_name: binarysound/colorado


text:
# branches

你可以通过 `branches` 指令配置分支构建策略。

```yaml
branches:
  include: [ master ]
  exclude: de*
  # include: [ master, release/* ]
  # exclude: [ release/1.0.0, release/1.1.* ]
```

## 常用配置

只允许 `master` 分支构建，其他分支不构建

```yaml
branches:
  include: master
```

只允许 `master` `dev` 分支构建

```yaml
branches:
  include: [ master, dev ]
```

正则匹配

```yaml
branches:
  include: release/1.1.*
```

除了 `dev` 分支，其他分支都构建

```yaml
branches:
  exclude: dev
```

gha_language: PHP


text:
# Vuedals

VueJS (2.x) Plugin for multiple modals windows with a single component instance.

## DEMO

[View demo on jsFiddle](https://jsfiddle.net/ackqudv7/19/)

### What is this?

A plugin to open stocked modals windows, event based, with just one component in your DOM.

### What do you mean with "just one component"?

e.g. if you want to have 3 modals, you don't need to add the component 3 times, just one (preferably in the root of your app) and open as many modals as you want by using an Event Bus

## Install

Install with npm:

```js
npm install --save vuedals
```

## Example

```js
import Vue from 'vue';
import {default as Vuedals, Component as Vuedal, Bus as VuedalsBus} from 'vuedals';

Vue.use(Vuedals);

var myComp = Vue.extend({
    template: `<div>
            <h1>Hello World!</h1>
            <button @click="showIt()">Show me the money</button>
        </div>`,

    methods: {
        showIt() {
            VuedalsBus.$emit('new', {
                name: 'showing-the-money',

                component: {
                    name: 'the-money',

                    template: `
                        <div>
                            <h1>THE MONEY!</h1>
                            <p>Money, money, money, moooneeyyy $ $ $ $</p>
                        </div>
                    `
                }
            });
        }
    }
});

var vm = new Vue({
    el: '#app',

    components: {
        myComp,
        Vuedal
    },

    template: `<div>
        <my-comp></my-comp>

        <vuedal></vuedal>
    </div>`
});
```

## Usage

### Opening a new modal window

You can emit an event in your component:

```js
this.$emit('vuedals:new', { option });
```

or a method:

```js
this.$vuedals.new({ options });
```

or the Vuedals Event Bus:

```js
import {Bus as Vuedals} from 'vuedals';

...

methods: {
    openNewModal() {
        Vuedals.$emit('new', { options });
    }
}
```

### Closing a modal

You can emit an event in your component:

```js
this.$emit('vuedals:close'[, data]);
```

a method:

```js
this.$vuedals.close([data]);
```

or the Vuedals Event Bus:

```js
import {Bus as Vuedals} from 'vuedals';

...

methods: {
    openNewModal() {
        Vuedals.$emit('close'[, data]);
    }
}
```

#### Closing an especific modal

If you need to close a specific modal index, you can pass it as an `$index` property of the data.

```js
this.$vuedals.close({
    $index: 3
})
```

*$index* can be an integer or a function. In case $index is a function, the additional data and all the vuedals that is currently present is `index(data, this.vuedals)` passed as argument so that you can determine the index of the vudedal to close and return the index of it

```js
this.$vuedals.close({
    $index(data, vuedals) {
        // this will always close the latest modal
        return vuedals.length - 1;
    }
})
```

### Events

Depending if you're creating the modal *from the component* or *from the Vuedals Event Bus*, these are the events (component / bus):

##### vuedals:new / new
Open a new modal window, with the given options

##### vuedals:close / close
Close the most recently opened modal window, if data is given, will pass it to the `onClose` option.

#### vuedals:opened / opened
When a modal was open. Returns an object with:

1. The index of the recently opened modal
2. The options passed to that modal instance

#### vuedals:closed / closed
When a modal was closed. Returns an object with:

1. The index of the closed modal
2. The options passed to that modal instance
3. The data given when `close` was called

#### vuedals:destroyed / destroyed
Emitted when the last modal instance is closed. *i.e. there's not more open modals left*

1. The index of the closed modal
2. The options passed to that modal instance
3. The data given when `close` was called

### Options

When creating a new modal, you'll need to pass the given options:

#### name
A reference name of the modal. Use to define the css class of that modal

*Default: null*

#### component
A Vue component to display inside the modal

#### props
A props object that will be passed to the component inside the modal.

example:

```js
import {Bus as Vuedals} from 'vuedals';

...

methods: {
    openModal() {
        this.$vuedals.open({
            name: 'test-component',

            // Pass these props to the component
            props: {
                firstname: 'John',
                lastname: 'Doe'
            },

            component: {
                name: 'show-john-doe',

                // Expect these props values
                props: ['firstname', 'lastname'],

                template: `
                    <div>
                        Hi {{ firstname }} {{ lastname }}
                    </div>
                `
            }
        });
    }
}
```

#### size
The size of the modal.

Possible values are:
- **xs**: 350px width
- **sm**: 550px width
- **md**: 650px width
- **lg**: 850px width
- **xl**: 1024px width

*Default: md*

#### dismissable
Should the modal include an "X" to be closed?

*Default: true*

#### escapable
Can this modal be closed by pression the *esc* key?

*Default: false*

#### title
Title of the modal window

*Default: ''*

#### header
An object that will be used to generate a custom header

*Default: null*

```
header: {
    component: 'header-component',
    props: {
        custom: 'Props'
    }
}
```

#### onClose
Callback function to call when the modal is closed. Any given data is passed as a parameter for that callback. Example:

```js
this.$vuedals.open({
    name: 'test-component',

    // Pass these props to the component
    props: {
        firstname: 'John',
        lastname: 'Doe'
    },

    component: {
        name: 'show-john-doe',

        // Pass these props to the component
        props: ['firstname', 'lastname'],

        template: `
            <div>
                Hi {{ firstname }} {{ lastname }}
            </div>
        `
    },

    onClose(data) {
        console.log('Data received from the vuedal instance': data);
    }
});
```

#### onDismiss
Callback function to call when the modal is closed.

Please notice that even `close` and `dismiss` both close the active modal instance (closes the modal) only the `close` event accepts data argument that can be passed to the callback, while `dismiss` just send the modal to close.

The callback may prevent the modal closing by returning `false`.

Example:

```js
this.$vuedals.open({
    name: 'test-component',

    // Pass these props to the component
    props: {
        firstname: 'John',
        lastname: 'Doe'
    },

    component: {
        name: 'show-john-doe',

        // expect these props
        props: ['firstname', 'lastname'],

        template: `
            <div>
                Hi {{ firstname }} {{ lastname }}
            </div>
        `
    },

    onDismiss() {
        console.log('The user dismissed the modal');
    }
});
```

repository: SRichner/vuedals

repo_name: SRichner/vuedals