text:
# Subdocuments

Subdocuments are documents embedded in other documents. In Mongoose, this
means you can nest schemas in other schemas. Mongoose has two
distinct notions of subdocuments: [arrays of subdocuments](https://masteringjs.io/tutorials/mongoose/array#document-arrays) and single nested
subdocuments.

```javascript
const childSchema = new Schema({ name: 'string' });

const parentSchema = new Schema({
  // Array of subdocuments
  children: [childSchema],
  // Single nested subdocuments
  child: childSchema
});
```

Note that populated documents are **not** subdocuments in Mongoose.
Subdocument data is embedded in the top-level document.
Referenced documents are separate top-level documents.

```javascript
const childSchema = new Schema({ name: 'string' });
const Child = mongoose.model('Child', childSchema);

const parentSchema = new Schema({
  child: {
    type: mongoose.ObjectId,
    ref: 'Child'
  }
});
const Parent = mongoose.model('Parent', parentSchema);

const doc = await Parent.findOne().populate('child');
// NOT a subdocument. `doc.child` is a separate top-level document.
doc.child;
```

What is a Subdocument?

Subdocuments versus Nested Paths

Subdocument Defaults

Finding a Subdocument

Adding Subdocs to Arrays

Removing Subdocs

Parents of Subdocs

Alternate declaration syntax for arrays

## What is a Subdocument?

Subdocuments are similar to normal documents. Nested schemas can have
[middleware](middleware.html), [custom validation logic](validation.html),
virtuals, and any other feature top-level schemas can use. The major
difference is that subdocuments are
not saved individually, they are saved whenever their top-level parent
document is saved.

```javascript
const Parent = mongoose.model('Parent', parentSchema);
const parent = new Parent({ children: [{ name: 'Matt' }, { name: 'Sarah' }] });
parent.children[0].name = 'Matthew';

// `parent.children[0].save()` is a no-op, it triggers middleware but
// does **not** actually save the subdocument. You need to save the parent
// doc.
await parent.save();
```

Subdocuments have `save` and `validate` [middleware](middleware.html)
just like top-level documents. Calling `save()` on the parent document triggers
the `save()` middleware for all its subdocuments, and the same for `validate()`
middleware.

```javascript
childSchema.pre('save', function(next) {
  if ('invalid' == this.name) {
    return next(new Error('#sadpanda'));
  }
  next();
});

const parent = new Parent({ children: [{ name: 'invalid' }] });
try {
  await parent.save();
} catch (err) {
  err.message; // '#sadpanda'
}
```

Subdocuments' `pre('save')` and `pre('validate')` middleware execute
**before** the top-level document's `pre('save')` but **after** the
top-level document's `pre('validate')` middleware. This is because validating
before `save()` is actually a piece of built-in middleware.

```javascript
// Below code will print out 1-4 in order
const childSchema = new mongoose.Schema({ name: 'string' });

childSchema.pre('validate', function(next) {
  console.log('2');
  next();
});

childSchema.pre('save', function(next) {
  console.log('3');
  next();
});

const parentSchema = new mongoose.Schema({
  child: childSchema
});

parentSchema.pre('validate', function(next) {
  console.log('1');
  next();
});

parentSchema.pre('save', function(next) {
  console.log('4');
  next();
});
```

## Subdocuments versus Nested Paths

In Mongoose, nested paths are subtly different from subdocuments.
For example, below are two schemas: one with `child` as a subdocument,
and one with `child` as a nested path.

```javascript
// Subdocument
const subdocumentSchema = new mongoose.Schema({
  child: new mongoose.Schema({ name: String, age: Number })
});
const Subdoc = mongoose.model('Subdoc', subdocumentSchema);

// Nested path
const nestedSchema = new mongoose.Schema({
  child: { name: String, age: Number }
});
const Nested = mongoose.model('Nested', nestedSchema);
```

These two schemas look similar, and the documents in MongoDB will
have the same structure with both schemas. But there are a few
Mongoose-specific differences:

First, instances of `Nested` never have `child === undefined`.
You can always set subproperties of `child`, even if you don't set
the `child` property. But instances of `Subdoc` can have `child === undefined`.

```javascript
const doc1 = new Subdoc({});
doc1.child === undefined; // true
doc1.child.name = 'test'; // Throws TypeError: cannot read property...

const doc2 = new Nested({});
doc2.child === undefined; // false
console.log(doc2.child); // Prints 'MongooseDocument { undefined }'
doc2.child.name = 'test'; // Works
```

## Subdocument Defaults

Subdocument paths are undefined by default, and Mongoose does
not apply subdocument defaults unless you set the subdocument
path to a non-nullish value.

```javascript
const subdocumentSchema = new mongoose.Schema({
  child: new mongoose.Schema({
    name: String,
    age: {
      type: Number,
      default: 0
    }
  })
});
const Subdoc = mongoose.model('Subdoc', subdocumentSchema);

// Note that the `age` default has no effect, because `child`
// is `undefined`.
const doc = new Subdoc();
doc.child; // undefined
```

However, if you set `doc.child` to any object, Mongoose will apply
the `age` default if necessary.

```javascript
doc.child = {};
// Mongoose applies the `age` default:
doc.child.age; // 0
```

Mongoose applies defaults recursively, which means there's a nice
workaround if you want to make sure Mongoose applies subdocument
defaults: make the subdocument path default to an empty object.

```javascript
const childSchema = new mongoose.Schema({
  name: String,
  age: {
    type: Number,
    default: 0
  }
});
const subdocumentSchema = new mongoose.Schema({
  child: {
    type: childSchema,
    default: () => ({})
  }
});
const Subdoc = mongoose.model('Subdoc', subdocumentSchema);

// Note that Mongoose sets `age` to its default value 0, because
// `child` defaults to an empty object and Mongoose applies
// defaults to that empty object.
const doc = new Subdoc();
doc.child; // { age: 0 }
```

## Finding a Subdocument

Each subdocument has an `_id` by default. Mongoose document arrays have a
special [id](api/mongoosedocumentarray.html#mongoosedocumentarray_MongooseDocumentArray-id) method
for searching a document array to find a document with a given `_id`.

```javascript
const doc = parent.children.id(_id);
```

## Adding Subdocs to Arrays

MongooseArray methods such as `push`, `unshift`, `addToSet`, and others cast arguments to their proper types transparently:

```javascript
const Parent = mongoose.model('Parent');
const parent = new Parent();

// create a comment
parent.children.push({ name: 'Liesl' });
const subdoc = parent.children[0];
console.log(subdoc); // { _id: '501d86090d371bab2c0341c5', name: 'Liesl' }
subdoc.isNew; // true

await parent.save();
console.log('Success!');
```

You can also create a subdocument without adding it to an array by using the [`create()` method](api/mongoosedocumentarray.html#mongoosedocumentarray_MongooseDocumentArray-create) of Document Arrays.

```javascript
const newdoc = parent.children.create({ name: 'Aaron' });
```

## Removing Subdocs

Each subdocument has its own [deleteOne](api/subdocument.html#Subdocument.prototype.deleteOne()) method.
For an array subdocument, this is equivalent to calling `.pull()` on the subdocument.
For a single nested subdocument, `deleteOne()` is equivalent to setting the subdocument to [`null`](https://masteringjs.io/tutorials/fundamentals/null).

```javascript
// Equivalent to `parent.children.pull(_id)`
parent.children.id(_id).deleteOne();
// Equivalent to `parent.child = null`
parent.child.deleteOne();

await parent.save();
console.log('the subdocs were removed');
```

Parents of Subdocs

Sometimes, you need to get the parent of a subdoc. You can access the
parent using the `parent()` function.

```javascript
const schema = new Schema({
  docArr: [{ name: String }],
  singleNested: new Schema({ name: String })
});
const Model = mongoose.model('Test', schema);

const doc = new Model({
  docArr: [{ name: 'foo' }],
  singleNested: { name: 'bar' }
});

doc.singleNested.parent() === doc; // true
doc.docArr[0].parent() === doc; // true
```

If you have a deeply nested subdoc, you can access the top-level document
using the `ownerDocument()` function.

```javascript
const schema = new Schema({
  level1: new Schema({
    level2: new Schema({
      test: String
    })
  })
});
const Model = mongoose.model('Test', schema);

const doc = new Model({ level1: { level2: 'test' } });

doc.level1.level2.parent() === doc; // false
doc.level1.level2.parent() === doc.level1; // true
doc.level1.level2.ownerDocument() === doc; // true
```

Alternate declaration syntax for arrays

If you create a schema with an array of objects, Mongoose will automatically convert the object to a schema for you:

```javascript
const parentSchema = new Schema({
  children: [{ name: 'string' }]
});
// Equivalent
const parentSchema = new Schema({
  children: [new Schema({ name: 'string' })]
});
```

### Next Up

Now that we've covered Subdocuments, let's take a look at
[querying](queries.html).

repository: Automattic/mongoose

repo_name: Automattic/mongoose


text:
[![Gitpod ready-to-code](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/<?= $generator->githubUserAccount ?>/<?= $generator->packageName ?>)

# <?= $generator->githubUserAccount ?>-library-template

[![Integrate](https://github.com/<?= $generator->githubUserAccount ?>/<?= $generator->packageName ?>/workflows/Integrate/badge.svg)](https://github.com/<?= $generator->githubUserAccount ?>/<?= $generator->packageName ?>/actions)
[![Prune](https://github.com/<?= $generator->githubUserAccount ?>/<?= $generator->packageName ?>/workflows/Prune/badge.svg)](https://github.com/<?= $generator->githubUserAccount ?>/<?= $generator->packageName ?>/actions)
[![Release](https://github.com/<?= $generator->githubUserAccount ?>/<?= $generator->packageName ?>/workflows/Release/badge.svg)](https://github.com/<?= $generator->githubUserAccount ?>/<?= $generator->packageName ?>/actions)
[![Renew](https://github.com/<?= $generator->githubUserAccount ?>/<?= $generator->packageName ?>/workflows/Renew/badge.svg)](https://github.com/<?= $generator->githubUserAccount ?>/<?= $generator->packageName ?>/actions)

[![Code Coverage](https://codecov.io/gh/<?= $generator->githubUserAccount ?>/<?= $generator->packageName ?>/branch/main/graph/badge.svg)](https://codecov.io/gh/<?= $generator->githubUserAccount ?>/<?= $generator->packageName ?>)
[![Type Coverage](https://shepherd.dev/github/<?= $generator->githubUserAccount ?>/<?= $generator->packageName ?>/coverage.svg)](https://shepherd.dev/github/<?= $generator->githubUserAccount ?>/<?= $generator->packageName ?>)

[![Latest Stable Version](https://poser.pugx.org/<?= $generator->githubUserAccount ?>/<?= $generator->packageName ?>/v/stable)](https://packagist.org/packages/<?= $generator->githubUserAccount ?>/<?= $generator->packageName ?>)
[![Total Downloads](https://poser.pugx.org/<?= $generator->githubUserAccount ?>/<?= $generator->packageName ?>/downloads)](https://packagist.org/packages/<?= $generator->githubUserAccount ?>/<?= $generator->packageName ?>)

## Installation

:bulb: This is a great place for showing how to install the package, see below:

Run

```sh
$ composer require <?= $generator->githubUserAccount ?>/<?= $generator->packageName . PHP_EOL ?>
```

## Usage

:bulb: This is a great place for showing a few usage examples!

## Changelog

Please have a look at [`CHANGELOG.md`](CHANGELOG.md).

## Contributing

Please have a look at [`CONTRIBUTING.md`](.github/CONTRIBUTING.md).

## Code of Conduct

Please have a look at [`CODE_OF_CONDUCT.md`](.github/CODE_OF_CONDUCT.md).

## License

This package is licensed using the MIT License.

Please have a look at [`LICENSE.md`](LICENSE.md).

## Curious what I am building?

:mailbox_with_mail: [Subscribe to my list](https://localheinz.com/projects/), and I will occasionally send you an email to let you know what I am working on.

license: MIT

repository: inquid/inquid-template-generator

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: inquid/inquid-template-generator


text:
# MathJax/mhchem Extension 3.0

mhchem 3.0 is a 3rd-party extension to MathJax for typesetting chemical equations.

## Usage

    \ce{CO2 + C -> 2 CO}

## Manual

[The manual (including a live test drive)](https://mhchem.github.io/MathJax-mhchem/)

## Using the MathJax CDN

For information on how to load the extension and make the `\ce` command available,
see the [official MathJax docs](http://docs.mathjax.org/en/latest/configuration.html#using-in-line-configuration-options).
In short, use this config:

    TeX: {
        extensions: ["[Contrib]/mhchem/mhchem.js"]
    }

## Changes of v3.0.x (when compared to v2.6.0 "legacy: true")

- Complete rewrite of syntax parser
- Staggered layout for charges (IUPAC style)
- Improved spacing and space handling: 1/2 X^{2-} v, $n-1$ H^3HO(g), ^{22,98}_{11}Na, ...
- Decimal amounts: 0.5 H2O, 0,5 H2O
- Advanced charge/bond/hyphen distinction: OH-(aq), \mu-Cl, -H- ...
- Decimal and negative superscripts/subscripts: ^0_-1n-, ^{22.98}_{11}Na
- Superscript electrons: OCO^{.-}
- IUPAC fraction style: (1/2)H2O
- Auto-italic variables: n H2O, nH2O, NO_x, but pH
- Improved scanning: Fe^n+, X_\alpha, NO_$x$, $\alpha$$a$, ...
- Some unicode input, e.g. arrows
- {text} text escape
- \bond{3}
- Arrow arguments now parsed as \ce: A ->[H2O] B, A ->[$x$] B
- <--> arrow
- More opeators: A + B = C - D, \pm
- Recursion works (\ce inside \ce)
- Removed hardly used synonyms \cf, \cee and command \hyphen
- Excited state: X^*
- Ellipsis vs bond: A...A, B...B, ...
- Punctuation: , ;
- Dissociation constant: pKa
- Orbitals: sp^2, s^{0.5}p^3-N
- Kroeger-Vink notation
- Better-looking Fast-HTML rendering: \ce{A + _{a}X}
- Many other things
- Side-effects for non-standard input

## GitHub Contributions

If you want to contribute (open an issue, for instance), please do it at https://github.com/mhchem/MathJax-mhchem/.
The [MathJax third party extension repository](https://github.com/mathjax/MathJax-third-party-extensions) is a mirror.

repository: mhchem/MathJax-third-party-extensions

repo_name: mhchem/MathJax-third-party-extensions


text:
# basset [![Build Status](https://secure.travis-ci.org/pwlmaciejewski/basset.png?branch=master)](http://travis-ci.org/pwlmaciejewski/basset)

Website performance sniffer.
Uses [phantomjs](http://phantomjs.org/) and
[netsniff.js](https://github.com/ariya/phantomjs/blob/master/examples/netsniff.js)
to perform multiple tests and display averaged results.

## Installation

```
npm install -g basset
```

**Caution!** Remember that you need to have `phantomjs` command in your `PATH`.

## Command-line usage

```
basset -n 10 http://bbc.com
......F...
Average
  onLoad: 4419.56 ± 1587.90 ms
  requests: 82 (html: 4, css: 4, js: 34, img: 39, other: 1)
```

For more info: `basset -h`

## API documentation

Basset is designed to be a command-line tool which can be easily
used as a node module, so don't be affraid to `require('basset')` in your project.

### Basset class

It's extremely easy to use `basset` in your project:

* Basset needs to be initialized with an `url` and `options`.
* Method `sniff` starts the testing sequence.
* Basset communicates with outer world using events (it derives from `EventEmitter`).

Basic example:

```javascript
	var Basset = require('basset');
	var basset = new Basset('http://google.com', { repeatNum: 2 });
	basset.on('end', function (results) {
		average = results.average()
		console.log('onLoad: ' + average.getValue('onLoad'));
	});
	basset.sniff();
```

##### `new Basset(url, options)`

Argument `url` is required, `options` are optional.

Default options:

```
  repeatNum: 1
```

##### `.sniff()`

Run all tests (sniffers).

##### `begin` event

Emitted before starting of a first test.

##### `end` event

Emitted after all tests stopped. Passes `Statistic` intance to handler function.
See `Statistic class` for more information.

```javascript
	var basset = new Basset('http://google.com', { repeatNum: 2 });
	basset.on('end', function (results) {
		var avg = results.average();
		console.log(avg.getValue('onLoad'));
	});
	basset.sniff();
```

##### `testStart` event

Emitted on test start.

##### `result` event

Emitted when test gives valid result. Passes `HarResult` instance to handler function.
See `HarResult class` and `Result class` section for more informaction.

```javascript
	var basset = new Basset('http://bbc.com');
	basset.on('result', function (result) {
		console.log(result.getValue('onLoad')); // Prints onLoad time
	});
	basset.sniff();
```

##### `failure` event

Emitted when test fails (browser error occured or something else gone wrong).
Passes `Error` instance to handler function.

##### `testStop` event

Emitted after test stop (after `failure` or `result` event).

### Result class

`Result` class represents a set of results. It has an array of `valueNames`
and you can set values only from that array. It means that if `valueNames = ['foo']`
you can `setValue('foo', 1)` but not `setValue('bar', 1)`. By default `valueNames` is empty,
so you need to derive from `Result` to create something functional.

##### `getValueNames()`

Returns a copy of internal `valueNames` array.

##### `getValue(name)`

Returns value with `name`. If `name` isn't in `valueNames` array it throws an `Error`.

##### `setValue(name, value)`

Sets `value`. If `name` isn't in `valueNames` array it throws an `Error`.

##### `hasValue(name)`

Returns true if `name` appears in `valuesNames` array.

##### `getValues(values)`

Sets values object. If one of the `values` property isn't in `valueNames` it throws an `Error`.

##### other methods

For more information about `Result` class see `lib/result.coffee`.

### HarResult class

`HarResult` derives from `Result`. It overrides `valueNames` and defines set of methods to
feed the object with a har json.

##### `feedWithHar(har)`

Accepts an object and gets essential information from it. If `har` isn't a valid
har object it throws an `Error`.

##### other methods

For more information about `HarResult` class see `lib/harResult.coffee`.

### Statistic class

`Statistic` class has many `Result` intances. It can compute average
and standard deviation from them.

##### `addResult(result)`

Add a `result` to internal `results` array.

##### `average()`

Returns a `Result` instance which represents an average of `results` array items.

##### `deviation()`

Returns a `Result` instance which represent a standard deviation of `results` array items.

## Development

* `make coffee` - generate js files
* `make watch` - make sure to have `inotifywait` installed (`apt-get install inotify-tools`)
* `npm test` - run tests

## Changelog

`0.0.1` - Initial release


text:
# Electron  React  Parcel <img<EMAIL_ADDRESS>width=32>

Bolierplate code for building multi-platform, production ready desktop apps using [Electron](https://electronjs.org/), [React](https://reactjs.irg), [React-Router](https://reacttraining.com/react-router/web/guides/quick-start) and [Parcel](https://parceljs.org/).

Also contains CSS styling using [Material-UI](https://github.com/mui-org/material-ui) and [React-Transition-Group](https://reactcommunity.org/react-transition-group/) for animations.

## Scripts

`yarn start` will start the Electron app and the React app at the same time.
`yarn build` will build the React app and package it along the Electron app.

## DevTools React

In the console tab insert the following code and hit enter. It will installs the react devtools for the current session

```js
require('electron-react-devtools').install()
```

## Build

### Linux
```json=
"scripts": {
    "electron-build": "electron-builder --linux deb tar.xz"
}
```

### Windows
```json=
"scripts": {
    "electron-build": "electron-builder --windows nsis:ia32"
}
```

### macOS
```json=
"scripts": {
    "electron-build": "electron-builder -mwl"
},
"build": {
    "appId": "com.exemple",
    "files": [
      "src/electron.js",
      "src/assets/*",
      "build/**/*"
    ],
    "mac": {
      "target": "dmg",
      "icon": "src/assets/logo.png"
    },
    "win": {
      "target": "nsis",
      "icon": "src/assets/logo.png"
    },
    "linux": {
      "target": "deb",
      "icon": "src/assets/logo.png",
      "category": "Development"
    }
  },
```
## Just React

`yarn react-start` will start the React app at http://localhost:3000.
`yarn react-build` will build the React app and package it in build folder.

repository: Agillmann/electron-react-app-lab

gha_language: JavaScript

gha_license_id: MIT

repo_name: Agillmann/electron-react-app-lab


text:
---
layout: default
---

# 1997-09-25 - Re: The Telcos oppose Oxley

## Header Data

From: "Robert A. Costner"<EMAIL_ADDRESS>To<EMAIL_ADDRESS>Message Hash: 254c1bb3848e059644431e80d77ec2f303f2b931374dae1517d3c4848c4b0ad0

Message ID<EMAIL_ADDRESS>Reply To<EMAIL_ADDRESS>UTC Datetime: 1997-09-25 02:48:00 UTC

Raw Date: Thu, 25 Sep 1997 10:48:00 +0800

## Raw message

```
{% raw  %}From: "Robert A. Costner"<EMAIL_ADDRESS>Date: Thu, 25 Sep 1997 10:48:00 +0800
To<EMAIL_ADDRESS>Subject: Re: The Telcos oppose Oxley
In-Reply-To<EMAIL_ADDRESS>Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

At 06:15 PM 9/24/97 -0700, Lizard wrote:
>Though, on second thought, there is a serious issue with it -- if, as
>we hope, encryption becomes widespread, than anyone doing anything
>will be using it;including 'in the commission of a crime'. This could
>make petty misdemeanors into 20 year federal crimes, and THAT is
>something to worry about. Hm.

While this provision (that criminalized the use of crypto in a crime) of
the original SAFE bill was a "bad thing" I personally thought that much of
the rest of the bill was ok and had some demented hope that this bad spot
could be fixed next year.  No one needs to say "I told you so."

The state of Georgia has a similar provision.  There is a law that makes it
a crime to use a "telecommunications facility".  As I recall, it is a
felony and applies to drug charges.  The Georgia courts routinely give
people an extra five years for selling drugs through a phone call and for
what I suspect was the original intent of the law, a beeper.

In Georgia the presence of a beeper is synonymous with drug sales.  At
least with law enforcement agencies.  Probationers and parolees are not
allowed to "report" to their supervising agent if they are wearing a
beeper.  For police, the presence of a beeper on a person is reason to
suspect drugs.

I'm sure that we have the possibility of crypto becoming the same thing.

  -- Robert Costner                  Phone:<PHONE_NUMBER>
     Electronic Frontiers Georgia<EMAIL_ADDRESS>
     http://www.efga.org/            run PGP 5.0 for my public key

{% endraw %}
```

## Thread

+ Return to [September 1997](/archive/1997/09)

+ Return to "[Bill Stewart <stewarts@ix.netcom.com>](/authors/bill_stewart_stewarts_at_ix_netcom_com_)"
+ Return to "[Dave Emery <die@pig.die.com>](/authors/dave_emery_die_at_pig_die_com_)"
+ Return to "[Declan McCullagh <declan@well.com>](/authors/declan_mccullagh_declan_at_well_com_)"
+ Return to "[Eric Blossom <eb@comsec.com>](/authors/eric_blossom_eb_at_comsec_com_)"
+ Return to "["Robert A. Costner" <pooh@efga.org>](/authors/robert_a_costner_pooh_at_efga_org_)"
+ Return to "[Tim May <tcmay@got.net>](/authors/tim_may_tcmay_at_got_net_)"

+ _Unknown thread root_
  + 1997-09-25 (Thu, 25 Sep 1997 09:22:41 +0800) - [Re: The Telcos oppose Oxley](/archive/1997/09/e9c5ef8b09ba27e78a16a6797c0fe5303a2f609bd864c3c27405eb9e873272b5) - _Declan McCullagh<EMAIL_ADDRESS>    + 1997-09-25 (Thu, 25 Sep 1997 10:27:14 +0800) - [Re: The Telcos oppose Oxley](/archive/1997/09/73d1eb49180402992699696b1f136c851f248b61b5136b8a6c4c0cb6cc92cb6b) - _Tim May<EMAIL_ADDRESS>    + 1997-09-25 (Thu, 25 Sep 1997 10:48:00 +0800) - Re: The Telcos oppose Oxley - _"Robert A. Costner"<EMAIL_ADDRESS>      + 1997-09-25 (Fri, 26 Sep 1997 03:06:12 +0800) - [Re: The Telcos oppose Oxley](/archive/1997/09/52af5baaacde98a9158e230388a8826c450f8b11fa3befbcba8d757ff377ee3a) - _Bill Stewart<EMAIL_ADDRESS>        + 1997-09-27 (Sat, 27 Sep 1997 17:10:23 +0800) - [Re: The Telcos oppose Oxley](/archive/1997/09/064707b60f5e3ff3e193d400a7586541bbb5a584276778175e3c882769ca297e) - _Eric Blossom<EMAIL_ADDRESS>          + 1997-09-27 (Sun, 28 Sep 1997 04:29:56 +0800) - [Re: The Telcos oppose Oxley](/archive/1997/09/d797814e4bd483110cceaf1665870c1281497af2d5c5a1c4a023a13e10545268) - _Dave Emery<EMAIL_ADDRESS>


text:
# Paste Image

Paste image directly from clipboard to markdown/asciidoc(or other file)!

**Support Mac/Windows/Linux!** And support config destination folder.

![paste-image](./res/vscode-paste-image.gif)

Now you can enable `pasteImage.showFilePathConfirmInputBox` to modify file path before save:

![confirm-inputbox](./res/confirm-inputbox.png)

## Usage

1. capture screen to clipboard
2. Open the command palette: `Ctrl+Shift+P` (`Cmd+Shift+P` on Mac)
3. Type: "Paste Image" or you can use default keyboard binding: `Ctrl+Alt+V` (`Cmd+Alt+V` on Mac).
4. Image will be saved in the folder that contains current editing file
5. The relative path will be paste to current editing file

## Config

- `pasteImage.defaultName`

    The default image file name.

    The value of this config will be pass to the 'format' function of moment library(a js time manipulation library), you can read document https://momentjs.com/docs/#/displaying/format/ for advanced usage.

    And you can use variable:

    - `${currentFileName}`: the current file name with ext.
    - `${currentFileNameWithoutExt}`: the current file name without ext.

    Default value is `Y-MM-DD-HH-mm-ss`.

- `pasteImage.path`

    The destination to save image file.

    You can use variable:

    - `${currentFileDir}`: the path of directory that contain current editing file.
    - `${projectRoot}`: the path of the project opened in vscode.
    - `${fileBasename}`: the current file name with ext.
    - `${fileBasenameNoExtension}`: the current file name without ext.

    Default value is `./`.

- `pasteImage.showFilePathConfirmInputBox`

    Enabling this `boolean` setting will make Paste Image ask you to confirm the file path(or file name). This is useful if you want to change the file path of the image you are currently pasting. Default is `false`.

## Format

### File name format

If you selected some text in editor, then extension will use it as the image file name. **The selected text can be a sub path like `subFolder/subFolder2/nameYouWant`.**

If not the image will be saved in this format: "Y-MM-DD-HH-mm-ss.png". You can config default image file name by `pasteImage.defaultName`.

### File link format

When you editing a markdown, it will pasted as markdown image link format `![](imagePath)`.

When you editing a asciidoc, it will pasted as asciidoc image link format `image::imagePath[]`.

In other file, it just paste the image's path.

## Contact

If you have some any question or advice, Welcome to [issue](https://github.com/mushanshitiancai/vscode-paste-image/issues)

## TODO

- [x] support win (by @kivle)
- [x] support linux
- [x] support use the selected text as the image name
- [x] support config (@ysknkd in #4)
- [x] support config relative/absolute path (@ysknkd in #4)
- [x] support asciidoc
- [x] support use variable ${projectRoot} and ${currentFileDir} in config
- [x] support config basePath
- [x] support config forceUnixStyleSeparator
- [x] support config prefix
- [x] support config suffix
- [x] support use variable ${currentFileName} and ${currentFileNameWithoutExt} in config
- [x] support check if the dest directory is a file
- [x] support select text as a sub path with multi new directory like `a/b/c/d/imageName` or `../a/b/c/d/imageName`
- [x] support config default image name pattern
- [x] support config the text format
- [x] support file path confirm box (by @DonMartin76)

## License

The extension and source are licensed under the [MIT license](LICENSE.txt).

repository: dcasati/vscode-paste-image

repo_name: dcasati/vscode-paste-image


text:
# Alumni-Portal-Guide

**To use ALUMNI PORTAL first you have to open XAMPP Control Panel.**

*Then start Apache and MYSQL servers.*

1.	Include that SQL file named (*university*.sql) provided in this zip file in your xamp databases as a new database.
2.		Here you will see a button named "**Register your University**".

4.	Click on it and provide details. Make sure your university name should not contain *spaces* or *special characters except underscore*.

5.	It will send you an *auto-generated* password through which you can login into our portal.

6.	Use your email and password(provided) to log in to your account.

7.	Here you can add **Admins**, **workshops**, **posts** etc.

8.	Tell your alumni that you have registered for **Alumni Portal**. Kindly sign Up there to get in touch.

9.	Alumni will sign up, you/Admin can approve their requests to use portal.

10. **What Alumni can do?**

	 **Alumni** can add posts.

	 Talk to other alumni & talk to admins as well through chatting.

	 Add wokrhsops if you provide them priviliges.

	 **Alumni** can comment on posts.

	 **Alumni** can edit posts that Alumni have posted not *Admins*' posts.

11. **What Admins can do?**

	 **Admins** can Add posts.

	 **Admins** can Add workhsops.

	 **Admins** can approve requests of alumni to join your portal.

	 **Admins** can talk to other admins and to *Admins*.

	 **Admins** can talk to Representative that is YOU.

	 **Admins** can edit *Admins*.

	 **Admins** can comment on posts.

	 **Admins** can edit workhsops/Posts.

 12. **What can YOU(Representative) do?**
	All the things that *Admins* can do, you can do.
	You can add *Admins*.
	Talk to *Admins*.
	Talk to *Admins* through *Admins*.

 13. **What are Posts?**
	Posts can be annoucements,job alerts, requirements, recruitments etc.

# Alumni-Signup

1. Provide all required information.

2. Choose university from the option box.

3. Wait for the approval of your profile from admins or representative.

gha_language: PHP


text:
<meta itemprop="name" content="tfra.dynamic_embedding.Variable" />
<meta itemprop="path" content="Stable" />
<meta itemprop="property" content="resource_handle"/>
<meta itemprop="property" content="restrict_policy"/>
<meta itemprop="property" content="tables"/>
<meta itemprop="property" content="__init__"/>
<meta itemprop="property" content="export"/>
<meta itemprop="property" content="lookup"/>
<meta itemprop="property" content="remove"/>
<meta itemprop="property" content="restrict"/>
<meta itemprop="property" content="size"/>
<meta itemprop="property" content="upsert"/>

# tfra.dynamic_embedding.Variable

    View source on GitHub

## Class `Variable`

A Distributed version of HashTable(reference from lookup_ops.MutableHashTable)

It is designed to dynamically store the Sparse Weights(Parameters) of DLRMs.

__init__

View source

``` python
__init__(
    key_dtype=dtypes.int64,
    value_dtype=dtypes.float32,
    dim=1,
    devices=None,
    partitioner=default_partition_fn,
    shared_name=None,
    name='DynamicEmbedding_Variable',
    initializer=None,
    trainable=True,
    checkpoint=True,
    init_size=0,
    restrict_policy=None,
    bp_v2=False,
)
```

Creates an empty `Variable` object.

Creates a group of tables placed on devices,
the type of its keys and values are specified by key_dtype
and value_dtype, respectively.
The environment variables 'TF_HASHTABLE_INIT_SIZE' can be used to set the
inital size of each tables, which can help reduce rehash times.
The default initial table size : 1,048,576 for CPU, 16,777,216 for GPU.

#### Args:

* `key_dtype`: the type of the key tensors.
* `value_dtype`: the type of the value tensors.
* `dim`: the length of the value array for each key.
* `devices`: the list of devices holding the tables.
  One table will be created on each device.
* `partitioner`: partition function of keys,
  return the partition index for each key.

Example partition func:
```python
def default_partition_fn(keys, shard_num):
  return tf.cast(keys % shard_num, dtype=tf.int32)
```
* `shared_name`: No used.
* `name`: A name for the operation (optional).
* `initializer`: The value to use if a key is missing in the hash table.
  which can be a python number, numpy array or `tf.initializer` instances.
  If initializer is `None` (the default), `0` will be taken.
* `trainable`: True, will be treated as a trainable Variable, and add to
  to the list of variables collected in the graph under the key
  `GraphKeys.TRAINABLE_VARIABLES`.
* `checkpoint`: if True, the contents of the SparseVariable are
  saved to and restored from checkpoints.
  If `shared_name` is empty for a checkpointed table,
  it is shared using the table node name.
* `init_size`: initial size for the Variable and initial size of each hash
  tables will be int(init_size / N), N is the number of the devices.
* `restrict_policy`: a restrict policy to specify the rule to restrict the
  size of variable. If in training program, the variable is updated by
  optimizer, then the sparse slot variables in optimizer are also be
  restricted.
* `bp_v2`:update parameters by *updating* instead of *setting*, which solves
  the race condition problem among workers during backpropagation in large-scale
  distributed asynchronous training.

#### Returns:

A `Variable` object.

## Properties

resource_handle

Returns the resource handle associated with this Resource.

restrict_policy

tables

## Methods

export

View source

``` python
export(name=None)
```

Returns tensors of all keys and values in the table.

#### Args:

* `name`: A name for the operation (optional).

#### Returns:

A pair of tensors with the first tensor containing all keys and the
  second tensors containing all values in the table.

lookup

View source

``` python
lookup(
    keys,
    name=None
)
```

Looks up `keys` in a Variable, outputs the corresponding values.

The `default_value` is used for keys not present in the table.

#### Args:

* `keys`: Keys to look up. Can be a tensor of any shape. Must match the
  table's key_dtype.
* `name`: A name for the operation (optional).

#### Returns:

A tensor containing the values in the same shape as `keys` using the
  table's value type.

remove

View source

``` python
remove(
    keys,
    name=None
)
```

Removes `keys` and its associated values from the variable.

If a key is not present in the table, it is silently ignored.

#### Args:

* `keys`: Keys to remove. Can be a tensor of any shape. Must match the table's
  key type.
* `name`: A name for the operation (optional).

#### Returns:

The created Operation.

#### Raises:

* `TypeError`: when `keys` do not match the table data types.

restrict

View source

``` python
restrict(
    num_reserved,
    **kwargs
)
```

Restrict the size of self, also including features reside in commensal
slots, and the policy status. The restriction rule follow the setting
in `restrict_policy`.

#### Args:

* `num_reserved`: int. Number of remaining features after restriction.
* `**kwargs`: keyword arguments passing to `restrict_policy.apply_restriction`.

#### Returns:

An operation to restrict size of the variable itself. Return None if
the restrict policy is not set.

size

View source

``` python
size(
    index=None,
    name=None
)
```

Compute the number of elements in the index-th table of this Variable.

If index is none, the total size of the Variable wil be return.

#### Args:

* `index`: The index of table (optional)
* `name`: A name for the operation (optional).

#### Returns:

A scalar tensor containing the number of elements in this Variable.

upsert

View source

``` python
upsert(
    keys,
    values,
    name=None
)
```

Insert or Update `keys` with `values`.

If key exists already, value will be updated.

#### Args:

* `keys`: Keys to insert. Can be a tensor of any shape. Must match the table's
  key type.
* `values`: Values to be associated with keys. Must be a tensor of the same
  shape as `keys` and match the table's value type.
* `name`: A name for the operation (optional).

#### Returns:

The created Operation.

#### Raises:

* `TypeError`: when `keys` or `values` doesn't match the table data
  types.

repository: deeplearningnrs/recommenders-addons

repo_name: deeplearningnrs/recommenders-addons


text:
# Fix
An ultra-lightweight web glue for .NET, written in C#.
## README needs updating
This README is out of date. I've just picked Fix up again to use with Simple.Web, so the information below is wrong. I'll update it soon.
MR 21-Jul-2012
## What?
Fix joins together web servers, request handlers and "infixes", or middleware, in such a way that the implementations of each don't need to know anything about each other, or, indeed, about Fix itself.
### Example?
This is a Console application which runs a web server using Fix:

    class Program
    {
        static void Main()
        {
            using (var server = new Server("http://*:81/"))
            {
                var fixer = new Fixer(server.Start, server.Stop);
                fixer.AddHandler(new RequestPrinter().PrintRequest);
                fixer.Start();
                Console.Write("Running. Press Enter to stop.");
                Console.ReadLine();
                fixer.Stop();
            }
        }
    }
Fixer, Server and RequestPrinter are all in separate assemblies, with no dependencies between them. The Console application has references to all the assemblies, and uses Fix to hook everything up.
### More example?
    class Program
    {
        static void Main()
        {
            using (var server = new Server("http://*:81/"))
            {
                var fixer = new Fixer(server.Start, server.Stop);
                fixer.AddHandler(new RequestPrinter().PrintRequest);
                fixer.AddHandler(new InfoPrinter().PrintInfo);
                fixer.AddInfix(new MethodDownshifter().DownshiftMethod);
                fixer.Start();
                Console.Write("Running. Press Enter to stop.");
                Console.ReadLine();
                fixer.Stop();
            }
        }
    }
In this case, we are adding two handlers, either of which could serve the request. We're also adding an Infix, which can modify the request before it is passed to the handlers.
##Why?
Partly because it's interesting to boil something like a web application server down to the bare minimum like this.

More importantly, by relying entirely on .NET standard Action and Func delegates, Fix eliminates unnecessary coupling between classes and assemblies, as well as dependencies on itself.
So you could write your own Fixer class and use that to wire up any servers, handlers or modules that would work with this "reference implementation".

Another benefit is that because Fix takes a functional approach to the problem, it is friendlier to functional languages like F# and Clojure.
And functional languages are ideal for writing web applications, which aren't supposed to maintain any state anyway.
Ideally, a request will come in and be turned into a response by a series of operations.

###Action and Func, eh?
Yes, and the actual signatures are hideous. What I've done in this code is to add "using" aliases for them, to make it easier to read:

    using RequestHandler = System.Action<string, string, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, string>>, byte[], System.Action<int, string, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, string>>, byte[]>>;
    using ResponseHandler = System.Action<int, string, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, string>>, byte[]>;
    using Infix = System.Action<string, string, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, string>>, byte[], System.Action<int, string, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, string>>, byte[]>, System.Delegate>;
##Production-ready?
Good grief, no. There's a lot of discussion going on around this area at the moment (e.g. [the OWIN project](http://owin.github.com/owin))
and this is my contribution. The delegate signatures used are by no means ideal, particularly the *byte[]* type being used for the request
and response bodies, which should probably be a *Func of byte[]* or a *Task of byte[]* or something.

I'd love to hear people's thoughts on this. Best way is to catch me on [Twitter](http://twitter.com/markrendle).

repository: jjvdangelo/Fix

repo_name: jjvdangelo/Fix


text:
# Docker | Node.js | Simple rest api

# Create docker image

```
 docker build -t rest-api-node .
```

# Search images

Search the image as you named it
```
    docker images
```

# Run container
```
    docker run rest-api-node
```

## Interactive mode (port 5000 according to our code, but running in a container, through out 6000 port in our o.s)
```
    docker run -it -p 8000:5000 rest-api-node
```

## Detached mode (port 5000 according to our code, but running in a container, through out 6000 port in our o.s)

```
    docker run -d -p 8000:5000 rest-api-node
```

  This generate an id : E.g. "9533abc13667265f97fcecede862d5173aa7f840e1eb9ec7e7a85306cb8b66f3"
  ```
    docker ps
  ```

  ```
    docker stop container_id
    docker stop 9533abc13667
  ```

repository: davidramos-om/docker-rest-api-node

repo_name: davidramos-om/docker-rest-api-node


text:
# How To Contribute

## Setup

* `git clone git@github.com:cybertooth-io/ember-simple-auth-aws-amplify.git`
* `cd ember-simple-auth-aws-amplify`
* `yarn`

### Building The Add-on

* `ember b`
* `ember build`

### Linting

* `npm run lint:hbs`
* `npm run lint:js`
* `npm run lint:js -- --fix`

### Running tests

* `ember test` – Runs the test suite on the current Ember version
* `ember test --server` – Runs the test suite in "watch mode"
* `ember try:each` – Runs the test suite against multiple Ember versions

### Running The Dummy Application

* `ember server`
* Visit your app at http://localhost:4200.

For more information on using ember-cli, visit [http://ember-cli.com/](http://ember-cli.com/).

## Upgrading The Add-On

When upgrading this add-on, after successfully performing `ember init` use the following
commands to install the following dependencies required by this add-on.

```bash
ember install ember-auto-import
ember install ember-concurrency
yarn add @aws-amplify/auth @aws-amplify/core ember-simple-auth
```

## Linking This Add-on For Local Testing

### Linking

Use yarn.

```bash
# from this add-on project
$ yarn link
# from the other project that depends on this add-on
$ yarn link ember-simple-auth-aws-amplify
```

Note: I've actually had to go into my _other project_ and put this into its `package.json`:
`"ember-simple-auth-aws-amplify": "link:../ember-simple-auth-aws-amplify",`

### Unlinking

Again, use yarn.

```bash
# from this add-on project
$ yarn unlink
# from the other project that linked to this add-on
$ yarn unlink ember-simple-auth-aws-amplify
```

## Deploying The Dummy Application

Make sure your `~/.aws/credentials` file has a profile named _cybertooth_
with a valid key and secret,

```
[cybertooth]
aws_access_key_id = <KEY>
aws_secret_access_key = <SECRET>
```

Deploy by invoking the following command: `ember deploy production`

Confirm your changes are showing up in our S3 container: http://ember-simple-auth-aws-amplify.cybertooth.io/

You may need to go into AWS CloudFront to expire the index.html file before the site
changes are picked up (see [issue](https://github.com/cybertoothca/ember-cli-text-support-mixins/issues/29)).

## Releasing & Publishing To NPM

```bash
# `yarn publish` will prompt you for the next/new version name
$ yarn publish
$ git push
$ git push --tags
```


text:
# message-analyzer

Analyzing our text/fb messenger messages

## Submodules:

[Git Submodule Documentation](https://git-scm.com/book/en/v2/Git-Tools-Submodules)

- [Vue Frontend](https://github.com/glasses-n-contacts/private-messages-frontend)
- [Messenger Scraper](https://github.com/glasses-n-contacts/messenger-scraper)

## Setup

Uses Python 3.6.5.

1. Create a `variables.py` file in the project root directory with the following variables:

    ```
    CONTACT_INFO = <phone number or apple id, whichever is used in imessage, of the recipient of your messages>
    ABSOLUTE_PATH = <absolute path to sqlite db, corresponds to ~/Library/Messages/chat.db>
    NAME = <Your first name used in fb messenger>
    TARGETS = <An array of the names of the users, ie. ['Lucy','Bill']
    MONGODB_URI = <MONGO URI of mongodb instance where we're going to store the messages for safekeeping>
    CLIENT_MONGODB = <MONGO client>
    MESSENGER_ID = <Your messenger id, as shown in the data packets -_->
    ```

2. Save the html page source file of a fb messenger conversation in a `data` directory created at the root of the project. See `MessageScraper` for more info.

3. Run `pip3 install -r requirements.txt`

## Classes

1. MessageScraper:

    * Gets all iMessage interactions with any other user specified by their phone number or apple id, including reactions and attachments.

    * Attachments are copied to `data/attachments` with the same filenames.

    * Scrapes page source of fb messenger messages using bs4 to get interactions with another user.

        To get this page source, go to messenger.com, scroll all the way to the beginning of the conversation with the user of
        interest, and click "save as" to save it as an html file. Save it in a data/ directory at the root of the project.

    * I recommend using <http://sqlitebrowser.org> for examining the sqlite database (~/Library/Messages/chat.db) which is what the scraper reads from to get iMessage data.

2. MessageAnalyzer

    * Analyzes the actual text
    * Word clouds
    * Entity recognition

3. TextClassifier

    * Classification of text. Currently used to determine if a text is from Lucy or Bill.

    * Current options: Naive bayes, logistic regression, svm.

## Server

Run `python app.py` to start the server which contains API calls to analyze text.

### Endpoints

- `/all_detailed`

    Returns all messages, iMessage and Messenger in a JSON array.

    messasge format:

    ```
    {
        message: text message content,
        date_delivered: delivered date,
        is_reaction: 1 for reaction, 0 for other,
        associated_message_guid: (only for reactions) the message guid associated with the reaction,
        is_from_me: 1 for 'me', 0 for the other,
        attachments: [{
            filename: filename of the attachment, might be empty,
            url: url of the attachment, could be either localhost or remote(messenger),
        }],
        guid: (only for non-reactions) guid of the message,
        reactions: [{
            is_from_me: 1 for 'me', 0 for the other,
            has_emoji: 1 if the message doesn't need to be mapped to an emoji,
            emoji: the reaction emoji, the field only exists if has_emoji == 1,
        }],
        is_system_message: if the message is a messenger system message,
    }
    ```

- `/imessages`

    format same as above, but only return iMessages.

- `/messenger`

    format same as above, but only returns Messenger messages.

- `/attachments/<path:path>`

    Serves attachments by looking for the `path` file in `data/attachments`. `path` should be the filename rather than the complete path (should've been renamed -_-).

    Example:

    `{url}/attachments/violet.png` points to `data/attachments/violet.png`.

More interesting analysis visualizations to come.

repository: glasses-n-contacts/message-analyzer

repo_name: glasses-n-contacts/message-analyzer


text:
---
sidebar_position: 1
---
# Welcome

Welcome to the Tarant user guide! This guide shows you how to get started on this actor model framework.

## What is Tarant?

## Is Tarant for me?

if you are thinking to implement a BFF or use graphQL give it a try to see if it fits your use case.

## Ready to get started?

Find out how to start in 5 minutes with our [quick start guide](/docs/quick-start). Or visit the [page](https://www.tarant.com) and [its repo](https://github.com/tarantx) and start exploring.

repository: tarantx/tarant-page

repo_name: tarantx/tarant-page


text:
---
layout: post
title:  "Programming challenge sites"
date:   2014-11-19 15:24:47
categories: programming
---

I've been checking out a bunch of sites where you can improve your knowledge of
algorithms and puzzle solving. In no particular order here are some:

[Topcoder.com][topcoder] The site that started it all. In all these years they
are still using a java applet as their coding environment. Whatever works.
People have even written plugins so you can code in vim locally and submit I
believe. This is a great site that has tons of problems. The only thing that
kind of stinks AFAIK is when you submit and answer and don't get a 100% of it
right it doesn't tell you what you missed. When you don't get feedback it's hard
to know what you have to practice. Topcoder supports C++, Java, C#, Visual
Basic, and Python.

[Codechef.com][codechef] This is another great site with tons of challenges. You
can submit code in all the popular languages. I think they are using GCC where
possible because they are using a very old 1.0 version of Go. I tried submitting
some code and it told me append wasn't a function!
Lots of problems and solutions. I think its more focused on getting right
answers than ensuring your code handles edge cases which is nice when you want
to explore/answer new problems quickly.

[Hackerrank.com][hackerrank] Supports pretty much every major language.
Lots of challenges. Coding in the browser is nice as it supports vim and emacs,
which isn't so bad if you don't have to write a bunch of tests and not that many
lines of code =)

[Coderbyte.com][coderbyte] Supports Javascript, Python, Ruby, PHP, C++ and Java. The easy and medium challenges are suited for freshmen/sophomores.

[Interviewcake.com][cake] Some free questions, then it's paid. This isn't a challenges site, but asks questions and gives hints as you try and get the answer. Could be useful for people starting out.

As I was writing this post I found an equivalent one over at
[http://codecondo.com/coding-challenges/][codecondo] that included more sites. Check it out!

[topcoder]: http://topcoder.com
[codechef]: http://codechef.com
[hackerrank]:    http://hackerrank.com
[coderbyte]:    http://coderbyte.com
[cake]:    http://interviewcake.com
 [codecondo]: http://codecondo.com/coding-challengines

extension: markdown


text:
# project-euler
Project Euler is a website dedicated to a series of computational problems intended to be solved with computer programs.
The project attracts adults and students interested in mathematics and computer programming.
https://projecteuler.net/

repository: sebranly/project-euler

repo_name: sebranly/project-euler


text:
# cache2k 2.0.0.Final "North Atlantic"

This change log lists the complete changes since the last stable version [1.6.0.Final](/1/6.0.Final.html).

## Upgrading from version 1

Version 2 has breaking changes. Recompilation is required. Most code will run with
minor or no modifications. Common used functionality was kept or will be replaced
gradually via deprecation. Deprecated elements may be removed in a version 2 minor
release. Asses your code and change deprecated usages to the suggested alternative to
be compatible with future releases.

Major changes:

- Requires at least Java 8 to run
- JMX and XML configuration support is no longer part of `cache2k-core`
- No caching of exceptions by default. This has to be enabled explicitly by specifying
  `ResiliencePolicy`. Previous default resilience available as `UniversalResiliencePolicy` in
  `cache2k-addon`

## New and Noteworthy

cache2k now requires at least Java 8. This release focusses on API cleanup
and touch ups with adaptions to available Java 8 concepts
(e.g. CompetebleFuture or Duration). No major functionality was added.

- cache2k-api, cache2k-core, cache2k-jmx and cache2k-config are fully modularized
- Requires at least Java 8 to run
- Adaptions to Java 8 on API level. E.g. use of Duration in the configuration
- New interfaces for `CacheLoader` and `CacheWriter` in package `org.cache2k.io`
- Removal of deprecated classes and methods
- JMX and XML configuration support is no longer part of `cache2k-core`
- OSGi support with `cache2k-osgi-all` removed, see: [GH#83](https://github.com/cache2k/cache2k/issues/83)
- `@Nullable` annotations with Kotlin native type support
- General scheme to enable extra functionality (`Feature`), used for JMX and Micrometer support
- No caching of exceptions by default. This has to be enabled explicitly by specifying
  `ResiliencePolicy`. Previous default resilience available as `UniversalResiliencePolicy` in
  `cache2k-addon`
- Configuration: Functionality can be bundled in features and can augment the
  configuration and wrap the cache instance.

## Possible Breakages

Since this is a major release, some rarely used things in the API are
changed without backwards compatibility. Most code is supposed to run
without breaking.

- Requires at least Java 8 to run
- Remove deprecated classes and methods: `Cache.prefetch`, `Cache.prefetchAll`, `IntCache`, `LongCache`,
`CacheEntry.getLastModification`, `AbstractCacheEntry`
- Incompatible change of `CustomizationSupplier` interface
- `org.cache2k.integration.ResiliencePolicy` removed. Replaced by: `org.cache2k.io.ResiliencePolicy`
- JMX support moved from `cache2k-core` to `cache2k-jmx` to minimize module dependencies
- XML configuration moved from `cache2k-core` to `cache2k-config` to minimize module dependencies
- Dropped apache commons logging support. Commons logging seems to be not
  maintained any more and lacks Jigsaw/module support.
- Drop support for XML configuration on Android, removed XML pull dependency
  (The Android will be potentially unsupported in cache2k V2 at first)
- Moved JCache configuration classes in `org.cache.jcache` from `cache2k-api` to `cache2k-jcache`.
  If these are used, `cache2k-jcache` needs to be in compile scope.
- `Cache2kConfiguration`: Changed all parameters of type long, representing
  milliseconds to type `Duration`
- Remove deprecated classes and methods: `Cache.prefetch`, `Cache.prefetchAll`, `IntCache`, `LongCache`,
`CacheEntry.getLastModification`, `AbstractCacheEntry`
- `Cache.getStatistics` removed. Replaced by `CacheManagement.of(Cache).sampleStatistics()`.
- `Cache.clearAndClose` removed. Replaced by `CacheManagement.destroy`
- Removed deprecated `MutableCacheEntry.getCurrentTime`, replaced with `getStartTime`
- Remove `MutableCacheEntry.wasExisting` and `MutableCacheEntry.getOldValue`
- Rename `MutableCacheEntry.getRefreshedTime` to `getModificationTime`
- `MutableCacheEntry.exists`: Does not change the value after `setValue` or triggered load
- `MutableCacheEntry.getValue`: Does not change the value after `setValue`
- Every class with `Configuration` shortened to `Config` and consequently changed the
  package name `org.cache2k.configuration` to `org.cache2k.config`.
- `Cache2kBuilder.toConfiguration()` renamed to `config()`
- Lots restructuring around the extra configuration sections and customizations
- remove `Cache2kBuilder.enableJmx`. Replaced with `Cache2kBuilder.enable(JmxSupport.class)`
- `Cache.requestInterface` throws `UnsupportedOperationException` if the requested interface
  is not supported instead of null
- Change in special expiry values semantics: `ExpiryTimeValues.NO_CACHE` removed.
  `ExpiryTimeValues.NOW` does not start a refresh and expire immediately.
   `ExpiryTimeValues.REFRESH` does expire and start a refresh if refresh ahead is enabled.
- No caching of exceptions by default. This has to be enabled explicitly by specifying
  `ResiliencePolicy`. Previous default resilience available as `UniversalResiliencePolicy` in
  `cache2k-addon`
- Move `Weigher` to package `org.cache2k.operation`.
- Rename `MutableCacheEntry.reload` to `MutableCacheEntry.load`
- Remove `Cache2kBuilder.enableJmx`

## API Changes

- `org.cache2k.integration.CacheLoader` and everything in package `org.cache2k.integration`
  is deprecated. Replacements are available in `org.cache2k.io`. This major change was done to
  change from abstract classes to interface. The new package was introduced for smoother transition
  to keep the previous classes and deprecated them.
- Move `TimeReference` to `org.cache2k.operation` and also make `Scheduler` available
- `Cache2kBuilder`: New methods `setup` and `enable`
- New method: `Cache.computeIfAbsent` with function
- New methods `Cache.loadAll` and `Cache.reloadAll` which return `CompletableFuture`
  Old methods which use `CacheOperationCompletionListener` are deprecated
- New methods: `Cache.mutate`, `Cache.mutateAll` for a mutation only entry processor variant
- `Cache.entries` and `Cache.keys` return a `Set` for iteration and stream support
- New method `CacheEntry.getExceptionInfo()`
- `org.cache2k.jmx`, API for JMX MXBeans removed
- New interfaces `CacheOperation`, `CacheControl` and `CacheInfo` in `org.cache2k.operation`
- New method: `MutableCacheEntry.getExpiryTime()`
- New method: `MutableCacheEntry.setExpiryTime()`
- New method: `MutableCacheEntry.lock`
- Lots of generic typing refinements
- Allow listeners to throw a checked exception
- `@Nullable`, `@NonNull` annotations
- Deprecated `AdvancedKeyValueSource` and `KeyValueStore`

## Fixes and Improvements

- All cache customizations (e.g. `CacheLoader`) implement `Customization`.
- Speedup of internal hash table, because compatibility for Java 6 could be removed
- `Cache.loadAll()` and `Cache.reloadAll()` complete with exception if a a loader
  exception happened. If more than one exception happened the one is propagated.
- Improved interface of `ExceptionPropagator` and `LoadExceptionInfo`,
  A `CacheEntry` may be cast to `LoadExceptionInfo` if an exception is present
- `Cache.invoke`, `EntryProcessor`: Make expiry calculations and listeners calls more consistent
  if expiry event races with the start of the operation
- `MutableCacheEntry.lock` allows to lock an entry for mutation explicitly
- `Cache.asMap` / `ConcurrentMap` implementation implements compute methods
  and runs them only once
- Introduced `ConfigAugmenter` which can make changed to the configuration before a cache is build
- `Cache2kBuilder`: Methods `setup`, `apply` allow to execute a function on the configuration
  or builder, which can be used to factor out configuration fragments.
  We use this to provide `enable` and `disable` methods on policies.
- AdvancedCacheLoader, AsyncCacheLoader and ExpiryPolicy get null if current entry carries exception, https://github.com/cache2k/cache2k/issues/163
- Remove `ServiceLoader` in modules `cache2k-jmx` and `cache2k-micrometer`
- Introduce concept of `CacheFeature` and `ToggleCacheFeature`
- `CacheType`: immutable instead of bean. `CacheType.of` moved from `CacheTypeCapture`
- Remove the need of serializable from the configuration objects, by doing a deep
  copy of the default configuration via bean setters and getters.
- `Cache2kConfig`: Make `setEternal` a separate flag.
   Remove logic from setters, so we can use setters and getter to copy the
   object
- Ignore `entryCapacity` setting in case a weigher is specified
- Cap suppression or caching of exceptions determined by `ResiliencePolicy` to the
  `expireAfterWrite` duration, if specified
- Fix site build for Java 11
- Documentation touch ups
- Change configuration XML schema to version 2 and archive version 1
- Spring cache manager applies default setup also to dynamically created caches that
  are retrieved via `getCache`

gha_language: Java


text:
# bitfield

a very simple bitfield, compliant with the Bittorrent spec

    npm install bitfield

#### Example

```js
var Bitfield = require("bitfield");

var field = new Bitfield(256); //create a bitfield with 256 bits

field.set(128); //set the 128th bit
field.set(128, true); //same as above

field.get(128); //true
field.get(200); //false (all values are initialised to `false`)
field.get(1e3); //false (out-of-bounds is also false)

field.set(128, false); //set the 128th bit to 0 again

field.buffer; //the buffer used by bitfield
```

#### Methods
`Bitfield(data)`: `data` can be either a node.js buffer, WebGL Int8Array or numeric array, or a number representing the maximum number of supported bytes.

`Bitfield#get(index)`: Returns a boolean indicating whether the bit is set.

`Bitfield#set(index[, value])`: `value` defaults to true. Sets the bit to `1` for a value of `true` or `0` for `false`.

##### Auto-grow mode
`Bitfield(data, { grow: size })`: If you `set` an index that is out-of-bounds, the Bitfield will automatically grow so that the bitfield is big enough to contain the given index, up to the given `size` (in bit). If you want the Bitfield to grow indefinitely, pass `Infinity` as the size.

#### Properties

`Bitfield#buffer`: The contents of the bitfield.

`Bitfield#grow`: The passed growth option (defaults to `0`).

## License

MIT

gha_language: EJS


text:
# Medical Application
---

**SNHU CS-320**

**medicalApplication** software tests example using **JUnit** test case.

_Bugs:_

1. Doctors are able to be added with same ID.
2. Medical Record allow to search for patient ID not in the database.
3. Blank entries for ID and name are able to added to the system.

To run the application type:

$ _java App_

To run JUnit test type:

$ _java org.junit.runner.JUnitCore AllTests_

repository: arsari/MedicalApplication

repo_name: arsari/MedicalApplication


text:
General Reading
===============

General reading about cryptocurrency and blockchain. Things to think about. Ideally you'd read top down.

On Anonymity
------------
* [Anonymous vs pseudononymous](https://tante.cc/2011/08/12/anonymous-vs-pseudonymous/): on most
of the popular blockchains, you aren't anonymous. You're using a
nickname
(that looks something like `0x13f2ef50A55D5B3B8A9D9B083b1Ed9F9427cd832`), and it's just not clear (yet) that you go by that nickname.
* [Your Sloppy Bitcoin Drug Deals Will Haunt You For Years](https://www.wired.com/story/bitcoin-drug-deals-silk-road-blockchain/): the problem with a public, immutable, 10 year old blockchain is that it's a public, immutable, 10 year old blockchain. There's a public ledger of every transactions that's ever occurred. It's just a matter of typing your nickname (`0x13f2ef50A55D5B3B8A9D9B083b1Ed9F9427cd832`) into your real name (`David Q. Cokebuyer`).
* U.S. exchanges are required to comply with [Know Your Customer](https://steemit.com/bitcoin/@steemitguide/guide-to-regulating-cryptocurrency-via-the-know-your-customer-procedure-and-compliance) regulations when dealing with larger customers.
* Governments and regulators are getting better at turning nicknames into real names. The [U.S. Internal Revenue Service has requested records on Coinbase users](https://medium.com/@GlobalTaxAccountants/irs-narrows-scope-of-coinbase-subpoena-impact-for-coinbase-users-770532755c5e). This is a big step forward in tying transactions to known entities, as long as the coins stay in an exchange the IRS can subpoena. Buy coins and move them to an overseas exchange, though, and it gets much harder.
* [Monero](https://www.monero.how/how-does-monero-privacy-work) and similar coins look to provide privacy that the big platforms like Bitcoin and Ethereum weren't designed for.

Evaluating Coins
----------------
* [CryptoMiso - ranking coins based on github quality](https://www.cryptomiso.com/)
    * [Article about CryptoMiso](https://news.bitcoin.com/new-website-ranks-600-cryptocurrencies-github-activity/)

Individual Coins
----------------
* [0x Protocol](https://0xproject.com/) - "0x is an open, permissionless protocol allowing for ERC20 tokens to be traded on the Ethereum blockchain."

repository: bbhart/coininfo

repo_name: bbhart/coininfo


text:
---
authors:
- 'tannerwelsh'
team_size: 1
goal_id: 254
title: 'Init 4: Relational Databases'
created_at: '2017-04-10T10:38:28Z'
labels:
- practice
- foundational
published: true
level: '0'
base_xp: 40
bonus_xp: 15
redirect_from: '/goals/254'
---

# Init 4: Relational Databases

## Challenge Rating

This goal will likely be within your ZPD if you...

- Have completed the first three initiation goals: [1][bossggle-word-game], [2][developer-tools], and [3][hello-web-servers]
- Have used a spreadsheet application like Excel
- Have used git and GitHub to do basic tasks like forking, cloning, making commits, and pushing to a remote repository
- Have used a command line shell
- Are interested in how databases are designed and used
- Are interested in learning about relational databases systems

## Description

Design, build, and query relational databases for a variety of applications. In this goal, you'll practice using SQL to create and work with databases.

This goal uses Khan Academy's [Intro to SQL: Querying and managing data][ka-sql-course] course.

In addition to going through the tutorials and projects in the Khan Academy course, you'll create and work with databases for apps you've already built in the previous initiation goals. If you haven't yet completed them, this goal will be confusing.

### Introduction to Solo Goals

This goal has a team size of 1, which makes it a _solo_ goal.

Solo goals work a bit differently than team goals. The big difference for you is that _you are the only person responsible for completing the project_.

The benefit of this is that you can use solo goals to challenge yourself and discover where your strengths and weaknesses lie. Doing a solo goal is a great way to find your ZPD.

The drawback of doing a solo goal is that it isn't good practice for doing what professional web developers spend most of their time doing: collaborating with others to produce software. You also don't have teammates to depend upon.

Doing a solo goal _does not_ mean that you have to do everything "by yourself". You still have access to (and should make use of) all the resources you'd have during team goals. One of the best sources of support for you will be other learners who are working on or have completed this goal. Find out who they are, and ask them for help when you get stuck!

### Recommended Pace

It is recommended (but not required) that you follow along with the day-by-day pace included here. These are designed to help you break down the problem into more manageable parts so that you can pace your work appropriately.

Each day, pay attention to the **terms & concepts** highlighed in **bold**. By the end of the day, you should have a better idea of what they mean and how to use them. In other words, aim to be able to answer the question "what is X?" for yourself.

#### Day 1

Complete the specs in [Stage 1](#stage-1) to get started with the basics of SQL and install the [PostgreSQL][] database on your computer.

To prepare for the Khan Academy project, complete the [SQL basics][sql-basics] section of the course. For additional practice, go through the first 6 lessons of [SQL Bolt][sql-bolt] (from "Introduction" to "SQL Review").

You'll be learning and practicing:

- what a **database** is and how it is similar to a spreadsheet
- what a database **table** is and how to create it
- what **columns** and **data types** are, and how they are used within a database
- what a **primary key** is and why it is needed
- how to **insert** data into a table
- how to find data on a database using **queries**
- what it means to **aggregate** data and how to use some common **aggregate functions**
- how to **filter** data with SQL using the `WHERE` keyword
- how to **sort** data with SQL using the `ORDER BY` keyword

#### Day 2

Complete the specs in [Stage 2](#stage-2) to gain additional SQL practice and to start working with some specialized database tools:

- [SQL Designer][] is a handy tool for designing database schemas
- [Postico][] is a PostgreSQL client for the Mac that lets you interact with your database with a GUI (Graphical User Interface)

To prepare for the Khan Academy project, complete the [More advanced SQL queries][more-advanced-sql-queries] section.

You'll be learning and practicing:

- how to use the **AND/OR operators** in your queries
- what a **subquery** is and how to use it
- how to **group** query results and filter them with the `HAVING` keyword
- how to design a database **schema**

#### Day 3

Complete the specs in [Stage 3](#stage-3) to design, build, and populate databases for the "Bike Shop" and "Music Player" apps. Now you'll have to apply your SQL skills to your own code.

Because you've already designed the **object model** for these apps, you have a head start for designing the **database schema**. Notice how you can map _classes_ in JavaScript to _tables_ in a database, with _properties_ becoming equivalent to table _columns_. _Instances_ of a class are a lot like _rows_ in a database table: entries in a set that have the same properties/fields, but different values/data. This is the essence of [Object-relational mapping](https://en.wikipedia.org/wiki/Object-relational_mapping)—but don't worry about that too much right now. We'll get into it more later :).

It is recommended that you continue the Khan Academy course and complete the [Relational queries in SQL][relational-queries-in-sql] section. For additional practice, go through lessons 6-12 of [SQL Bolt][sql-bolt].

You'll be learning and practicing:

- why data can and should be split across multiple **related tables**
- what a **foreign key** is and why it is needed
- how to connect related tables using **`JOIN` queries**
- how to generate **mock data** and add it to your database

#### Day 4

Complete the specs in [Stage 4](#stage-4) to continue practicing database design, this time by building schema for the Bossggle and Mmmarkdown apps.

With these apps, you don't have the benefit of an object model to work from. Instead, you have to consider the _features_ that the application has, and then design a database schema that can support these features.

To prepare for the Khan Academy project, complete the [Modifying databases with SQL][modifying-databases-with-sql] section. For additional practice, go through the last lessons (starting at 13) of [SQL Bolt][sql-bolt].

You'll be learning and practicing:

- how to design a **schema** to support particular application features
- how to **update** rows in a table
- how to **delete** rows in a table
- how to **alter** the schema of a table after it's created

#### Day 5

Complete the specs in [Stage 5](#stage-5) to solidify your database design skills by reverse-engineering the databases for your favorite apps.

There are no new concepts for today: this day is all about practicing the skills you've learned over the week.

## Context

The series of initiation goals are designed for new members of Learners Guild to get oriented to the learning environment, build key foundational skills, and work on some fun projects.

1. [Init 1: Bossggle Word Game][bossggle-word-game]
1. [Init 2: Developer Tools][developer-tools]
1. [Init 3: Hello Web Servers][hello-web-servers]
1. [Init 4: Relational Databases][relational-databases]
1. [Init 5: Web APIs][web-apis]
1.

So far, the apps you've built haven't had to deal with a lot of data or with data that needed to be persistent (technical term that means "data that is saved for later use").

When applications need to _persist data_, there are basically two options: save to a file or write to a database.

In the last goal you built a Markdown editor that used filesystem persistence. It saved data to files on the web server.

This approach is fine for small sets of data that are mostly independent, like photos or Word documents. When the data being stored gets bigger and more complex, then it's time to consider using a database.

There are a lot of types of databases, each with their own strengths and appropriate uses. This goal is designed to orient you to a common type of database system and query language: the relational database and the SQL query language. Often you'll see the initialism RDB for "relational database", and SQL stands for "Standard Query Language".

Use this goal to familiarize yourself with these tools while working with familiar apps.

## Specifications

These are the basic specs for Relational Databases, broken into 5 stages. If you complete these specs, try taking on some of the [Stretch specs](#stretch).

#### Stage 1

Setup repo, complete a Khan Academy project, and install PostgreSQL. For instructions on installing PostgreSQL, see the guides in [Resources > Guides](#guides).

- [ ] Artifact repo is created on GitHub.
- [ ] The artifact repo is properly licensed, preferably with the [MIT license][mit-license].
- [ ] Solution SQL for the Khan Academy project: [Design a store database][ka-proj-store-db] is added to a file in your repo named `store_db.sql`
- [ ] SQL in `store_db.sql` has consistent indentation.
- [ ] All the SQL keywords in `store_db.sql` are written in ALL CAPS.
- [ ] PostgreSQL is installed on your computer with Homebrew.

#### Stage 2

Complete another Khan Academy project, use the SQL Designer tool, and install the [Postico app][postico] (this is recommended, but not required).

- [ ] Solution SQL for the Khan Academy project: [Data dig][ka-proj-data-dig] is added to a file in your repo named `data_dig.sql`
- [ ] SQL in `data_dig.sql` has consistent indentation.
- [ ] All the SQL keywords in `data_dig.sql` are written in ALL CAPS.
- [ ] Schema diagrams are created for both the "Store database" and "Data dig" database using the [SQL Designer tool][sql-designer].
- [ ] Screenshots of each schema diagram are added to repo as `store_db_schema.png` and `data_dig_schema.png`, respectively.

#### Stage 3

Create schemas and mock data for the "Music Player" app from the Init 3 goal. Then run queries against them. Read the [Generating Mock Data](#generating-mock-data) section to learn how to generate fake data.

##### Music Player

- [ ] Folder `music-player/` exists in your repo.
- [ ] Database schema SQL (using PostgreSQL syntax) for the Music Player from [Init 3: Hello, Web Servers][hello-web-servers] is included in the file `music-player/schema.sql`.
- [ ] Music Player schema includes table and appropriate columns for Artists
- [ ] Music Player schema includes table and appropriate columns for Albums
- [ ] Music Player schema includes table and appropriate columns for Songs
- [ ] Music Player schema includes table and appropriate columns for Playlists
- [ ] Mock data is generated for the Music Player and added to the file `music-player/mock_data.sql`.
- [ ] Sample queries against the Music Player database are added to the file `music-player/queries.sql`.
- [ ] Queries against the Music Player use the `WHERE` keyword (at least once)
- [ ] Queries against the Music Player use the `LIMIT` keyword (at least once)
- [ ] Queries against the Music Player use the `ORDER BY` keyword (at least once)
- [ ] Queries against the Music Player use the `LIKE` keyword (at least once)
- [ ] Queries against the Music Player use the `AND/OR` keyword (at least once)
- [ ] Queries against the Music Player use the `HAVING` keyword (at least once)
- [ ] Queries against the Music Player use the `IN` keyword (at least once)
- [ ] Queries against the Music Player use the `JOIN` keyword (at least once)

##### Bike Shop

Create a database for a fictional bike shop. Use the [Table Schema for Bike Shop](#table-schema-for-bike-shop) provided.

- [ ] Folder `bike-shop/` exists in your repo.
- [ ] Database schema SQL (using PostgreSQL syntax) for the Bike Shop is included in the file `bike-shop/schema.sql`.
- [ ] Bike Shop schema matches the specifications in [Table Schema for Bike Shop](#table-schema-for-bike-shop).

#### Stage 4

Complete the final Khan Academy project. Design and create schemas for the "Bossggle" app from the Init 1 goals.

- [ ] Solution SQL for the Khan Academy project: [App impersonator][ka-proj-app-impersonator] is added to a file in your repo named `app_impersonator.sql`
- [ ] SQL in `app_impersonator.sql` has consistent indentation.
- [ ] All the SQL keywords in `app_impersonator.sql` are written in ALL CAPS.
- [ ] Folder `bossggle/` exists in your repo.
- [ ] Database schema SQL (using PostgreSQL syntax) for the Bossggle game from [Init 1: Bossggle Word Game][bossggle-word-game] is included in the file `bossggle/schema.sql`.

Bossggle schema supports the following features (i.e. you _could_ write SQL to show this data):
- [ ] List all words guessed
- [ ] Count all correct words guessed
- [ ] Count all incorrect words guessed
- [ ] List all words guessed and their scores
- [ ] Get sum of scores for all words guessed
- [ ] Show 10 most recently guessed words

#### Stage 5

Pick 2-3 real-world apps (for example: Twitter, Instagram, Google Drive, etc.) and design a sample database schema for each of them. Then generate some mock data and run queries against them. Your schemas don't have to be _exactly_ what these apps would use, but they should roughly approximate the basic features.

- [ ] 2 or 3 real-world apps are chosen and folders are created for each of them.

For each real-world app chosen there exists:
- [ ] A SQL schema in the file `<app name>/schema.sql`.
- [ ] A set of mock data `INSERT` statements in the file `<app name>/mock_data.sql`.
- [ ] A set of example queries in the file `<app name>/queries.sql`.
- [ ] Queries against the real-world apps use the `INSERT` keyword (at least once)
- [ ] Queries against the real-world apps use the `UPDATE` keyword (at least once)
- [ ] Queries against the real-world apps use the `DELETE` keyword (at least once)
- [ ] Queries against the real-world apps use the `WHERE` keyword (at least once)
- [ ] Queries against the real-world apps use the `LIMIT` keyword (at least once)
- [ ] Queries against the real-world apps use the `ORDER BY` keyword (at least once)
- [ ] Queries against the real-world apps use the `JOIN` keyword (at least once)
- [ ] SQL in all real-world app SQL files have consistent indentation.
- [ ] All the SQL keywords all real-world app SQL files are written in ALL CAPS.

### Table Schema for Bike Shop

##### Table: `bikes`

| Column Name    | Data Type             | Default Value |
|:---------------|:----------------------|:--------------|
| `id`           | SERIAL (PRIMARY KEY)  |               |
| `name`         | VARCHAR               |               |
| `price`        | DECIMAL               | 0.00          |
| `frame_id`     | INTEGER (FOREIGN KEY) |               |
| `rings_front`  | INTEGER               | 3             |
| `rings_back`   | INTEGER               | 7             |
| `brakes_front` | BOOLEAN               | true          |
| `brakes_back`  | BOOLEAN               | true          |
{:.mdl-data-table}

##### Table: `frames`

| Column Name | Data Type            | Default Value |
|:------------|:---------------------|:--------------|
| `id`        | SERIAL (PRIMARY KEY) |               |
| `color`     | VARCHAR              | 'black'       |
| `size`      | INTEGER              | 55            |
| `style`     | VARCHAR              | 'street'      |
{:.mdl-data-table}

##### Table: `tires`

| Column Name | Data Type            | Default Value |
|:------------|:---------------------|:--------------|
| `id`        | SERIAL (PRIMARY KEY) |               |
| `diameter`  | INTEGER              | 22            |
| `type`      | VARCHAR              | 'street'      |
{:.mdl-data-table}

##### Table: `bike_frame`

| Column Name | Data Type             | Default Value |
|:------------|:----------------------|:--------------|
| `id`        | SERIAL (PRIMARY KEY)  |               |
| `bike_id`   | INTEGER (FOREIGN KEY) | NULL          |
| `frame_id`  | INTEGER (FOREIGN KEY) | NULL          |
{:.mdl-data-table}

##### Table: `bike_tires`

| Column Name     | Data Type             | Default Value |
|:----------------|:----------------------|:--------------|
| `id`            | SERIAL (PRIMARY KEY)  |               |
| `bike_id`       | INTEGER (FOREIGN KEY) | NULL          |
| `front_tire_id` | INTEGER (FOREIGN KEY) | NULL          |
| `back_tire_id`  | INTEGER (FOREIGN KEY) | NULL          |
{:.mdl-data-table}

### Stretch

If you complete all of the specs listed above (the checkboxes), there's no reason to stop there! Keep practicing with these stretch specs.

Choose an additional 3 real-world apps to reverse-engineer the databases for.

For each real-world app chosen there exists:
- [ ] A folder in your repo `<app name>/`
- [ ] A SQL schema in the file `<app name>/schema.sql`.
- [ ] A set of mock data `INSERT` statements in the file `<app name>/mock_data.sql`.
- [ ] A set of example queries in the file `<app name>/queries.sql`.

Find a couple of large datasets online, create databases for them, and practice querying against them. Some good places to look are at [data.gov](https://www.data.gov/) and this list of [public datasets](https://github.com/caesar0301/awesome-public-datasets).

- [ ] 2 large datasets are included as CSV or JSON data in a folder called `datasets/`.
- [ ] SQL schema creating tables for the datasets are inclued in your repo.
- [ ] 10+ queries against the datasets are included in files in your repo.

## Resources

Use these resources to fill in the gaps in your skills and knowledge as you find them. There is more here than you can do in a week, so focus on the areas that are in your zone of proximal development (ZPD).

##### Courses

- Khan Academy: [Intro to SQL: Querying and managing data][ka-sql-course] #sql #db
  - [SQL basics][sql-basics]
  - [More advanced SQL queries][more-advanced-sql-queries]
  - [Relational queries in SQL][relational-queries-in-sql]
  - [Modifying databases with SQL][modifying-databases-with-sql]
- Treehouse: [Querying Relational Databases (2h)](https://teamtreehouse.com/library/querying-relational-databases) #sql #db
- Treehouse: [SQL Basics](https://teamtreehouse.com/library/sql-basics) #sql #db
- Treehouse: [Modifying Data With SQL](https://teamtreehouse.com/library/modifying-data-with-sql) #sql #db
- Lynda: [SQL Essential Training (3h 2m)](https://www.lynda.com/SQL-tutorials/SQL-Essential-Training/139988-2.html) #sql #db

##### Exercises

- [SQL Bolt][sql-bolt] #sql #db
- [SQL Zoo](http://sqlzoo.net/) #sql #db
- [SQL Teaching](https://www.sqlteaching.com/) #sql #db

##### Guides

- CodeMentor: [Getting Started with PostgreSQL on Mac OSX](https://www.codementor.io/devops/tutorial/getting-started-postgresql-server-mac-osx) #devops #sql #postgresql
- [Punit's instructions for installing Homebrew + PostgreSQL (on a mac)](https://gist.github.com/punitrathore/ca32542fddd0d8b625aab610c35e4545) #postgresql

##### Tools

- [Quick DB Diagrams](https://app.quickdatabasediagrams.com/) #sql
- [SQL Designer][sql-designer] #sql
- [Mock Data Generator][mockaroo] #data #db
- [Postico: PostgreSQL Client for the Mac][postico] #sql #postgresql #macapp

### Generating Mock Data

To quickly generate some "mock" (fake) data for your database, you can use a tool like [Mockaroo][].

It isn't too hard. Just follow these steps:

1. Pick a table from your database
2. Go to the [Mockaroo][] app
3. Add the fields you want to generate mock data for (make sure to match the spelling/capitalization of your table columns!)
4. Pick the corresponding data type to use for each field
5. Customize the options (if you want to)
6. Determine the # of rows to generate
7. Select the `SQL` format
8. Specify the table name
9. Click `Download data`
10. Copy the SQL statements from the downloaded file into your SQL console and execute them!

[simple-book-store]: {{ site.url }}{% link _goals/69-Simple_Book_Store.md %}

[bossggle-word-game]: {{ site.url }}{% link _goals/251-Init_1-Bossggle_Word_Game.md %}
[bike-shop-oop]: {{ site.url }}{% link _goals/252-Init_6-OOP_Practice_with_Bike_Shop.md %}
[hello-web-servers]: {{ site.url }}{% link _goals/253-Init_3-Hello_Web_Servers.md %}
[relational-databases]: {{ site.url }}{% link _goals/254-Init_4-Relational_Databases.md %}
[web-apis]: {{ site.url }}{% link _goals/255-Init_5-Web_APIs.md %}
[developer-tools]: {{ site.url }}{% link _goals/256-Init_2-Developer_Tools.md %}

[ka-sql-course]: https://www.khanacademy.org/computing/computer-programming/sql
[sql-basics]: https://www.khanacademy.org/computing/computer-programming/sql#sql-basics
[more-advanced-sql-queries]: https://www.khanacademy.org/computing/computer-programming/sql#more-advanced-sql-queries
[relational-queries-in-sql]: https://www.khanacademy.org/computing/computer-programming/sql#relational-queries-in-sql
[modifying-databases-with-sql]: https://www.khanacademy.org/computing/computer-programming/sql#modifying-databases-with-sql
[ka-proj-store-db]: https://www.khanacademy.org/computing/computer-programming/sql/sql-basics/p/project-design-a-store-database
[ka-proj-data-dig]: https://www.khanacademy.org/computing/computer-programming/sql/more-advanced-sql-queries/p/project-data-dig
[ka-proj-app-impersonator]: https://www.khanacademy.org/computing/computer-programming/sql/modifying-databases-with-sql/p/project-app-impersonator

[sql-bolt]: https://sqlbolt.com/

[postgresql]: https://www.postgresql.org/
[sql-designer]: http://sql.apps.learnersguild.org/
[postico]: https://eggerapps.at/postico/
[mockaroo]: https://www.mockaroo.com/

[mit-license]: https://opensource.org/licenses/MIT

repository: looknotime/web-development-js

repo_name: looknotime/web-development-js


text:
# LinearMPC
MATLAB implementation of model predictive control for a linear system.

The plant model used in the simulation code is the quadruple-tank process as a MIMO linear system [1].

For a quadratic programming solver, this sample code employes 'quadprog' included in MATLAB optimization toolbox, but any other optimization solvers for linear or convex problem can be configured for this program.

## Simulation Result
![alt text](https://github.com/jinsung20/LinearMPC/blob/master/Result.png)

## Requirements
MATLAB Optimization Toolbox
or
3rd party quadtratic programming solver, etc.

## Reference
[1] K. H. Johansson, "The quadruple-tank process: a multivariable laboratory process with an adjustable zero," IEEE Transactions on Control Systems Technology, vol. 8, no. 3, pp. 456-465, May 2000.


text:
# Degeliella rosulata (P. M. Jørg. & D. J. Galloway) P. M. Jørg. SPECIES

#### Status
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Biblthca Lichenol. 88: 236 (2004)

#### Original name
Degelia rosulata P. M. Jørg. & D. J. Galloway

### Remarks
null

repository: mdoering/backbone

repo_name: mdoering/backbone


text:
## In POSIX `sh`, brace expansion is undefined.

### Problematic code:

```sh
#!/bin/sh

for i in {1..5}; do ...
```

Here, `$i` expands to `{1..5}`. It does **not** expand to the sequence `1 2 3 4 5`

### Correct code:

For simple sequences of numbers, you may use the `seq` command, e.g. `seq 1 5`.

### Rationale:

### Exceptions:

None

[Source](https://github.com/koalaman/shellcheck/wiki/SC3009)

repository: codacy/codacy-shellcheck

gha_language: Scala

gha_license_id: NOASSERTION

repo_name: codacy/codacy-shellcheck


text:
# Advanced Carthage Bootstrap
Faster way to update outdated dependencies and reduce Carthage bootstraping time.

### How to use:

Place `carthage_bootstrap` file on your repository.

Make sure that we can execute that file on the Terminal by running this cammand:

```bash
chmod 755 carthage_bootstrap
```

Finally, you can update all dependencies by running this command:

```bash
./carthage_bootstrap
```

To re-generate script file:

```bash
shc -f carthage_bootstrap.sh -o carthage_bootstrap
```

repository: ducito/Advanced-Carthage-Bootstrap

repo_name: ducito/Advanced-Carthage-Bootstrap


text:
---
title: "phoneCallWaiting"
description: "Incoming phone call"
nav_exclude: true
image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png
---
# Constructor: phoneCallWaiting
[Back to constructors index](/API_docs/constructors/index.html)

Incoming phone call

### Attributes:

| Name     |    Type       | Required | Description |
|----------|---------------|----------|-------------|
|video|[Bool](/API_docs/types/Bool.html) | Optional|Is this a video call|
|id|[long](/API_docs/types/long.html) | Yes|Call ID|
|access\_hash|[long](/API_docs/types/long.html) | Yes|Access hash|
|date|[int](/API_docs/types/int.html) | Yes|Date|
|admin\_id|[long](/API_docs/types/long.html) | Yes|Admin ID|
|participant\_id|[long](/API_docs/types/long.html) | Yes|Participant ID|
|protocol|[PhoneCallProtocol](/API_docs/types/PhoneCallProtocol.html) | Yes|Phone call protocol info|
|receive\_date|[int](/API_docs/types/int.html) | Optional|When was the phone call received|

### Type: [PhoneCall](/API_docs/types/PhoneCall.html)

### Example:

```
$phoneCallWaiting = ['_' => 'phoneCallWaiting', 'video' => Bool, 'id' => long, 'access_hash' => long, 'date' => int, 'admin_id' => long, 'participant_id' => long, 'protocol' => PhoneCallProtocol, 'receive_date' => int];
```

repository: danog/MadelineProtoDocs

repo_name: danog/MadelineProtoDocs


text:
---
actual_indicator_available: 'Number of health workers per 1000 population and by metropolitan
  status '
actual_indicator_available_description: Health care workers include active physicians,
  physician assistants, advanced practice registered nurse, nurse practitioners, clinical
  nurse specialist, certified registered nurse anesthetists, and advance practice
  nurse midwives.
comments_and_limitations: Metro/non-metro indicator and population data are obtained
  from AHRF.
computation_units: Number of health care workers (per 1000 population)
data_non_statistical: false
date_metadata_updated: December 2016
date_of_national_source_publication: July 2016
disaggregation_geography: National and by metro status
goal_meta_link: http://unstats.un.org/sdgs/files/metadata-compilation/Metadata-Goal-3.pdf
graph: longitudinal
graph_title: US health care workers per 1000 population
graph_type: line
has_metadata: true
indicator: 3.c.1
indicator_definition: Number of health workers per 1000 population.
indicator_name: Health worker density and distribution
indicator_sort_order: 03-0c-01
indicator_variable: healthworker_density
layout: indicator
method_of_computation: 'Number of health workers by cadre / Total population Method
  of measurement National database or registry of health workers, preferably at individual
  level. Method of estimation If there is a national database or registry, there should
  be regular assessment of completeness using census data, professional association
  registers, facility censuses, etc. Health worker concentration: percentage of all
  health workers working in urban areas divided by percentage of total population
  in urban areas.'
national_geographical_coverage: United States
periodicity: Annual
permalink: /3-c-1/
published: true
reporting_status: complete
scheduled_update_by_national_source: July 2017
sdg_goal: 3
source_active_1: true
source_agency_staff_email_1<EMAIL_ADDRESS>source_agency_staff_name_1: Joanna Yoon
source_agency_survey_dataset_1: NCHWA/HRSA/AHRF
source_notes_1: null
source_organisation_1: NCHWA/HRSA/AHRF
source_title_1: null
source_url_1: http://ahrf.hrsa.gov/
target: Substantially increase health financing and the recruitment, development,
  training and retention of the health workforce in developing countries, especially
  in least developed countries and small island developing States.
target_id: 3.c
title: Health worker density and distribution
un_custodial_agency: WHO
un_designated_tier: '1'
us_method_of_computation: "Data are derived from several data sources. Physician information\
  \ is from the American Medical Association Physician Master file. Physician assistant,\
  \ advanced practice registered nurse, nurse practitioner,clinical nurse specialist,certified\
  \ registered nurse anesthetists, and advance practice nurse midwife data are from\
  \ the Centers from Medicare and Medicaid Services (CMS) National Provider Identification\
  \ (NPI) File. The Administrative Simplification provisions of the Health Insurance\
  \ Portability and Accountability Act of 1996 (HIPAA) mandated the adoption of standard\
  \ unique identifiers for health care providers and health plans. The NPI is a unique\
  \ identifier developed by CMS. Covered health care providers and all health plans\
  \ and health care clearinghouses must use the NPIs in the administrative and financial\
  \ transactions adopted under HIPAA. 2010 Population information is from 2010 Census\
  \ Redistricting Data (Public Law 94-171) Summary File, U.S. Census Bureau and 2011-2014\
  \ Population Estimates are from the Bureau of the Census and include the calculated\
  \ number of people living in an area as of July 1. The estimated population is calculated\
  \ from a components of change model that incorporates information on natural change\
  \ (births, deaths) and net migration (net internal migration, net international\
  \ migration) that has occurred in an area since a Census 2000 reference date for\
  \ 2001-2009 estimates and Census 2010 for 2011-2014 estimates. 2013 metro/non-metro\
  \ information is from the U.S. Department of Agriculture\u2019s Economic Research\
  \ Service (ERS) website:  http://www.ers.usda.gov/data-products/rural-urban-continuum-codes.aspx."
variable_description: null
variable_notes: null
---

repository: brockfanning/sdg-data-usa

repo_name: brockfanning/sdg-data-usa


text:
---
date: 2020-07-31
tags:
- timeline
- taijiquan/forms/yilu
- power
---

# Power Points in the Yilu

:::{.video style="padding-top: 56.25%"}
```{=html}
<iframe class="absolute inset-0 w-full h-full" src="https://www.youtube.com/embed/GriC7VLS8B8" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
```
:::

## [Notes](http://practicalmethod.com/2020/07/yilu-first-13-moves-power-points-20200717-online-video-trailer/)
* Most of the time, the power is through a split.  The ends must lock / not move.
* Whether it's a split or a lever like after fetch water, the structure must be there.
* The power coming in needs to hit a half-pipe and come back out.  It comes in on the elbow and leaves through the hand.  Vice versa when going out and coming back in.

## Things to work on
* Lock the center and move the two ends; my center always tosses.
* Maintaining the line in single whip.

## Video notes
### [[jingangdaodui]]
* Focal points / where the power is.
* Hands grab hold, power on the elbows.
* First move pulls the opponent in.
* Turn the torso so there's space to come in.
* You want the power to return to the opponent at the end.
* Split hand and foot.
* Power going up through the hand and power coming back down through the elbow.

### [[lancayi]]
* Split hands opening out.
* Use elbow to tear coming in / split elbow to foot stepping out.

### [[liufengsibi]]
* Split hand to rear foot using front kua.

### [[danbian]]
* Use whole body power to send hands out.
* Use right kua to whip hand, throwing left hand out.
* Hands circle to attach, then pull in, similar to first move.

### [[baiheliangchi]]
* Insert foot to inside opponent's feet, then split against hand.
* Block high, attack low.
* Front foot is light because it rotates freely.

### [[louxiaobu]]
* Push down / propel out.
* Close in with elbow.

### [[chushou]]
* Elbow comes in, turns around and hand goes out to lift up, then kick.
* Forearm attaches, doesn't move.  Turn with waist.  Kick right kua for power.

### [[xiexingaobu]]
* Double negative circle: hands touch opponent, use kua to push.
* Fetch water: forearm touch, split kua.
* Power to fingertips, don't move, pump it out.
* Lock hand, rotate shoulder.
* Armpit to kua split.
* Elbows and two kuas come into one point, then split open.
* Then join again on left side, rotate to right.
* Touch with hand, then split with kua to propel.
* Big move like yanking.

path: /content/Lecture notes/2030501.md


text:
## API example: Node + Express

This small application demonstrates how you might set up a web server
using Node.js and [Express][express] with RESTful routes to accept your Recurly.js
form submissions and use the tokens to create and update customer billing
information without having to handle credit card data.

This example makes use of the official [node client library][node-client-library] for API v3.

Note that it is not necessary to use the Express framework. In this example it is
used to organize various API actions into distinct application routes, but one
could just as easily implement these API actions within another application
framework.

### Routes

- `POST` [/api/subscriptions/new](app.js#L28-66)
- `POST` [/api/accounts/new](app.js#L69-85)
- `PUT` [/api/accounts/:account_code](app.js#L88-103)

### Use

#### Docker

1. If you haven't already, [install docker](https://www.docker.com/get-started).

2. Update the values in docker.env at the (root of the repo)[https://github.com/recurly/recurly-integration-examples/blob/main/docker.env]

3. Run `docker-compose up --build`

4. Open [http://localhost:9001](http://localhost:9001)

#### Local

1. Start the server

  ```bash
  $ npm i
  $ node app
  ```
2. Open [http://localhost:9001](http://localhost:9001)

[express]: https://expressjs.com/
[client]: https://github.com/recurly/recurly-client-node

repository: alemarcha/recurly-integration-examples

branch_name: refs/heads/main

repo_name: alemarcha/recurly-integration-examples