text:
---
title: Basic Economic Concepts
author: McGraw-Hill Education

subject: Social Studies
category: Common Core Basics
chapter: 5
section: 5.1
tag: Economics

cover_image: ccb-social-studies.jpg

excerpt: "In any economic system, limited resources force people to make choices. People cannot have everything they want. The study of economics helps us analyze the best way to use our limited resources."

---
## Scarcity and Choice

Sometimes people ask why we bother studying economics. There are many possible answers to this question. Most economists say that we study economics so we can learn how to deal with the problem of scarcity. Scarcity is the shortage of goods. It occurs because people have unlimited wants or needs, but they have limited resources for satisfying those wants and needs. To put it more simply, we cannot have everything we may want. Scarcity is often called the universal economic problem because people in every society, past and present, have faced scarcity.

People have tried to overcome scarcity by improving the ways goods and services are produced. For example, during the Industrial Revolution, manufacturing was changed from small-scale cottage industries (people working at home to produce goods) to mass production in large factories. These factories also transformed how the factors of production were used. The factors of production are the key resources used to produce goods and services. The three main factors of production are natural resources (land), human resources (labor), and capital goods (capital).

| Factors of Production | Definition | Examples |
|:-|:-|:-|
| Natural Resources, land |natural features or materials | oceans, wild animals, forests, minerals |
| Human Resources, labor | the time and effort of workers | factory workers, doctors, teachers, farmers |
| Capital Goods, capitol | items designed to produce other goods | tractors, computers, office and factory buildings |
{: .striped .responsive-table }

Unfortunately, changes that occurred during the Industrial Revolution did not mean workers and their families had easier lives. In fact, large factories often became sweatshops. Laborers were forced to work long hours under unpleasant and dangerous conditions for little pay. Technology had made production more efficient (productive without being wasteful) and had increased output, but scarcity was not eliminated.

Scarcity forces us to make choices about how to use limited resources. When a business has a scarcity of one or more of the factors of production, the business may have difficulty producing its product. People also face scarcity. For instance, you may want to see a new movie, shop for shoes, and go out to dinner. However, you have only enough money to do one of these things. Your scarce resource is money. You will not be able to do everything you would like to do; you'll have to choose which activity is the most important or the most necessary.

### Choices Involve Costs

When we think about the cost of something, we normally think about the price of items we purchase. For example, if you choose to buy a coat, the "cost" to you is the price you paid for the coat. Economists tend to look at cost in a different way. They measure the true cost by what a consumer did not buy, by what a business did not produce, or by what goods or services the government did not provide. This is called the opportunity cost. It is the item or service that was not purchased.

#### Consumer Choices

Suppose Janet has $20 to spend on Saturday night. Janet narrows her plans to two choices. She can buy a movie ticket and treats at the theater, or she can buy a large pizza. If Janet buys the pizza, the opportunity cost is what she gave up, in this case, the movie ticket and treats.

#### Business Choices

Similarly, businesses face opportunity costs when they decide what items  to produce. Suppose Clara's Clothing Outlet can produce two types of clothing, T-shirts and sweatshirts. Because of the size of the business and the number of available workers and machinery, Clara's Clothing can produce 1,000 T-shirts per day or 500 sweatshirts per day. If the business chooses to produce the 1,000 T-shirts, the opportunity cost is the 500 sweatshirts that were not produced.

#### Government Choices

Even the government confronts opportunity cost. Suppose your town needs to upgrade local schools and also needs to upgrade the water-treatment plant. Each project will cost $10 million. However, the town has only $10 million to spend. If your town spends its scarce financial resources ($10 million) to upgrade local schools, the opportunity cost is the improvement of the water-treatment plant.

### Graphing Opportunity Cost

Graphs organize data to show trends and relationships. The production possibilities curve (PPC) is a graph that shows all possible combinations of two products that suppliers might produce. If the supplier produces more of one product, it will have to cut back on the production of the other product. This is because the supplier's resources are limited. Economists assume that available resources are being used efficiently. The suppliers of products could be businesses, government, or the entire economy.

#### Production Possibilities Table

Clara's Clothing Outlet can produce 1,000 T-shirts or 500 sweatshirts per day, but not 1,000 T-shirts and 500 sweatshirts. The business can also choose to produce some T-shirts and some sweatshirts. The following table shows some of the combinations of T-shirts and sweatshirts the business can make.

**Production Possibilities (Daily}**

| Product | Points | Points | Points | Points |
|:-|:-:|:-:|:-:|:-:|
| | A | B | C | D |
| T-Shirts | 1,000 | 800 | 500 | 0 |
| Sweatshirts | 0 | 200 | 400 | 500 |
{: .striped .responsive-table }

![Production Possibilities Curve](img/ppc.png){: .responsive-img .materialboxed }

Notice option A-if the firm produces 1,000 T-shirts, 0 sweatshirts are produced. This is the case when all of the firm's resources are used to produce T-shirts. With option B, however, some of the firm's resources are switched from the production of T-shirts to the production of sweatshirts, so the firm can produce 800 T-shirts and 200 sweatshirts. With option D, all of the firm's resources are used to produce 500 sweatshirts, and no resources are available to produce any T-shirts.

#### Production Possibilities Curve

A PPC plots the numbers from the production possibilities table on a graph. This graph shows how the increased production of one item (sweatshirts) causes a drop in the production of a second item (T-shirts). The vertical axis of the PPC shows how many T-shirts Clara's Clothing Outlet might produce in a single day. As you can see, the firm could produce from O to 1,000 T-shirts. The horizontal axis of the PPC shows how many sweatshirts the firm might choose to produce, which ranges from O to 500.


text:
---
layout: post
title: "Mountain Lion Setup, Part 1 : Upgrade Lion"
date: 2012-08-16 10:00:14 +0100
comments: true
sharing: true
footer: true
categories: Tech
tags:
- Apple
- Lion
- Mountain Lion
discuss_url: //180
url: //180/Mountain_Lion_Setup%2C_Part_1_%3A_Upgrade_Lion
id: 180
---
MacBook Pro with Lion arrives, before installing any other software apply for the [Up-to-Date Programme][uptodate] for free a mountain lion upgrade.

Once you have completed the form acceptance email should arrive in about 5 minutes. One email contains a link to a document and the other email contains the password. Once opened the document contains the redemption code.

To redeem upgrade code, /Applications/App Store.app -> Featured -> Quick Links, Redeem

This will Result in a 4.1GB temporary app called `/Applications/Install OS X Mountain Lion.app` Once finished downloading this will prompt you to run. Which will install Mountain Line reboot and complete the installation and remove the temporary app.

\[Optional\]
*Note:* As XCode no longer ships with command line tools and the gcc that can be installed with it is not compatible with compiling ruby, Xcode is no longer required for Ruby Development.

I then also got Xcode 4 from the app store but have not ran it yet to install the command line tools, this app was:

    1.7G	/Applications/Xcode.app
\[\\Optional\]

My disk usage looked like this after a Lion to Mountain Lion upgrade with only the xcode 4 app installed:

     29G     /

    5.0G	/Applications
    2.5G	/Library
      0B	/Network
    3.1G	/System
    4.0K	/User Information
    280M	/Users
    259G	/Volumes
    2.7M	/bin
      0B	/cores
    4.5K	/dev
    4.0K	/etc
    1.0K	/home
    7.8M	/mach_kernel
    1.0K	/net
     17G	/private
    1.5M	/sbin
    4.0K	/tmp
    360M	/usr
    4.0K	/var

Report generated with `$ sudo du -sh /*`

\[Optional\]
XCode is required for OSX and iOS development. [Here is a useful page about the major changes in xcode 4.3][xcode4.3]. How ever if you only want to do Ruby development with [RVM][] Then there are other tools required see [Mountain Lion setup Part2][p2]

Run `/Applications/Xcode.app`, Once started from the Xcode menu goto File -> Preferences or press '⌘,'
Then select Downloads.

You should see Image below, Install the command line tools.

\[\\Optional\]

[uptodate]: http://www.apple.com/uk/osx/uptodate/

[xcode4.3]: http://developer.apple.com/library/ios/#documentation/DeveloperTools/Conceptual/WhatsNewXcode/Articles/xcode_4_3.html
[homebrew]: http://mxcl.github.com/homebrew/
[RVM]: https://rvm.io/rvm/
[p2]: http://amaras-tech.co.uk/article/182

license: MIT

branch_name: refs/heads/master

extension: markdown

license_type: permissive


text:
# asyncpp

Asyncpp is a C++ utility library for asynchronous or functional programming using modern C++ lambdas, without getting into callback hell.  It is ideally suited for use with Boost ASIO.

This was inspired by the popular [async](https://github.com/caolan/async) Node.js library.

### What problem does this solve?

In asynchronous programming (e.g. network programming using Boost ASIO, where the thread
doesn't block on network calls) you lose the ability to pass data back to a calling
function via return values.  And if there are many chained asynchronous operations, or
some combination of serial and parallel asynchronous operations, then you quickly wind up
with a mess of callbacks.

This library helps by packaging several common patterns of asynchronous operations, to keep your code
clean and reasonable.

Here's a contrived example.  Imagine we have to call a blocking function three times in a row.  If
any of the invocations returns `false`, we want to return `false` to the caller.

```c++
bool func();

bool call_func_three_times() {
    for (int i = 0; i < 3; i++) {
        if (!func()) {
            return false;
        }
    }
    return true;
}
```

Now what if the functions are non-blocking?  Note that the following naive attempt would
not work:

```c++
bool func_async();

bool call_func_three_times_async() {
    for (int i = 0; i < 3; i++) {
        if (!func_async()) {  // Non-blocking.
            return false;
        }
    }
    return true;
}
```

It can't work because the non-blocking calls can't really return the final return value,
since the operations they perform complete at some point in the future.  Furthermore, the
above code is spawning three calls in parallel, not in series.

A proper version of the asynchronous code needs callbacks, and could look like this:

```c++
using KeepGoingCallback = std::function<void(bool keep_going)>;
using FinalCallback = std::function<void(bool return_code)>;

// This function  spawns some asynchronous activity, and eventually
// invokes 'callback' with the value true to keep going, or false to stop.
void func_async(KeepGoingCallback callback);

// Start the chain of invocations.  Eventually, 'final_callback'
// will be invoked with true if all three functions succeded,
// or false if there were any errors.
void call_function_three_times_async(FinalCallback final_callback) {
    func_async([final_callback](bool keep_going) {
        // This lambda is eventually invoked by func_async() when it's
        // done.  func_async() will pass it true or false, to trigger
        // the next step in the chain, or stop altogether.
        if (keep_going) {
            func_async([final_callback](bool keep_going) {
                // This lambda is also invoked by func_async().
                if (keep_going) {
                    func_async([final_callback](bool keep_going) {
                        // This lambda too.
                        if (keep_going) {
                            // We're done and all three calls succeeded.
                            final_callback(true);
                        } else {
                            // We're done but the third call failed.
                            final_callback(false);
                        }
                    });
                } else {
                    // The second call failed.  Stop.
                    final_callback(false);
                }
            });
        } else {
            // The first call failed.  Stop.
            final_callback(false);
        }
    });
}
```

This now *works*, but we're in **callback hell**.

#### Cleaned up with Asyncpp

Using **Asyncpp** library, the code becomes:

```c++
using KeepGoingCallback = std::function<void(bool keep_going)>;
using FinalCallback = std::function<void(bool return_code)>;

void func_async(KeepGoingCallback callback);

void call_function_three_times_async(FinalCallback final_callback) {
    async::ntimes(3, func_async, final_callback);
}
```

We've completely generalized the pattern of multiple serial calls to an asynchronous
function.

The **Asyncpp** library also has functions for parallel calls, parallel calls
with a limit on the number of simultaneous outstanding calls, loops, filters, and more.

#### Boost example

Here's an example using the Boost ASIO network library.  Instead of writing:

```c++
resolver.async_resolve(query, [=](error_code& err, ...) {
    // Do stuff, then:
    asio::async_connect(socket, iter, [=](error_code& err, ...) {
        // Do stuff, then:
        asio::async_write(socket, request, [=](error_code& err, ...) {
            // Do stuff, then:
            asio::asio_read_until(socket, response, "\r\n", [=](error_code& err, ...) {
                // Do stuff, then:
                asio::asio_read_until(socket, response, "\r\n", [=](error_code& err, ...) {
                    // Do stuff, then:
                    asio::asio_read_until(socket, response, "\r\n", [=](error_code& err, ...) {
                        // Do stuff, then:
                        asio::async_read_until(socket, response, "\r\n\r\n", [=](error_code& err, ...) {
                            // Keep nesting and nesting until your tab key breaks :-(
                        }
                    }
                }
            }
        }
    }
}
```

with **asyncpp** we can write this as a flat sequence of steps:

```c++
    using Callback = async::TaskCallback<int>;
    async::TaskVector<int> tasks {
        [](Callback next) {
            resolver.async_resolve(query,
                [=](error_code& err, ...) { next(async::OK, 0); };
        }, [](Callback next) {
            // Do stuff, then:
            asio::async_connect(socket, iter,
                [=](error_code& err, ...) { next(async::OK, 1); };
        }, [](Callback next) {
            // Do stuff, then:
            asio::async_write(socket, request,
                [=](error_code& err, ...) { next(async::OK, 2); };
        }, [](Callback next) {
            // Do stuff, then:
            asio::async_read_until(socket, response, "\r\n",
                [=](error_code& err, ...) { next(async::OK, 3); };
        }, [](Callback next) {
            // Do stuff, then:
            asio::async_read_until(socket, response, "\r\n",
                [=](error_code& err, ...) { next(async::OK, 4); };
        }, [](Callback next) {
            // Do stuff, then:
            asio::async_read_until(socket, response, "\r\n",
                [=](error_code& err, ...) { next(async::OK, 5); };
        }, [](Callback next) {
            // Do stuff, then:
            asio::async_read_until(socket, response, "\r\n\r\n",
                [=](error_code& err, ...) { next(async::OK, 6); };
        }
    };
    async::series<int>(tasks);
```

### Functions

#### each

Takes an input vector and a function, and applies that function to each element in the vector

#### map

Takes an input vector and a function, and applies that function to each element in the vector.  Returns (via the final_callback) a new vector with the transformed values.

#### series

Invokes a series of tasks, and collects result values into a vector. As each task completes, it invokes a callback with an error code and a result value. If the error code is not `async::OK`, iteration stops. Once all tasks complete or there is an error, `final_callback` is called with the last error and the results vector.

Each task may invoke its callback immediately, or at some point in the future.

#### parallel

Invokes a series of tasks, each of which produces some output value, and aggregates the results into an output vector.

A task may run to completion immediately, or it may defer calling its completion callback.  The latter would be if using with an asynchronous execution framework like Boost ASIO.  If each task runs to completion immediately, then this call becomes equivalent to [`series`](#series).

There is no limit on how many calls may be outstanding at the same time.

#### parallelLimit

Same as [`parallel`](#parallel), but allows the setting of a limit on how many tasks may be concurrently outstanding.

#### filter

Takes a vector of input data, and passes each element through a test function that returns **true** or **false**.  If **true**, that element is added to an output vector.

#### reject

Similar to [`filter`](#filter), except each element is added to the output vector if the test function returns **false**.

#### whilst

Takes two functions, `test` and `func`.  It repeatedly calls `test`, and if that returns **true**, then calls `func`.  It `test` ever returns **false** or `func` passes a non-OK (non-zero) error code to its callback, then the `whilst` function stops.

#### doWhilst

Similar to [`whilst`](#whilst), except if follows `do..while` control flow.  That is, it calls `func` first, then `test`.  Otherwise, the same rules rules.

#### until

Similar to [`whilst`](#whilst), except that instead of stopping when `test` returns **false**, it stops when `test` returns **true**.

#### doUntil

Similar to [`doWhilst`](#doWhilst), except that instead of stopping when `test` returns **false**, it stops when `test` returns **true**.

#### forever

Executes a function repetedly, until it passes a non-OK (non-zero) error code to its callback.  This is equivalent to [`whilst`](#whilst) with a `test` function that always returns **true**.

#### ntimes

Executes a function a given number of times, or until it passes a non-OK (non-zero) error code to its callback.

### Summary

Function | Concurrency | Executes vec of functions | Applies single function to data vec | Returns vec of results | Output vec same size as input
------------------------------- | :---:       | :-: | :-: | :-: | :-:
[each](#each)                   | limit = _n_ | no  | yes | no  | n/a
[map](#map)                     | limit = _n_ | no  | yes | yes | yes
[series](#series)               | 1           | yes | no  | yes | yes
[parallel](#parallel)           | no limit    | yes | no  | yes | yes
[parallelLimit](#parallelLimit) | limit = _n_ | yes | no  | yes | yes
[filter](#filter)               | limit = _n_ | no  | yes | yes | no
[reject](#reject)               | limit = _n_ | no  | yes | yes | no
[whilst](#whilst)               | 1           | no  | no  | no  | n/a
[doWhilst](#doWhilst)           | 1           | no  | no  | no  | n/a
[until](#until)                 | 1           | no  | no  | no  | n/a
[doUntil](#doUntil)             | 1           | no  | no  | no  | n/a
[forever](#forever)             | 1           | no  | no  | no  | n/a
[ntimes](#ntimes)               | 1           | no  | no  | no  | n/a

### Examples

Build using `scons`.  Binaries will be in `bin/` directory.

Examples are in [/examples](/examples) directory.

Run tests with `scons test`.

### Requirements

* C++11.
* SCons (`brew install scons`)
* Boost (`brew install boost`)

Tested with:

```
Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
Target: x86_64-apple-darwin13.3.0
Thread model: posix
```

This library was developed primarily for use with Boost ASIO, but should support other
single-thread asynchronous frameworks.  It has not been tested with multithreaded code.

---------

Made with :horse: by Paul Rademacher.

repository: vadio/asyncpp

extension: md

repo_name: vadio/asyncpp


text:
# Contributing

[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/guastallaigor/vue-tiez/issues)

Thanks for your interest in contributing to Vue Tiez! ❤

**Please ask first before starting work on any significant new features!**

The main goal right now is that we have all the components and sections from [ZEIT Design System][zeit-design]

## Coding standards

[![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/standard/standard)

We also follow [Stylelint][stylelint] / [Stylelint Config Standard][stylelint-config-standard]

You can use `yarn run stylelint` and `yarn run stylelint:vue` to check if there's anything wrong regarding the lint

## Basic information

* Project setup?
  [We've got you covered!](#project-setup)

* Found a bug?
  [Let us know!][new-issue]

* Patched a bug?
  [Make a PR!][new-pr]

* Adding a new feature?
  Make sure to [open an issue][new-issue] describing your feature, then open a [new PR][new-pr] when you're ready for feedback!

* Commit formatting
  [Commitizen/Commitlint](#commit-formatting)

## Project setup

The following steps will get you up and running:

1. Fork and clone the repo
```sh
$ git clone https://github.com/YOUR_GITHUB_USERNAME/vue-tiez.git
```
2. Install the required dependencies:
```sh
$ cd vue-tiez
$ yarn
```

### Storybook
For visual testing, this project contains storybook which you can run by doing the next command
```sh
$ yarn storybook
```

### Jest
Before making the PR, if you changed or added something that needs to be tested, please make the tests inside the `tests/unit` folder

To run the tests, you can use the next command

```sh
$ yarn test:unit
```

To develop using tests, you can use this command also

```sh
$ yarn test:watch
```

## Commit formatting

We use [Commitizen][commitizen] and [`commitlint`][commitlint] to make sure all of the commits to the project are easy to read

You can commit using `npm run commit` to help you with that

There's a `pre-push` hook that runs all the unit tests before you can push it

If an error occurs, you can use the `npm run commit:retry` command that runs the previous `npm run commit` that you already filled

[commitizen]: https://github.com/commitizen/cz-cli
[commitlint]: [https://github.com/conventional-changelog/commitlint]
[egghead]: https://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github
[new-issue]: https://github.com/guastallaigor/vue-tiez/issues/new/choose
[new-pr]: https://github.com/guastallaigor/vue-tiez/compare/master...master
[zeit-design]: https://zeit.co/design
[stylelint]: https://github.com/stylelint/stylelint
[stylelint-config-standard]: https://github.com/stylelint/stylelint-config-standard

repository: guastallaigor/vue-tiez

gha_language: JavaScript

gha_license_id: MIT

repo_name: guastallaigor/vue-tiez


text:
# SimpleExpansion
A simple model for free expansion of a gas using stochastic dynamics

## Background
The main purpose of this piece of code is simulating the free expansion of a gas (https://en.wikipedia.org/wiki/Free_expansion).

Here we use a minimal discrete time model. We initialize it with all the molecules in the left cavity. At each time step, one particle chosen randomly changes its position to the other cavity.Even with such a simple dynamics, several properties of free expansion can be derived.

The main purpose of this code is the generation of animated visualizations, useful for teaching basic statistical mechanics.

Where the value of the potential at x_0 is an arbitrary integration constant.

## Examples of usage
### Create and update the ExpansionSim object
```[Matlab]
%% Initialization
r = 10; % Number of rows
c = 10; % Number of columns

%% Create the object
obj = ExpansionSim(r, c);

%% Update N times
N = 100;
obj.Update(N);
```

### Plot occupation diagram
```[Matlab]
obj.Plot(); % Plots current occupation diagram

obj.Plot(tStep); % Plots the occupation diagram at a given time step
```

![Occupation_diagram](./figs/occupation.png "Occupation diagram")

### Plot a summary of the occupation as a bar plot
```[Matlab]
obj.PlotBar(); % Bar plot of the current occupation summary

obj.Plot(tStep); % Bar plot of the occupation summary at a given time step
```

![Bar_diagram](./figs/bar.png "Summary of the occupation")

### Plot historic summary of occupation
```[Matlab]
obj.PlotHistoric();
```

![Historic](./figs/historic.png "Occupation history")

### Create an animated occupation diagram
```[Matlab]
obj.Animate();
```

![Animation](./figs/animation.gif "Animation")

By [Pablo Rodríguez-Sánchez](https://sites.google.com/site/pablorodriguezsanchez/ "Contact"), November 2017.

repository: PabRod/SimpleExpansion

repo_name: PabRod/SimpleExpansion


text:
# mydal

A simple JavaScript data access layer and table gateway implementation for MySQL.

By [Joe Fallon](http://blog.joefallon.net)

MyDAL has the following features:

*   Promise support.
*   Full suite of unit tests.
*   It can be integrated into any existing project.
*   Can be fully understood in just a few moments.
*   The library implements the data mapper design patter
    (a.k.a. table gateway).
*   The mysql npm package is used for all data access.
*   Connection pooling is used by default.
*   Written in TypeScript.

## Installation

The easiest way to install MyDAL is with npm.

```
npm install mydal --save
```

## Usage

There are two main classes that are used to represent all of the
relationships within the database.

```
TableGateway
JoinTableGateway
```

Additionally, there is a factory called ConnectionPoolFactory for creating
MySQL connection pools.

```
public static create(poolConfig: PoolConfig): Pool;
````

### Entities

An entity represents a single row within a database. Another name for
this type of object is data transfer object (DTO). Here is an
example entity class for a row in a products table.

```
export class Product {
    public id:          number;
    public name:        string;
    public description: string;
    public price:       number;
    public created:     string;
    public updated:     string;

    public constructor() {
        this.created     = '';
        this.description = null;
        this.id          = 0;
        this.name        = '';
        this.price       = 0;
        this.updated     = '';
    }
}
```

### TableGateway

Both of these classes are designed to be wrapped by classes that you
create. The classes that you create can selectively expose the functionality
provided.

The TableGateway class is designed to access all tables
in the database that are not join (or associative) tables.

At a minimum, a class accessed by the TableGateway needs a
primary key. The name of the primary key will default to id
if one is not provided.

Optionally, two additional columns are provided for created
and updated timestamps. The name of those to columns is
configurable by you.

The TableGateway provides the following constructor:

```
// If no primary key is supplied, then "id" is assumed.
constructor(connectionPool: Pool, tableName: string, primaryKey = 'id');
```

The TableGateway provides the following promise style data access and
modification methods:

```
// Returns the inserted row with the inserted primary key (e.g. id) added.
createRow(row: any): Promise<any>;

retrieveRow(id: number): Promise<any>;

updateRow(row: any): Promise<number>;

deleteRow(id: number): Promise<number>;

retrieveRows(fieldName: string, fieldValue: any): Promise<any[] | null>;

retrieveRowsByIds(ids: number[]): Promise<any[]>;

retrieveRowsByIsNull(fieldName: string): Promise<any[]>;

retrieveRowsByNotEqual(fieldName: string, fieldValue: any): Promise<any[]>;

setFieldNullWhere(fieldName: string, fieldValue: any): Promise<number>;

deleteRowsBy(fieldName: string, fieldValue: any): Promise<number>;

countRowsByValue(fieldName: string, fieldValue: any): Promise<number>;
```

The the following methods are used to set the optional created and updated timestamp columns names:

```
setCreatedColumnName(value: string): void;
setUpdatedColumnName(value: string): void;
```

### Example Products Table Schema

```
Name        Type            Options
----------- --------------- ---------------------------
id          interger        non-null, autoincrement, pk
name        string          non-null
description string          nullable
price       decimal(10,2)   non-null
created     string          non-null
updated     string          non-null
```

### Example ProductsGateway

```
import {Pool} from "mysql";

import {TableGateway} from "../../src/TableGateway";
import { Product } from '../entities/Product';

export class ProductsGateway {
    private static readonly TABLE_NAME = 'products';

    private readonly _tableGateway: TableGateway;

    constructor(connectionPool: Pool) {
        this._tableGateway = new TableGateway(connectionPool, ProductsGateway.TABLE_NAME);
        this._tableGateway.setCreatedColumnName('created');
        this._tableGateway.setUpdatedColumnName('updated');
    }

    /**
     * @returns The inserted Product.
     */
    public async createRow(product: Product): Promise<Product> {
        return this._tableGateway.createRow(product);
    }

    /**
     * @returns Retrieves the row with the given id if found, null otherwise.
     */
    public async retrieveRow(id: number): Promise<Product> {
        return this._tableGateway.retrieveRow(id);
    }

    /**
     * @returns Returns the number of affected rows (0 or 1).
     */
    public async updateRow(product: Product): Promise<number> {
        return this._tableGateway.updateRow(product);
    }

    /**
     * @returns Returns the number of affected rows (0 or 1).
     */
    public async deleteRow(id: number): Promise<number> {
        return this._tableGateway.deleteRow(id);
    }

    /**
     * @returns Returns an array of products.
     */
    public async retrieveByDescription(description: string): Promise<Product[]> {
        return this._tableGateway.retrieveRows('description', description);
    }

    /**
     * @returns Returns an array of Products.
     */
    public async retrieveByIds(ids: number[]): Promise<Product[]> {
        return this._tableGateway.retrieveRowsByIds(ids);
    }

    /**
     * @returns Returns an array of Products.
     */
    public async retrieveByNullDescription(): Promise<Product[]> {
        return this._tableGateway.retrieveRowsByIsNull('description');
    }

    /**
     * @returns Returns an array of Products.
     */
    public async retrieveByDescriptionNotEqual(description: string): Promise<Product[]> {
        return this._tableGateway.retrieveRowsByNotEqual('description', description);
    }

    /**
     * @returns Returns the number of affected rows.
     */
    public async setDescriptionNullWhereNameIs(value: string): Promise<number> {
        return this._tableGateway.setFieldNullWhere('description', value);
    }

    /**
     * @returns Returns the number of affected rows.
     */
    public async deleteWhereNameIs(name: string): Promise<number> {
        return this._tableGateway.deleteRowsBy('name', name);
    }

    /**
     * @returns Returns the count.
     */
    public async countProductsByName(name: string): Promise<number> {
        return this._tableGateway.countRowsByValue('name', name);
    }
}
```

It is also possible to forgo data mappers and return the results directly.

### JoinTableGateway

The JoinTableGateway is used to manage access to an
associative table that represents a many-to-many relationship.

As a review, a join table must consist of two fields, at a minimum.
Each field is a foreign-key to another table. Optionally, a column
with a timestamp to represent the time created is provided as well.
It is assumed that the combination of the two foreign key fields
is unique.

### Example JoinTableGateway

```
import {Pool} from "mysql";
import {JoinTableGateway} from "../../src/JoinTableGateway";

export class OrdersProductsGateway {
    private readonly tableName = 'orders_products';
    private readonly id1Name   = 'table1_id';
    private readonly id2Name   = 'table2_id';

    private joinTableGateway: JoinTableGateway;

    constructor(connectionPool: Pool) {
        let table = this.tableName;
        let id1   = this.id1Name;
        let id2   = this.id2Name;
        this.joinTableGateway = new JoinTableGateway(connectionPool, table, id1, id2);
        this.joinTableGateway.setCreatedColumnName('created');
    }

    public createRow(id1: number, id2: number): Promise<boolean> {
        return this.joinTableGateway.createRow(id1, id2);
    }

    public retrieveRow(id1: number, id2: number): Promise<any> {
        return this.joinTableGateway.retrieveRow(id1, id2);
    }

    public deleteRow(id1: number, id2: number): Promise<number> {
        return this.joinTableGateway.deleteRow(id1, id2);
    }

    public retrieveByTable1Id(id1: number): Promise<any[]> {
        return this.joinTableGateway.retrieveById('table1_id', id1);
    }

    public deleteByTable1Id(id1: number): Promise<number> {
        return this.joinTableGateway.deleteById('table1_id', id1);
    }
}
```

repository: joefallon/mydal

repo_name: joefallon/mydal


text:
# TeamCity Cookbook

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

# Requirements

* java

# Attributes

Used by both recipes:

* `node["teamcity_server"]["version"]` - TeamCity version. Default is `8.1.1`.
* `node["teamcity_server"]["base_url"]` - Base URL for TeamCity packages.
Default is `http://download.jetbrains.com/teamcity/`.
This value may also use FTP (ftp://) or local (file://) (e.g., a shared folder).

Used by Build Agent:

* `node["teamcity_server"]["build_agent"]["server"]` - TeamCity server address.
  Default value is `nil`. If value isn't changed then server is fist node with
  recipe `teamcity_server::server`.
* `node["teamcity_server"]["build_agent"]["name"]` - Build Agent name. Default
  is `nil`.

Used by Sever:

* `node["teamcity_server"]["server"]["address"]` - Address for listening.
  Default is `<IP_ADDRESS>`.
* `node["teamcity_server"]["server"]["port"]` — Port for listening. Default is
  `8111`.

## Recipes

This cookbook provides two recipes:

* build_agent.rb: Installs TeamCity Build Agent.
* server.rb: Installs TeamCity Server.
* default.rb: Installs TeamCity Server and TeamCity Build Agent.

## Contributing

1. Fork the repository on Github
2. Create a named feature branch (i.e. `add-new-recipe`)
3. Write you change
4. Write tests for your change (if applicable)
5. Run the tests, ensuring they all pass
6. Submit a Pull Request

## Developer requirements

### Required

* [chef-dk](https://downloads.getchef.com/chef-dk/) >= 0.3.2

The Chef-DK comes with all relevant chef tools, like berkshelf.

### Docker

* [docker](https://docs.docker.com/installation/#installation) >= 1.2.0
* [packer](https://www.packer.io/downloads.html) >= 0.7.2

```
$ #cookbooks will be vendored in ./berks-cookbooks
$ berks vendor
$
$ #create the docker image
$ packer build packer-docker.json
```

Run it:
`$ docker run -v --publish 8111:8111 hschaeidt/teamcity`

Goto: http://localhost:8111

### Vagrant

* [virtualbox](https://www.virtualbox.org/wiki/Downloads) >= 4.2
* [vagrant](https://www.vagrantup.com/downloads.html) >= 1.5
* vagrant plugin vagrant-berkshelf >= 2.0.1
* vagrant plugin vagrant-omnibus >= 1.4.1

To install the vagrant plugins on their latest version:
`$ vagrant plugin install vagrant-berkshelf`
`$ vagrant plugin install vagrant-omnibus`

To start the machine:
`$ vagrant up`

Goto: http://localhost:8111

repository: phoolish/chef-teamcity-server

repo_name: phoolish/chef-teamcity-server


text:
# JobDSL workshop

Contains basic Jenkins Docker image setup required for the workshop.

## Setup on Mac OS and Windows

* [Download](https://www.docker.com/docker-toolbox) and [install](https://docs.docker.com/installation/mac/) Docker Toolbox

* Create new virtual machine using docker-machine(Part of the Docker toolbox)

```shell
  docker-machine create --driver virtualbox jobdsl-workshop
```

* Setup port forwarding in order to be able to access web pages from Docker container in browser on the host machine

```shell
  VBoxManage controlvm jobdsl-workshop natpf1 "HTTP,tcp,<IP_ADDRESS>,8080,,8080"
  VBoxManage controlvm jobdsl-workshop natpf1 "HTTP,tcp,<IP_ADDRESS>,50000,,50000"
```

* Restart virtual machine in order to make sure that port forwarding settings applied correctly. *Important!* Check that you don't have other VM's running that uses the same port (run docker-machine ls or check VirtualBox GUI)

```shell
  docker-machine restart jobdsl-workshop
```

* Make sure that you have correct env settings for docker-machine

```shell
  eval $(docker-machine env jobdsl-workshop)
```

## Setup on Linux

Make sure that you have Docker installed. If not then how to is [here](https://docs.docker.com/installation/ubuntulinux/)

## Preparations

* Clone this repo

```shell
  git clone https://github.com/praqma-training/jobdsl-workshop.git
```

* Kick containers

```shell
   cd jobdsl-workshop
   bash -ex do-things.sh
```

* After few seconds you should be able to see Jenkins page in your browser at localhost:8080! Time to do things!

## Assignments

* Follow [JobDSL tutorial](https://github.com/jenkinsci/job-dsl-plugin/wiki/Tutorial---Using-the-Jenkins-Job-DSL) and create simple job
* Learn [how to build your JobDSL specification](https://github.com/jenkinsci/job-dsl-plugin/wiki/User-Power-Moves#run-a-dsl-script-locally) and setup CI job for it
* Learn how to use configure block
* Try templates and libraries
* Team work

repository: JohanWranker/jobdsl-workshop

repo_name: JohanWranker/jobdsl-workshop


text:
# Reddit-Data-Tools

Reddit user Stuck_In_The_Matrix has created a very large archive of public Reddit comments
 and put them up for downloading, see: [Thread on Reddit](https://www.reddit.com/r/datasets/comments/3bxlg7/i_have_every_publicly_available_reddit_comment/)

I want to create some tools to handle this over 900 GByte of JSON data, therefore I have started with
   some Java classes to parse the comments. This repository contains code to

* create a Lucene 5 index (skipping deleted comments, needs 24 hours single-threaded)
* convert the JSON data into CSV (cuts required size in half and is easier to digest for many programs)

Future plans are to create a simple web interface for complex queries
(for example: >2000 upvotes, must not be in /r/funny or /r/pics, must contain all of (op, surely, deliver),
must not contain more than one mention of (safe, picture, money) and can be from 2012 or 2013).
Currently you will have to write such queries in Java (see: Search class to get an idea of how to start).

## Field order of CSV:

    @JsonPropertyOrder(value = {"author", "name", "body", "author_flair_text", "gilded", "score_hidden", "score", "link_id",
            "retrieved_on", "author_flair_css_class", "subreddit", "edited", "ups", "downs", "controversiality",
            "created_utc", "parent_id", "archived", "subreddit_id", "id", "distinguished"})

## Fields indexed with Lucene

            doc.add(new StringField("author", comment.author, Field.Store.YES));
            doc.add(new StringField("name", comment.name, Field.Store.YES));
            doc.add(new TextField("body", comment.body, Field.Store.YES));
            doc.add(new IntField("gilded", comment.gilded, Field.Store.YES));
            doc.add(new IntField("score", comment.score, Field.Store.YES));
            doc.add(new IntField("ups", comment.ups, Field.Store.YES));
            doc.add(new IntField("downs", comment.downs, Field.Store.YES));
            doc.add(new LongField("created_utc", comment.created_utc, Field.Store.YES));
            doc.add(new StringField("parent_id", comment.parent_id, Field.Store.YES));
            doc.add(new StringField("subreddit", comment.subreddit, Field.Store.YES));
            doc.add(new StringField("id", comment.id, Field.Store.YES));
            doc.add(new StringField("url", Comment.createLink(comment.subreddit, comment.link_id, comment.id), Field.Store.YES));

   STORE.YES means the field is contained in the index and can be shown on a search result page.

## License

My code is free to use under the [Apache License](http://www.apache.org/licenses/LICENSE-2.0), version 2.
Contributions will be accepted under the same terms and are welcome.

## Code style

The simplest thing that will work.

## Author

Ingo Wiarda /<EMAIL_ADDRESS>

repository: IronsInTheFire/reddit-data-tools

repo_name: IronsInTheFire/reddit-data-tools


text:
# type

A `type` declaration inside a `lib` declares a kind of C `typedef`, but stronger:

```crystal
lib X
  type MyInt = Int32
end
```

Unlike C, `Int32` and `MyInt` are not interchangeable:

```crystal
lib X
  type MyInt = Int32

  fun some_fun(value : MyInt)
end

X.some_fun 1 # Error: argument 'value' of 'X#some_fun' must be X::MyInt, not Int32
```

Thus, a `type` declaration is useful for opaque types that are created by the C library you are wrapping. An example of this is the C `FILE` type, which you can obtain with `fopen`.

Refer to the [type grammar](../type_grammar.md) for the notation used in typedef types.

repository: crystal-lang/crystal-book

gha_language: Makefile

gha_license_id: NOASSERTION

repo_name: crystal-lang/crystal-book


text:
ProjectTimeStretcher
====================

This project was writen as an exploration what I could do with it in the Processing.org enviroment.

Since I upgraded to Yosemite a lot of old Processing sketches broke, rather than fixing the problem I wanted to do a complete rewrite (JAVA is dead?).

I wrote the Proccesing sketch while working for Bill Spinhoven as an emulation of his prior art (was a neat exercise).

![alt tag](https://github.com/DeRaafMedia/ProjectTimeStretcher/blob/master/bin/data/TimeStretcher.png)

Bill Spinhoven used the technique in some of his installations ('Alberts Ark' -> http://www.li-ma.nl/site/catalogue/doc/bill-spinhoven/alberts-ark-registratie-imago-kunstrai-1990/7833, 'Time Stretcher', e.a).

The technique used is called 'slit scanning'. A very nice explanation can be found -> https://www.youtube.com/watch?v=KhRo2WbWnKU .

A page with slit scan art links and resources->  http://www.flong.com/texts/lists/slit_scan/

An HTML5 rewrite of the 'Time Strecher' -> https://github.com/DNArt/Timestretcher/blob/master/README.md

=======================

This sofware is only tested with Mac OS X Yosemite, the openframeworks version used was 0.8.4 and the Xcode version was 6.1.

repository: DeRaafMedia/ProjectTimeStretcher

repo_name: DeRaafMedia/ProjectTimeStretcher


text:
---
layout: recipe
name: "One Minute Muffin"
---

Ingredients:
- 1⁄4 cup flax seed meal
- 1⁄2 teaspoon baking powder
- 1 teaspoon cinnamon
- 1 egg
- 1 teaspoon oil
- sugar to taste (or honey, stevia)

Directions:
- Mix all ingredients in a coffee mug.
- Micorowave for one minute on high.

---

This flax muffin is quick, vertsatile (just mix in other goodies), and only makes one at a time, so you've got no huge tray to tempt you. Custom muffins every morning!


text:
- In [[Plugins 01]] we demonstrated how to get started developing Logseq plugins. To recap, the simple steps are:
	- download the latest Logseq app
	- turn on developer mode
	- build a normal web app with JavaScript, HTML & CSS, plus the Logseq plugin sdks: @logseq/libs
	- install the app on the plugins page
- In this guide, we will dive deeper by building a more *real-world* plugin - a mind map app that turns your Logseq page into a beautiful mind map graph.
- The finished code is at https://github.com/logseq/logseq-plugin-samples/tree/master/logseq-mind-mapping. The simplify, in this guide we will only show the most essential part of the code.
## Some Background
	- To build more sophisticated plugins for Logseq, it's better for us to understand a little bit how it works. Currently, each plugin runs in an iframe separate from the main Logseq app. The main app provides some APIs (such as operations on the block, getting app settings) through the SDK to the plugins. The iframe serves as the plugin's UI and can be shown or hidden through related APIs. What's more, the main Logseq app provides ways to *inject* UI elements such as icons or buttons to some specific positions in the main app.
	- That's all, let's get started!
## Preparations
	- As we do in [[Plugins 01]], create a project folder contains a package.json, which contains three required fields: `name`, `main` and `logseq`.
	- In our `index.html` we need to add the scripts that we need:
	-
	  ```html
	    <script<EMAIL_ADDRESS>	    <script src="https://cdn.jsdelivr.net/npm/regenerator-runtime"></script>
	    <script src="https://cdn.jsdelivr.net/npm/mind-elixir/dist/mind-elixir.js"></script
	  ```
	- The `@logseq/libs` should be obvious. We will use async/await in our JavaScript, hence the regenerator-runtime is needed. Finally, we load the wonderful mind-elixir library to actually draw our mind map.
## Build the Map
	- The first line should be familiar now:
	-
	  ```js
	  logseq.ready(createModel(), main).catch(console.error)
	  ```
	- We register a function `main` to run when the main app is ready. But what's the `createModel` function? Let's see its content:
	-
	  ```js
	  function createModel() {
	    return {
	      openMindMap() {
	        logseq.showMainUI();
	      },
	    };
	  }
	  ```
	- It just returns an object, which contains a method to open the plugin's UI (main UI). *Model* is an important concept in Logseq plugin development. We will later inject a button (or some other UI) into the main app as a template string. Because functions like event handlers can not be passed through string, we need a place for them. And that's what *model* is for. Besides creating them on ready, we can also add the model using the`logseq.provideModel` API.
	- Let's add to the `main` function:
	-
	  ``` js
	    logseq.App.onPageHeadActionsSlotted(({ slot }) => {
	      logseq.provideUI({
	        key: "hook-ui-page-file-mounted",
	        slot,
	        template: `
	            <a data-on-click="openMindMap"
	               style="opacity: .5; position: relative; top: -3px; padding-right: 8px;"
	               title="Open Mind Mapping Canvas">
	              <i class="iconfont icon-mind-map" style="font-size: 17px;"></i>
	            </a>
	          `,
	      });
	    });

	  ```
	- This code just adds a button in the page head to open our mind map. Notice the `openMindMap` will be called on our `model`.
	- Next, let's build up the UI:
	-
	  ``` js
	    const root = document.querySelector("#app");
	    const displayMap = document.createElement("div");
	    displayMap.classList.add("mind-display", "hidden");
	    root.append(displayMap);
	  ```
	- Because the plugin's UI runs in a separate iframe, we can do anything we want here, without affecting the main APP's UI. Because the map hasn't been built, we will hide it first.
	- Next, we'd like to get all the blocks from the current page. But here's a problem: we don't know if the page is visible or not! Luckily the `logseq.on(ui:visible:changed)` API call will let us register a callback when the visibility of the page has changed.
	-
	  ``` js
	   logseq.on("ui:visible:changed", async ({ visible }) => {
	      if (!visible) {
	        displayMap.classList.add("hidden");
	        displayMap.innerHTML = "";
	        return;
	      }

	    // TODO: build the map!
	  })
	  ```
	- If the page is hidden, we will hide the map too. If it's visible, we shall build the map:
	-
	  ``` js
	   const blocks = await logseq.Editor.getCurrentPageBlocksTree();
	   initMindMap(displayMap, blocks);
	  ```
	- `logseq.Editor` includes APIs to interact with the Logseq editor and `getCurrentPageBlocksTree` is a powerful one to get back all the blocks of the current page as a tree structure. The tree of blocks is a fundamental data structure of Logseq, with which you can do many powerful things in your plugin.
	- After we get back the blocks tree, we just walk the whole tree and use the elixir-mind APIs to build a connected mind map. The details are not relevant here and are therefore left out. Feel free to check the finished code. Also, load the plugin in your Logseq app and enjoy the beautiful mind map generating from your pages!
## Conclusion
	- In this guide, we walk through building a simple but powerful mind map plugin for Logseq. While the plugin APIs are still work-in-progress, they can already do many powerful things. We invite you to hack them with your imagination. Feedbacks are super welcomed - we will improve the plugin APIs through listening to your voices!

url: https://raw.githubusercontent.com/logseq/docs/22e1fa3ad0211313eca152c35f6d51eef636bc0e/pages/Plugins 02 - Build a mind map plugin.md

repository: logseq/docs

filename: Plugins 02 - Build a mind map plugin.md

gha_language: Clojure

repo_name: logseq/docs


text:
Samples for PowerShell Module
========================
This repository contains reference samples for Cohesity PowerShell Module

### Create VMs on vCenter and Add VMs to protection Job and Run Protection Job.

[README](./VMware/)

### This is an example powershell for simple random recovery test for each VMware Protection Job.

[README](./VMware)

repository: cohesity/cohesity-powershell-module

gha_language: C#

repo_name: cohesity/cohesity-powershell-module


text:
# A model for a literal notation for most APL arrays

## How to use

First load the library with `]load apl-array-notation/*`.

### `Deserialise`

This takes a character array and evaluates it as array notation, returning the resulting array.

```apl
Deserialise '[1 2 ⋄ 3 4]'
Deserialise '(a:{(+⌿⍵)÷≢⍵}' 'b:42)'
Deserialise '(1 2 3',(⎕UCS 10),'4 5)'
```

An optional left argument of `0` may be specified to return an APL expression which will generate the array rather than returning the array itself.

### `Serialise`

This takes an array and returns a character vector of matrix representing the argument in array notation.

```apl
Serialise 2 2⍴⍳4
Serialise ⎕fix ':namespace' 'a←{(+⌿⍵)÷≢⍵}' 'b←42' ':endnamespace'
Serialise '(1 2 3)(4 5)'
```

An optional left argument of `1` may be specified to force return of a vector by using `⋄` to fuse lines.

### `∆NS`

Extends `⎕NS` to allow a two-element right argument of names and values:

```apl
myns←∆NS ('name1' 'name2')(7 42)
'myns'∆NS ('name3' 'name4')('apl' 'dyalog')
```

### `∆NSinverse`

Takes a ref or name of a namespace and returns a two-element vector of names and values.
```
∆NSinverse myns
∆NSinverse 'myns'
```

### `Array`

This allows using the notation inline, optionally over multiple lines, without having to quote everything. Instead, the notation is encapsulated in a dfn, which is used as operand for `Array` which in turn returns the corresponding array. A right argument must be supplied, and may be `⍬` or `1` returns the array, while `0` returns an expression for the array.

## Domain and Limitations

### Valid Content

The models handle arrays consisting of numbers, characters, namespaces, one-liner dfns/dops, and such arrays. Note that namespaces lose their scripts, names, and system variables when serialised, just like when converted to JSON using `⎕JSON`. Classes, Instances, Interfaces, and namespaces are not supported. Namespaces with circular references will cause `Serialise` to recurse until `WS FULL`.

### Functions and Operators

`Serialise` does handle multi-line dfns/dops, but `Deserialise` is not able to parse them. Tradfns/tradops and derived functions/operators (including primitives and trains) are not supported.

### Code Layout

`Serialise` generates indented notation using line breaks, but will fall back to using diamonds for the inner parts of certain nested arrays. It will often generate superfluous parentheses and diamonds.

### Scoping and Order of Evaluation

The official proposal for the below notation includes specification of exact scope in phrases, including order of evaluation. The models do not attempt to address this other than encapsulating namespace members such that names created as side effects avoid polluting their surroundings. This also means that a namespace cannot contain a member with a name identical to itself.

### System Variables

`Deserialise` does not accept invalid APL names as members of namespaces. This includes otherwise valid system names like `⎕IO` and `⎕ML`.

## Notation

The notation extends strand notation as follows:

### Round Parentheses

A diamond (`⋄`) inside a parenthesis causes the parenthesis to represent a vector where each diamond-delimited phrase represents an element.
 `(1 2 ⋄ 3 4 5)` is equivalent to `(1 2)(3 4 5)`

A colon (`:`) inside a parenthesis causes the parenthesis to represent a namespace where each diamond-delimited phrase represents a name:value pair.
 `(ans:42)` is equivalent to `⎕JSON'{"ans":42}'` (except for the display form)

An empty parenthesis (`()`) represents a new empty namespace.
 `()` is equivalent to `⎕NS⍬`

### Square Brackets

A diamond (`⋄`) inside a bracket causes the bracket to represent an array where each diamond-delimited phrase represents a major cell.
 `[1 2 3 ⋄ 4 5 6]` is equivalent to `2 3⍴1 2 3,4 5 6`

If a major cell is scalar, it will be interpreted as a 1-element vector.
 `[1 ⋄ 2]` is equivalent to `⍪1 2`

If major cells have differing shapes, they will be extended in the manner of Mix (`↑`).
 `[1 2 ⋄ 3 4 5]` is equivalent to `2 3⍴1 2 0,3 4 5`

### Diamonds, Whitespace, Line Breaks

At least one diamond is required to indicate array notation as opposed to traditional parenthesisation or bracketing.
 `(1)` is equivalent to `1`
 `'abcdef'[[1 2 3 ⋄ 4 5 6]]` is equivalent to `'abcdef'[2 3⍴1 2 3,4 5 6]`

All-whitespace phrases are ignored.
 `(1 2 ⋄ ⋄ 3 4 5)` is equivalent to `(1 2)(3 4 5)`
 `(1 2 ⋄ )` is equivalent to `,⊂1 2`
 `(1 ⋄ )` is equivalent to `,1`

Any diamond may be exchanged with a line break.
 `(1 2`
 `3 4 5)`  is equivalent to `(1 2 ⋄ 3 4 5)`

repository: abrudz/apl-array-notation

repo_name: abrudz/apl-array-notation


text:
General
-------------------------
This directory contains project files for the following publication:

Tanger P, Vega-Sánchez ME, Fleming M, Tran K, Singh S, Abrahamson JB, Jahn CE, Santoro N, Naredo EB, Baraoidan M, Danku JMC, Salt DE, McNally KL, Simmons BA, Ronald PC, Leung H, Bush DR, McKay JK, Leach JE (2015) Cell wall composition and bioenergy potential of rice straw tissues are influenced by environment, tissue type, and genotype. BioEnergy Research, online in advance of print. http://dx.doi.org/10.1007/s12155-014-9573-y

Comments and requests should be directed to:
<EMAIL_ADDRESS>
While all data and code is made freely available, we would appreciate citation when appropriate.

Files
-------------------------
There are 3 directories:

fieldvsGH_final - R scripts

input           - input files

output          - output files that scripts generate

Requirements
-------------------------
Obviously you need R installed (> 3.0.0 should do).

Initially set the working directory to fieldvsgh_final/

Based on wherever you unzipped the file from Datadryad.
```r
setwd("fill/in/your/path/fieldvsgh_final/")
```

If you downloaded from datadryad, you need to get the scripts.

These are hosted at bitbucket.org:

https://bitbucket.org/paultanger/scripts_tanger_etal_2014

You can either use git clone (if you have git installed),

or just download the files directly:
```r
# with git clone
setwd("../")
system("git clone<EMAIL_ADDRESS>temp")
system("rm -r fieldvsgh_final")
system("mv temp fieldvsgh_final")
setwd("fieldvsgh_final/")
# then open the new readme.md

# or download directly
url = "https://bitbucket.org/paultanger/scripts_tanger_etal_2014/get/9553a8fa314c.zip"
thefile = tempfile(tmpdir=tempdir(), fileext=".zip")
download.file(url, thefile, method="curl")
unzip(thefile, junkpaths=T, exdir="../fieldvsgh_final", overwrite=T)
unlink(thefile)
```

If you downloaded from bitbucket, you need to get the data:
```r
url = "http://datadryad.org/bitstream/handle/10255/dryad.77419/AllDataTanger2014.zip?sequence=1"
thefile = tempfile(tmpdir=tempdir(), fileext=".zip")
download.file(url, thefile, method="curl")
unzip(thefile, junkpaths=T, exdir="../input", overwrite=F)
unlink(thefile)
# and create output directory
system("mkdir ../output/")
```

The following packages are required:

This code only needs to be run once.

```r
install.packages("xlsx")
install.packages("rJava")
install.packages("reshape2")
install.packages("Hmisc")
install.packages("car")
install.packages("lsmeans")
install.packages("lme4")
install.packages("glmulti")
install.packages("AICcmodavg")
install.packages("plyr")
install.packages("ggplot2")
install.packages("grid")
install.packages("gridExtra")
install.packages("scales")
install.packages("corrplot")
install.packages("RColorBrewer")
```

Then, load these packages.  This needs to be done every time before running the scripts.

```r
library("xlsx")
library("rJava")
library("reshape2")
library("Hmisc")
library("car")
library("lsmeans")
library("lme4")
library("glmulti")
library("AICcmodavg")
library("plyr")
library("ggplot2")
library("grid")
library("gridExtra")
library("scales")
library("corrplot")
library("RColorBrewer")
```

How to Use
-------------------------
The files used to process the data and generate figures, tables, and objects for further manipulation:

Feel free to explore each script individually to examine how the data was processed and modify as you see fit.

```r
source("mergealldatatogether.R")
```
This requires scripts that process each input file separately.  The input files are named appropriately and located in the input directory.  It outputs tab separated value files that are used in all subsequent calls below.  All calls below this can be run separately in any order.  The most important output from this step is summary statistics of biological replicates in the output file named "SummaryData5Lines_Rearrange.tsv"

```r
source("plot20linedata.R")
```
This generates Fig 1 and Fig S1

```r
source("getcontrasts.R")
```
This generates Table S2 (formatting was done in excel)

```r
source("getvariancecomps.R")
```
This generates Tables 2 and 3

```r
source("getfullequationsfrommodelselection.R")
```
This generates Tables S10 and S11 (some models were added manually)

```r
source("examinelinearmodelsGHtoField.R")
```
This generates Table S7

```r
source("getandgraphcorrelations.R")
```
This generates Fig 6 and Tables S8 and S9

```r
source("pairwisecorrelations.R")
```
This generates the pairwise list for Tables S8 and S9

```r
source("graphdata.R")
```
This generates all other figures except Fig 5 (produced in JMP)

License
-------------------------
Copyright (c) 2014, Paul Tanger

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.


text:
# USE CASE 1: Produce a report on the salary of all the employees
## CHARACTERISTIC INFORMATION
### Goal in Context

As an *HR advisor* I want to produce a report on the salary of all the employees so that I can support financial reporting of the organisation.

### Scope

Company.

### Level

Primary task

### Preconditions

Database contains current employee salary data.

### Success End Condition

A report is available for HR to provide to finance.

### Failed End Condition

No report is produced

### Primary Actor

HR Advisor.

### Trigger

A request for finance information is sent to HR.

## MAIN SUCCESS SCENARIO

1. Finance request salary information for all the employees.
3. HR advisor extracts current salary information of all employees.
4. HR advisor provides report to finance.

## EXTENSIONS

None.

## SUB-VARIATIONS

None.

## SCHEDULE

**DUE DATE:** Release <IP_ADDRESS>

repository: markusmeresma/sem

repo_name: markusmeresma/sem


text:
PORTUGUÊS - PORTUGUESE
faça o donwload do projeto do github em:
https://github.com/prajnasb/observations/archive/refs/heads/master.zip

extraia os arquivos e copie apenas o conteúdo da pasta '/experiments/data' para a pasta 'dataset';

abra o arquivo 'copy_images_prajna.ipynb' no jupter-notebook e execute as células.

----------------------
ENGLISH - INGLÊS

download the project from github in the following link:
https://github.com/prajnasb/observations/archive/refs/heads/master.zip

extract the files and copy only the contents of the '/experiments/data' folder to the 'dataset' folder;

open the file 'copy_images_prajna.ipynb' in a jupyter-notebook instance and execute the cells.

branch_name: refs/heads/main


text:
Registry
========

This package provides a Python client library for accessing and modifying the dispel4py registry.

Dependencies
------------

The registry client has been tested with Python versions 2.7.5, 2.7.2, 2.6.6.
The following packages are required to use the registry:

 * requests (http://docs.python-requests.org/)

Installation
------------

The easiest way to install the registry client is via pip:

`pip install git+git://github.com/akrause2014/registry.git#egg=registry`


text:
# AI Artist

Project intended for university course.
But also an interesting one.

To view the final result of video style transfer, click this [link](https://www.bilibili.com/video/av77410445)

------

**References:**
1. [Neural Style Transfer (TensorFlow)](https://www.tensorflow.org/tutorials/generative/style_transfer)


text:
# 1.1 Introduction

Upon loading the application, you will notice several things: a menu bar at the top, and below that, there are 3 large, empty rectangles.
These rectangles are image components, which are explained in [1.2 Basic Usage]($LOCAL/BasicUsage.md).
Below the first image component, there are some parameters, which are also explained more in-depth in section 1.2.
<br />
In the menu bar, there are 3 menus- File, Data, and Help.
The File menu is discussed in section 1.2, and the Data menu is discussed in [1.5 Configuring]($LOCAL/Configuring.md).
The Help menu is used to get where you are right now-- the documentation!
It also has a bit about this application along with the licensing for the libraries it uses.

### Next up: [1.2 Basic Usage]($LOCAL/BasicUsage.md)

--------

### [Table of Contents]($LOCAL/TableOfContents.md)

repository: LucasBaizer/Organoid-Detector

repo_name: LucasBaizer/Organoid-Detector


text:
#Authentication Server (AS)

##Overview
The Authentication Server (AS) has a key pair with the [Identity Exchange](https://github.com/dickhardt/A2P3/tree/master/app/ix) (IX) and is trusted by the IX to authenticate the user. The [Agent](https://github.com/dickhardt/A2P3_agent) interacts with the user, and then sends components of the request from an App to the AS to encrypt and sign for the IX.

In the POC, the user authenticates and enrolls at the Setup Server and then is sent to the AS. The AS generates an Agent Request that is redirected back to Setup, that generates an IX that is redirected back to the AS that then calls the IX to get the AS Directed Identifier for the User.

The AS then has the user enroll a Personal Agent that can then be used to authenticate the user to Apps.

##Agent Enrollment

The agent is enrolled by acquiring a `code` from the AS and then calling the `/register/agent` API at the AS.

The code is acquired by scanning the QR code generated during the agent enrollment process on the AS web site, or if the AS web site is running on the mobile device, the agent may be invoked with the `/enroll` API call as such:

	a2p3.net://enroll?code=efhnjauy3kduijhdkjsdkajskjfd

Once the Agent has the code, it prompts the user for a name for the agent, ideally prefilling the name with the device name. The Agent then prompts the user for the passcode the user entered at the AS, generates a unique 128 bit identifier, converts it to a URL safe string, and then the Agent sends:

	passcode:   passcode user typed in
	name:	 	user friendly name to identify this device
	code:		code received
	device:		secret shared between this device and AS

as `application/json` content to  to `/register/agent`

example

```
POST /register/agent
Content-Type: application/json

{ "passcode": 1234
, "name": "my iphone"
, "code": "efhnjauy3kduijhdkjsdkajskjfd"
, "device": "kiwjsyvsneysidoopSjkDeleksdd"
}

```
If all goes well, the AS will return

```
{ result : { token : kIOiuUIUIjksddakjladlkjdas }

```

The returned `token` is used when the Agent is making calls to the Registrar.

The generated `device` parameter is saved and used in later calls to the AS.

The Agent discards the passcode and name values that it gathered from the user.

##Token Exchange

When the Agent has received an Agent Request from an App and successfully received authentication and authorization from the User, the Agent calls the AS to acquire an IX Token that it then returns to the calling App.

The Agent then sends the following data as JSON:

```
device:		#device value previously generated
sar:		#signature of Agent Request
auth:
	passcode:		#passcode provided by user if requested
	authorization:	#boolean if user authorized transaction

```
as `application/json` content to `/token`

example

```
POST /token
Content-Type: application/json

{ "device":"kiwjsyvsneysidoopSjkDeleksdd"
, "sar": "jhGYUbjhHhjhHhJKNkjnIJiiuIUUIjhkHBuytrtrRTtRTF"
, "auth":
	{ "passcode": "1234"
	, "authorization": true
	}
```


text:
![rike-logo](https://github.com/arago/rike/raw/master/logo.png)

EC2 AMI Quickstart:
=============

* launch a [rike AMI 4.1](https://aws.amazon.com/amis/rike-ami-4-1) instance
  * medium or larger size required
  * the network security group requires the port 443 to be open, 22 (for remote administration via ssh) and 80 (which redirects to 443) are optional
* wait 5 to 10 minutes until the machine installation completes
* navigate to https://[your amazon instance.amazonaws.com]/
* log in with<EMAIL_ADDRESS>and password=rikeadmin123$
* change the admin password (and email)

repository: osfp-Pakistan/rike

repo_name: osfp-Pakistan/rike


text:
---
layout: "azuredevops"
page_title: "AzureDevops: azuredevops_serviceendpoint_sonarcloud"
description: |-
  Manages the SonarCloud service endpoint within an Azure DevOps organization.
---

# azuredevops_serviceendpoint_sonarcloud
Manages a SonarCloud service endpoint within Azure DevOps.

## Example Usage

```hcl
resource "azuredevops_project" "example" {
  name               = "Example Project"
  visibility         = "private"
  version_control    = "Git"
  work_item_template = "Agile"
  description        = "Managed by Terraform"
}

resource "azuredevops_serviceendpoint_sonarcloud" "example" {
  project_id            = azuredevops_project.example.id
  service_endpoint_name = "Example SonarCloud"
  token                 = "0000000000000000000000000000000000000000"
  description           = "Managed by Terraform"
}
```

## Argument Reference

The following arguments are supported:

* `project_id` - (Required) The ID of the project.
* `service_endpoint_name` - (Required) The Service Endpoint name.
* `token` - (Required) Authentication Token generated through SonarCloud (go to `My Account > Security > Generate Tokens`).
* `description` - (Optional) The Service Endpoint description.

## Attributes Reference

The following attributes are exported:

* `id` - The ID of the service endpoint.
* `project_id` - The ID of the project.
* `service_endpoint_name` - The Service Endpoint name.

## Relevant Links

- [Azure DevOps Service REST API 7.0 - Endpoints](https://docs.microsoft.com/en-us/rest/api/azure/devops/serviceendpoint/endpoints?view=azure-devops-rest-7.0)
- [Azure DevOps Service Connections](https://docs.microsoft.com/en-us/azure/devops/pipelines/library/service-endpoints?view=azure-devops&tabs=yaml)
- [SonarCloud User Token](https://docs.sonarcloud.io/advanced-setup/user-accounts/)

## Import
Azure DevOps Service Endpoint SonarCloud can be imported using the **projectID/serviceEndpointID**, e.g.

```sh
terraform import azuredevops_serviceendpoint_sonarcloud.example 00000000-0000-0000-0000-000000000000/00000000-0000-0000-0000-000000000000
```

gha_language: Go


text:
# ExportImage {#ExportImage .reference}

Exports a custom image to an OSS bucket in the same region as the custom image.

## Description {#section_aqg_jcz_xdb .section}

-   Exporting custom mirrors created using market mirrored System Disk snapshots is not supported.
-   Supports custom mirrors that export information that includes disk snapshots in mirrors, the number of data disks cannot exceed 4, and the maximum capacity of a single data disk cannot exceed 500 GiB.
-   You need to [open a ticket](https://workorder-intl.console.aliyun.com/#/ticket/createIndex) to contact Ali cloud to turn on export mirroring for you.

-   You are required to authorize the ECS official service account to write data to the OSS by using RAM:
    1.  Create a role: `AliyunECSImageExportDefaultRole` \(Other role names are invalid\) and set the following policy to the role:

        ```
         {
           "Statement": [
             {
               "Action": "sts:AssumeRole",
               "Effect": "Allow",
               "Principal": {
                 "Service": [
                   "ecs.aliyuncs.com"
                 ]
               }
             }
           ],
           "Version": "1"
         }
        ```

    2.  Add the default system permission policy for the role `AliyunECSImageExportDefaultRole` : `AliyunECSImageExportRolePolicy`. his policy is the default policy for ECS to provide exported images. You can also create your custom policies that must contain:

        ```
         {
           "Version": "1",
           "Statement": [
             {
               "Action": [
                 "oss:GetObject",
                 "oss:PutObject",
                 "oss:DeleteObject",
                 "oss:GetBucketLocation",
                 "oss:AbortMultipartUpload",
                 "oss:ListMultipartUploads",
                 "oss:ListParts"
               ],
               "Resource": "*",
               "Effect": "Allow"
             }
           ]
         }
        ```

## Request parameters {#RequestParameter .section}

|Name|Type|Required|Description|
|:---|:---|:-------|:----------|
|Action|String|Yes|Required parameter. Value: ExportImage.|
|RegionId|String|Yes|The RegionId of the custom image. For more information, query the latest region ID list by calling [DescribeRegions](intl.en-US/API Reference/Regions/DescribeRegions.md#).|
|ImageId|String|Yes|The ID of the custom image.|
|OssBucket|String|Yes|The OSS bucket to which the image is to be exported.|
|OssPrefix|String|No|The prefix of your OSS object name can consist a length of \[1, 30\] digits or letters.|
|ClientToken|String|No|Used to guarantee the idempotence of the request. The value is generated by a client. It must be unique among all requests and contains a maximum of 64 ASCII characters. For more information, see [How to ensure idempotence](intl.en-US/API Reference/Appendix/How to ensure idempotence.md#).|

## Response parameters {#ResponseParameter .section}

|Name|Type|Description.|
|:---|:---|:-----------|
|RegionId|String|The region ID.|
|ExportTaskId|String|The image exporting task ID.|

## Examples { .section}

**Request example**

```
https://ecs.aliyuncs.com/?Action=ExportImage
&RegionId=cn-hangzhou
&ImageId=m-231234567
&OssBucket=testexportImage
&<Common Request Parameters>
```

**Response example**

**XML format**

```
<ExportImageResponse>
    <RequestId>C8B26B44-0189-443E-9816-D951F59623A9</RequestId>
    <ExportTaskId>tsk-231234567</ExportTaskId>
    <RegionId>cn-hangzhou</RegionId>
</ExportImageResponse>
```

 **JSON format**

```
{
    "RequestId": "C8B26B44-0189-443E-9816-D951F59623A9",
    "RegionId": "cn-hangzhou",
    "ExportTaskId": "tsk-231234567"
}
```

## Error codes {#ErrorCode .section}

The following error codes are specific to this interface. For more error codes, visit the [API error center](https://error-center.alibabacloud.com/status/product/Ecs).

|Error code|Error message|HTTP status code|Meaning|
|:---------|:------------|:---------------|:------|
|Forbidden|User is not authorized to operate on the specified image.|400|You are not allowed to export the image.|
|IncorrectImageStatus|The image is not available.|400|The specified image is unavailable.|
|MissingParameter|An input parameter RegionId that is mandatory for processing the request is not supplied.|400|The `RegionId` parameter is required.|
|MissingParameter|An input parameter ImageId that is mandatory for processing the request is not supplied.|400|The `ImageId` parameter is required.|
|MissingParameter|An input parameter OssBucket that is mandatory for processing the request is not supplied.|400|The `OssBucket` parameter is required.|
|OssBucket.NotFound|The specified OssBucket does not exist.|400|The specified OSS bucket does not exist in the specified region.|
|OssPrefix.Malformed|The specified OssPrefix format is incorrect.|400|The specified prefix format of OSS object is invalid.|
|RegionId.NotFound|The specified RegionId does not exist.|400|The `RegionId` of the specified image does not exist.|
|ExportImageFailed|Failed to export image.|403|Failed to export the image.|
|ImageId.NotFound|The image does not exist.|403|The specified image ID does not exist.|
|ImageNotSupported|The specified image is from the image market and does not support export.|403|The specified image cannot be exported because it is from the image marketplace.|
|InvalidRegion.NotSupport|The specified region does not support image import or export.|403|The specified region temporarily does not support importing or exporting images.|
|OperationDenied.ImageExporting|The specified image is being exported.|403|Exporting the specified image.|

repository: qmutz/ecs

repo_name: qmutz/ecs


text:
# Firestore Service

[![FEArmy](./assets/FEA_open_source_sm.png)](https://github.com/orgs/Wolox/teams/front-end-army/members)

Create firestore queries as if you were using a REST api.

## Installation

```
npm install firestore-service
```

## Prerequisites

1 - Create a firestore data base, you can do it [here](https://console.firebase.google.com/)

2 - Get your database credentials. You can find those in
`Project Overview -> Add firebase to your web app`

Note: We strongly recommend you to save the credentials on a `.env` file and don't upload them to any repository.

## Getting Started

Once you have your credentials and the package install you can start using firestore service.

You will need to initialize the service as soon as you can, the code should look something like this:

```js
import firestoreService from 'firestore-service';

const firebaseConfig = {
  apiKey: xxxxxxxxxxxx,
  authDomain: xxxxxxxxxxxx,
  databaseURL: xxxxxxxxxxxx,
  projectId: xxxxxxxxxxxx,
  storageBucket: xxxxxxxxxxxx,
  messagingSenderId: xxxxxxxxxxxx
};

firestoreService.initialize(firebaseConfig);
```

## Response format

Every HTTP method will return a response with the following body.

```
{
  ok: a boolean -> true: Success, false: Failure
  data: The data you requested,
  status: An HTTP status code, see the code table below,
  statusText: 'OK' or 'Failure',
  request: the actual request (GET, POST, etc.)
}
```

## Supported methods

### GET

You can get all the elements from a collection or a specific element if the element's id is specified.

Note: The path will always be `collection/id/collection2/id2/...`. The "url" will finish with a collection if you want an array of elements or with an id if you want a single one.

E.g.:

```js
const response = await firestoreService.get('regions');
```

The response will have all the "regions"

```js
const response = await firestoreService.get('regions/32');
```

The response will have the information about the region with id 32.

#### Extra query parameters

Firestore service allows you to use certain tools to manipulate your data in the query. For this you should add extra parameters into the function get.

- Limit

The response will only have 20 "regions"

```js
const response = await firestoreService.get('regions/32', { limit: 20 });
```

- Filter

The response will only have users who are older than 22 years old and younger than 35

```js
const response = await firestoreService.get('regions/32', {
  filters: [
    { field: 'age', condition: '<', value: 35 },
    { field: 'age', condition: '>', value: 22 }
  ]
});
```

Supported condition operators:

- `<`
- `<=`
- `>`
- `>=`
- `==`
- `array-contains`

Note: If you want to combine `==` with any of the others you will have to create an index in your db. More info about this [here](https://firebase.google.com/docs/firestore/query-data/indexing)

- Order By

Allows for ordering the query result by database field and `ascending/descending` direction. The default `orderDirection` is `ascending`

The following query will get `regions` ordered by `age` `ascending`

```js
const response = await firestoreService.get('regions', { orderBy: 'age' });
```

The following query will get `regions` ordered by `age` `descending`

```js
const response = await firestoreService.get('regions', {
  orderBy: 'age',
  descending: true
});
```

The following query will get `regions` ordered by `age` and `name` `ascending`

```js
const response = await firestoreService.get('regions', {
  orderBy: ['age', 'name']
});
```

Note: If you want to order your query by several fields you will have to create an index in your db,More info about this [here](https://firebase.google.com/docs/firestore/query-data/indexing)

### POST

You can create an element by calling POST with the collection's path and the body with the element's data.

E.g.:

```js
const body = {
  firstName: 'New name'
  lastName: 'New last name'
};

firestoreService.post('regions/32/users', body)
```

The previous request will create a new user under the region with id 32 using the information sent in the body. It will return the created user with its id.

### DELETE

You can delete a certain element from a collection by using DELETE with a path to the element.

E.g.:

```js
firestoreService.delete('regions/32/users/1');
```

The user from the region with id 32 that has id 1 will be deleted. The response will be empty

### PATCH

You can update an element by calling PATCH and providing only the fields desired to be updated from an element.

E.g.:

```js
const body = {
  firstName: 'New name2'
};

firestoreService.patch('regions/32/users/1', body);
```

The user with id 1 that belongs to the region with id 32 will have his name altered but will keep the previous values. The response will contain the updated user

### PUT

You can update an element by calling PUT and providing all the fields in an element, providing less fields will make the rest of the values `null` (except for the id). Providing a different id in the body will result in an error.

E.g.:

```js
const body = {
  id: 1,
  firstName: 'New name3',
  lastName: 'New last name3'
};

firestoreService.put('regions/32/users/1', body);
```

The user with id 1 that belongs to the region with id 32 will be altered.The response will contain the edited user.

```js
const body = {
  firstName: 'New name3'
};

firestoreService.put('regions/32/users/1', body);
```

The user with id 1 that belongs to the region with id 32 will be altered and the `lastName` field will be set to null. The response will contain the edited user.

```js
const body = {
  id: 2,
  firstName: 'New name3',
  lastName: 'New last name3'
};

firestoreService.patch('regions/32/users/1', body);
```

An error will be thrown because of id mismatch.

## Authentications

Firestore service also supports methods to authenticate users. These are not http methods, are functions to be used with the same package.

### LOGIN

You can login with an already created user (You can create them in the firebase [console](https://console.firebase.google.com/))

```js
const email =<EMAIL_ADDRESS>const password = 'xxxxxx'

const response = await firestoreService.login(email, password);
```

The response will have all the user info.

### SIGN UP

You can sign up a new user with the sign up method.

```js
const email =<EMAIL_ADDRESS>const password = 'xxxxxx'

const response = await firestoreService.signUp(email, password);
```

If the response is succesful, the user will be created and all it's information will be in the response.

### UPDATE PROFILE

You can update a user's profile with the following method.

```js
const body = { name: 'example name', phone: 'example phone'}

const response = await firestoreService.updateProfile(body);
```

If the response is succesful, the user will be updated.

Note: The user should be logged in to perform the update

## Supported status codes

```
OK: 200
CREATED: 201
NO_CONTENT: 204
BAD_REQUEST: 400
UNAUTHORIZED: 401
FORBIDDEN: 403
NOT_FOUND: 404
CONFLICT: 409
```

## License

This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details

## Contributing

Learn how to contribute in the [CONTRIBUTING.md](CONTRIBUTING.md) file.

## About

This project is maintained by [Lucas Zibell](https://github.com/LucasZibell) and it was written by [Wolox](http://www.wolox.com.ar).

![Wolox](https://raw.githubusercontent.com/Wolox/press-kit/master/logos/logo_banner.png)

repository: Wolox/firestore-service

repo_name: Wolox/firestore-service


text:
#### C++ Directives

---

# Preprocessor Directives

> The **preprocessor** is a tool that scans the file from top to bottom looking for any lines that begin with #, known as a **hash symbol**. Each such line is not a program statement, but rather directs the **preprocessor** to modify the file in some way before compilation continues, each such line being known as a **preprocessor directive**. The directive ends at the end of the line, no semicolon is used at the end of the line.

## Include

> Perhaps the most commonly-used preprocessor directive is **\#include**, known as an include directive. **\#include** directs the compiler to replace that line by the contents of the given filename.

```cpp
#include "filename"
#include <filename>
```

## Header Files

Header files are included through Pre-Processor Directives.

Header files contain code such as groups of related functions & their [[C++ Functions#Declaration]]'s and [[C++ Functions#Definition]]'s', as well as [[C++ Classes]].

When you input a header file with an `#include` statement its basically like copy/pasting all the code where the file is included. sometimes this can lead to duplication and errors if included multiple times so to prevent this we use [[#Header File Guards]].

### Header File Guards

These guards look like this:

```cpp
#ifndef FILENAME_H
#define FILENAME_H

// Header file contents

#endif
```

> `#define FILENAME_H` defines the symbol `FILENAME_H` to the preprocessor. The `#ifndef FILENAME_H` and `#endif` form a pair that instructs the preprocessor to process the code between the pair only if FILENAME_H is not defined ("ifndef" is short for "if not defined"). Thus, if the preprocessor includes encounter the header more than once, the code in the file during the second and any subsequent encounters will be skipped because `FILENAME_H` was already defined.
> .
> <u>Good practice</u> is to guard every header file. The following shows the `threeintsfcts.h` file with the guarding code added:

```cpp
#ifndef THREEINTSFCT_H
#define THREEINTSFCT_H

int ThreeIntsSum(int num1, int num2, int num3);
int ThreeIntsAvg(int num1, int num2, int num3);

#endif
```

Another example from [This video by The Cherno](https://youtu.be/9RJTQmK0YPI?list=PLlrATfBNZ98dudnM48yfGUldqGD0S4FFb) is instead of `ifndef` and all that, using instead `#pragma once` which says to include the file only once per translation unit.

To be safe and make sure all compilers will support portability and the use the fastest option you can use both:

```cpp
#pragma once
#ifndef _HEADER_H_
#define _HEADER_H_

...

#endif
```

repository: MichaelHettmer/FAQ

filename: C++ Directives.md

repo_name: MichaelHettmer/FAQ


text:
# zpcg

JavaScript client for the Montenegrin 🇲🇪 [ŽPCG](https://www.zcg-prevoz.me/) railway API. Complies with the [friendly public transport format](https://github.com/public-transport/friendly-public-transport-format). Inofficial, using *ŽPCG* endpoints. Ask them for permission before using this module in production.

[![npm version](https://img.shields.io/npm/v/zpcg.svg)](https://www.npmjs.com/package/zpcg)
[![Build Status](https://travis-ci.org/juliuste/zpcg.svg?branch=master)](https://travis-ci.org/juliuste/zpcg)
[![Greenkeeper badge](https://badges.greenkeeper.io/juliuste/zpcg.svg)](https://greenkeeper.io/)
[![dependency status](https://img.shields.io/david/juliuste/zpcg.svg)](https://david-dm.org/juliuste/zpcg)
[![license](https://img.shields.io/github/license/juliuste/zpcg.svg?style=flat)](license)
[![fptf version](https://fptf.badges.juliustens.eu/badge/juliuste/zpcg)](https://fptf.badges.juliustens.eu/link/juliuste/zpcg)
[![chat on gitter](https://badges.gitter.im/juliuste.svg)](https://gitter.im/juliuste)

## Installation

```shell
npm install --save zpcg
```

## Usage

```javascript
const zpcg = require('zpcg')
```

This package contains data in the [*Friendly Public Transport Format*](https://github.com/public-transport/friendly-public-transport-format) and provides the following methods:

- [`stations()`](docs/stations.md) to get a list of operated stations, such as `Podgorica`, `Bar` or `Belgrade`.
- [`journeys(origin, destination, date = new Date())`](docs/journeys.md) to get routes between stations. *Please note that the API doesn't yet support interchange connections.*
- [`journeyLeg(legId, departureDate)`](docs/journeyLeg.md) to get all passed stations and prices for a given journey leg.

## Contributing

If you found a bug, want to propose a feature or feel the urge to complain about your life, feel free to visit [the issues page](https://github.com/juliuste/zpcg/issues).

license: ISC

repository: juliuste/zpcg

gha_license_id: ISC

repo_name: juliuste/zpcg


text:
# how to contribute

first off, thanks for taking the time to contribute!

**a disclaimer : i'm a noob xD**

## pull requests

*   state clearly the changes included in your pull request. Add a suitable commit message.

* 	comments in your code. pls!

*   please create your pull request against the `master` branch. i will rebase/merge it to the maintenance
    branches, if necessary.

## bug reports

raise github issue(s) in the issue counter to report all sorts of bugs.

## documentation

there is a documentation available under <https://github.com/yedhink/bashed-on-a-feeling/blob/master/README.md>. Feel free to create a github issue if
documentation is missing, incomplete or outdated.

## questions

there are various channels, on which you can ask questions:

*   the mailing list<EMAIL_ADDRESS>
*   pm in Linkedin  : https://www.linkedin.com/in/yedhin1998


text:
# Specifications for the Sinatra Assessment

Specs:
- [x] Use Sinatra to build the app
- [x] Use ActiveRecord for storing information in a database
- [x] Include more than one model class (e.g. User, Post, Category)
- [x] Include at least one has_many relationship on your User model (e.g. User has_many Posts)
- [x] Include at least one belongs_to relationship on another model (e.g. Post belongs_to User)
- [x] Include user accounts with unique login attribute (username or email)
- [x] Ensure that the belongs_to resource has routes for Creating, Reading, Updating and Destroying
- [x] Ensure that users can't modify content created by other users
- [x] Include user input validations
- [x] BONUS - not required - Display validation failures to user with error message (example form URL e.g. /posts/new)
- [x] Your README.md includes a short description, install instructions, a contributors guide and a link to the license for your code

Confirm
- [x] You have a large number of small Git commits
- [x] Your commit messages are meaningful
- [x] You made the changes in a commit that relate to the commit message
- [x] You don't include changes in a commit that aren't related to the commit message

To do:

more validation of models and error messages

tasks views & controller:
    - new task that can be assigned to a process or a job
    - edit task descrption
    - display tasks by processes or jobs

View of models by user "My Maps"

CSS to put tasks into boxes

Home User view by tables and css so everything is easy to understand

gha_language: Ruby


text:
---
title: I.t lesson 8-05-17
layout: post
author: horatio.holloway
permalink: /copy-of-i.t-lesson-5-12-16-horatio-holloway/
source-id: 1AfhfABX4nwkbZXl1SK7uaRJjI9TOYjfJ0GcMbjequLI
published: true
---

    Title
    2nd lesson back with CodeAcademy
    Date
    08-05-17

    Starting point:
    About 4% way through the python exercises.

    Target for this lesson?
    Get at least 10 % through the program

    Did I reach my target?
(add details to "Lesson Review")
    Yes, I got to 14%

    Year 7 Review

    How did I learn? What strategies were effective?

    My creativity for learning strategies is wearing thin at this point. However, that does not mean that I don't already have techniques I have previously used that I am content with. For example. The majority of the lesson consisted of me and the people sitting near me helping each other with the code if we were ever stuck. The way that this week was unique though        was that we never directly gave each other the answer. We instead gave each other tips (different from the hints that the website itself it provide) that allowed the person who was being helped to figure things out (partly) out for themselves, which obviously helps more in the long run.

    What limited my learning? Which habits do I need to work on?

    Until about 20 minutes to go I was reading instructions kind of blindly and was getting through the exercises without really understanding them. I figured this put when I came to an exercise that said something similar "when you can predict what this code will print then press save and continue". This sudden change showed me that I didn’t really understand was I was doing and when I had to show (although I could have just pressed continue) that I understood 'strings’ I was almost clueless to WHY things worked and not just HOW things worked. I discussed this with the people next to me and we agreed to maybe read more slowly and take each exercise in before going to the next one.

    What will I change for next time? How will I improve my learning?

    -I will make sure that I take the exercises more slowly and understand each one before moving onto the next.


text:
# Gherkin Definitions

This is a script that takes takes Gherkin feature files enriched with `Definition` blocks and outputs orindary Gherkin feature files that can be read by Cucumber.

As an example, take this input file:

```cucumber
Feature: I want to test my bicycle

    Scenario: Count wheels
        Given I have a bicycle with 2 wheels
        When I count the wheels
        Then I get 2

Definition: I have a bicycle with <numberOfWheels> wheels
    Given I have a frame
    And I attach <numberOfWheels> wheels
    And I attach a saddle
```

Gherkin-definitions turns this into the following output:

```cucumber
Feature: I want to test my bicycle

    Scenario: Count wheels
        Given I have a frame
        And I attach 2 wheels
        And I attach a saddle
        When I count the wheels
        Then I get 2
```

Because definition steps get expanded in the features that are run, the test output will contain all these steps.
We can mitigate this in the future by writing a custom formatter that cleans up the output.

## Usage

`gherkin-definitions` exports a function that transforms a file with definitions to one where definition steps have been expanded:

```js
    var input = fs.readFileSync('/path/to/my/file', { encoding: 'utf8' });
    var output = require('gherkin-definitions')(input);
    fs.writeFileSync('/path/to/output', output);
```

Included is also a gulp task, which can be used like this:

```js
    var gherkinDefinitions = require('gherkin-definitions/gulp');
    gulp.task('expand-gherkin-definitions', function() {
        gulp.src('./features/**/*.feature')
            .pipe(gherkinDefinitions)
            .pipe(gulp.dest('./expanded-features'));
    });
```

Now you can run your tests against the `expanded-features` directory instead of the `features` one.

## Motivation

We want a way to compose steps out of other steps for use in cucumber.js.
This seemed the easiest solution to get the job done.

Although some in the cucumber community consider putting to much (or any) logic into steps something of an antipattern, for us it makes sense.
We primarily use (abuse?) Gherkin as a basic programming language (see Minosse) allowing our testers to work independently on automated testcases.
The recommended approach of tackling reduction in the step implementations is at odds with this, because it requires diving into another language (the one the steps are written in).
Hence the need for a way to write gherkin 'functions', to keep our feature files clean and readable.

repository: generelspaz/gherkin-definitions

repo_name: generelspaz/gherkin-definitions


text:
# Build on OSX

## Pre-requisites
### Brew
Install *brew* on OSX.

```bash
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
```

### wget
After installing brew, we can use brew to install wget (so you can download files from the command-line):
```bash
brew install wget
```

### CMake
We need cmake to configure and build OpenMesh and MeshMonk. We're copying here the installation instructions from [this page](http://tudat.tudelft.nl/projects/tudat/wiki/Install_on_Mac_OS_X#Install-CMake-on-Mac-OS-X):
1. Download the latest binary distribution for Mac OSX from the [Downloads page](https://cmake.org/download/)
2. Open the resulting .dmg-file you just downloaded
3. Drag and drop the CMake icon to the Applications folder icon.
4. Launch CMake (from you Applications folder, for example)
5. Add CMake to your path so you can call it from command-line:
```bash
sudo mkdir -p /usr/local/bin
sudo /Applications/CMake.app/Contents/bin/cmake-gui --install=/usr/local/bin
```
6. Verify your installation (you might have to close and open a new Terminal):
```bash
cmake --version
```

## Install libraries

### 1. Install eigen
1. Use brew to install eigen
```bash
brew install eigen
```
or upgrade:
```bash
brew upgrade eigen
```

2. Make a symlink to the main 'Eigen' folder from /usr/local/include/ so that you can include Eigen in your projects.
```bash
ln -s /usr/local/Cellar/eigen/3.3.7/include/eigen3/Eigen /usr/local/include/Eigen
```

### 2. _(optional)_ 'Install' nanoflann
Like Eigen, nanoflann is also a header-only library. There is only one header file you need, so we deliver that in the meshmonk repository under '/vendor' directory. So all that's left is to copy that to /usr/local/include:
```bash
sudo cp /home/user/projects/meshmonk/vendor/nanoflann.hpp /usr/local/include/
```

### 3. Install OpenMesh

```bash
cd /Users/user/Downloads/
wget http://www.openmesh.org/media/Releases/6.3/OpenMesh-6.3.zip
unzip OpenMesh-6.3.zip
cd OpenMesh-6.3
mkdir build
cd build
cmake ..
make
```

Copy/paste the *.dylib* files:
```bash
sudo sudo cp Build/lib/*.* /usr/local/lib/
```

Copy/paste the header files
```bash
cp -R /Users/user/Downloads/OpenMesh-6.3/src/OpenMesh /usr/local/include/
```

## MeshMonk

### Compile
Make a 'projects' folder in your home directory and go into it(or go into a directory you are already using for GitHub projects):
```bash
cd
mkdir projects
cd projects
```
Clone the online MeshMonk repository
```
git clone https://github.com/TheWebMonks/meshmonk.git
```
Enter the subfolder with the c++ sourcecode and use `make` to compile it. As an alternative to this step, you may use the precompiled version of 'libmeshmonk.dylib' in the 'builds' folder of the meshmonk download.
```bash
cd meshmonk
make
```
From the meshmonk folder, copy the shared library object libmeshmonk.dylib to /usr/local/lib
```bash
cp libmeshmonk.dylib /usr/local/lib
```

Copy the header files to /usr/local/include/
```bash
(cd /Users/user/projects/meshmonk/ && find . -name '*.hpp' -print | tar --create --files-from -) | (cd /usr/local/include/ && sudo tar xvfp -)
```

repository: TheWebMonks/meshmonk

repo_name: TheWebMonks/meshmonk


text:
# Fast Signatures from Compact Knapsack

This is the proof-of-concept implementation of Tachyon (CCS'18), that is a high-speed post-quantum signature. The paper can be found at https://eprint.iacr.org/2018/873.pdf

Note: I highly recommend using CodeLite to run this code (http://codelite.org).

## Tachyon Dependencies

1. b2 - https://github.com/BLAKE2/libb2

## Usage

After installing the dependencies, go to Tachyon folder and make (don't forget to update the makefile (Tachyon.mk), specifically the path). Then, under the Debug folder you can see the executable. Code is tested with Intel i7 Skylake Ubuntu 16.04.

This code is not to be considered secure. Its purpose is not to be used for real-world systems.

## License

Please check the licenses for the dependencies before using this code.

Special thanks to Peter Rindal for providing the AES codes (in https://github.com/ladnir/cryptoTools) and the fast bitread operations; and the ntt implementation is adopted from pq-crystals (in https://github.com/pq-crystals/dilithium).

## Contact

Please contact me<EMAIL_ADDRESS>or Rouzbeh Behnia<EMAIL_ADDRESS>for your questions

repository: ozgurozmen/TACHYON

repo_name: ozgurozmen/TACHYON