text:
Homework
========

- Recapitulate: functions and Node.js theory.
- Finish and understand exercises from lecture.
- Build a little web server that can serve a `index.html` at `/`, `subpage.html` at `/subpage` and can serve `.css` and `.js` files from a `/assets` folder.
  Hints:
  - Google Search is your most important skill.
  - To work with the request url you will probably need some [String functions](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/prototype#Methods).
  - Splitting a string into an array [`string.split()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split) and then accessing parts of the array can be an easy way to get substrings.
  - One way to look if a certain text is part of a longer text is  [`string.indexOf()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/indexOf).
 - You will have to [send the correct mime types](http://nodejs.org/api/http.html#http_response_writehead_statuscode_reasonphrase_headers).
  - Comment your code.
- Bonus exercise: try to refactor the node exercise 3: use less anonymous inline callbacks, make it flat, comment your code


text:
---
layout: post
title:      "Nested Resources - RoR"
date:       2018-06-15 23:07:31 +0000
permalink:  nested_resources_-_ror
---

I'm making a very simple app to try to help my wife and I keep track of our son's napping habits.  This could easily turn into a blog post about the perils of new parenthood and sleep deprivation but I will do my best to keep this technical.

The idea of this app is that there are two resources: Days and Rests.  A Day has_many Rests and a Rest belongs_to a Day.

I used:

```
rails generate resource Day date:date
```

and

```
rails generate resource Rest name:string duration:integer
```

to generate my resources.  Day has an attribute called date that is of type date and Rest has attributes called name and duration of types string and integer, respectfully.

## Wiring up the models

In the models directory, I modified day.rb and rest.rb in order to wire up the associations as such:

...models/day.rb
```
class Day < ApplicationRecord
	has_many :rests
	accepts_nested_attributes_for :rests

end
```

...models/rest.rb
```
class Rest < ApplicationRecord
	belongs_to :day

end
```

The key here is the accepts_nested_attributes_for tag.  This will allow me to use the build function in order to create rests beneath a given day.

## Routing

After nesting my resource in my routes file, like this:

../config/routes.rb
```
...

resources :days do
  	resources :rests
  end

	....

```
my routes will be as follows:

```
 day_rests         GET           /days/:day_id/rests(.:format)               rests#index
                               POST       /days/:day_id/rests(.:format)               rests#create
 new_day_rest GET           /days/:day_id/rests/new(.:format)     rests#new
edit_day_rest   GET          /days/:day_id/rests/:id/edit(.:format) rests#edit
     day_rest        GET          /days/:day_id/rests/:id(.:format)          rests#show
                               PATCH    /days/:day_id/rests/:id(.:format)           rests#update
                               PUT         /days/:day_id/rests/:id(.:format)           rests#update
                               DELETE /days/:day_id/rests/:id(.:format)           rests#destroy
         days            GET         /days(.:format)                                             days#index
                               POST      /days(.:format)                                            days#create
      new_day       GET         /days/new(.:format)                                   days#new
     edit_day         GET         /days/:id/edit(.:format)                            days#edit
          day              GET         /days/:id(.:format)                                     days#show
                                PATCH   /days/:id(.:format)                                     days#update
                                PUT          /days/:id(.:format)                                   days#update
                                DELETE /days/:id(.:format)                                    days#destroy
```

## Using build in the Controller

Over in my days controller, my #new method is defined as follows:

../controllers/days_controller.rb
```
...

def new
		@day = Day.new
		@day.rests.build
	end

	....

```

Because the nested resource is established in my routing and models, I am able to utilize this very convenient pattern.  The final peice of the puzzle is also here in the days_controller.

```

...

def create
		@day = Day.create(day_params)
		redirect_to day_path(@day)
	end

	def show
		@day = Day.find(params[:id])
	end

	private

		def day_params
			params.require(:day).permit(:date, rests_attributes: [:id, :name, :duration])
		end

		....
```

My #create method utilizes strong params, day_params, defined as a private method later in the controller.  By passing rests_attributes: [:id, :name, :duration] into the permit method of day_params, I am allowing the instance of day to be create with it's rests.  That's just what a really, really tired dad needs!

branch_name: refs/heads/master

extension: markdown

license_type: permissive


text:
## Redux-Promise and axios
#### Examples using actions, reducers, redux-promise middleware and axios ajax requests.

```
> npm install
> npm start
```

license: MIT

repository: qmeteor/weather

extension: md

repo_name: qmeteor/weather


text:
# istio-coredns-plugin

CoreDNS gRPC plugin to serve DNS records out of Istio ServiceEntries.

The plugin runs as a separate container in the CoreDNS pod, serving DNS A
records over gRPC to CoreDNS.

Hosts in service entries which also contain addresses will resolve to those
addresses, as long as they're host addresses not CIDR ranges.

Service entries without addresses will by default not resolve, unless the
--default-address flag is given, in which case that address will be used
for address-less service entries.

Wildcard hosts in the service entries will also resolve appropriately.
E.g., consider the following service entry:

```yaml
apiVersion: networking.istio.io/v1alpha3
kind: ServiceEntry
spec:
  hosts:
  - *.google.com
  addresses:
  - <IP_ADDRESS>
  - <IP_ADDRESS>
  resolution: STATIC
  endpoints:
  - ...
```

A query against the coreDNS pod would return the following:

```bash
$ dig +short @<coreDNSIP> A maps.google.com
<IP_ADDRESS>
<IP_ADDRESS>

$ dig +short @<coreDNSIP> A mail.google.com
<IP_ADDRESS>
<IP_ADDRESS>

$ dig +short @<coreDNSIP> A google.com
 # no response
```

## Usage

Deploy the core-DNS service in the istio-system namespace

```
kubectl apply -f coredns.yaml
```

Update the kube-dns config map to point to this coredns service as the
upstream DNS service for the `*.global` domain. You will have to find out
the cluster IP of coredns service and update the config map (or write a
controller for this purpose!).

E.g.

```yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: kube-dns
  namespace: kube-system
data:
  stubDomains: |
    {"global": ["<IP_ADDRESS>"]}
```

repository: istio-ecosystem/istio-coredns-plugin

gha_language: Go

repo_name: istio-ecosystem/istio-coredns-plugin


text:
# The Scholar
Fake app that provides a interface for teachers to manage their classes and students. The main goal of this repository is to learn and explore Angular features.

## Data & Environment
First you will need a environment file following `api/.env.example`. Copy this one, name it `.env` and put your environment information there. The `TOKEN` property is a [JWK](https://jwt.io/) token.

This app implements a [JSON Server](https://github.com/typicode/json-server) API with a fake database provided by a JSON file (`api/db.json`, for instance). You can create your data there. Just create a JSON file with the following structure and point it in your `.env` file.

```
{
  "users": {},
  "archives": {},
  "courses": {},
  "students": {}
}
```
Please, read the guide under [JSON Server](https://github.com/typicode/json-server) GitHub page in order to know how to better manipulate the database file.

## Usage
**Note:** this guide assumes that you already have Node and NPM installed.

- **API:** navigate to `api/`, install its dependencies and run it:

```
npm install && npm start
```

- **Angular App:** first you will need Angular CLI installed at your machine. After that, navigate to `webapp/`, install its dependencies and run the Angular server:

```
npm install -g @angular/cli
```
```
npm install && ng serve
```

repository: dcanevarollo/the-scholar

branch_name: refs/heads/main

repo_name: dcanevarollo/the-scholar


text:
# Heimdall

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

A blazingly fast performance stat monitoring and collection library for
node or the browser.

## Installation

```cli
npm install heimdalljs
```

## How fast?

Heimdall allows for 2 forms of stat collection: counter based and time
based.

The overhead of time based stat collection is the cost of allocating a
 tiny `TypedArray`, a four element `Array`, and `performance.now()`. On
Desktop Chrome on a 2015 era MacBook Pro this amounts to roughly 200
nano seconds. You can easily run the benchmarks on devices you care about
 to see what the cost will be for you.

The overhead of counter based collection is the cost of a method call
 with two bitwise operations and an integer increment.  An occasional
 Uint32Array allocation is thrown in when more space is needed. The cost
 here is pragmatically negligible, and counters are ideal for situations
 in which the overhead of a timer is enough to significantly alter stats.

## Usage

**instantiate**
```js
const heimdall = new Heimdall();
```

### Timing
**start timing something**
```js
const token = heimdall.start('<label>');
```

**stop timing something**
```js
heimdall.stop(token);
```

### Monitors

A monitor is a group of counters which you can increment as needed to track things such as entry
into a function or object creations.

**querying**
```js
let condition = heimdall.hasMonitor('<name>');
```

**register**

When you register a monitor, the first argument functions as the unique name for that monitor,
while all other arguments (labels) will be the name of a specific counter in your group of counters.

The call to `registerMonitor` will give you back an object with your labels as its keys and
the token to increment as the value at that key.

```js
const tokens = heimdall.registerMonitor('<name>', ...labels);
```

Full Example:
```js
const { foo, bar, baz } = heimdall.registerMonitor('my-first-monitor', 'foo', 'bar', 'baz');

heimdall.increment(foo); // increment 'foo' counter in the 'my-first-monitor' group.
```

### Annotations

```js
heimdall.annotate(<annotation>);
```

### Other

**configFor**
**toJSON**

For the documentation for `HeimdallTree` see []().

## Removing Heimdall from production builds.

If desired, heimdall can be stripped from production builds using
[this plugin](https://github.com/heimdalljs/babel5-plugin-strip-heimdall) for Babel5 or [this plugin]() for Babel6.

## Global Session

Heimdall tracks a graph of timing and domain-specific stats for performance.
Stat collection and monitoring is separated from graph construction to provide
control over context detail.  Users can create fewer nodes to have reduced
performance overhead, or create more nodes to provide more detail.

The graph obviously needs to be global.  This is not a problem in the browser,
but in node we may have multiple different versions of heimdalljs loaded at
once.  Each one will have its own `Heimdall` instance, but will use the same
session, saved on `process`.  This means that the session will have a
heterogeneous graph of `HeimdallNode`s.  For this reason, versions of heimdalljs
that change `Session`, or the APIs of `HeimdallNode` or `Cookie` will use a
different property to store their session (`process._heimdall_session_<n>`).  It
is quite easy for this to result in lost detail & lost stats, although it is
also easy to detect this situation and issue a warning.

## TypeScript

If you are using [Visual Studio Code](https://code.visualstudio.com/) for development,
you might want to install both [`typescript`](https://github.com/Microsoft/TypeScript)
and [`tslint`](https://github.com/palantir/tslint) packages via [`yarn`](https://yarnpkg.com/en/).

```sh
yarn global add typescript tslint
```

repository: lblod/frontend-rdfa-editor-demo

gha_language: HTML

gha_license_id: MIT

repo_name: lblod/frontend-rdfa-editor-demo


text:
# Changelog
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased][latest]

## [3.2.2] - 2021-07-19
### Fixed
- TypeScript: Add missing methods typedefs (#611)
- Internal: Fixed TypeScript types, added null checks, automated type declaration files

## [3.2.1] - 2021-05-17
### Fixed
- TypeScript: Use express types for middleware (#564)

## [3.2.0] - 2021-03-30
### Fixed
- Update Node API endpoint to enable source map processing for server-side errors.

### Added
- Add tagging to errors with 3 possible API's
    ```bash
    Honeybadger.configure({tags: string | string[] | undefined})
    Honeybadger.setContext({tags: string | string[] | undefined})
    Honeybadger.notify('error', {tags: string | string[] | undefined})
    ```

## [3.1.0] - 2021-03-04
### Fixed
- Add default reason for unhandled promises (previously reason was "undefined") (#546)

### Added
- Add `Honeybadger.clear()` method to clear context and breadcrumbs
- Deprecate `Honeybadger.resetContext()`

## [3.0.4] - 2021-03-01
### Fixed
- Add server middleware signatures to type declarations (#540, @getabetterpic)

## [3.0.3] - 2021-02-02
### Fixed
- types: Make sure every breadcrumb prop is optional (#527, @paambaati)

## [3.0.2] - 2021-01-28
### Fixed
- utf8 encode JSON payload in Node

## [3.0.1] - 2021-01-20
### Fixed
- Adjust backtrace display and logging in Node
- Fix a bug in Node lambdaHandler

## [3.0.0] - 2021-01-19
### Added
- [@honeybadger-io/js](https://www.npmjs.com/package/@honeybadger-io/js) is
  a new universal/isomorphic JavaScript package combining the deprecated
  [honeybadger-js for browsers](https://www.npmjs.com/package/honeybadger-js)
  and the [honeybadger for Node.js](https://www.npmjs.com/package/honeybadger)
  NPM packages.

  Moving forward, development for both platforms will happen here. The new API
  is mostly the same as the old packages, with a few breaking config changes.
  Users who are upgrading from either the *honeybadger-js* or *honeybadger* NPM
  packages should read [the upgrading
  guide](https://docs.honeybadger.io/lib/javascript/support/upgrading-to-v3.html),
  and all users should refer to the [new
  documentation](https://docs.honeybadger.io/lib/javascript/index.html).

repository: dobrinov/honeybadger-js

repo_name: dobrinov/honeybadger-js


text:
# CommonsService

[![CI Status](https://img.shields.io/travis/leticiassiqueira25/CommonsService.svg?style=flat)](https://travis-ci.org/leticiassiqueira25/CommonsService)
[![Version](https://img.shields.io/cocoapods/v/CommonsService.svg?style=flat)](https://cocoapods.org/pods/CommonsService)
[![License](https://img.shields.io/cocoapods/l/CommonsService.svg?style=flat)](https://cocoapods.org/pods/CommonsService)
[![Platform](https://img.shields.io/cocoapods/p/CommonsService.svg?style=flat)](https://cocoapods.org/pods/CommonsService)

## Example

To run the example project, clone the repo, and run `pod install` from the Example directory first.

## Requirements

## Installation

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

```ruby
pod 'CommonsService'
```

## Author

leticiassiqueira25<EMAIL_ADDRESS>
## License

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

repository: letyciamarques/DetalhesMoeda

branch_name: refs/heads/develop

gha_language: Swift

repo_name: letyciamarques/DetalhesMoeda


text:
---
description: About Legacy
---

# .

{% hint style="danger" %}
**WARNING: These are the archives, not current information**

These pages contain information about Legacy, a USD supercomputer that is no longer available, and other information that is no longer in use.  It is kept as a reference for the maintenance of records, and in case of future need.
{% endhint %}

The Legacy Supercomputer was acquired in 2006 through USD’s [Institutional Development Award](https://www.nigms.nih.gov/Research/CRCB/IDeA/Pages/inbre_map.aspx)from the National Institutes of Health. It was expanded in 2009 and 2011 with additional NIH funding, and the last expansion in 2013 was funded by the college of Arts and Sciences. Legacy's user base has grown from a small cohort of bioinformatics faculty in 2006 to virtually all Science Technology Engineering and Mathematics disciplines with emerging use cases in the humanities.

Legacy is named after the 'Legacy'[ sculpture](http://www.usd.edu/fine-arts/art/success-stories) on USD's Vermillion campus.

Legacy runs the CentOS Linux operating system and is made up of 680 AMD Opteron CPU cores with 70TB of shared network storage.

The hardwear specifications for Legacy vary by node and are as follows:

## Overview

680 Processing cores, 29 compute nodes, 1 login node, 1 management node

## Processors

4-core, 12-core, and 16-core AMD Opteron

## RAM

32GB - 128GB per node

## Storage

133GB -890GB local scratch disk per node 70TB centrally-shared network storage

## Network

Dedicated gigabit Ethernet compute and storage networks

## Details

**Compute nodes 16 through 23**

Each node contains:

2x Quad Core AMD Opteron 2356 processors \(8 total cores\)

32GB RAM

133GB local scratch disk

**Compute nodes 24 through 30**

Each node contains:

2x 12-Core AMD Opteron 6172 processors \(24 total cores\)

96GB RAM

890GB local scratch disk

**Compute nodes 31 through 44**

Each node contains:

2x 16-Core AMD Opteron 6272 processors \(32 total cores\)

128GB RAM

890GB local scratch disk

repository: USDRCG/GitBook

repo_name: USDRCG/GitBook


text:
# Deserializing objects using parameterized constructors with `JsonSerializer`

## Motivation

`JsonSerializer` deserializes instances of objects (`class`es and `struct`s) using public parameterless
constructors. If none is present, and deserialization is attempted, the serializer throws a `NotSupportedException`
with a message stating that objects without public parameterless constructors, including `interface`s and `abstract`
types, are not supported for deserialization. There is no way to deserialize an instance of an object using a parameterized constructor.

A common pattern is to make data objects immutable for various reasons. For example, given `Point`:

```C#
public struct Point
{
    public int X { get; }

    public int Y { get; }

    public Point(int x, int y) => (X, Y) = (x, y);
}
```

It would be beneficial if `JsonSerializer` could deserialize `Point` instances using the parameterized constructor above, given that mapping JSON properties into readonly members is not supported.

Also consider `User`:

```C#
public class User
{
  public string UserName { get; private set; }

  public bool Enabled { get; private set; }

  public User() { }

  public User(string userName, bool enabled)
  {
    UserName = userName;
    Enabled = enabled;
  }
}
```

`User` instances will be deserialized using the parameterless constructor above, and the `UserName` and `Enabled` properties will be ignored, even if there is JSON that maps to them in the payload.

Although there is work scheduled to support deserializing JSON directly into properties with private setters
(https://github.com/dotnet/runtime/issues/29743), providing parameterized constructor support as an option
increases the scope of support for customers with varying design needs.

Deserializing with parameterized constructors also gives the opportunity to do JSON "argument" validation once on the creation of the instance.

This feature enables deserialization support for `Tuple<...>` instances, using their parameterized constructors.

This feature is designed to support round-tripping of such "immutable" types.

There are no easy workarounds for the scenarios this feature enables:

- Support for immutable classes and structs (https://github.com/dotnet/runtime/issues/29895)
- Choosing which constructor to use
- Support for `Tuple<...>` types

Only public constructors are supported.

## New API Proposal

```C#
namespace System.Text.Json.Serialization
{
  /// <summary>
  /// When placed on a constructor, indicates that the constructor should be used to create
  /// instances of the type on deserialization.
  /// <remarks>The constructor must be public. The attribute cannot be placed on multiple constructors.</remarks>
  /// </summary>
  [AttributeUsage(AttributeTargets.Constructor, AllowMultiple = false)]
  public sealed partial class JsonConstructorAttribute : JsonAttribute
  {
    public JsonConstructorAttribute() { }
  }
}
```

### Example usage

Given an immutable class `Point`,

```C#
public class Point
{
  public int X { get; }

  public int Y { get; }

  public Point() {}

  [JsonConstructor]
  public Point(int x, int y) => (X, Y) = (x, y);
}
```

We can deserialize JSON into an instance of `Point` using `JsonSerializer`:

```C#
Point point = JsonSerializer.Deserialize<Point>(@"{""X"":1,""Y"":2}");
Console.WriteLine(point.X); // 1
Console.WriteLine(point.Y); // 2
```

## Solutions by other libraries

### `Newtonsoft.Json` (.NET)

`Newtonsoft.Json` provides a `[JsonConstructor]` attribute that allows users to specify which constructor to use. The attribute can be applied to only one constructor, which may be non-`public`.

`Newtonsoft.Json` also provides a globally applied
[`ConstructorHandling`](https://www.newtonsoft.com/json/help/html/T_Newtonsoft_Json_ConstructorHandling.htm) which determines which constructor is used if none is specified with the attribute. The options are:

`Default`: First attempt to use the public default constructor, then fall back to a single parameterized constructor,
then to the non-`public` default constructor.

`AllowNonPublicDefaultConstructor`: Newtonsoft.NET will use a non-`public` default constructor before falling back to a
parameterized constructor.

Non-`public` support is not provided by `JsonSerializer` by default, so configuring selection precedence involving non-`public` constructors is not applicable.

### `Utf8Json`

`Utf8Json` chooses the constructor with the most matched arguments by name (case insensitive). This best-fit matching approach can be considered by `JsonSerializer` in the future.

The constructor to use can also be specified with a `[SerializationConstructor]` attribute.

`Utf8Json` does not support non-`public` constructors, even with the attribute.

### `Jil` (.NET)

`Jil` supports deserialization exclusively by using a parameterless constructor (may be non-`public`), and doesn't provide options to configure the behavior.

### `Jackson` (Java)

`Jackson` provides an annotation type called
[`JsonCreator`](https://fasterxml.github.io/jackson-annotations/javadoc/2.7/com/fasterxml/jackson/annotation/JsonCreator.html)
which is very similar in functionality to the `JsonConstructor` attributes in `Newtonsoft.Json`
and proposed in this spec.

```Java
@JsonCreator
public BeanWithCreator(
    @JsonProperty("id") int id,
    @JsonProperty("theName") String name) {
    this.id = id;
    this.name = name;
}
```

As shown, a `@JsonProperty` annotation can be placed on a parameter to indicate the JSON name. Adding
`JsonParameterName` attribute to be placed on constructor parameters was considered, but `Newtonsoft.Json` does not have an equivalent for this. There's probably not a big customer need for this behavior.

In addition to constructors, the `JsonCreator` can be applied to factory creator methods. There
hasn't been any demand for this from the .NET community. Support for object deserialization with factory
creation methods can be considered in the future.

## Feature behavior

### Attribute presence

#### Without `[JsonConstructor]`

##### A public parameterless constructor will always be used if present

Given `Point`,

```C#
public class Point
{
    public int X { get; }

    public int Y { get; }

    public Point() {}

    public Point(int x, int y) => (X, Y) = (x, y);
}
```

The public parameterless constructor is used:

```C#
Point point = JsonSerializer.Deserialize<Point>(@"{""X"":1,""Y"":2}");
Console.WriteLine(point.X); // 0
Console.WriteLine(point.Y); // 0
```

##### `struct`s will always be deserialized using the default constructor if `[JsonConstructor]` is not used

Given `Point`,

```C#
public struct Point
{
    public int X { get; }

    public int Y { get; }

    public Point(int x, int y) => (X, Y) = (x, y);
}
```

The default constructor is used:

```C#
Point point = JsonSerializer.Deserialize<Point>(@"{""X"":1,""Y"":2}");
Console.WriteLine(point.X); // 0
Console.WriteLine(point.Y); // 0
```

##### A single public parameterized constructor will always be used if there's no public parameterless constructor

Given `Point`,

```C#
public class Point
{
    public int X { get; }

    public int Y { get; }

    public Point(int x, int y) => (X, Y) = (x, y);
}
```

The singular parameterized constructor is used:

```C#
Point point = JsonSerializer.Deserialize<Point>(@"{""X"":1,""Y"":2}");
Console.WriteLine(point.X); // 1
Console.WriteLine(point.Y); // 2
```

This rule does not apply to `struct`s as there's always a public parameterless constructor.

##### `NotSupportedException` is thrown when there are multiple parameterized ctors, but no public parameterless ctor

Given another definition for `Point`,

```C#
public class Point
{
    public int X { get; }

    public int Y { get; }

    public int Z { get; }

    public Point(int x, int y) => (X, Y) = (x, y);

    public Point(int x, int y, int z = 3) => (X, Y, Z) = (x, y, z);
}
```

A `NotSupportedException` is thrown because it is not clear which constructor to use. This may be resolved by using the `[JsonConstructor]`, or by adding a
public parameterless constructor.

```C#
Point point = JsonSerializer.Deserialize<Point>(@"{""X"":1,""Y"":2,""Z"":3}"); // Throws `NotSupportedException`
```

This rule does not apply to `struct`s as there's always a public parameterless constructor.

#### Using [JsonConstructor]

##### `[JsonConstructor]` can only be used on one constructor

Given `Point`,

```C#
public class Point
{
  public int X { get; }

  public int Y { get; }

  public int Z { get; }

  [JsonConstructor]
  public Point() {}

  [JsonConstructor]
  public Point(int x, int y) => (X, Y) = (x, y);
}
```

An `InvalidOperationException` is thrown:

```C#
Point point = JsonSerializer.Deserialize<Point>(@"{""X"":1,""Y"":2,""Z"":3}"); // Throws `InvalidOperationException`
```

### Parameter name matching

#### Constructor parameters that bind to object properties will use their Json property names for deserialization.

Each property's CLR name will be converted with the `camelCase` naming policy to find its matching constructor parameter. The constructor parameter will use the cached JSON property name to find a match on deserialization, and the object property will be ignored on deserialization.

This matching mechanism is optimized for object definitions that follow the
C# guidelines for naming properties and method parameters.

This proposal does not include an extension point for users to specify a policy to determine the match, but it can be considered in the future.

Consider `Point`:

```C#
public class Point
{
  public int X { get; }

  public int Y { get; }

  public Point(int x, int y) => (X, Y) = (x, y);
}
```

The `int X` property matches with the `int x` parameter, and the `int Y` property matches with the `int y` property.
With default serializer options, the properties would normally match with their exact pascal case representations. The
constructor arguments will be configured to bind with the JSON instead:

```C#
Point point = JsonSerializer.Deserialize<Point>(@"{""X"":1,""Y"":2}");

Console.WriteLine(point.X); // 1
Console.WriteLine(point.Y); // 2
```

This means that the JSON property name(s) specified for each property will be properly applied to each
matching parameter constructor. ASP.NET default settings of `camelCase` casing (and case-insensitivity) will work fine without needing extra configuration.

The benefit of this approach is that a `JsonPropertyName` attribute placed on a property would be honored by its matching constructor parameter on deserialziation,
enabling roundtripping scenarios:

```C#
public class Point
{
  [JsonPropertyName("XValue")]
  public int X { get; }

  [JsonPropertyName("YValue")]
  public int Y { get; }

  public Point(int x, int y) => (X, Y) = (x, y);
}
```

```C#
Point point = new Point(1,2);

string json = JsonSerializer.Serialize(point);
Console.WriteLine(json); // {"XValue":1,"YValue":2}

point = JsonSerializer.Deserialize<Point>(json);
Console.WriteLine(point.X); // 1
Console.WriteLine(point.Y); // 2
```

**If a constructor parameter does not match with a property, `InvalidOperationException` will be thrown if deserialization is attempted.**

**Parameter naming matching is case sensitive by default**. This can be toggled by users with the `options.PropertyNameCaseInsensitive` option.

**Constructor argument deserialization will honor the `[JsonPropertyName]`, `[JsonIgnore]`, and `[JsonConverter]` attributes placed on the matching object property.**

#### If no JSON maps to a constructor parameter, then default values are used.

This is consistent with `Newtonsoft.Json`. If no JSON maps to a constructor parameter, the following fallbacks are used in order:

- default value on constructor parameter
- CLR `default` value for the parameter type

Given `Person`,

```C#
public struct Person
{

    public string Name { get; }

    public int Age { get; }

    public Point Point { get; }

    public Person(string name, int age, Point point = new Point(1, 2))
    {
        Name = name;
        Age = age;
        Point = point;
    }
}
```

When there are no matches for a constructor parameter, a default value is used:

```C#
Person person = JsonSerializer.Deserialize<Person>("{}");
Console.WriteLine(person.Name); // null
Console.WriteLine(person.Age); // 0
Console.WriteLine(person.Point.X); 1
Console.WriteLine(person.Point.Y); 2
```

#### Members are never set with JSON properties that matched with constructor parameters

Doing this can override modifications done in constructor. `Newtonsoft.Json` has the same behavior.

Given `Point`,

```C#
public struct Point
{
    public int X { get; set; }

    public int Y { get; set; }

    [JsonConstructor]
    public Point(int x, int y)
    {
        X = 40;
        Y = 60;
    }
}
```

We can expect the following behavior:

```C#
Point obj = JsonSerializer.Deserialize<Point>(@"{""X"":1,""Y"":2}");
Assert.Equal(40, obj.X); // Would be 1 if property were set directly after object construction.
Assert.Equal(60, obj.Y); // Would be 2 if property were set directly after object construction.
```

This behavior also applies to property name matches (from JSON properties to object properties) due
to naming policy.

#### JSON properties that don't map to constructor parameters or object properties go to extension data, if present

This is in keeping with the established serializer handling of extension data.

#### Serializer uses "last one wins" semantics for constructor parameter names

This is consistent with how object properties are deserialized.

```C#
Point point = JsonSerializer.Deserialize<Point>(@"{""X"":1,""Y"":2,""X"":4}");
Assert.Equal(4, point.X); // Note, the value isn't 1.
Assert.Equal(2, point.Y);
```

The serializer will not store any extra JSON values that map to constructor arguments in extension data.

Given `Person:

```C#
public class Person
{
    public string FirstName { get; set; }

    public string LastName { get; set; }

    public Guid Id { get; }

    [JsonExtensionData]
    public Dictionary<string, JsonElement> ExtensionData { get; set; }

    public Person(Guid id) => Id = id;
}
```

We can expect the following behavior with `JsonSerializer`:

```C#
string json = @"{
    ""FirstName"":""Jet"",
    ""Id"":""270bb22b-4816-4bd9-9acd-8ec5b1a896d3"",
<EMAIL_ADDRESS>    ""Id"":""0b3aa420-2e98-47f7-8a49-fea233b89416"",
    ""LastName"":""Doe"",
    ""Id"":""63cf821d-fd47-4782-8345-576d9228a534""
    }";

Person person = JsonSerializer.Deserialize<Person>(json);
Console.WriteLine(person.FirstName); // Jet
Console.WriteLine(person.LastName); // Doe
Console.WriteLine(person.Id); // 63cf821d-fd47-4782-8345-576d9228a534 (note that the first matching JSON property "won")
Console.WriteLine(person.ExtensionData["EmailAddress"].GetString()); //<EMAIL_ADDRESS>Console.WriteLine(person.ExtensionData.ContainsKey("Id")); // False
```

This is consistent with `Newtonsoft.Json` behavior.

#### `options.IgnoreNullValues` is honored when deserializing constructor arguments

This is helpful to avoid a `JsonException` when null is applied to value types.

Given `PointWrapper` and `Point_3D`:

```C#
public class PointWrapper
{
	public Point_3D Point { get; }

	public PointWrapper(Point_3D point) {}
}

public struct Point_3D
{
	public int X { get; }

	public int Y { get; }

	public int Z { get; }
}
```

We can ignore `null` tokens and not pass them as arguments to a non-nullable parameter. A default value will be passed instead.
 The behavior if the serializer does not honor the `IgnoreNullValue` option would be to preemptively throw a `JsonException`, rather than leaking an `InvalidCastException` thrown by the CLR.

```C#
JsonSerializerOptions options = new JsonSerializerOptions
{
    IgnoreNullValues = true
};
PointWrapper obj = JsonSerializer.Deserialize<PointWrapper>(@"{""Point"":null}"); // obj.Point is `default`
```

In the same scenario, `Newtonsoft.Json` fails with error:

```C#
JsonSerializerSettings settings = new JsonSerializerSettings { NullValueHandling = true };
PointWrapper obj = JsonConvert.DeserializeObject<PointWrapper>(@"{""Point"":null}");

// Unhandled exception. Newtonsoft.Json.JsonSerializationException: Error converting value {null} to type 'Program+Point_3D'. Path 'Point', line 1, position 21.
```

#### Specified constructors cannot have more than 64 parameters

This is an implementation detail. If deserialization is attempted with a constructor that has more than
64 parameters, a `NotSupportedException` will be thrown.

We expect most users to have significantly less than 64 parameters, but we can respond to user feedback.

#### [`ReferenceHandling` semantics](https://github.com/dotnet/runtime/blob/13c1e65a9f7aab201fe77e3daba11946aeb7cbaa/src/libraries/System.Text.Json/docs/ReferenceHandling_spec.md) will not be applied to objects deserialized with parameterized constructors

`NotSupportedException` will be thrown if any properties named "$id", "$ref", or "$values" are found in the payload, and `options.ReferenceHandling` is set to
`ReferenceHandling.Preserve`. If the feature is off, these properties will be treated like any other (likely end up in extension data property).
This behavior prevents us from breaking people if we implement this feature in the future.

`Newtonsoft.Json` does not not honor reference metadata within objects deserialized with parameterized constructors. They are ignored and treated like any other property.

Consider an `Employee` class:

```C#
public class Employee
{
    public string FullName { get; set; }

    public Employee Manager { get; internal set; }

    public Employee(Employee manager = null)
    {
        Manager = manager;
    }
}
```

Serializing an `Employee` instance with `ReferenceHandling.Preserve` semantics may look like this:

```C#
Employee employee = new Employee();
employee.FullName = "Jet Doe";
employee.Manager = employee;

JsonSerializerOptions options = new JsonSerializerOptions
{
    ReferenceHandling = ReferenceHandling.Preserve
};

string json = JsonSerializer.Serialize(employee, options);
Console.WriteLine(json); // {"$id":"1","Manager":{"$ref":"1"},"FullName":"Jet Doe"}
```

It might be non-trivial work to resolve such scenarios on deserialization and handle error cases.

### Deserialization with parameterized constructor does not apply to enumerables

The semantics described in this document does not apply to any type that implements `IEnumerable`.
This may change in the future, particularly if an
[option to treat enumerables as objects](https://github.com/dotnet/runtime/issues/1808) with members is provided.

repository: dotnet/runtime

gha_language: C#

repo_name: dotnet/runtime


text:
---
layout: v2
title: Plugins
bodyclass: plugins-page
---

## Leaflet Plugins database

While Leaflet is meant to be as lightweight as possible, and focuses on a core set of features, an easy way to extend its functionality is to use third-party plugins. Thanks to the awesome community behind Leaflet, there are literally hundreds of nice plugins to choose from.

---

Tile & image layers

 Basemap providers

 Basemap formats

 Non-map base layers

 Tile/image display

 Tile load

 Vector tiles

Overlay data

 Overlay data formats

 Dynamic data loading

 Synthetic overlays

 Data providers

Overlay Display

Markers & renderers

Overlay animations

Clustering/decluttering

Heatmaps

DataViz

Overlay interaction

Edit geometries

Time & elevation

Search & popups

Area/overlay selection

Map interaction

Layer switching controls

Interactive pan/zoom

Bookmarked pan/zoom

Fullscreen

Minimaps & synced maps

Measurement

Mouse coordinates

Events

User interface

Print/export

Geolocation

Miscellaneous

Geoprocessing

Routing

Geocoding

Plugin collections

Integration

Frameworks & build systems

3rd party

		Develop your own

---

## Tile & image layers

The following plugins allow loading different maps and provide functionality to tile and image layers.

* [Basemap providers](#basemap-providers)
* [Basemap formats](#basemap-formats)
* [Non-map base layers](#non-map-base-layers)
* [Tile/image display](#tileimage-display)
* [Tile load](#tile-load)
* [Vector tiles](#vector-tiles)

### Basemap providers

Ready-to-go basemaps, with little or no configuration at all.

{% include plugin_category_table.html category="basemap-providers" %}

### Basemap formats

Plugins for loading basemaps or GIS raster layers in common (albeit non-default) formats.

{% include plugin_category_table.html category="basemap-formats" %}

### Non-map base layers

Sometimes you don't want to load a map, just big custom images. **Really** big ones.

{% include plugin_category_table.html category="non-map-base-layers" %}

### Tile/image display

The following plugins change the way that tile or image layers are displayed in the map.

{% include plugin_category_table.html category="tile-image-display" %}

### Tile Load

The following plugins change the way that tile layers are loaded into the map.

{% include plugin_category_table.html category="tile-load" %}

### Vector tiles

Plugins to display [vector tiles](https://github.com/mapbox/vector-tile-spec).

{% include plugin_category_table.html category="vector-tiles" %}

## Overlay data

The following plugins provide new ways of loading overlay data (GIS vector data): points, lines and polygons.

* [Overlay data formats](#overlay-data-formats)
* [Dynamic data loading](#dynamiccustom-data-loading)
* [Synthetic overlays](#synthetic-overlays)
* [Data providers](#data-providers)

### Overlay data formats

Load your own data from various GIS formats.

{% include plugin_category_table.html category="overlay-data-formats" %}

### Dynamic/custom data loading

Load dynamic data which is updated in the map, or load GIS vector data in non-standard ways.

{% include plugin_category_table.html category="dynamic-custom-data-loading" %}

### Synthetic overlays

These plugins create useful overlays from scratch, no loading required.

{% include plugin_category_table.html category="synthetic-overlays" %}

### Data providers

Load overlay data from third-party-services. See also [basemap providers](#basemap-providers) and [plugin collections](#collections).

{% include plugin_category_table.html category="data-providers" %}

## Overlay display

The following plugins provide new ways of displaying overlay data information.

* [Markers & renderers](#markers--renderers)
* [Overlay animations](#overlay-animations)
* [Clustering/decluttering](#clusteringdecluttering)
* [Heatmaps](#heatmaps)
* [DataViz](#dataviz)

### Markers & renderers

These plugins provide new markers or news ways of converting abstract data into images in your screen. Leaflet users versed in GIS also know these as symbolizers.

{% include plugin_category_table.html category="markers-renderers" %}

### Overlay animations

These plugins animate markers or some geometries. See also [geometries with time or elevation](#geometryinteraction-time).

{% include plugin_category_table.html category="overlay-animations" %}

### Clustering/Decluttering

When you are displaying a lot of data, these plugins will make your map look cleaner.

{% include plugin_category_table.html category="clustering-decluttering" %}

### Heatmaps

These plugins create heatmaps and heatmap-like visualizations from vector data.

{% include plugin_category_table.html category="heatmaps" %}

### DataViz

Powerful multi-purpose libraries for data visualization.

{% include plugin_category_table.html category="dataviz" %}

## Interaction with geometries/features

The following plugins enable users to interact with overlay data: edit geometries, select areas or features, interact with the time dimension, search features and display information about them.

* [Edit geometries](#edit-geometries)
* [Time & elevation](#time--elevation)
* [Search & popups](#search--popups)
* [Area/overlay selection](#areaoverlay-selection)

### Edit geometries

Allows users to create, draw, edit and/or delete points, lines and polygons.

{% include plugin_category_table.html category="edit-geometries" %}

### Time & elevation

Most data is two-dimensional (latitude and longitude), but some data has more dimensions (altitude and/or time). The following plugins help users navigate these extra dimensions.

{% include plugin_category_table.html category="time-elevation" %}

### Search & popups

Plugins that search for overlays and enhance how to display information about them.

{% include plugin_category_table.html category="search-popups" %}

### Area/overlay selection

These plugins help users select either overlays or areas in the map.

{% include plugin_category_table.html category="area-overlay-selection" %}

## Map interaction

New ways to interact with the map itself.

* [Layer switching controls](#layer-switching-controls)
* [Interactive pan/zoom](#interactive-panzoom)
* [Bookmarked pan/zoom](#bookmarked-panzoom)
* [Fullscreen](#fullscreen-controls)
* [Minimaps & synced maps](#minimaps--synced-maps)
* [Measurement](#measurement)
* [Mouse coordinates](#mouse-coordinates)
* [Events](#events)
* [User interface](#user-interface)
* [Print/export](#printexport)
* [Geolocation](#geolocation)

### Layer switching controls

The following plugins enhance or extend `L.Control.Layers`.

{% include plugin_category_table.html category="layer-switching-controls" %}

### Interactive pan/zoom

Change the way the user can interactively move around the map.

{% include plugin_category_table.html category="interactive-pan-zoom" %}

### Bookmarked pan/zoom

Change the way the user is moved around the map, by jumping to predefined/stored places.

{% include plugin_category_table.html category="bookmarked-pan-zoom" %}

### Fullscreen controls

Allows display of the map in full-screen mode.

{% include plugin_category_table.html category="fullscreen-controls" %}

### Minimaps & synced maps

Display two maps at once. One of them might be a different size and zoom level, usable as a minimap to aid with navigation.

{% include plugin_category_table.html category="minimaps-synced-maps" %}

### Measurement

Allow the user to measure distances or areas.

{% include plugin_category_table.html category="measurement" %}

### Mouse coordinates

Show the geographical coordinates under the mouse cursor in different ways.

{% include plugin_category_table.html category="mouse-coordinates" %}

### Events

These plugins extend Leaflet event handling.

{% include plugin_category_table.html category="events" %}

### User interface

Buttons, sliders, toolbars, sidebars, and panels.

{% include plugin_category_table.html category="user-interface" %}

### Print/export

Print or export your map.

{% include plugin_category_table.html category="print-export" %}

### Geolocation

Plugins that extend Leaflet's geolocation capabilities.

{% include plugin_category_table.html category="geolocation" %}

## Miscellaneous

### Geoprocessing

The following plugins perform several sorts of geoprocessing (mathematical and topological operations on points, lines and polygons).

{% include plugin_category_table.html category="geoprocessing" %}

### Routing

The following plugins use external services to calculate driving or walking routes.

{% include plugin_category_table.html category="routing" %}

### Geocoding

External services that transform an address or the name of a place into latitude and longitude (or vice versa).

{% include plugin_category_table.html category="geocoding" %}

### Plugin collections

Sets of plugins that span several categories.

Plugin developers: please keep future plugins in individual repositories.

{% include plugin_category_table.html category="plugin-collections" %}

## Integration

### Frameworks & build systems

Ease your development integrating Leaflet into a development framework or automating some of the javascript/CSS work for complex applications.

{% include plugin_category_table.html category="frameworks-build-systems" %}

### 3rd party integration

The following plugins integrate Leaflet into third party services or websites.

{% include plugin_category_table.html category="3rd-party-integration" %}

## Develop your own

Leaflet keeps it simple. If you can think of a feature that is not required by all Leaflet users, and you can write the JavaScript code in a reusable way, you've got yourself a Leaflet plugin already.

There are no hard requirements on how to create your own plugin, but all developers are encouraged to read the recommendations in the [plugin guide](https://github.com/Leaflet/Leaflet/blob/main/PLUGIN-GUIDE.md).

Once your plugin is ready, you can submit it: just send a pull request with a new plugin file in [/docs/_plugins/](https://github.com/Leaflet/Leaflet/tree/main/docs/_plugins)to our GitHub repository.

repository: CapeSepias/Leaflet

gha_language: JavaScript

repo_name: CapeSepias/Leaflet


text:
---
uid: crmscript_ref_NSAAATestClassForModeling_GetUshortProbability
title: NSAAATestClassForModeling.GetUshortProbability()
intellisense: NSAAATestClassForModeling.GetUshortProbability
sortOrder: 8927
keywords: GetUshortProbability()
so.topic: reference
---

# NSAAATestClassForModeling.GetUshortProbability()

Actual probability, may differ from the one in the list

* **Returns:** Integer

repository: stianol/crmscript

repo_name: stianol/crmscript


text:
# fish-common-lisp-completions

## Installation

Install with fisher :

```
fisher install takeokunn/fish-common-lisp-completions
```

Otherwise, you could copy the file in your fish directory (typically in ~/.config/fish/completions).

## Commands

* sbcl
* ros(roswell)

## LICENSE

MIT

repository: takeokunn/fish-common-lisp-completions

repo_name: takeokunn/fish-common-lisp-completions


text:
An engine for producing 2D graphics as produced over the course of the semester in my university graphics course. All code
in the `fed` directory (i.e. with the `Fed` prefix) is mine, while everything else was provided by the instructor. All instructor-provided code is untouched up to and including commit `560eee`. Commits after this point include changes to this code.

Features of the engine include:

  * Blending
  * Shading
  * Clipping
  * Bitmaps
  * Transformations
  * Convex Polygons
  * Gradients
  * Stroking (opaque colors only)

To buld, test, and produce sample images, use

    $ make
    $ ./tests
    $ ./image -e expected

(Requires `libpng` to build)

Sample images created with the engine are shown below:

![alt tag](results/solid_ramp.png)

![alt tag](results/blend_white.png)

![alt tag](results/blend_black.png)

![alt tag](results/circles_blend.png)

![alt tag](results/spocks_quad.png)

![alt tag](results/spocks_zoom.png)

![alt tag](results/nine0.png)

![alt tag](results/nine1.png)

![alt tag](results/circles_fat.png)

![alt tag](results/tri.png)

![alt tag](results/tri_clipped.png)

![alt tag](results/poly.png)

![alt tag](results/poly_center.png)

![alt tag](results/poly_rotate.png)

![alt tag](results/draw_concat_scale.png)

![alt tag](results/draw_concat_scale_bitmap.png)

![alt tag](results/draw_concat_rotate.png)

![alt tag](results/draw_concat_rotate_bitmap.png)

![alt tag](results/gradient_insets.png)

![alt tag](results/gradient_insets_rot.png)

![alt tag](results/linear_big.png)

![alt tag](results/radial.png)

![alt tag](results/radial_quad.png)

![alt tag](results/radial_big.png)

![alt tag](results/bitmap_shader_clamp.png)

![alt tag](results/poly_shaders.png)

![alt tag](results/lerp0.png)

![alt tag](results/lerp1.png)

![alt tag](results/stroke_line.png)

![alt tag](results/stroke_polyline.png)

![alt tag](results/stroke_rect.png)

![alt tag](results/stroke_rings.png)

![alt tag](results/stroke_star.png)


text:
# Adding graphical effects: 3D particles

[(Augmenting user strokes: color) < previous](GUIDE-v3.md)  |

---
#### Introduction

This is the last in a series of four tutorials that walk you through the creation of a real-time collaborative whiteboard with Socket.IO. A fully featured demo can be found [here](https://socket-io-whiteboard.herokuapp.com/).

In our [previous](GUIDE-v3.md) installment of the guide, we augmented the user's "brush" with color. Some of you might have added even more features, like pen size, gradients, etc.

We are now at the final tutorial of this guide, so let us end on a special note. Up till now we have only been working with 2D graphics. If you've played with the [demo](https://socket-io-whiteboard.herokuapp.com/) then you've noticed the most glaring difference between it and our own whiteboard: fancy 3D particle effects.

Let's do the same here.

---
#### Integrating `THREE.js`

[`THREE.js`](http://threejs.org/) is a powerful and popular library for rendering 3D graphics on HTML5's `canvas` element.

First let us include the library script for `THREE.js` before the `/whiteboard.js` script in our `public/index.html` file. We can use the version hosted on the CDN:
```html
...
  <script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r74/three.min.js"></script>
  <script src="/socket.io/socket.io.js"></script>
  <script src="/whiteboard.js"></script>
</body>
</html>
```

Next, in `public/index.html`, we add another `<canvas>` to the whiteboard container `<div>` to serve as the rendering canvas for `THREE.js`. Put it right between the whiteboard `<canvas>` and the user count `<svg>`:
```html
...
<canvas class="whiteboard">Canvas not supported :(</canvas>
<canvas class="gfx-layer"></canvas>
<svg height="30px" width="100%" class="user-count">
...
```

Then, we append the following code at the bottom of `public/whiteboard.js` to initialise the 3D world:
```javascript
// 3d particle effects

var tick = 0, clock = new THREE.Clock(true);
var gfxCanvas = container.querySelector('canvas.gfx-layer');

var camera = new THREE.PerspectiveCamera(
      28,
      container.offsetWidth / container.offsetHeight,
      1,
      10000
    ),
    renderer = new THREE.WebGLRenderer({
      antialias: true,
      alpha: true,
      canvas: gfxCanvas
    }),
    scene = new THREE.Scene();

camera.position.z = 100;
renderer.setSize(container.offsetWidth, container.offsetHeight);
renderer.setClearColor(0x000000, 0);
```

---
#### Integrating `GPUParticleSystem.js`

`THREE.js` is poweful, but we'd rather not write a particle system from scratch. Luckily, we can use the particle system from [this](http://threejs.org/examples/#webgl_gpu_particle_system) example (credit: [Charlie Hoey](http://charliehoey.com/)).

Just like before, we include the library script for `GPUParticleSystem.js` after the `THREE.js` script and before the `/whiteboard.js` script in our `public/index.html` file. We can use the version hosted on the CDN:
```html
...
  <script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r74/three.min.js"></script>
  <script src="https://cdn.rawgit.com/mrdoob/three.js/a84b64b1d7efb31ba36a1b10d11a1d1f9f7b7c26/examples/js/GPUParticleSystem.js"></script>
  <script src="/socket.io/socket.io.js"></script>
  <script src="/whiteboard.js"></script>
</body>
</html>
```

This particle library requires some texture files to work. Create a new directory `textures` inside `public/`. Then, save these two image files inside `public/textures/` with these names:

`particle2.png`, which can be found [here](v4/public/textures/particle2.png).

`perlin-512.png`, which can be found [here](v4/public/textures/perlin-512.png).

Then we append the following code at the bottom of `public/whiteboard.js` to initialise the particle system:
```javascript
var particleSystem = new THREE.GPUParticleSystem({maxParticles: 250000});
var spawnerOpts = {
      spawnRate: 3000,
      timeScale: 1
};
var particleOpts = {
      positionRandomness: 0.5,
      velocity: new THREE.Vector3(),
      velocityRandomness: 0.5,
      colorRandomness: 0.2,
      turbulence: 0.4,
      lifetime: 0.8,
      size: 16,
      sizeRandomness: 1
};

scene.add(particleSystem);
```

Take note of `particleSystem` and `particleOpts`. If you experience perfomance issues when using the whiteboard, or want to turn up the seizure inducing lights, tweak the options here. You can see the results of changing these options at the [official GPUParticleSystem demo](http://threejs.org/examples/#webgl_gpu_particle_system). Play around to find your ideal settings!

---
#### Adding particle effects when drawing

There are many strategies we can use for spawning the particles. The most obvious way is to spawn them at the user's current mouse position, but if we do that the particles don't follow the mouse trail nicely. You can try it out yourself and compare the animation with the [demo](https://socket-io-whiteboard.herokuapp.com/).

With that in mind, let's use a slightly different particle spawning strategy:

1. Every line segment drawn will emit a burst of particles uniformly along its length.
2. Every line segment is animated in this way only once.
3. The particles match the line segment's color.
4. We see particle effects when other users draw too.

We will keep track of fresh line segments that have not yet been animated in an array, and pop them from the array when they have been animated. Let us call the array `unanimatedLines` and declare it at the top of the `// particle effects` section in `public/whiteboardjs`:
```javascript
// 3d particle effects

var unanimatedLines = [];
var tick = 0, clock = new THREE.Clock(true);
...
```

We want fresh line segments to be pushed into that array, so add this statement to the bottom of the `drawLine` function body:
```javascript
function drawLine(line) {
  ...
  ctx.stroke();
  unanimatedLines.push(line);
}
```
Since this function is also called when other users' strokes are received, we can fulfill condition **#4** of our strategy.

Now we need to consume those unanimated lines in our animation loop. Copy this code to the bottom of the `// particle effects` section in `public/whiteboard.js`:
```javascript
animate();
function animate() {
  requestAnimationFrame(animate);
  var delta = clock.getDelta() * spawnerOpts.timeScale;
  var maxSpawn = spawnerOpts.spawnRate * delta;
  tick += delta;

  unanimatedLines.forEach(function(line) {
    spawnParticlesAlongLine(maxSpawn / unanimatedLines.length, line);
  });
  unanimatedLines = [];

  if (tick < 0) tick = 0;
  particleSystem.update(tick);
  renderer.render(scene, camera);
}
```
Focus on the middle section of `animate`. The `forEach` callback calls the as yet undeclared `spawnParticlesAlongLine` function on each line in `unanimatedLines` to animate them. Once the loop is complete, we clear the `unanimatedLines` array to fulfill condition **#2** of our strategy.

We are left with conditions **#1** and **#3** of our particle spawning strategy. Let us write our `spawnParticlesAlongLine` function to fulfill them. Add this code to the bottom of the `// particle effects` section in `public/whiteboard.js`:
```javascript
function spawnParticlesAlongLine(number, line) {
  for (var i = 0; i < number; i++) { // ensure uniform distribution
    var percent = i / number;
    var pos = { // position particle on correct part of line
        x: line.startX * (1 - percent) + line.endX * percent,
        y: line.startY * (1 - percent) + line.endY * percent
    };
    particleOpts.color = parseInt(line.colorString.substr(1), 16); // convert our colorString into RGB hex for the particle system
    particleOpts.position = new THREE.Vector3(pos.x, pos.y, 0); // start position of this particle
    particleSystem.spawnParticle(particleOpts);
  }
}
```

That looks correct, but when we try drawing on the whiteboard...

![> VIDEO PLACEHOLDER: multiple browser view, drawing to show no particle effects](images/v4-00-particleSpawnLocBug.gif)

What's wrong? It turns out the spawn positions of our missing particles were based on the 2D line's position. However, the particles are in a 3D "world", and we have to map the 2D screen position to the 3D world position so they spawn where we want them. Let's use the undeclared function `getWorldPosFromCameraPos` to perform the mapping for us. Change the `var pos = {x: ... y: ...};` in `spawnParticlesAlongLine` as such:
```javascript
var pos = getWorldPosFromCameraPos( // position particle on correct part of line
        line.startX * (1 - percent) + line.endX * percent,
        line.startY * (1 - percent) + line.endY * percent
    );
```

Then we declare the `getWorldPosFromCameraPos` function under the `spawnParticlesAlongLine` function:
```javascript
function getWorldPosFromCameraPos(x, y) {
  var vector = new THREE.Vector3();
  vector.set(
      (x / wb.width) * 2 - 1, -(y / wb.height) * 2 + 1,
      0.5
  );
  vector.unproject(camera);

  var dir = vector.sub(camera.position).normalize();
  var distance = -camera.position.z / dir.z;
  var pos = camera.position.clone().add(dir.multiplyScalar(distance));
  return {
    x: pos.x,
    y: pos.y,
    z: pos.z
  };
}
```

Now let's try drawing on the whiteboard again:

![> VIDEO PLACEHOLDER: multiple browser view, drawing, change color, drawing](images/v4-01-particleSpawnLocBugFixed.gif)

Awesome. We did it! Great job!

---
#### Final code

Here is what your code should look like at this point:

`index.js` (no change)
```javascript
var express = require('express');
var app = express();
var http = require('http').Server(app);
var io = require('socket.io')(http);

var userCount = 0;

io.on('connection', function(socket){
  userCount++;
  console.log('Users connected: ' + userCount);
  io.emit('user count', userCount);

  socket.on('disconnect', function(){
    userCount--;
    console.log('Users connected: ' + userCount);
    io.emit('user count', userCount);
  });

  socket.on('draw line', function(line){
    socket.broadcast.emit('draw line', line);
  });
});

app.use(express.static('public'));

http.listen(parseInt(process.argv[2]), function(){
  console.log('listening on port ' + process.argv[2]);
});
```

`public/index.html`
```html
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Collaborative Whiteboard</title>
  <link rel="stylesheet" type="text/css" href="index.css">
</head>

<body>
  <div id="whiteboard-container">
    <canvas class="whiteboard">Canvas not supported :(</canvas>
    <canvas class="gfx-layer"></canvas>
    <svg height="30px" width="100%" class="user-count">
      <text x="0" y="30" class="user-count">Loading user count...</text>
    </svg>
    <div style="width: 100%; position: absolute;">
      <div class="color-picker-wrapper" style="background-color: #aa88ff;">
        <input class="color-picker" type="color" value="#aa88ff">
      </div>
    </div>
  </div>

  <script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r74/three.min.js"></script>
  <script src="https://cdn.rawgit.com/mrdoob/three.js/a84b64b1d7efb31ba36a1b10d11a1d1f9f7b7c26/examples/js/GPUParticleSystem.js"></script>
  <script src="/socket.io/socket.io.js"></script>
  <script src="/whiteboard.js"></script>
</body>
</html>
```

`public/index.css` (no change)
```css
body {
  background-color: #101010;
  margin: 0px;
  overflow: hidden;
}
#whiteboard-container {
  height: 600px;
  width: 900px;
  border: 2px solid white;
  position: absolute;
  top: 0px;
  bottom: 0px;
  left: 0px;
  right: 0px;
  margin: auto;
}
#whiteboard-container canvas {
  position: absolute;
}
#whiteboard-container > svg.user-count {
  height: 30px;
  width: 100%;
  position: absolute;
  left: 10px;
  bottom: 10px;
  cursor: default;
}
#whiteboard-container text.user-count {
  fill: #00D5B0;
  font-size: 12px;
  font-family: sans-serif;
  text-anchor: start;
}
#whiteboard-container .color-picker-wrapper {
  border-radius: 100%;
  margin-top: 20px;
  margin-left: auto;
  margin-right: auto;
  height: 32px;
  width: 32px;
  border: 1.5px solid #101010;
}
#whiteboard-container .color-picker {
  opacity: 0;
  width: inherit;
  height: inherit;
  padding: 0;
}
.color-picker:hover {
  cursor: pointer;
}
```

`public/whiteboard.js`
```javascript
var socket = io();

// whiteboard ------------------------------------------

// size the whiteboard to parent container
var container = document.getElementById('whiteboard-container');
var wb = container.querySelector('canvas.whiteboard');
wb.height = container.clientHeight;
wb.width = container.clientWidth;

// set stroke style
var colorString = '#aa88ff';
var ctx = wb.getContext('2d');
ctx.strokeStyle = colorString;
ctx.lineWidth = 2;
ctx.lineCap = 'round';
ctx.lineJoin = 'round';

// draw logic ------------------------------------------

var prevX, prevY,
    isDrawing = false;

container.onmousedown = function(e){
  e.preventDefault();
  isDrawing = true;
  var pos = getMouseEventContainerPos(e);
  prevX = pos.x;
  prevY = pos.y;
};

container.onmousemove = function(e){
  if (!isDrawing) return;
  var pos = getMouseEventContainerPos(e);
  var newLine = {
    startX: prevX,
    startY: prevY,
    endX: pos.x,
    endY: pos.y,
    colorString: colorString
  };
  drawLine(newLine);
  socket.emit('draw line', newLine);
  prevX = pos.x;
  prevY = pos.y;
};

document.onmouseup = function(){
  isDrawing = false;
};

container.onmouseleave = function(e) {
  if (!isDrawing) return;
  container.onmousedown(e);
};

function getMouseEventContainerPos(e) {
  return {
    x: e.offsetX + e.target.getBoundingClientRect().left - container.getBoundingClientRect().left,
    y: e.offsetY + e.target.getBoundingClientRect().top - container.getBoundingClientRect().top
  };
}

socket.on('draw line', drawLine);
function drawLine(line) {
  ctx.strokeStyle = line.colorString;
  ctx.beginPath();
  ctx.moveTo(line.startX, line.startY);
  ctx.lineTo(line.endX, line.endY);
  ctx.stroke();
  unanimatedLines.push(line);
}

// user count ------------------------------------------

socket.on('user count', updateUserCount);
var userCountText = container.querySelector('text.user-count');
function updateUserCount(count) {
  userCountText.textContent = 'CONNECTED: ' + count;
}

// color picker ----------------------------------------

var colorPickerWrapper = container.querySelector('.color-picker-wrapper');
var colorPickerInput = colorPickerWrapper.querySelector('input.color-picker');
colorPickerInput.onchange = function() {
  colorPickerWrapper.style.backgroundColor = colorPickerInput.value;
  colorString = colorPickerInput.value;
};

// 3d particle effects ------------------------------------

var tick = 0, clock = new THREE.Clock(true);
var gfxCanvas = container.querySelector('canvas.gfx-layer');

var camera = new THREE.PerspectiveCamera(
      28,
      container.offsetWidth / container.offsetHeight,
      1,
      10000
    ),
    renderer = new THREE.WebGLRenderer({
      antialias: true,
      alpha: true,
      canvas: gfxCanvas
    }),
    scene = new THREE.Scene();

camera.position.z = 100;
renderer.setSize(container.offsetWidth, container.offsetHeight);
renderer.setClearColor(0x000000, 0);

var particleSystem = new THREE.GPUParticleSystem({maxParticles: 250000});
var spawnerOpts = {
      spawnRate: 3000,
      timeScale: 1
};
var particleOpts = {
      positionRandomness: 0.5,
      velocity: new THREE.Vector3(),
      velocityRandomness: 0.5,
      colorRandomness: 0.2,
      turbulence: 0.4,
      lifetime: 0.8,
      size: 16,
      sizeRandomness: 1
};

scene.add(particleSystem);

animate();
function animate() {
  requestAnimationFrame(animate);
  var delta = clock.getDelta() * spawnerOpts.timeScale;
  var maxSpawn = spawnerOpts.spawnRate * delta;
  tick += delta;

  unanimatedLines.forEach(function(line) {
    spawnParticlesAlongLine(maxSpawn / unanimatedLines.length, line);
  });
  unanimatedLines = [];

  if (tick < 0) tick = 0;
  particleSystem.update(tick);
  renderer.render(scene, camera);
}

function spawnParticlesAlongLine(number, line) {
  for (var i = 0; i < number; i++) { // ensure uniform distribution
    var percent = i / number;
    var pos = getWorldPosFromCameraPos( // position particle on correct part of line
        line.startX * (1 - percent) + line.endX * percent,
        line.startY * (1 - percent) + line.endY * percent
    );
    particleOpts.color = parseInt(line.colorString.substr(1), 16); // convert our colorString into RGB hex for the particle system
    particleOpts.position = new THREE.Vector3(pos.x, pos.y, 0); // start position of this particle
    particleSystem.spawnParticle(particleOpts);
  }
}

function getWorldPosFromCameraPos(x, y) {
  var vector = new THREE.Vector3();
  vector.set(
      (x / wb.width) * 2 - 1, -(y / wb.height) * 2 + 1,
      0.5
  );
  vector.unproject(camera);

  var dir = vector.sub(camera.position).normalize();
  var distance = -camera.position.z / dir.z;
  var pos = camera.position.clone().add(dir.multiplyScalar(distance));
  return {
    x: pos.x,
    y: pos.y,
    z: pos.z
  };
}

```

---
#### Thank you

And that completes our collaborative whiteboard app. We've covered a lot of ground, and we've come up with a fairly pretty and complete app from scratch, so pat yourself on the back; you've earned it. Take a look at the **Homework** sections at the bottom of each tutorial and try implementing them. Share your personal whiteboard and let us hear about it on [twitter](https://twitter.com/socketio?lang=en) or [slack](http://slack.socket.io/)!

---
#### Homework

Here are some ideas to improve the application:
- Lower the strength of other user's particles in relation to the local user to reduce clutter
- Add more of your own 3D effects
- Multiple whiteboards on the same page
- The sky's the limit!

---
#### Getting this example

You can find it on GitHub [here](.).
```
git clone https://github.com/nus-fboa2016-si/whiteboard.git
```
```
cd whiteboard/guide/v4
```

---

[(Augmenting user strokes: color) < previous](GUIDE-v3.md)  |


text:
---
title: Welcome to the Library!
nav: Library
---

{% capture questions %}
 Have you been in the Library building?

 Have you visited the Library website?

 Have you talked to a librarian (before today)?

 Have you used the Library's chat help?
{% endcapture %}
{% include card.html text=questions title="Questions:" %}

## Research Help

The big take away: [University of Idaho Librarians](https://www.lib.uidaho.edu/about/librarians.html) are on campus to [help](https://www.lib.uidaho.edu/help/) you!

The library can be a complicated and overwhelming place, please don't be hesitate to ask questions.

Library activity Bingo card:

| Visit the [Reference Desk](https://www.lib.uidaho.edu/about/hours.html#reference) (just inside the Library's front door). | Connect with Reference librarians via [chat, text, or email](https://www.lib.uidaho.edu/help/). |
| Ask anytime on our [24/7 Chat Reference](https://www.lib.uidaho.edu/help/chat.html). | Explore our [captivating, information filled website](https://www.lib.uidaho.edu/). |
| [Book a room](https://www.lib.uidaho.edu/services/rooms.html) for your group meeting. | Play a [board game](https://libguides.uidaho.edu/Games). |
{:.table .table-bordered}

repository: evanwill/library-intro

repo_name: evanwill/library-intro


text:
Wi-Fi Deep Sleep
===============

**Only for Android KitKat.**

Once installed this mod prevents Wi-Fi from waking up during device sleep mode and when you turn on the screen without unlocking it (to look at the clock, for example).

Background
----------
Normally Wi-Fi can be awakened and kept on due to [Wifi locks](http://developer.android.com/reference/android/net/wifi/WifiManager.WifiLock.html) held by certain applications that often use to abuse this opportunity. This results in Wi-Fi being turned on over up to the half of the total sleep time (or even more) which in turn of course eats the battery. Another issue is that once turned on by a single application it notifies and awakes lots of other apps that may start, for example, their heavy synchronization tasks, etc., making everything even worse.

Auto Wi-Fi apps
---------------
Nevertheless, Wifi lock is a good mechanism when used carefully, and generally it should be respected when deciding whether to switch Wi-Fi on and off. This becomes a problem for most of Wi-Fi management apps found in Play Market: they can switch Wi-Fi off in the middle of a Skype call just because the screen was turned off.

The solution
------------
This mod alters a system state machine responsible for managing Wi-Fi so that once put to sleep it can not be woken up by any application that requests a lock. Wi-Fi is only put asleep when no application holds a lock. That is it doesn't cancel locks held already, but once all of them are gone, no one else is able to aquire a new lock until the screen is turned on and unlocked. This doesn't apply to special [high performance](http://developer.android.com/reference/android/net/wifi/WifiManager.html#WIFI_MODE_FULL_HIGH_PERF) Wifi lock, it still can be aquired as usual even in asleep mode (anyway, it seems that applications does not use to use this lock too often, so the battery should not became an issue).

Installation
------------
 1. Download and install [Xposed framework](http://repo.xposed.info/module/de.robv.android.xposed.installer)
 2. Search for and install **[Wi-Fi Deep Sleep](http://repo.xposed.info/module/ru.abusalimov.xposed.wifideepsleep)** module
 3. Activate the module and reboot

Usage
-----
To make the mod to take an effect proceed to **Settings → Wi-Fi → Advanced** and make sure that:
  - **Keep Wi-Fi on during sleep** is either *Only when plugged in* or *Never (increases data usage)*
  - **Scanning always available** is turned *off*

The module provides no user interface, nor it runs any services in a background: only modifies a corresponding part of Android. You won't be able to notice it in the main menu or in a task manager. Think of it as a patch that can be turned on and off through Xposed installer.

Links
-----
 - [Module page](http://repo.xposed.info/module/ru.abusalimov.xposed.wifideepsleep) on Xposed repo
 - [Discussion](http://forum.xda-developers.com/xposed/modules/mod-wi-fi-deep-sleep-t2752947) thread on XDA

repository: yanggis/XposedWifiDeepSleep

repo_name: yanggis/XposedWifiDeepSleep


text:
# Development

## Prerequisites

* [Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)
    * macOS: _(built-in)_
    * Windows:
        * `choco install git -y`
        * `git config --global core.autocrlf false`
* [Go](https://golang.org/doc/install)
    * macOS: `brew install go`
    * Windows: `choco install golang -y`
* [Docker](https://www.docker.com/products/docker-desktop)
* Make (and build tools)
    * macOS: `xcode-select --install`
    * Windows:
        * `choco install cygwin make -y`
        * `[Environment]::SetEnvironmentVariable("PATH", "C:\tools\cygwin\bin;$ENV:PATH", "MACHINE")`

### Caveats

* The acceptance tests require the docker daemon to be able to communicate with a local containerized insecure registry. On Docker Desktop 3.3.x, this may result in failures such as: `Expected nil: push response: : Get http://localhost:<port>/v2/: dial tcp [::1]:<port>: connect: connection refused`. To fix these failures, it may be necessary to add the following to the Docker Desktop Engine config:
    * macOS: Docker > Preferences > Docker Engine:
```
  "insecure-registries": [
    "<my-host-ip>/32"
  ]
```

### Testing GitHub actions on forks

The lifecycle release process involves chaining a series of GitHub actions together such that:
* The "build" workflow creates the artifacts
  * .tgz files containing the lifecycle binaries, shasums for the .tgz files, a cosign public key, an SBOM, etc.
  * OCI images containing the lifecycle binaries, tagged with their commit sha (for more information, see RELEASE.md)
* The "draft-release" workflow finds the artifacts and downloads them, creating the draft release
* The "post-release" workflow re-tags the OCI images that were created during the "build" workflow with the release version

It can be rather cumbersome to test changes to these workflows, as they are heavily intertwined. Thus we recommend forking the buildpacks/lifecycle repository in GitHub and running through the entire release process end-to-end.
For the fork, it is necessary to add the following secrets:
* COSIGN_PASSWORD (see [cosign](https://github.com/sigstore/cosign#generate-a-keypair))
* COSIGN_PRIVATE_KEY
* DOCKER_PASSWORD (if not using ghcr.io)
* DOCKER_USERNAME (if not using ghcr.io)

The tools/test-fork.sh script can be used to update the source code to reflect the state of the fork.
It can be invoked like so: `./tools/test-fork.sh <registry repo name> <path to cosign public key>`

## Tasks

To test, build, and package binaries into an archive, simply run:

```bash
$ make all
```
This will create archives at `out/lifecycle-<LIFECYCLE_VERSION>+linux.x86-64.tgz` and `out/lifecycle-<LIFECYCLE_VERSION>+windows.x86-64.tgz`.

`LIFECYCLE_VERSION` defaults to the value returned by `git describe --tags` if not on a release branch (for more information about the release process, see [RELEASE](RELEASE.md)). It can be changed by prepending `LIFECYCLE_VERSION=<some version>` to the
`make` command. For example:

```bash
$ LIFECYCLE_VERSION=1.2.3 make all
```

Steps can also be run individually as shown below.

### Test

Formats, vets, and tests the code.

```bash
$ make test
```

### Build

Builds binaries to `out/linux/lifecycle/` and `out/windows/lifecycle/`.

```bash
$ make build
```

> To clean the `out/` directory, run `make clean`.

### Package

Creates archives at `out/lifecycle-<LIFECYCLE_VERSION>+linux.x86-64.tgz` and `out/lifecycle-<LIFECYCLE_VERSION>+windows.x86-64.tgz`, using the contents of the
`out/linux/lifecycle/` directory, for the given (or default) `LIFECYCLE_VERSION`.

```bash
$ make package
```

repository: GoogleContainerTools/skaffold

repo_name: GoogleContainerTools/skaffold


text:
---
layout: default
---

# 1998-07-09 - RE: FC: Forget Internet restrictions -- how about banning TV?

Message-ID: <2FBF98FC7852CF11912A00000000000108A78AE3@DINO>
MIME-Version: 1.0
Content-Type: text/plain

So attila, Afghanistan will be a better place because they've banned
television?

I think you miss the point.

Harv.

From: attila<EMAIL_ADDRESS>> Sent: Thursday, July 09, 1998 12:37 PM
> To: Declan McCullagh; cypherpunks
> Subject: Re: FC: Forget Internet restrictions -- how about banning TV?
>
>
> On Thu, 9 Jul 1998, Declan McCullagh forwarded from TIME:
>
> >...
> >   The revolution will not be televised -- at least not in
> Afghanistan.
> >   The Taliban government today banned TV, and gave Afghans
> 15 days to
...deletia...
>
>     sounds good to me; I've raised 5 children who know how to _read_.
>
>     I've never owned a television, never saw the need to bring cancer
>     into the home.
...deletia...

{% endraw %}
```

## Thread

+ Return to [July 1998](/archive/1998/07)

+ Return to "[attila <attila@hun.org>](/authors/attila_attila_at_hun_org_)"
+ Return to "["Harvey Rook (Exchange)" <hrook@exchange.microsoft.com>](/authors/harvey_rook_exchange__hrook_at_exchange_microsoft_com_)"

+ 1998-07-09 (Thu, 9 Jul 1998 14:27:38 -0700 (PDT)) - RE: FC: Forget Internet restrictions -- how about banning TV? - _"Harvey Rook (Exchange)"<EMAIL_ADDRESS>  + 1998-07-09 (Thu, 9 Jul 1998 14:53:07 -0700 (PDT)) - [RE: FC: Forget Internet restrictions -- how about banning TV?](/archive/1998/07/556f5e706d56e7dd2b5b4a0e98eedf2ae7e02258cb4e12eaae52a80a338c66b8) - _attila<EMAIL_ADDRESS>


text:
---
layout: post
title: New Website!
date:   2017-05-28 11:22:00
categories: meta
---
# The site
Discord4J is undergoing major revisions as part of version 3.0. Part of this includes a brand
new website! Currently the site is missing some areas including: a dedicated wiki, CI,
and javadocs section. But I hope to add these in the near future, in the meantime they
redirect to our current hosts.

# Other stuff
In addition to the new site, we are currently planning the full rewrite of Discord4J. The dev
team is working hard to make sure this is well thought-out, powerful and intuitive. We expect
for Discord4J 3.0 to have some form of release within the next few months. Additionally,
development of Discord4J will be done under our new [Discord4J Github Organization](https://github.com/Discord4J), as such we plan to move the current repository to this
organization once Discord4J 3.0 is near completion.

gha_language: CSS


text:
kshlm.custom-rpms
=========
Installs all rpms in a given directory

Role Variables
--------------

Requires either (and only) one of the following variables to be set

- rpms_dir : A directory on the machine being configured that contains the rpms to be installed
- host_rpms_dir: A directory on the Ansible host that contains the rpms to be installed. The role syncs this directory with the machine being configured and installs the rpms.

Example Playbook
----------------

When the rpms are already present on the machine

```yml
---
- hosts: all
  vars:
    rpms_dir: /rpms
  roles:
    - kshlm.custom-rpms
```

When the rpms are on the host
```yml
---
- hosts: all
  vars:
    host_rpms_dir: ./rpms
  roles:
    - kshlm.custom-rpms
```

License
-------

MIT

repository: kshlm/my-ansible-roles

repo_name: kshlm/my-ansible-roles


text:
[Embedded Machine Learning for Microcontroller using MicroML framework. MicroML brings Machine Learning algorithms to microcontrollers, including limited 8-bit Arduino AVR boards, to run a classification model.](https://github.com/TronixLab/ArduinoMicroML)

[TinyMaix is a tiny inference Neural Network library specifically for microcontrollers (TinyML).](https://github.com/sipeed/TinyMaix)

[Tensorflow para microcontroladores](https://www.tensorflow.org/lite/microcontrollers)

[Esp32 NN](https://github.com/espressif/esp-nn)

[Voice Controlled Robot using the ESP32 and TensorFlow Lite](https://www.youtube.com/watch?v=cp2qRrhaZRA)

[First steps with ESP32 and TensorFlow Lite for<EMAIL_ADDRESS>
[TensorFlow Lite With Platform.io and the ESP32](https://www.youtube.com/watch?v=kZdIO82059E)

[ESP32 Tensorflow micro speech with the external microphone](https://www.survivingwithandroid.com/esp32-tensorflow-micro-speech-i2s-external-microphone/)

[TfTrackpad: AI-powered, programmable DIY trackpad](https://eloquentarduino.github.io/2021/07/tftrackpad-ai-powered-programmable-diy-trackpad/)

[Meet your new table tennis coach, a tinyML-powered paddle!](https://blog.arduino.cc/2021/07/23/meet-your-new-table-tennis-coach-a-tinyml-powered-paddle/)


text:
# Hooks
The hooks folder contains the MediaWiki hooks to be able to use the project itself.

### Files in the directory

* ##### MultiCodeBlockHooks.php
  > This file is the class for the MediaWiki hooks so that the parser can call the extension functions accordingly.

repository: QuickWrite/MultiCodeBlock

repo_name: QuickWrite/MultiCodeBlock


text:
# 0.4.0 (2021-01-27)

### Fixes

- Clippy warnings have been fixed [#201](https://github.com/microsoft/com-rs/pull/201)
- A few things which were not properly being converted to their ABI representation now are [#191](https://github.com/microsoft/com-rs/pull/191)
- Incorrect CLSID Registry keys [#190](https://github.com/microsoft/com-rs/pull/190)
- Handle COM classes with multiple fields [#188](https://github.com/microsoft/com-rs/pull/188)
- Keep leading zeros in COM GUID [#187](https://github.com/microsoft/com-rs/pull/187)

### Added

- Support for `#[no_std]` environments [#199](https://github.com/microsoft/com-rs/pull/199)

### Changed

- The ABI for COM functions is now "system" instead of hard-coding "stdcall" [#203](https://github.com/microsoft/com-rs/pull/203)

# 0.3.0 (2020-04-03)

### Changed

The public API for this crate has changed considerably since the previous version. Please take a look at the README and docs folder for information on how to use this crate.

# 0.2.0 (2020-04-03)

### Fixes

- Fixed docs.rs build [#93](https://github.com/microsoft/com-rs/pull/93)
- Support paths when defining super traits [#110](https://github.com/microsoft/com-rs/pull/110)
- Made interface pointers more correct [#125](https://github.com/microsoft/com-rs/pull/125)
- Fix multiple user generated fields not being generated [#132](https://github.com/microsoft/com-rs/pull/132)

### Added

- `Debug` for `IID` [#128](https://github.com/microsoft/com-rs/pull/128)
- Allow more interfaces [#135](https://github.com/microsoft/com-rs/pull/135)

### Changed

- Define IIDs as strings [#107](https://github.com/microsoft/com-rs/pull/107)
- Require unsafe for interface methods [#120](https://github.com/microsoft/com-rs/pull/120)
- Remove winapi as dependency [#122](https://github.com/microsoft/com-rs/pull/122)
- Interface{Ptr,Rc} => Com{Ptr,Rc} [#129](https://github.com/microsoft/com-rs/pull/129)
- Runtime is now done through stand alone functions [#136](https://github.com/microsoft/com-rs/pull/136)

# 0.1.0 (2019-10-01)

Initial release of the `com` crate.

A one stop shop for all things related to [COM](https://docs.microsoft.com/en-us/windows/win32/com/component-object-model--com--portal) programming in Rust.

This library exposes various macros, structs and functions to the user for both producing and consuming COM components in an idiomatic manner.

repository: willox/com-rs

repo_name: willox/com-rs


text:
We welcome any contributions from the community.

## Getting started

To get started, please proceed to

1. [Fork](https://docs.github.com/en/get-started/quickstart/fork-a-repo) the atoti repository:

<img src="assets/fork_atoti_repo.png">

2. Pull the `main` branch (`git checkout main` and `git pull`) from the forked repository.
3. Run `poetry install` to be sure to work with the expected dependencies.
4. Create a working branch `git switch -c <PSEUDO>/<SUBJECT>`.
5. Start JupyterLab: `poetry run jupyter lab`.
6. Create the folder and notebooks.
    Add notebooks responsible for data pre-processing to the [list of untested notebooks](tests/execute_notebooks.py).
    The main notebook using atoti should be tested to ensure users can run it.
7. If a dependency is missing run `poetry add <DEPENDENCY_NAME>`: **DEPENDENCIES MUST NOT BEEN ADDED WITH CONDA OR PIP** since the Github CI relies on the `poetry.lock` file to install dependencies.
8. Commit and push changes to the forked repository using `git push`.
9. Create a [pull request](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests) from the forked repository.

Please monitor the pull request as each pull request is subject to automatic code testing. The atoti team will review and comment on any pull requests to ensure each submission is aligned with the API's usage.

## Pull Request Rules
Please make sure your PR follows the rules below:

### General notebook rules

- folders and files name should be lowercase with hyphen.

  Example: `name-of-my-folder-or-file`

- notebook example should be put inside a folder which name is the notebook's title. This folder should be located under a specific "domain" folder.

  Example: `/relevant-domain/title-of-my-notebook-folder/`

- entrypoint should be named `main.ipynb`
- README TOC should be updated to link to the new notebook
- notebook should have an H1 title, matching folder name and README TOC
- create a README at notebook level to briefly introduce yourself and the use case.

### Data rules

- data files name should use snake_case
- data files should be of reasonnable size, not exceeding 50MB, unless programmatically generated
- all data files should be uploaded on data.atoti.io If you don't have access to it, data should be hosted on a public host and an owner will transfer them to data.atoti.io upon review

### Python code rules

- variables should follow Google's [naming convention](http://google.github.io/styleguide/pyguide.html#316-naming)
- python files should be formatted with [Black](https://black.readthedocs.io/en/stable/)
- python methods should be typed
- documentation should follow Google's [docstring](http://google.github.io/styleguide/pyguide.html#381-docstrings)

### Testing and CI

This repository is tested with a [Github Action](.github/workflows/test.yaml).

These commands can be used while developing:

- Reformat python files using black :

  ```bash
  poetry run black .
  ```

- Reformat notebooks using black-nb :

  ```bash
  poetry run black-nb notebooks/
  ```

- Execute all the notebooks:

  ```bash
  poetry run python tests/execute_notebooks.py
  ```

### About

Checkout [atoti.io](https://www.atoti.io) for more info!

By opening an issue or a pull request, you agree with atoti's [terms of use](https://www.atoti.io/terms) and [privacy policy](https://www.atoti.io/privacy-policy).

repository: atoti/notebooks

gha_language: Jupyter Notebook

repo_name: atoti/notebooks


text:
# DesignScript Geometry Basics

The simplest geometrical object in the Dynamo standard geometry library is a point. All geometry is created using special functions called constructors, which each return a new instance of that particular geometry type. In Dynamo, constructors begin with the name of the object’s type, in this case Point, followed by the method of construction. To create a three dimensional point specified by x, y, and z Cartesian coordinates, use the *ByCoordinates* constructor:

![](images/12-1/GeometryBasics_01.png)

```js
// create a point with the following x, y, and z
// coordinates:
x = 10;
y = 2.5;
z = -6;

p = Point.ByCoordinates(x, y, z);
```

Constructors in Dynamo are typically designated with the “*By*” prefix, and invoking these functions returns a newly created object of that type. This newly created object is stored in the variable named on the left side of the equal sign.

Most objects have many different constructors, and we can use the *BySphericalCoordinates* constructor to create a point lying on a sphere, specified by the sphere’s radius, a first rotation angle, and a second rotation angle (specified in degrees):

![](images/12-1/GeometryBasics_02.png)

```js
// create a point on a sphere with the following radius,
// theta, and phi rotation angles (specified in degrees)
radius = 5;
theta = 75.5;
phi = 120.3;
cs = CoordinateSystem.Identity();

p = Point.BySphericalCoordinates(cs, radius, theta,
    phi);
```

Points can be used to construct higher dimensional geometry such as lines. We can use the *ByStartPointEndPoint* constructor to create a Line object between two points:

![](images/12-1/GeometryBasics_03.png)

```js
// create two points:
p1 = Point.ByCoordinates(3, 10, 2);
p2 = Point.ByCoordinates(-15, 7, 0.5);

// construct a line between p1 and p2
l = Line.ByStartPointEndPoint(p1, p2);
```

Similarly, lines can be used to create higher dimensional surface geometry, for instance using the *Loft* constructor, which takes a series of lines or curves and interpolates a surface between them.

![](images/12-1/GeometryBasics_04.png)

```js
// create points:
p1 = Point.ByCoordinates(3, 10, 2);
p2 = Point.ByCoordinates(-15, 7, 0.5);

p3 = Point.ByCoordinates(5, -3, 5);
p4 = Point.ByCoordinates(-5, -6, 2);

p5 = Point.ByCoordinates(9, -10, -2);
p6 = Point.ByCoordinates(-11, -12, -4);

// create lines:
l1 = Line.ByStartPointEndPoint(p1, p2);
l2 = Line.ByStartPointEndPoint(p3, p4);
l3 = Line.ByStartPointEndPoint(p5, p6);

// loft between cross section lines:
surf = Surface.ByLoft([l1, l2, l3]);
```

Surfaces too can be used to create higher dimensional solid geometry, for instance by thickening the surface by a specified distance. Many objects have functions attached to them, called methods, allowing the programmer to perform commands on that particular object. Methods common to all pieces of geometry include *Translate* and *Rotate*, which respectively translate (move) and rotate the geometry by a specified amount. Surfaces have a *Thicken* method, which take a single input, a number specifying the new thickness of the surface.

![](images/12-1/GeometryBasics_05.png)

```js
p1 = Point.ByCoordinates(3, 10, 2);
p2 = Point.ByCoordinates(-15, 7, 0.5);

p3 = Point.ByCoordinates(5, -3, 5);
p4 = Point.ByCoordinates(-5, -6, 2);

l1 = Line.ByStartPointEndPoint(p1, p2);
l2 = Line.ByStartPointEndPoint(p3, p4);

surf = Surface.ByLoft([l1, l2]);

// true indicates to thicken both sides of the Surface:
solid = surf.Thicken(4.75, true);
```

*Intersection* commands can extract lower dimensional geometry from higher dimensional objects. This extracted lower dimensional geometry can form the basis for higher dimensional geometry, in a cyclic process of geometrical creation, extraction, and recreation. In this example, we use the generated Solid to create a Surface, and use the Surface to create a Curve.

![](images/12-1/GeometryBasics_06.png)

```js
p1 = Point.ByCoordinates(3, 10, 2);
p2 = Point.ByCoordinates(-15, 7, 0.5);

p3 = Point.ByCoordinates(5, -3, 5);
p4 = Point.ByCoordinates(-5, -6, 2);

l1 = Line.ByStartPointEndPoint(p1, p2);
l2 = Line.ByStartPointEndPoint(p3, p4);

surf = Surface.ByLoft([l1, l2]);

solid = surf.Thicken(4.75, true);

p = Plane.ByOriginNormal(Point.ByCoordinates(2, 0, 0),
    Vector.ByCoordinates(1, 1, 1));

int_surf = solid.Intersect(p);

int_line = int_surf.Intersect(Plane.ByOriginNormal(
    Point.ByCoordinates(0, 0, 0),
    Vector.ByCoordinates(1, 0, 0)));
```

repository: DynamoDS/DynamoPrimer

repo_name: DynamoDS/DynamoPrimer


text:
Asserts an array (or array-like object) contains one or more items.

```js
expect([0, 1, 2], 'to contain', 1);
expect([{ name: 'John Doe' }, { name: 'Jane Doe' }], 'to contain', {
  name: 'Jane Doe',
});
expect([0, 1, 2], 'to contain', 0, 2);
```

In case of a failing expectation you get the following output:

```js
expect([{ name: 'John Doe' }, { name: 'Jane Doe' }], 'to contain', {
  name: 'Jonnie Doe',
});
```

```output
expected [ { name: 'John Doe' }, { name: 'Jane Doe' } ]
to contain { name: 'Jonnie Doe' }
```

This assertion can be negated using the `not` flag:

```js
expect([{ name: 'John Doe' }, { name: 'Jane Doe' }], 'not to contain', {
  name: 'Jonnie Doe',
});
```

In case of a failing expectation you get the following output:

```js
expect([{ name: 'John Doe' }, { name: 'Jane Doe' }], 'not to contain', {
  name: 'Jane Doe',
});
```

```output
expected [ { name: 'John Doe' }, { name: 'Jane Doe' } ]
not to contain { name: 'Jane Doe' }

[
  { name: 'John Doe' },
  { name: 'Jane Doe' } // should be removed
]
```

repository: alexjeffburke/unexpected

repo_name: alexjeffburke/unexpected


text:
**Please introduce yourself and tell us where you grew up and where you live now. Where can we find you on social media?**

[picture](Mexicanx105)

My name is Deborah Gonzalez and my pen name is Smok (it means dragon in Polish). I was born and still live in a small town in Baja California Norte. My father’s family is from Colima and my mother is from Nayarit.
I’m [@smokthedragon](https;//www.twitter.com/smokthedragon) on Twitter.

**What kind of creative work do you do?**

I write speculative poetry, and sometimes I make videos of my poems.

**Had you ever been to a WorldCon before?**

No, but I can’t wait to go again.

**What did you expect being part of the Initiative would be like? How did your experience compare with that expectation?**

I didn’t know what to expect, but I was sure I was going to learn a lot. My experience exceed any expectation. I learned, I found a new family, and made new friends, and it was really amazing.

"Worldcon is a magical place," John said at the the Mexicanx Initiative reception. And it really was magical. From start to finish, the convention was full of surprises and adventures. But the real magic started much earlier.

Two years ago I decided that I wanted to write professionally, because writing is something that I've always done but I never considered it as a career. So, I started writing more and sending my poems to contests here in México. One day I made video of one of my poems, just for fun. My sister recorded me and my boyfriend made the music. I posted it on YouTube and showed to my family and friends, and that was it. I kept writing, and participating in contests, and every fail was like a heartbreak for me, and I started wondering if I was good enough, but I’m stubborn como mi ama, and kept doing it anyway.

One night I was scrolling through Twitter before going to sleep and found John’s tweet because someone I follow had retweet it. I was hesitant to participate at first, but I decided to take the risk and send my tweet telling him why I wanted to go to Worldcon, and went to sleep. He answered me the next day, telling me that he saw my video (the video that I made just for fun), and, well, the rest is history. It’s amazing how the points connect without even noticing. Some may call it destiny, luck, or a blessing, but it doesn’t matter; it was happening to me and I was grateful.

From the moment I arrived in San Jose, everything went smoothly. I went to the convention and met John in his booth for the first time, where he gave me the warmest welcome ever. And then the opening ceremonies happened, and that’s when I realized, that the Mexicanx Initiative was something else. It was not just a group of Mexicanx people having the opportunity to go to a Sci-Fi/fantasy convention. It was the beginning of something bigger.

The first person I talked was Dianita, who was really sweet and interesting, and then I met Vania because we both said at the same time, “Glad I didn’t trip on the stage!” In that moment I knew we would be good friends. The Mexicanx reception really felt like a family party and I had too much fun meeting everyone. The second day were the Mexicanx Initiative readings. I went to the convention center early to practice in a corner, scaring the people that passed by. At the reading, I was amazed at the talent of each Mexicanx that participated, and fell in love with all the stories that they told. And when it was my turn, I made sure to make enough hand gestures so that no one noticed how my hands where shaking, but that’s when it hit me, for real, I was in the right place doing what I was born to do.

[picture](Mexicanx035)

In the four days of the convention, I felt so welcome and inspired by the SF/F community. I learned from the most talented people and met the kindest souls. I’m super grateful to every person that supported the initiative, and even more grateful for being part of the Mexicanx Initiative family. That’s why I think Worldcon is a magical place, because of the people that make that magic happen. Going to Worldcon 76 was one of the best experiences I've had in my life.

**Tell us about one highlight moment of your WorldCon experience.**

My highlight moment was definitely the reading. It was my first time reading my work in public and I really enjoyed it.

[picture](mexicanx055)

**Recommend any or all of the following: a song, a written work, a piece of visual art, and a movie. Tell us why you love them!**

Songs:  I can’t chose one, so I’m going to recommend two songs. "Apocalíptico" and "Desencuentro" by Residente (the former vocalist of Calle 13).

Written work: “Mexican Bestiary” by David Bowles.

Visual art: The work of Eden Reeve. Go follow her on Twitter, where she is [@edenreeve](https://www.twitter.com/edenreeve). She is amazing.

Movie: The documentary of Residente. Every creative person needs to watch that documentary. Is about how he produces his self-titled album in ten countries based on his own DNA. It’s really cool.

**What was the funniest thing that happened during your trip?**

When I danced with a charming but very old man at the Fairmont bar.

**Where should new people start familiarizing themselves with your work?**

These are the links for three video poems I have on YouTube:

Extraterrestre: [https://www.youtube.com/watch?v=XKdrJpZx7GY](https://www.youtube.com/watch?v=XKdrJpZx7GY)

Solaris: [https://www.youtube.com/watch?v=boI6XsUcdZY](https://www.youtube.com/watch?v=boI6XsUcdZY)

La Llegada: [https://youtu.be/TMP-5n2nO2Y(https://youtu.be/TMP-5n2nO2Y)