text:
---
title: Howard PD
nav: pd2_nav
---

# Howard Professional Development

## Exploring Computer Science

### Phase 1: Online Introduction (~2 hours) ###

Milestone complete!

### Phase 2: Blended Summer Study  (5 days in-person & ~8 hours online)###

Milestone Complete!

### Phase 3: Academic Year Development (4 Saturdays in-person & ~12 hours online) ###

Phase 3 is composed of quarterly in-person meetings and monthly online activities. The meetings will continue to build pedagogical strategies and explore the essential elements of ECS. You will participate in activities such as teaching new content and keeping the classroom environment equitable and engaging for all students.

**Save the dates**

Quarter 1: Saturday, October 10, 2015

Quarter 2: Saturday, November 7, 2015

Quarter 3: Saturday, February 20, 2016

Quarter 4: Saturday, April 9, 2016

8:30am - 3:30pm

Breakfast and lunch will be served.

**Location**

[Applications and Research Laboratory (ARL)

Room B37

10920 Clarksville Pike

Ellicott City, MD 21042

](https://www.google.com/maps/place/Applications+and+Research+Laboratory/@39.2349191,-76.8947807,17z/data=!3m1!4b1!4m2!3m1!1s0x89b7df61228ae963:0x7557056ab12cc472)

**What to bring to Phase 3 quarterly sessions:**

Laptop and Charger

ECS green journal

Curriculum guide

Snacks

Water

### Phase 4: Summer Wrap-up (3 days in-person - Summer 2016) ###

More info coming soon!

[**Back to the top**](#top)

----------
Please visit [FAQs](/educate/pd/15-16/faq) for more information.

branch_name: refs/heads/staging


text:
```
PROPOSAL TO CREATE A TECHNICAL OVERSIGHT COMMITTEE
Proposal Date: June 17, 2020
Acceptance Date:
```

# Technical Oversight Committee

## Mission
The goal of the Technical Oversight Committee is to provide technical leadership and guidance to the reactive foundation community.

The are responsible for:
 - Project alignment
 - Project Progression and Lifecycle
 - Approving the addition of new projects to the foundation
 - Creation of concepts and architecture for new projects
 - Aligning documentation reference and implementations
 - Providing recommended practices for the Reactive Foundation Projects
 - Ensuring active projects have the support and sponsorship they require

## Members
The goal is to have a diverse set of ideas to draw on before making any decisions. The TOC meetings are open to anyone working on a project in the reactive foundation, but the voting is limited to the members.

The Technical Oversight Committee Members consists of:
- Chairperson (appointed by the board)
- A nominated representatives from each of the Impact Reactive Foundation projects
- A representitive from the board

## Meetings
The Technical Oversight Committee should maintain active conversation:
 - publicly on discourse at https://community.reactive.foundation
 - privately via an email list server and
 - publicly via a meeting monthly on the second to last Thursday at 8am PT. (Details and minutes should be recorded at https://github.com/reactivefoundation/toc/meetings )

repository: alexy/foundation

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: alexy/foundation


text:
# **RegistryJob resource**

## **What is it?**
RegistryJob is a job execution instance. Each RegistryJob is a history of a specific task.
The task can be external registry synchronization, image scan (TBD), image sign (TBD), etc...

## How to create

### spec field

**Key**|**Requried**|**Type**|**Description**
:-----:|:-----:|:-----:|:-----:
ttl|Yes|int|Time-to-live (in seconds) after the job's completion.
0: Delete immediately.
-1: Do not delete
ttl>0: Delete after ttl seconds
priority|No|int|Priority of the job. It should be greater or equal to 0 (Default: 0)
syncRepository|No|registryJobSyncRepository|Repository Sync type task for an external registry

### spec.registryJobSyncRepository field

**Key**|**Requried**|**Type**|**Description**
:-----:|:-----:|:-----:|:-----:
externalRegistry.name|Yes|string|Name of the target external registry

## Example

---

Sync repositories for an external registry

```yaml
apiVersion: tmax.io/v1
kind: RegistryJob
metadata:
  name: job-sync-harbor-1
  namespace: default
spec:
  ttl: 0
  syncRepository:
    externalRegistry:
      name: harbor-1
```

## **Result**

---

For the repository sync task, you can check the list of the children Repository of the target external repository.

repository: tmax-cloud/registry-operator

gha_language: Go

repo_name: tmax-cloud/registry-operator


text:
## Python-C-Interface: Check whether a given dictionary contains only valid keys
Originally published: 2017-05-06 20:53:54
Last updated: 2017-05-06 20:53:54
Author: Jorj X. McKie

This function is given a Python dictioanry and a list of string / unicode values. It will check whether all dictionary keys occur in this list and will return 1 (true) or 0 (false).

license: MIT

gha_language: Python

gha_license_id: MIT


text:
---
title: Including the build version inside a rust binary
author: Keirua
layout: post
lang: en
image: rust-binary-version.rs.png
---

A recent problem was to include the build version of a rust binary, so that `$ program --version` answers with the appropriate version number.

We'll look at various solutions.

## Starting with an empty example

Here is a snippet of such a program:

```rust
// bin/empty.rs
extern crate clap;
use clap::App;

fn main() {
    App::new("")
       .version("1.0")
       .get_matches();
}
```

in `Cargo.toml`, you'll need to add `clap = "*"` as a dependency. It's a popular crate that does Command Line Argument Parsing, you'll encounter it often if you write command line programs.

If you run this example, it'll output our hardcoded version:

```bash
$ cargo run --bin empty -- --version
 1.0
```

It's not very useful for now since it's static, but that's a start.

A note about the command syntax:

 - first we tell cargo that we want to run a binary (something in the `bin` directory) called empty : `cargo run --bin empty`
 - then we tell that we want to provide this program with arguments using `--`
 - then we provide the arguments, here `--version`

It's very similar as running `cargo build && ./target/debug/empty --version`.

## Using cargo built-in variables

Let's improve this program. A first way to do is it to use **cargo's built-in variables**:

```rust
// bin/cargopkg.rs
fn main() {
    App::new("")
       .version(env!("CARGO_PKG_VERSION"))
       .get_matches();
}
```

If we run this program, we have a version:

```bash
$ cargo run --bin cargopkg -- --version
 0.1.0
```

Where does this `0.1.0` come from ? `std::env!` is a macro that fetches the value of an environment variable during compile time. **`CARGO_PKG_VERSION` gives us the version number set in `Cargo.toml`**.

A few [other environment variables](https://doc.rust-lang.org/cargo/reference/environment-variables.html#environment-variables-cargo-sets-for-crates) are available.

If you go in this direction, **you'll need to update your version every time you make a release**. There are pros and cons to this approach.

## Using a build script

Another approach is to **use a build script**. There are many parts so it is a bit hard to grasp at first:

 - we'll **setup a build script, `build.rs`**, and specify it's a build script in `Cargo.toml`
 - **our build script will print something with [a specific syntax](https://doc.rust-lang.org/cargo/reference/build-scripts.html#outputs-of-the-build-script)**.
 - **the build scripts' output is used by Cargo as an input** so that we can feed infos to cargo

One of the things we can tell Cargo is "let's add a new environment variable, with the hash of the latest commit". Let's do that.

```toml
# Cargo.toml
[package]
# …
build = "build.rs"
```

Cargo only supports one build script per project at the moment, so everything we do will be available to all the binary (should they care to use it). Here is our `build.rs` script:

```rust
// build.rs
use std::process::Command;
fn main() {
    // taken from https://stackoverflow.com/questions/43753491/include-git-commit-hash-as-string-into-rust-program
    let output = Command::new("git")
        .args(&["rev-parse", "HEAD"])
        .output()
        .unwrap();
    let git_hash = String::from_utf8(output.stdout).unwrap();
    println!("cargo:rustc-env=GIT_HASH={}", git_hash);
}
```

So we write a program that fetches the last commit hash via `git rev-parse HEAD`. [git rev-parse](https://git-scm.com/docs/git-rev-parse) provides the SHA1 of a revision.

Now we can make use of the `GIT_HASH` environment variable in our main program:

```rust
// bin/gitcommit.rs
extern crate clap;
use clap::App;

fn main() {
    App::new("")
       .version(env!("GIT_HASH"))
       .get_matches();
}
```

Now, lets run this program:

```bash
$ cargo run --bin gitcommit -- --version
909d20fe5bf4cfc3ae784c78401455b42bdf02d2
```

This is the approach we went with for [`ds_proxy`](https://github.com/betagouv/ds_proxy/pull/20/files)

## Using a dedicated crate

Well, parsing the git output ourselves in order to feed it to a special cargo string can be a bit tedious. As often in the rust ecosystem, there is a crate for that. [vergen](https://github.com/rustyhorde/vergen) exposes [a bunch of environment variables](https://docs.rs/vergen/3.0.4/vergen/#generate-build-time-information), like the build date, the sha1 of the commit or the target architecture.

license: Unlicense


text:
koa-gzip
=======

[![Build Status](https://secure.travis-ci.org/node-modules/koa-gzip.png)](http://travis-ci.org/node-modules/koa-gzip)

[![Dependency Status](https://gemnasium.com/node-modules/koa-gzip.png)](https://gemnasium.com/node-modules/koa-gzip)

[![NPM](https://nodei.co/npm/koa-gzip.png?downloads=true&stars=true)](https://nodei.co/npm/koa-gzip/)

![logo](https://raw.github.com/node-modules/koa-gzip/master/logo.png)

`gzip` support for [koa](https://github.com/koajs/koa) responses.

## Install

```bash
$ npm install koa-gzip
```

## Usage

```js
var koa = require('koa');
var gzip = require('koa-gzip');

var app = koa();
koa.use(gzip());
```

### gzip always be the last middleware

If you using other response middlewares, like [etag](https://github.com/koajs/etag), just use `gzip` be the first.

```js
app.use(gzip());
app.use(fresh());
app.use(etag());

client => request => gzip() => fresh() => etag() => logic codes
                                                        ||
            client <= gzip() <= fresh() <= etag() <= response
```

## License

(The MIT License)

Copyright (c) 2014 fengmk2<EMAIL_ADDRESS>and other contributors

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


text:
# NVIDIA Container Runtime for Docker

[![GitHub license](https://img.shields.io/badge/license-New%20BSD-blue.svg?style=flat-square)](https://raw.githubusercontent.com/NVIDIA/nvidia-docker/master/LICENSE)
[![Documentation](https://img.shields.io/badge/documentation-wiki-blue.svg?style=flat-square)](https://github.com/NVIDIA/nvidia-docker/wiki)
[![Package repository](https://img.shields.io/badge/packages-repository-b956e8.svg?style=flat-square)](https://nvidia.github.io/nvidia-docker)

NVIDIA-GPU-Docker          |NVIDIA-Docker architecture
:-------------------------:|:-------------------------:
![](https://cloud.githubusercontent.com/assets/3028125/12213714/5b208976-b632-11e5-8406-38d379ec46aa.png)  |  ![](https://devblogs.nvidia.com/wp-content/uploads/2018/05/dgx-docker-768x728.png)

## 1. Introduction

The NVIDIA Container Toolkit allows users to build and run GPU accelerated Docker containers. The toolkit includes a container runtime [library](https://github.com/NVIDIA/libnvidia-container) and utilities to automatically configure containers to leverage NVIDIA GPUs. Full documentation and frequently asked questions are available on the [repository wiki](https://github.com/NVIDIA/nvidia-docker/wiki).

## 2. Quickstart

**Make sure you have installed the [NVIDIA driver](https://github.com/NVIDIA/nvidia-docker/wiki/Frequently-Asked-Questions#how-do-i-install-the-nvidia-driver) and a [supported version](https://github.com/NVIDIA/nvidia-docker/wiki/Frequently-Asked-Questions#which-docker-packages-are-supported) of [Docker](https://docs.docker.com/engine/installation/) for your distribution (see [prerequisites](https://github.com/NVIDIA/nvidia-docker/wiki/Installation-(version-2.0)#prerequisites)).**

**If you have a custom `/etc/docker/daemon.json`, the `nvidia-docker2` package might override it.**

#### Ubuntu 18.04 LTS

```sh
# If you have nvidia-docker 1.0 installed: we need to remove it and all existing GPU containers
docker volume ls -q -f driver=nvidia-docker | xargs -r -I{} -n1 docker ps -q -a -f volume={} | xargs -r docker rm -f
sudo apt-get purge -y nvidia-docker

# Add the package repositories
curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add -
distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | \
  sudo tee /etc/apt/sources.list.d/nvidia-docker.list
sudo apt update

# Install nvidia-docker2 and reload the Docker daemon configuration
sudo apt install -y nvidia-docker2
sudo pkill -SIGHUP dockerd

# Test nvidia-smi with the latest official CUDA image
docker run --runtime=nvidia --rm nvidia/cuda:9.0-base nvidia-smi
```

After updating to the NVIDIA Container Runtime for Docker, you can run GPU-accelerated containers in one of the following ways.

- Use `docker run` and specify `runtime=nvidia`

      docker run --runtime=nvidia ...

- Use `nvidia-docker run`

      nvidia-docker run ...

## 3. Default Runtime

The default runtime used by the Docker® Engine is [runc](https://github.com/opencontainers/runc), our runtime can become the default one by configuring the docker daemon with --default-runtime=nvidia. Doing so will remove the need to add the --runtime=nvidia argument to docker run. It is also the only way to have GPU access during docker build.

You can set `nvidia` as the default runtime, for example, by adding the following line to the `/etc/docker/daemon.json` configuration file as the first entry.

```
"default-runtime": "nvidia",
```

The following is an example of how the added line appears in the JSON file. Do not remove any pre-existing content when making this change.

```
{
 "default-runtime": "nvidia",
  "runtimes": {
     "nvidia": {
         "path": "/usr/bin/nvidia-container-runtime",
         "runtimeArgs": []
     }
 },

}
```

You can then use `docker run` to run GPU-accelerated containers.

```
docker run ...
```

## 4. Environment variables (OCI spec)

Each environment variable maps to an command-line argument for `nvidia-container-cli` from [libnvidia-container](https://github.com/NVIDIA/libnvidia-container).
These variables are already set in our [official CUDA images](https://hub.docker.com/r/nvidia/cuda/).

### `NVIDIA_VISIBLE_DEVICES`
This variable controls which GPUs will be made accessible inside the container.

#### Possible values
* `0,1,2`, `GPU-fef8089b` …: a comma-separated list of GPU UUID(s) or index(es).
* `all`: all GPUs will be accessible, this is the default value in our container images.
* `none`: no GPU will be accessible, but driver capabilities will be enabled.
* `void` or *empty* or *unset*: `nvidia-container-runtime` will have the same behavior as `runc`.

### `NVIDIA_DRIVER_CAPABILITIES`
This option controls which driver libraries/binaries will be mounted inside the container.

#### Possible values
* `compute,video`, `graphics,utility` …: a comma-separated list of driver features the container needs.
* `all`: enable all available driver capabilities.
* *empty* or *unset*: use default driver capability: `utility`.

#### Supported driver capabilities
* `compute`: required for CUDA and OpenCL applications.
* `compat32`: required for running 32-bit applications.
* `graphics`: required for running OpenGL and Vulkan applications.
* `utility`: required for using `nvidia-smi` and NVML.
* `video`: required for using the Video Codec SDK.
* `display`: required for leveraging X11 display.

### `NVIDIA_REQUIRE_*`
A logical expression to define constraints on the configurations supported by the container.

#### Supported constraints
* `cuda`: constraint on the CUDA driver version.
* `driver`: constraint on the driver version.
* `arch`: constraint on the compute architectures of the selected GPUs.
* `brand`: constraint on the brand of the selected GPUs (e.g. GeForce, Tesla, GRID).

#### Expressions
Multiple constraints can be expressed in a single environment variable: space-separated constraints are ORed, comma-separated constraints are ANDed.
Multiple environment variables of the form `NVIDIA_REQUIRE_*` are ANDed together.

### `NVIDIA_DISABLE_REQUIRE`
Single switch to disable all the constraints of the form `NVIDIA_REQUIRE_*`.

### `NVIDIA_REQUIRE_CUDA`

The version of the CUDA toolkit used by the container. It is an instance of the generic `NVIDIA_REQUIRE_*` case and it is set by official CUDA images.
If the version of the NVIDIA driver is insufficient to run this version of CUDA, the container will not be started.

#### Possible values
* `cuda>=7.5`, `cuda>=8.0`, `cuda>=9.0` …: any valid CUDA version in the form `major.minor`.

### `CUDA_VERSION`
Similar to `NVIDIA_REQUIRE_CUDA`, for legacy CUDA images.
In addition, if `NVIDIA_REQUIRE_CUDA` is not set, `NVIDIA_VISIBLE_DEVICES` and `NVIDIA_DRIVER_CAPABILITIES` will default to `all`.


text:
---
name: Content issue
about: Missing, invalid or outdated content
title: ''
labels: content
assignees: ''

---

**Where does the issue occur?**
Link to the file or location on the website where the issue occurs. Optionally add screenshots for context.

**Describe the issue**
A clear and concise description of what the issue is.

**Expected changes**
A clear and concise description of what you expected to change.

**Additional context**
Add any other context about the problem here.


text:
# Artifactory Resource

Concourse resource for triggering, getting and putting new versions of artifacts within Artifactory repositories.

## Config

Complete source configuration details can be viewed in GoDoc on the [Source struct](https://godoc.org/github.com/digitalocean/artifactory-resource#Source)

## Check

Checks use the `items` domain to `find` artifacts with the supplied raw [AQL](https://www.jfrog.com/confluence/display/JFROG/Artifactory+Query+Language) or repo, path & name combination. Each artifact found is
returned as its own unique version for Concourse with the `Repo`, `Path`, `Name` & `Modified` values from the Artifactory API. `Modified` is used to filter future checks to ensure that API queries stay
performant.

## Get

Get will download an artifact to the input directory defined along with metadata for the artifact. The artifact is downloaded following its internal Artifactory path, so the `resource/local-path` metadata file is useful
to provide the specific path within the input directory to the downloaded artifact. View GoDoc for [GetParameter options](https://godoc.org/github.com/digitalocean/artifactory-resource#GetParameters)

## Put

Put supports publishing 1 or more artifacts using glob style patterns to locate artifacts to publish. View GoDoc for [PutParameter options](https://godoc.org/github.com/digitalocean/artifactory-resource#PutParameters)

## Examples

Configure the resource type:

```yaml
resource_types:
- name: artifactory
  type: docker-image
  source:
    repository: digitalocean/artifactory-resource
    tag: latest
```

Source configuration using raw AQL for `item.find`:

```yaml
resources:
- name: myapplication
  type: artifactory
  icon: application-export
  source:
    endpoint: https://example.com/artifactory/
    user: ci
    password: ((artifactory.password))
    aql:
      raw: '{"repo": "artifacts-local", "path": {"$match" : "myapplication/*"}}'
```

Source configuration using repo, path, name:

```yaml
resources:
- name: myapplication
  type: artifactory
  icon: application-export
  source:
    endpoint: https://example.com/artifactory/
    user: ci
    password: ((artifactory.password))
    aql:
      repo: artifacts-local
      path: myapplication/*
      name: '*'
```

Publishing artifacts to Artifactory:

```yaml
- put: myapplication
  params:
    repo_path: code
    pattern: built/myapplication/(*)
    target: artifacts-local/myapplication/{1}
```


text:
# Polystictus persoonii (Mont.) Cooke, 1886 SPECIES

#### Status
SYNONYM

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

#### Published in
Grevillea 14(no. 71): 85 (1886)

#### Original name
Polyporus persoonii Mont., 1834

### Remarks
null

repository: mdoering/backbone

path: /life/Fungi/Basidiomycota/Agaricomycetes/Polyporales/Polyporaceae/Earliella/Earliella scabrosa/ Syn. Polystictus persoonii/README.md

repo_name: mdoering/backbone


text:
How To Fix “The Update Information Is Outdated” In Ubuntu 14.04
================================================================================
![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/Fix_update_information_is_outdated.jpeg)

Seeing a red triangle in top panel in Ubuntu 14.04 that displays the following error?

> The update information is outdated. This may be caused by network problems or by a repository that is no longer available. Please update manually by selecting ‘Show updates’ from indicator menu, and watching for any failing repositories.

It looks something like this:

![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/Update_error_Ubuntu.jpeg)

Instead of red triangle, there is a pink exclamation sign because I am using one of the [best Ubuntu icon themes][1], Numix. Coming back to the error, this is a common update problem which you might see every now and then. Now you might be wondering what is causing this update error.

### Reason for ‘update information is outdated’ error ###

The reason is pretty explanatory in the error description itself. It reads “this may be caused by network problems or by a repository that is no longer available”. So, either you upgraded your system and some repository or PPA is no longer supported or you are facing some similar issue.

While the error is self-explanatory, the action it suggests, “Please update manually by selecting ‘Show updates’ from the indicator menu, and watching for any failing repositories.”, doesn’t work properly. If you click on Show updates, all you’ll see is that the system is already updated.

![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/System_updated_Ubuntu.png)

Weird isn’t it? How will we find out what is failing where and why?

### Fix ‘update information is outdated’ ###

The ‘solution’ discussed here will work for Ubuntu versions be it Ubuntu 14.04, 12.04 or 14.04. All you need to do is to open a terminal (Ctrl+Alt+T) and use the following command:

    sudo apt-get update

Wait for the command to finish and look at the result. Quick tip to add here, you can [add notifications in terminal][2] so that you are notified as soon as a long command finishes execution. In the last few lines at the end of the command, see what kind of error your system is facing.  Yes, you’ll see an error for sure.

In my case, I saw the famous [GPG error: The following could not be verified][3] error. Apparently there is some problem with [Spotify installation in Ubuntu 15.04][4].

![](http://itsfoss.itsfoss.netdna-cdn.com/wp-content/uploads/2015/07/Update_error_Ubuntu_1.jpeg)

It is very much possible that you might see a different error instead of the GPG error like me. In that case, I suggest you to go through this article which I wrote to [fix various common update errors in Ubuntu][5].

I know few people, specially beginners have strong aversion to command line but if you are using Linux, you simply cannot avoid terminal. Moreover, it is not that scary a thing. Give it a try, you will feel accustomed to it soon enough.

I hope this quick tip helped you to fix the recurring “update information is outdated” in Ubuntu. Any questions or suggestions is welcomed.

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

via: http://itsfoss.com/fix-update-information-outdated-ubuntu/

作者：[Abhishek][a]
译者：[译者ID](https://github.com/译者ID)
校对：[校对者ID](https://github.com/校对者ID)

本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译，[Linux中国](https://linux.cn/) 荣誉推出

[a]:http://itsfoss.com/author/abhishek/
[1]:http://itsfoss.com/best-icon-themes-ubuntu-1404/
[2]:http://itsfoss.com/notification-terminal-command-completion-ubuntu/
[3]:http://itsfoss.com/solve-gpg-error-signatures-verified-ubuntu/
[4]:http://itsfoss.com/install-spotify-ubuntu-1504/
[5]:http://itsfoss.com/fix-update-errors-ubuntu-1404/

url: https://raw.githubusercontent.com/kennethlyn/TranslateProject/6da6272b421c005d1458df87ea8c23f4b42b4d3e/sources/tech/20150722 How To Fix 'The Update Information Is Outdated' In Ubuntu 14.04.md

repository: kennethlyn/TranslateProject

repo_name: kennethlyn/TranslateProject


text:
# Memory Management in Cocoa and Cocoa Touch
##  MRC and ARC

Mobile Applications for iPhone and iPad

Telerik Software Academy

  http://academy.telerik.com

# Table of Contents

- Ways of Memory Management in Obj-C
  - Garbage Collection (deprecated)
  - Manual Reference Counting (MRC)
  - Automatic Reference Counting (ARC)

# Memory Management Overview

- Memory management is the process of managing computer memory
  - Unused objects are removed from memory
    - Or are deallocated
  - Used objects are kept in memory to prevent error to too-early-deallocated objects
  - This should be done efficiently, since allocating/deallocating memory is costly process

# Ways of Memory Management

- The Foundation and Cocoa frameworks support the following for memory management
  - Garbage Collection
    - The system automatically decides whether an object should be kept or removed from memory
    - **Deprecated**
  - Manual Reference Counting
    - The developer manually states if an object should be kept or removed from memory
  - Automatic Memory Management
    - The developer marks the objects to be kept
    - **Preffered**

#   Garbage Collection

- Memory management is a form of automatic memory management
  - The garbage collector iterates over the memory from time to time and reclaims blocks of memory, that are no longer used by the program
    - Used in Java and .NET platforms
      - Java Virtual Machine (JVM)
      - Common Language Runtime (CLR)
    - Deprecated in MAC OS X

#   Reference Counting
#   Manual and Automatic

# Reference Counting

- Reference counting is the technique of storing the count of references of an object
  - While the count is positive (1 or more), the object is kept in memory
  - If the count becomes 0, the object is deallocated from memory
- The Cocoa Framework support two types of Reference Counting
  - **Manual Reference Counting**
  - **Automatic Reference Counting**

# Manual Reference Counting

- In MRC the developer should keep the count of needed objects positive
  - And set the count to 0, when an object is no longer used
  - Done by sending `release` or `retain` messages to the object in use
    - `retain` increments the count by 1
    - `release` decrements the count by 1
  - When the count becomes equal to 0, a `dealloc` message is sent to the object

# Manulat Reference Counting

- _Example:_ allocate and deallocate an object

  - Superhero implementation:

  ```objectivec
  @interface Superhero
  //…
  -(NSString *)usePower:(NSString *)power {
    if(![self.powers containsObject:power]){
        return [NSString stringWithFormat:@"%@ cannot use %@", self.name, power];
    }
    return [NSString stringWithFormat:@"%@ is using %@", self.name, power];
  }
  //..
  @end
  ```

  - Using a `Superhero` object:

  ```objectivec
  int main() {
    Superhero *supergirl = [[[Superhero alloc] initWithName: @"Supergirl"
                                                  andPowers: @"Super strength", @"Flying", nil]]
                            retain];
    NSLog(@"%@", [supergirl usePower: @"Flying"]);
    [supergirl release];
    return 0;
  }
  ```

# Manual Reference Counting
##  [Demo](http://)

# Automatic Reference Counting
##  Like MRC, but easier

# Automatic Reference Counting

- ARC uses only two ways to control the memory:
  - `strong` (default)
    - Keep a reference to the object
    - Take ownership of the object
  - `weak`
    - Keep a reference to the object
    - Does not take ownership of the object

# Automatic Reference Counting
##  [Demo](http://)

# Memory Management in Cocoa
## Questions

repository: iliangogov/Mobile-Applications-for-iOS

path: /04. Memory-management/slides/README.md

gha_language: Objective-C

repo_name: iliangogov/Mobile-Applications-for-iOS


text:
# Generic Range

[![NuGet](https://img.shields.io/nuget/v/GenericRange)](https://www.nuget.org/packages/GenericRange/)
[![AppVeyor](https://ci.appveyor.com/api/projects/status/dynvdf82fvjsja7u?svg=true)](https://ci.appveyor.com/project/ProphetLamb/genericrange)
[![CodeCov](https://codecov.io/gh/ProphetLamb/GenericRange/branch/main/graph/badge.svg?token=2fsNMR53v5)](https://codecov.io/gh/ProphetLamb/GenericRange)

## Motivation

In multiple projects I've missed `Range` implementations for `Enum`s and especially `TimeSpan`s, but couldn't quite find anything that works.
So instead of multiple implementation of the same thing, but with a different underlying `Type` this project attempts to provide a API similar to the existing, but with whatever primitive the user desires.

## Features

This project provides a generic implementation of `System.Range` and `System.Index` constraint to primitive Types (such as `int`, `char`, and `double`), as well as `Enum`, and `TimeSpan`.

### Supported Types

**Primitives**

Integer | Floating-point
--- | ---
`sbyte` | `float`
`byte` | `double`
`short` | `decimal`
`ushort` |
`int` |
`uint` |
`long` |
`ulong` |

**Others**

Type | Comment
--- | ---
`TimeSpan` | Handled as `long` by `TimeSpan.Ticks`
`Enum` | Arithmetic based on underlying type.

## Getting started

Install the [NuGet package](https://www.nuget.org/packages/GenericRange/)

```ps
dotnet add package GenericRange
```

---

## `System.Range` compatibility

`System.Range` and `System.Index` can be explicitly cast to `Range<T>`.

```csharp
Range range = 0..^1;
Range<long> longRange = (Range<long>)range;
```

This is only possible for `IConvertible` primitives, but not for `TimeSpan`, and `Enum` types.

```csharp
Range range = 0..^1;
Range<Foo> fooRange = (Range<Foo>)range; // Throws InvalidCastException
Range<TimeSpan> timeRange = (Range<TimeSpan>)range; // Throws InvalidCastException
```

In order to obtain a `System.Range` from a `Range<T>` the `ToRange<T>()` function can be used.

```csharp
Range<int> intRange = new(2, true, 1, true); // ^2..^1
Range range = intRange.ToRange();
```

Analogous to the `System.Range` -> `Range<T>` cast this only work for `IConvertible` primitives.

```csharp
Range<Foo> fooRange = (Foo.One, Foo.Eight); // Implicit cast from ValueTuple<T,T> to Range<T>
Range range = fooRange.ToRange(); // Throws InvalidCastException
```

## `Index<T>.IsFromEnd`

To obtain the absolute index - the so called offset - from an `Index<T>` or `Range<T>` the `GetOffset()` and `GetLengthAndOffset()` methods can be used.

```csharp
Range<double> doubleRange = new(12.04, 4, true); // 12.04..^4
double startOffset = doubleRange.Start.GetOffset(100.0); // = 12.04
(double offset, double length) = doubleRange.GetOffsetAndLength(100.0); // = (12.04, 96)
```

## Fancy `Range<Enum>.Mask`

Computes a bitmask (`long`) form the `Range<Enum>`.

```csharp
Range<Foo> rangeAll = new(Foo.None, Foo.None, true);

Foo mask = (Foo)rangeAll.Mask(Foo.Eight);

Assert.AreEqual(Foo.All, mask);
```

This example uses the following `Enum`.

```csharp
public enum Foo : byte
{
    None = 0,
    One = 1,
    Two = 2,
    Three = 4,
    Four = 8,
    Five = 16,
    Six = 32,
    Seven = 64,
    Eight = 128,
    All = 255
}
```

In this enum the bit-flag with the highest bit is `Foo.Eight`, but the highest value is `Foo.All`. That mean that if we call `Mask` without a maximum of `Foo.Eight` the `maximum` wont be a bit-flag, but instead the bit-mask `Foo.All` which will break the algorithm.
I could workaround this by masking the highest bit and thus filtering all masks from flags, but that would create a whole lot of different problems.

For all `Enums` that are **not exclusively bit-flags use the `maximum` overload** to ensure the function returns the correct result.

## `!Index<T>.IsFromEnd` overloads

Almost all methods have an overload omitting the `length` argument required to resolve a index that `IsFromEnd`. Such methods `Debug.Assert` that all indices are `!IsFromEnd`.
For most cases wether an index `IsFromEnd` is determined at compile-time, thats how I justify `Assert`ing instead of `throw`ing.
In any edge cases; its generally safer to pick the overload with length.

## For a more detained documentation

Read the [auto-generated](https://github.com/lijunle/Vsxmd) doc file [here](./src/GenericRange.md).

repository: ProphetLamb/GenericRange

repo_name: ProphetLamb/GenericRange


text:
# FusionExport C# Client

Language SDK for FusionExport which enables exporting of charts & dashboards through C#.

## Prerequisites

.NET Framework version >= 4.0

## Installation

You can install the SDK using the `NuGet` package manager. To install, open the NuGet package manager console and run the following command:

```sh
$ Install-Package FusionExport -Version 1.0.0-rc0
```

## Getting Started

After installing the SDK in your `.NET` project, create a new file named `chart-config.json`,
which will contain the chart configurations to be exported. Before exporting your chart, make sure the export server is running.

The `chart-config.json` file:

```json
[
  {
    "type": "column2d",
    "renderAt": "chart-container",
    "width": "600",
    "height": "200",
    "dataFormat": "json",
    "dataSource": {
      "chart": {
        "caption": "Number of visitors last week",
        "subCaption": "Bakersfield Central vs Los Angeles Topanga"
      },
      "data": [
        {
          "label": "Mon",
          "value": "15123"
        },
        {
          "label": "Tue",
          "value": "14233"
        },
        {
          "label": "Wed",
          "value": "25507"
        }
      ]
    }
  }
]
```

Now import the SDK library into your project and write the export logic in your project as given below:

```csharp
using System;
using System.IO;
using System.Linq;
using FusionCharts.FusionExport.Client; // Import sdk

namespace FusionExportTest
{
    public static class ExportSingleChart
    {
        public static void Run(string host = Constants.DEFAULT_HOST, int port = Constants.DEFAULT_PORT)
        {
            // Instantiate the ExportConfig class and add the required configurations
            ExportConfig exportConfig = new ExportConfig();
            exportConfig.Set("chartConfig", File.ReadAllText("fullpath/of/chart-config-file.json"));

            // Instantiate the ExportManager class
            ExportManager em = new ExportManager(host: host, port: port);
            // Call the Export() method with the export config and the respective callbacks
            em.Export(exportConfig, OnExportDone, OnExportStateChanged);
        }

        // Called when export is done
        static void OnExportDone(ExportEvent ev, ExportException error)
        {
            if (error != null)
            {
                Console.WriteLine("Error: " + error);
            }
            else
            {
                var fileNames = ExportManager.GetExportedFileNames(ev.exportedFiles);
                Console.WriteLine("Done: " + String.Join(", ", fileNames)); // export result
            }
        }

        // Called on each export state change
        static void OnExportStateChanged(ExportEvent ev)
        {
            Console.WriteLine("State: " + ev.state.customMsg);
        }
    }
}
```

Finally, run your .NET app. The exported chart will be received when the `ExportDone` event is triggered .

## API Reference

You can find the full reference [here](https://www.fusioncharts.com/dev/exporting-charts/using-fusionexport/sdk-api-reference/c-sharp.html)

repository: fusioncharts/fusionexport-csharp-client

branch_name: refs/heads/develop

gha_language: C#

repo_name: fusioncharts/fusionexport-csharp-client


text:
---
layout: post
title: To quote "The Cycle of Time"...
date: '2015-03-18 06:59:00'
---

I've tried blogging before, but my output was never what I would call "prolific" -- after an initial burst of enthusiasm, updates dropped to somewhere between "rare" and "never."

> All this has happened before, and all this will happen again.

However as I finish my [education](http://www.cs.odu.edu/), I find myself more frequently feeling the urge to document things that I'm doing. Case in point: I'm regularly (more often than Windows even) using Linux again.

As I've re-mastered the world of command line terminals and text config files, I've had a number of "fun" experiences troubleshooting (and sometimes brute forcing) my way through problems. Linux was always my preferred development platform, and while coming back has illustrated how it has grown in some fantastic and noteworthy directions, Linux remains frustratingly unchanged in many other ways.

I've had similar adventures setting up and configuring integrated development environments and learning new tools for software development and debugging. How I both love and loathe Eclipse! I'm also frequently distracted by little side projects ([RetroPie](http://blog.petrockblock.com/retropie/)!) that would be fun to write about. And then of course there's my neverending geek lust over new technology and gadgets. Lastly, I have to acknowledge that my [daughter](https://www.youtube.com/watch?v=CNBhvAlX9rI) will probably creep her way into some posts... she just does too much cute stuff to *not* talk about!

So all these things to write about. I haven't queued up a backlog of posts to try and jump start this thing, but I have these (and a number of other) ideas jotted down in [Google Keep](https://keep.google.com/). Although -- since I've actually got the webhost up and running (and [Ghost](https://ghost.org/) is pretty nifty) -- I could actually just dump my list into new post titles and then fill in the bodies with content later... I'll have to think about that.

So, hooray new endeavors!

*Note: I did not build the very impressive BSG Lego model above. Go check out its [creator](http://www.mocpages.com/folder.php/87793)!*

And I'll leave you with this:
<iframe width="560" height="315" src="https://www.youtube.com/embed/6bOy3RNyWME" frameborder="0" allowfullscreen></iframe>

extension: markdown


text:
---
# Course title, summary, and position.
linktitle: 4. Client Integration
weight: 40

# Page metadata.
title: DRM Client Integration
date: "2018-09-09T00:00:00Z"
lastmod: "2018-09-09T00:00:00Z"
draft: false  # Is this a draft? true/false
toc: false  # Show table of contents? true/false
type: book  # Do not modify.

# Add menu entry to sidebar.
# - name: Declare this menu item as a parent with ID `name`.
# - weight: Position of link in menu.
menu:
  multidrm:
    parent: Multi-DRM
    name: Client Integration
    weight: 40
---

PallyCon Multi DRM service provides integration APIs and SDKs to support various client environment such as PC, mobile, OTT platform. The following documents describe how to use each client-specific SDK.

HTML5 Player Integration

Customers can use any of a variety of HTML5 player products for their web browser support. This document explains how to play streaming content (DASH or HLS) protected with multi-DRM (PlayReady, Widevine, FairPlay Streaming) using the HTML5 player from the web page of the service site.

        Read More

Multi-DRM Native Integration Guide

Customers have an option to integrate PallyCon multi-DRM with native DRM client on their own, without using PallyCon client SDKs. This document explains how to integrate multi-DRM license issuance without the SDKs.

        Read More

Widevine Android SDK Guide

PallyCon Widevine Android SDK makes it easy to apply Google's Widevine Modular DRM when developing media service apps for Android. This document describes how to use the libraries and sample project included in the SDK.

        Read More

FairPlay iOS SDK Guide

PallyCon FairPlay iOS SDK makes it easy to apply Apple's FairPlay Streaming DRM when developing media service apps for iOS. This document describes how to use the libraries and sample projects included in the SDK.

        Read More

PlayReady UWP SDK Guide

PallyCon PlayReady UWP SDK makes it easy to apply Microsoft’s PlayReady DRM when developing media service apps for Universal Windows Platform (UWP). This document describes how to use the libraries and sample projects included in the SDK.

        Read More

NCG Android SDK Guide

PallyCon NCG Android SDK makes it easy to apply INKA’s NCG(Netsync Content Guard) DRM when developing media service apps for Android. This document describes how to use the libraries and sample project included in the SDK.

        Read More

NCG iOS SDK Guide

PallyCon NCG iOS SDK makes it easy to apply INKA’s NCG(Netsync Content Guard) DRM when developing media service apps for iOS. This document describes how to use the libraries and sample project included in the SDK.

        Read More

Widevine AndroidTV SDK Guide

PallyCon Widevine Android TV SDK makes it easy to apply Google’s Widevine Modular DRM when developing media service apps for Android TV platform. This document describes how to use the libraries and sample project included in the SDK.

        Read More

Chromecast Integration Guide

This document describes how to integrate Chrome Cast with the FairPlay iOS SDK and Widevine Android SDK.

        Read More


text:
---
layout: page
title: Links
category: Links
permalink: /links/
---

* [me](http://mpmendespt.github.io/)
* [Anti-Spyware, Anti-Adware, Anti-Rootkits, Anti-Vírus](http://mpmendespt.esy.es/)
* [MPM Electrónica](http://mpmendes-electronica.blogspot.pt/)
* [Destaques…”Recortes”…Arquivo…](http://mpmendespt.blogspot.pt/)
* [Trading Ideas](http://mpmendespt-trading.blogspot.pt/)
* [Apontamentos Virtuais](http://apontamentos-virtuais.blogspot.pt/)
* * *
* [A Very Short History Of Data Science](http://www.forbes.com/sites/gilpress/2013/05/28/a-very-short-history-of-data-science/)
* * *
* [16 Free Data Science Books](http://www.wzchen.com/data-science-books)
* [How can I become a data scientist?](http://www.quora.com/How-can-I-become-a-data-scientist?redirected_qid=59455)
* * *
* [R-bloggers](http://www.r-bloggers.com/)
* [Freakonometrics ... An Open Lab-Notebook Experiment](http://freakonometrics.hypotheses.org/)
* [Blog with RStudio, R, RMarkdown, Jekyll and Github](http://andysouth.github.io/blog-setup/)
* [Setting up Jekyll (Part I) – including Flattr integration, comments etc.](http://michael-kuehnel.de/jekyll/2014/09/07/jekyll-github.html)
* [How I Created a Beautiful and Minimal Blog Using Jekyll, Github Pages](http://joshualande.com/jekyll-github-pages-poole/)
* [Blogging About R Code with R Markdown, Knitr, and Jekyll](http://nicolewhite.github.io/2015/02/07/r-blogging-with-rmarkdown-knitr-jekyll.html)
* [Maps in R: Plotting data points on a map](http://www.milanor.net/blog/?p=594)
* [Add Disqus Comments to Your Jekyll Powered Blog](http://schmidt-happens.com/articles/2011/09/26/adding-disqus-comments.html)
* [Jpegtran -scale lossless resize](http://jpegclub.org/jpegtran/)
* * *
* [R e RStudio | Análise Real](http://analisereal.com/2015/01/20/r-e-rstudio-2/)
* [RPubs - Análise de Dados com R](http://rpubs.com/adriano/esalq2012inicial)
* * *
* [Free Online Data Science Resources](http://www.semantikoz.com/blog/9-free-online-data-science-courses/)
* [CS276: Information Retrieval and Web Search](http://web.stanford.edu/class/cs276/)
* [GivenTheData: R and the web (for beginners)](http://giventhedata.blogspot.pt/2012/08/r-and-web-for-beginners-part-iii.html)
* [CS109 Data Science](http://cs109.github.io/2014/)
* [Policy functions and value functions under multiple uncertainty](http://www.carlboettiger.info/2012/06/13/Sethi-policy-functions.html)
* [Introducing the streamR package](http://pablobarbera.com/blog/archives/1.html)
* * *
* [PH525x series - Biomedical Data Science](http://genomicsclass.github.io/book/)
* * *
* [LaTeX Cookbook](http://www.personal.ceu.hu/tex/cookbook.html)
* [TEX Commands available in MathJax](http://www.onemathematicalcat.org/MathJaxDocumentation/TeXSyntax.htm)
* [Image Analysis Presentation](https://github.com/tleonardi/image_analysis_in_R/blob/master/presentation/image_analysis_presentation.md)
* [R Presentation](https://rstudio-pubs-static.s3.amazonaws.com/57625_d84d0f0cd9f9490cb2b0e48a4c5f2bf9.html)
* [Image Processing Algorithms](http://nir.bendvora.com/Work/ImageProc/index.html)
* * *
* [DataPyR](https://datapyr.zeef.com/kranthi.kumar)

gha_language: HTML


text:
# Rhizophydium mastigotrichis (Nowak.) J. Schröt., 1886 SPECIES

#### Status
SYNONYM

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

#### Published in
null

#### Original name
Chytridium mastigotrichis Nowak., 1876

### Remarks
null


text:
<properties
	pageTitle="Get started with authentication (Android) | Microsoft Azure"
	description="Learn how to use Mobile Services to authenticate users of your Windows Store app through a variety of identity providers, including Google, Facebook, Twitter, and Microsoft."
	services="mobile-services"
	documentationCenter="android"
	authors="RickSaling"
	manager="erikre"
	editor=""/>

<tags
	ms.service="mobile-services"
	ms.workload="mobile"
	ms.tgt_pltfrm="mobile-android"
	ms.devlang="java"
	ms.topic="article"
	ms.date="07/21/2016"
	ms.author="ricksal"/>

# Add authentication to your Mobile Services Android app

> [AZURE.SELECTOR-LIST (Platform | Backend )]
- [(iOS | .NET)](mobile-services-dotnet-backend-ios-get-started-users.md)
- [(iOS | JavaScript)](mobile-services-ios-get-started-users.md)
- [(Windows Runtime 8.1 universal C# | .NET)](mobile-services-dotnet-backend-windows-universal-dotnet-get-started-users.md)
- [(Windows Runtime 8.1 universal C# | Javascript)](mobile-services-javascript-backend-windows-universal-dotnet-get-started-users.md)
- [(Windows Phone Silverlight 8.x | Javascript)](mobile-services-windows-phone-get-started-users.md)
- [(Android | Javascript)](mobile-services-android-get-started-users.md)
- [(Xamarin.iOS | .NET)](mobile-services-dotnet-backend-xamarin-ios-get-started-users.md)
- [(Xamarin.iOS | Javascript)](partner-xamarin-mobile-services-ios-get-started-users.md)
- [(Xamarin.Android | .NET)](mobile-services-dotnet-backend-xamarin-android-get-started-users.md)
- [(Xamarin.Android | Javascript)](partner-xamarin-mobile-services-android-get-started-users.md)
- [(HTML | Javascript)](mobile-services-html-get-started-users.md)

>[AZURE.WARNING] This is an **Azure Mobile Services** topic.  This service has been superseded by Azure App Service Mobile Apps and is scheduled for removal from Azure.  We recommend using Azure Mobile Apps for all new mobile backend deployments.  Read [this announcement](https://azure.microsoft.com/blog/transition-of-azure-mobile-services/) to learn more about the pending deprecation of this service.
>
> Learn about [migrating your site to Azure App Service](https://azure.microsoft.com/en-us/documentation/articles/app-service-mobile-migrating-from-mobile-services/).
>
> Get started with Azure Mobile Apps, see the [Azure Mobile Apps documentation center](https://azure.microsoft.com/documentation/learning-paths/appservice-mobileapps/).

## Summary

This topic shows you how to authenticate users in Azure Mobile Services from your app. In this tutorial, you add authentication to the quickstart project using an identity provider that is supported by Mobile Services. After being successfully authenticated and authorized by Mobile Services, the user ID value is displayed.

This tutorial walks you through the basic steps to enable authentication in your app.

## Prerequisites

This tutorial is based on the code you download in the Mobile Services quickstart. Before you start this tutorial, you must first complete either [Get started with Mobile Services] or [Add Mobile Services to an existing app].

> [AZURE.IMPORTANT] If you completed the quickstart tutorial prior to the release of Azure Mobile Services Android SDK 2.0, you must re-do it, because the SDK is not backwards compatible. To verify the version, check the **dependencies** section of your project's **build.gradle** file.

## Register your app for authentication and configure Mobile Services

1. In the [Azure classic portal](https://manage.windowsazure.com/), click **Mobile Services** > your mobile service > **Dashboard**, and make a note of the **Mobile Service URL** value.

2. Register your app with one or more of the following authentication providers:
   * [Google](./
mobile-services-how-to-register-google-authentication.md)
   * [Facebook](./
mobile-services-how-to-register-facebook-authentication.md)
   * [Twitter](./
mobile-services-how-to-register-twitter-authentication.md)
   * [Microsoft](./
mobile-services-how-to-register-microsoft-authentication.md)
   * [Azure Active Directory](./
mobile-services-how-to-register-active-directory-authentication.md).

    Make a note of the client identity and client secret values generated by the provider. Do not distribute or share the client secret.

3. Back in the [Azure classic portal](https://manage.windowsazure.com/), click **Mobile Services** > your mobile service > **Identity** > your identity provider settings, then enter the client ID and secret value from your provider.

You've now configured both your app and your mobile service to work with your auth provider. You may optionally repeat all these steps for each additional identity provider you'd like to support.

> [AZURE.IMPORTANT] Verify that you've set the correct redirect URI on your identity provider's developer site. As described in the linked instructions for each provider above, the redirect URI may be different for a .NET backend service vs. for a JavaScript backend service. An incorrectly configured redirect URI may result in the login screen not being displayed properly and the app malfunctioning in unexpected ways.

### (Optional) Configure your .NET Mobile Service for Azure Active Directory

>[AZURE.NOTE] These steps are optional because they only apply to the Azure Active Directory login provider.

1. Install the [WindowsAzure.MobileServices.Backend.Security NuGet package](https://www.nuget.org/packages/WindowsAzure.MobileServices.Backend.Security).

2. In Visual Studio expand App_Start and open WebApiConfig.cs. Add the following `using` statement at the top:

        using Microsoft.WindowsAzure.Mobile.Service.Security.Providers;

3. Also in WebApiConfig.cs, add the following code to the `Register` method, immediately after `options` is instantiated:

        options.LoginProviders.Remove(typeof(AzureActiveDirectoryLoginProvider));
        options.LoginProviders.Add(typeof(AzureActiveDirectoryExtendedLoginProvider));

## Restrict permissions to authenticated users

By default, all requests to mobile service resources are restricted to clients that present the application key, which does not strictly secure access to resources. To secure your resources, you must restrict access to only authenticated clients.

1. In Visual Studio, open your mobile service project, expand the Controllers folder, and open **TodoItemController.cs**. The **TodoItemController** class implements data access for the TodoItem table. Add the following `using` statement:

		using Microsoft.WindowsAzure.Mobile.Service.Security;

2. Apply the following _AuthorizeLevel_ attribute to the **TodoItemController** class.

		[AuthorizeLevel(AuthorizationLevel.User)]

	This makes sure that all operations against the _TodoItem_ table require an authenticated user. You can also apply the *AuthorizeLevel* attribute at the method level.

3. (Optional) If you wish to debug authentication locally, expand the `App_Start` folder, open **WebApiConfig.cs**, and add the following code to the **Register** method.

		config.SetIsHosted(true);

	This tells the local mobile service project to run as if it is being hosted in Azure, including honoring the *AuthorizeLevel* settings. Without this setting, all HTTP requests to localhost are permitted without authentication despite the *AuthorizeLevel* setting. When you enable self-hosted mode, you also need to set a value for the local application key.

4. (Optional) In the web.config project file, set a string value for the `MS_ApplicationKey` app setting.

	This is the password that you use (with no username) to test the API help pages when you run the service locally.  This string value is not used by the live site in Azure, and you do not need to use the actual application key; any valid string value will work.

4. Republish your project.

3. Open the project that you created when you completed the tutorial [Get started with Mobile Services].

4. From the **Run** menu, then click **Run app** to start the app; verify that an unhandled exception with a status code of 401 (Unauthorized) is raised after the app starts.

	 This happens because the app attempts to access Mobile Services as an unauthenticated user, but the _TodoItem_ table now requires authentication.

Next, you will update the app to authenticate users before requesting resources from the mobile service.

## Add authentication to the app

1. In **Project Explorer** in Android Studio, open the ToDoActivity.java file and add the following import statements.

		import java.util.concurrent.ExecutionException;
		import java.util.concurrent.atomic.AtomicBoolean;

		import android.content.Context;
		import android.content.SharedPreferences;
		import android.content.SharedPreferences.Editor;

		import com.microsoft.windowsazure.mobileservices.authentication.MobileServiceAuthenticationProvider;
		import com.microsoft.windowsazure.mobileservices.authentication.MobileServiceUser;

2. Add the following method to the **ToDoActivity** class:

		private void authenticate() {
		    // Login using the Google provider.

			ListenableFuture<MobileServiceUser> mLogin = mClient.login(MobileServiceAuthenticationProvider.Google);

	    	Futures.addCallback(mLogin, new FutureCallback<MobileServiceUser>() {
	    		@Override
	    		public void onFailure(Throwable exc) {
	    			createAndShowDialog((Exception) exc, "Error");
	    		}
	    		@Override
	    		public void onSuccess(MobileServiceUser user) {
	    			createAndShowDialog(String.format(
	                        "You are now logged in - %1$2s",
	                        user.getUserId()), "Success");
	    			createTable();
	    		}
	    	});
		}

	This creates a new method to handle the authentication process. The user is authenticated by using a Google login. A dialog is displayed which displays the ID of the authenticated user. You cannot proceed without a positive authentication.

    > [AZURE.NOTE] If you are using an identity provider other than Google, change the value passed to the **login** method above to one of the following: _MicrosoftAccount_, _Facebook_, _Twitter_, or _windowsazureactivedirectory_.

3. In the **onCreate** method, add the following line of code after the code that instantiates the `MobileServiceClient` object.

		authenticate();

	This call starts the authentication process.

4. Move the remaining code after `authenticate();` in the **onCreate** method to a new **createTable** method, which looks like this:

		private void createTable() {

			// Get the table instance to use.
			mToDoTable = mClient.getTable(ToDoItem.class);

			mTextNewToDo = (EditText) findViewById(R.id.textNewToDo);

			// Create an adapter to bind the items with the view.
			mAdapter = new ToDoItemAdapter(this, R.layout.row_list_to_do);
			ListView listViewToDo = (ListView) findViewById(R.id.listViewToDo);
			listViewToDo.setAdapter(mAdapter);

			// Load the items from Azure.
			refreshItemsFromTable();
		}

9. From the **Run** menu, then click **Run app** to start the app and sign in with your chosen identity provider.

   	When you are successfully logged-in, the app should run without errors, and you should be able to query the backend service and make updates to data.

## Cache authentication tokens on the client

The previous example showed a standard sign-in, which requires the client to contact both the identity provider and the backend Azure service every time that the app starts. Not only is this method inefficient, you can run into usage-related issues should many customers try to start you app at the same time. A better approach is to cache the authorization token returned by the Azure service and try to use this first before using a provider-based sign-in.

>[AZURE.NOTE]You can cache the token issued by the backend Azure service regardless of whether you are using client-managed or service-managed authentication. This tutorial uses service-managed authentication.

1. Open the ToDoActivity.java file and add the following import statements:

        import android.content.Context;
        import android.content.SharedPreferences;
        import android.content.SharedPreferences.Editor;

2. Add the the following members to the `ToDoActivity` class.

    	public static final String SHAREDPREFFILE = "temp";
	    public static final String USERIDPREF = "uid";
    	public static final String TOKENPREF = "tkn";

3. In the ToDoActivity.java file, add the the following definition for the `cacheUserToken` method.

    	private void cacheUserToken(MobileServiceUser user)
	    {
    		SharedPreferences prefs = getSharedPreferences(SHAREDPREFFILE, Context.MODE_PRIVATE);
    	    Editor editor = prefs.edit();
	        editor.putString(USERIDPREF, user.getUserId());
    	    editor.putString(TOKENPREF, user.getAuthenticationToken());
	        editor.commit();
    	}

    This method stores the user id and token in a preference file that is marked private. This should protect access to the cache so that other apps on the device do not have access to the token because the preference is sandboxed for the app. However, if someone gains access to the device, it is possible that they may gain access to the token cache through other means.

    >[AZURE.NOTE]You can further protect the token with encryption if token access to your data is considered highly sensitive and someone may gain access to the device. However, a completely secure solution is beyond the scope of this tutorial and dependent on your security requirements.

4. In the ToDoActivity.java file, add the the following definition for the `loadUserTokenCache` method.

    	private boolean loadUserTokenCache(MobileServiceClient client)
	    {
	        SharedPreferences prefs = getSharedPreferences(SHAREDPREFFILE, Context.MODE_PRIVATE);
    	    String userId = prefs.getString(USERIDPREF, null);
	        if (userId == null)
	            return false;
    	    String token = prefs.getString(TOKENPREF, null);
    	    if (token == null)
    	        return false;

    	    MobileServiceUser user = new MobileServiceUser(userId);
    	    user.setAuthenticationToken(token);
    	    client.setCurrentUser(user);

    	    return true;
	    }

5. In the *ToDoActivity.java* file, replace the `authenticate` method with the following method which uses a token cache. Change the login provider if you want to use an account other than Google.

		private void authenticate() {
			// We first try to load a token cache if one exists.
		    if (loadUserTokenCache(mClient))
		    {
		        createTable();
		    }
		    // If we failed to load a token cache, login and create a token cache
		    else
		    {
			    // Login using the Google provider.
				ListenableFuture<MobileServiceUser> mLogin = mClient.login(MobileServiceAuthenticationProvider.Google);

		    	Futures.addCallback(mLogin, new FutureCallback<MobileServiceUser>() {
		    		@Override
		    		public void onFailure(Throwable exc) {
		    			createAndShowDialog("You must log in. Login Required", "Error");
		    		}
		    		@Override
		    		public void onSuccess(MobileServiceUser user) {
		    			createAndShowDialog(String.format(
		                        "You are now logged in - %1$2s",
		                        user.getUserId()), "Success");
		    			cacheUserToken(mClient.getCurrentUser());
		    			createTable();
		    		}
		    	});
		    }
		}

6. Build the app and test authentication using a valid account. Run it at least twice. During the first run, you should receive a prompt to login and create the token cache. After that, each run will attempt to load the token cache for authentication and you should not be required to login.

## Refresh the token cache

Our token cache should work in a simple case but, what happens when the token expires or is revoked? The token could expire when the app is not running. This would mean the token cache is invalid. The token could also expire while the app is actually running. The result is an HTTP status code 401 "Unauthorized".

We need to be able to detect an expired token, and refresh it. To do this we use a [ServiceFilter](http://dl.windowsazure.com/androiddocs/com/microsoft/windowsazure/mobileservices/ServiceFilter.html) from the [Android client library](http://dl.windowsazure.com/androiddocs/).

In this section you will define a ServiceFilter that will detect a HTTP status code 401 response and trigger a refresh of the token and the token cache. Additionally, this ServiceFilter will block other outbound requests during authentication so that those requests can use the refreshed token.

1. Open the ToDoActivity.java file and add the following import statements:

        import java.util.concurrent.atomic.AtomicBoolean;
		import java.util.concurrent.ExecutionException;

		import com.microsoft.windowsazure.mobileservices.MobileServiceException;

2. Add the following members to the `ToDoActivity` class.

    	public boolean bAuthenticating = false;
	    public final Object mAuthenticationLock = new Object();

    These will be used to help synchronize the authentication of the user. We only want to authenticate once. Any calls during an authentication should wait and use the new token from the authentication in progress.

3. In the ToDoActivity.java file, add the following method to the ToDoActivity class that will be used to block outbound calls on other threads while authentication is in progress.

	    /**
    	 * Detects if authentication is in progress and waits for it to complete.
         * Returns true if authentication was detected as in progress. False otherwise.
    	 */
    	public boolean detectAndWaitForAuthentication()
    	{
    		boolean detected = false;
    		synchronized(mAuthenticationLock)
    		{
    			do
    			{
    				if (bAuthenticating == true)
    					detected = true;
    				try
    				{
    					mAuthenticationLock.wait(1000);
    				}
    				catch(InterruptedException e)
    				{}
    			}
    			while(bAuthenticating == true);
    		}
    		if (bAuthenticating == true)
    			return true;

    		return detected;
    	}

4. In the ToDoActivity.java file, add the following method to the ToDoActivity class. This method triggers the wait and then update the token on outbound requests when authentication is complete.

    	/**
    	 * Waits for authentication to complete then adds or updates the token
    	 * in the X-ZUMO-AUTH request header.
    	 *
    	 * @param request
    	 *            The request that receives the updated token.
    	 */
    	private void waitAndUpdateRequestToken(ServiceFilterRequest request)
    	{
    		MobileServiceUser user = null;
    		if (detectAndWaitForAuthentication())
    		{
    			user = mClient.getCurrentUser();
    			if (user != null)
    			{
    				request.removeHeader("X-ZUMO-AUTH");
    				request.addHeader("X-ZUMO-AUTH", user.getAuthenticationToken());
    			}
    		}
    	}

5. In the ToDoActivity.java file, update the `authenticate` method of the ToDoActivity class so that it accepts a boolean parameter to allow forcing the refresh of the token and token cache. We also need to notify any blocked threads when authentication is completed so they can pick up the new token.

	    /**
    	 * Authenticates with the desired login provider. Also caches the token.
    	 *
    	 * If a local token cache is detected, the token cache is used instead of an actual
	     * login unless bRefresh is set to true forcing a refresh.
    	 *
	     * @param bRefreshCache
    	 *            Indicates whether to force a token refresh.
	     */
    	private void authenticate(boolean bRefreshCache) {

		    bAuthenticating = true;

		    if (bRefreshCache || !loadUserTokenCache(mClient))
	        {
	            // New login using the provider and update the token cache.
	            mClient.login(MobileServiceAuthenticationProvider.MicrosoftAccount,
	                    new UserAuthenticationCallback() {
	                        @Override
	                        public void onCompleted(MobileServiceUser user,
	                                Exception exception, ServiceFilterResponse response) {

	                    		synchronized(mAuthenticationLock)
	                    		{
		                        	if (exception == null) {
		                                cacheUserToken(mClient.getCurrentUser());
                                        createTable();
		                            } else {
		                                createAndShowDialog(exception.getMessage(), "Login Error");
		                            }
		            				bAuthenticating = false;
		            				mAuthenticationLock.notifyAll();
	                    		}
	                        }
	                    });
	        }
		    else
		    {
		    	// Other threads may be blocked waiting to be notified when
		    	// authentication is complete.
		    	synchronized(mAuthenticationLock)
		    	{
		    		bAuthenticating = false;
		    		mAuthenticationLock.notifyAll();
		    	}
                createTable();
		    }
	    }

6. In the ToDoActivity.java file, add this code for a new `RefreshTokenCacheFilter` class inside the ToDoActivity class:

		/**
		* The RefreshTokenCacheFilter class filters responses for HTTP status code 401.
		 * When 401 is encountered, the filter calls the authenticate method on the
		 * UI thread. Out going requests and retries are blocked during authentication.
		 * Once authentication is complete, the token cache is updated and
		 * any blocked request will receive the X-ZUMO-AUTH header added or updated to
		 * that request.
		 */
		private class RefreshTokenCacheFilter implements ServiceFilter {

	        AtomicBoolean mAtomicAuthenticatingFlag = new AtomicBoolean();

	        @Override
	        public ListenableFuture<ServiceFilterResponse> handleRequest(
	        		final ServiceFilterRequest request,
	        		final NextServiceFilterCallback nextServiceFilterCallback
	        		)
	        {
	            // In this example, if authentication is already in progress we block the request
	            // until authentication is complete to avoid unnecessary authentications as
	            // a result of HTTP status code 401.
	            // If authentication was detected, add the token to the request.
	            waitAndUpdateRequestToken(request);

	            // Send the request down the filter chain
	            // retrying up to 5 times on 401 response codes.
	            ListenableFuture<ServiceFilterResponse> future = null;
	            ServiceFilterResponse response = null;
	            int responseCode = 401;
	            for (int i = 0; (i < 5 ) && (responseCode == 401); i++)
	            {
	                future = nextServiceFilterCallback.onNext(request);
	                try {
	                    response = future.get();
	                    responseCode = response.getStatus().getStatusCode();
	                } catch (InterruptedException e) {
	                   e.printStackTrace();
	                } catch (ExecutionException e) {
	                    if (e.getCause().getClass() == MobileServiceException.class)
	                    {
	                        MobileServiceException mEx = (MobileServiceException) e.getCause();
	                        responseCode = mEx.getResponse().getStatus().getStatusCode();
	                        if (responseCode == 401)
	                        {
	                            // Two simultaneous requests from independent threads could get HTTP status 401.
	                            // Protecting against that right here so multiple authentication requests are
	                            // not setup to run on the UI thread.
	                            // We only want to authenticate once. Requests should just wait and retry
	                            // with the new token.
	                            if (mAtomicAuthenticatingFlag.compareAndSet(false, true))
	                            {
	                                // Authenticate on UI thread
	                                runOnUiThread(new Runnable() {
	                                    @Override
	                                    public void run() {
	                                        // Force a token refresh during authentication.
	                                        authenticate(true);
	                                    }
	                                });
	                            }

				                // Wait for authentication to complete then update the token in the request.
				                waitAndUpdateRequestToken(request);
				                mAtomicAuthenticatingFlag.set(false);
	                        }
	                    }
	                }
	            }
	            return future;
	        }
		}

    This service filter will check each response for HTTP status code 401 "Unauthorized". If a 401 is encountered, a new login request to obtain a new token will be setup on the UI thread. Other calls will be blocked until the login is completed, or until 5 attempts have failed. If the new token is obtained, the request that triggered the 401 will be retried with the new token and any blocked calls will be retried with the new token.

7. In the ToDoActivity.java file, add this code for a new `ProgressFilter` class inside the ToDoActivity class:

		/**
		* The ProgressFilter class renders a progress bar on the screen during the time the App is waiting for the response of a previous request.
		* the filter shows the progress bar on the beginning of the request, and hides it when the response arrived.
		*/
		private class ProgressFilter implements ServiceFilter {
			@Override
			public ListenableFuture<ServiceFilterResponse> handleRequest(ServiceFilterRequest request, NextServiceFilterCallback nextServiceFilterCallback) {

				final SettableFuture<ServiceFilterResponse> resultFuture = SettableFuture.create();

				runOnUiThread(new Runnable() {

					@Override
					public void run() {
						if (mProgressBar != null) mProgressBar.setVisibility(ProgressBar.VISIBLE);
					}
				});

				ListenableFuture<ServiceFilterResponse> future = nextServiceFilterCallback.onNext(request);

				Futures.addCallback(future, new FutureCallback<ServiceFilterResponse>() {
					@Override
					public void onFailure(Throwable e) {
						resultFuture.setException(e);
					}

					@Override
					public void onSuccess(ServiceFilterResponse response) {
						runOnUiThread(new Runnable() {

							@Override
							public void run() {
								if (mProgressBar != null) mProgressBar.setVisibility(ProgressBar.GONE);
							}
						});

						resultFuture.set(response);
					}
				});

				return resultFuture;
			}
		}

	This filter will show the progress bar on the beginning of the request and will hide it when the response arrived.

8. In the ToDoActivity.java file, update the `onCreate` method as follows:

		@Override
	    public void onCreate(Bundle savedInstanceState) {
		    super.onCreate(savedInstanceState);

		    setContentView(R.layout.activity_to_do);
		    mProgressBar = (ProgressBar) findViewById(R.id.loadingProgressBar);

		    // Initialize the progress bar
		    mProgressBar.setVisibility(ProgressBar.GONE);

		    try {
		    	// Create the Mobile Service Client instance, using the provided
		    	// Mobile Service URL and key
		    	mClient = new MobileServiceClient(
		    			"https://<YOUR MOBILE SERVICE>.azure-mobile.net/",
		    			"<YOUR MOBILE SERVICE KEY>", this)
                           .withFilter(new ProgressFilter())
                           .withFilter(new RefreshTokenCacheFilter());

		    	// Authenticate passing false to load the current token cache if available.
		    	authenticate(false);

		    } catch (MalformedURLException e) {
			    createAndShowDialog(new Exception("Error creating the Mobile Service. " +
			        "Verify the URL"), "Error");
		    }
	    }

       In this code, `RefreshTokenCacheFilter` is used in addition to `ProgressFilter`. Also during `onCreate` we want to load the token cache. So `false` is passed in to the `authenticate` method.

## Next steps

In the next tutorial, [Service-side authorization of Mobile Services users][Authorize users with scripts], you will take the user ID value provided by Mobile Services based on an authenticated user and use it to filter the data returned by Mobile Services.

[Register your app for authentication and configure Mobile Services]: #register
[Restrict table permissions to authenticated users]: #permissions
[Add authentication to the app]: #add-authentication
[Store authentication tokens on the client]: #cache-tokens
[Refresh expired tokens]: #refresh-tokens
[Next Steps]:#next-steps

[Get started with Mobile Services]: mobile-services-dotnet-backend-android-get-started.md
[Get started with authentication]: mobile-services-dotnet-backend-android-get-started-users.md
[Get started with push notifications]: mobile-services-dotnet-backend-android-get-started-push.md
[Authorize users with scripts]: mobile-services-dotnet-backend-service-side-authorization.md

[Mobile Services .NET How-to Conceptual Reference]: https://azure.microsoft.com/develop/mobile/how-to-guides/work-with-net-client-library
[Register your Windows Store app package for Microsoft authentication]: mobile-services-how-to-register-store-app-package-microsoft-authentication.md

repository: ChristianCholewa/azure-mobile-services

repo_name: ChristianCholewa/azure-mobile-services


text:
# Pololu3piPlus32U4 library

## Summary

<img align="right" src="https://a.pololu-files.com/picture/0J11323.240w.jpg?bf2f67dbe8c5a1035409af8b78b78f97">

This is a C++ library for the Arduino IDE that helps access the on-board hardware of the [Pololu 3pi+ 32U4 Robot](https://www.pololu.com/category/280/3pi-plus-32u4-oled-robot) (both the [newer OLED version](https://www.pololu.com/category/280/3pi-plus-32u4-oled-robot) and the [original LCD version](https://www.pololu.com/category/285/original-3pi-plus-32u4-robot)).

The 3pi+ 32U4 robot is a complete, high-performance mobile platform based on the ATmega32U4 microcontroller.  It has integrated motor drivers, encoders, a display screen (graphical OLED or LCD), a buzzer, buttons, line sensors, front bump sensors, an LSM6DS33 accelerometer and gyro, and an LIS3MDL compass. See the [3pi+ 32U4 user's guide](https://www.pololu.com/docs/0J83) for more information.

## Installing the library

Use the Library Manager in version 1.8.10 or later of the Arduino software (IDE) to install this library:

1. In the Arduino IDE, open the "Tools" menu and select "Manage Libraries...".
2. Search for "3pi+".
3. Click the Pololu3piPlus32U4 entry in the list.
4. Click "Install".
5. If you see a prompt asking to install missing dependencies, click "Install all".

## Usage

To access most of features of this library, you just need a single include statement.  For convenience, we recommend using the Pololu3piPlus32U4 namespace and declaring all of the objects you want to use as global variables, as shown below:

```cpp
#include <Pololu3piPlus32U4.h>

using namespace Pololu3piPlus32U4;

OLED display;
Buzzer buzzer;
ButtonA buttonA;
ButtonB buttonB;
ButtonC buttonC;
LineSensors lineSensors;
BumpSensors bumpSensors;
Motors motors;
Encoders encoders;
```

The IMU is not fully enabled by default since it depends on the Wire library, which uses about 1400 bytes of additional code space and defines an interrupt service routine (ISR) that might be incompatible with some applications.

Include Pololu3piPlus32U4IMU.h in one of your cpp/ino files to enable IMU functionality:

```cpp
#include <Pololu3piPlus32U4IMU.h>

IMU imu;
```

## Examples

Several example sketches are available that show how to use the library.  You can access them from the Arduino IDE by opening the "File" menu, selecting "Examples", and then selecting "Pololu3piPlus32U4".  If you cannot find these examples, the library was probably installed incorrectly and you should retry the installation instructions above.

## Classes and functions

The contents of the library are contained in the Pololu3piPlus32U4 namespace. The main classes and functions provided by the library are listed below:

* Pololu3piPlus32U4::ButtonA
* Pololu3piPlus32U4::ButtonB
* Pololu3piPlus32U4::ButtonC
* Pololu3piPlus32U4::Buzzer
* Pololu3piPlus32U4::Encoders
* Pololu3piPlus32U4::OLED
* Pololu3piPlus32U4::LCD
* Pololu3piPlus32U4::Motors
* Pololu3piPlus32U4::LineSensors
* Pololu3piPlus32U4::BumpSensors
* Pololu3piPlus32U4::IMU
* Pololu3piPlus32U4::ledRed()
* Pololu3piPlus32U4::ledGreen()
* Pololu3piPlus32U4::ledYellow()
* Pololu3piPlus32U4::usbPowerPresent()
* Pololu3piPlus32U4::readBatteryMillivolts()

## Dependencies

This library also references several other Arduino libraries which are used to help implement the classes and functions above.

* [FastGPIO](https://github.com/pololu/fastgpio-arduino)
* [PololuBuzzer](https://github.com/pololu/pololu-buzzer-arduino)
* [PololuHD44780](https://github.com/pololu/pololu-hd44780-arduino)
* [PololuMenu](https://github.com/pololu/pololu-menu-arduino)
* [PololuOLED](https://github.com/pololu/pololu-oled-arduino)
* [Pushbutton](https://github.com/pololu/pushbutton-arduino)
* [USBPause](https://github.com/pololu/usb-pause-arduino)

## Version history

* 1.1.2 (2021-10-15): Fixed a bug that prevented the OLED display from working if the MOS pin was previously changed to be an input.
* 1.1.1 (2021-08-11): Fixed a typo in the RotationResist demo.
* 1.1.0 (2021-08-10): Added support for the 3pi+ 32U4 OLED.
* 1.0.1 (2020-12-03): Moved code into `src/` folder; continuous integration; fixed some warnings; added missing library dependence on PololuMenu.
* 1.0.0 (2020-12-01): Customized example sketches for different 3pi+ editions. Reimplemented menus using the PololuMenu class. Added flipEncoders() method to the Encoders class to work better with the Hyper edition robot.
* 0.2.0 (2020-11-25): Initial public release; motor demos only support Standard Edition.
* 0.1.0 (2020-11-25): Initial release for production.


text:
% PROJECT(1) FMRIF User Manuals
% Joseph Naegele<EMAIL_ADDRESS>% February 2014

# NAME
**project** - Manage shared directories

# Synopsis
**project** command *project-name* [...]

# Description
The project tool allows users to create and maintain shared directories.
Project directories can be made public or private only to members/collaborators.
There are three roles for users of a project:

- Owner: The project creator
- Member: Users who can read and write in the project directory
- Collaborator: Users who can only read files in the project directory

Each project has a corresponding YAML file (*PROJECT_ROOT/.projectname.yml*) which stores
configuration information about the project. This file can be modified manually
if necessary, but you will afterwards need to run an **update** on the project.

The project tool uses POSIX ACLs under the hood, so you can modify/inspect the permissions
on your files manually using **setfacl**/**getfacl**, respectively.

# Options

-p <root>, --project-root <root>
:   manually specify a parent directory for a project *command*

## Commands

list
:   list all projects

check
:   check that all project permissions are correct. This checks
    every file in each project so it may take a while.

create [*--public*] *PROJECT-NAME*
:   Create new project. By default, projects are made 'private',
    i.e. they are NOT world-readable.

rename *PROJECT-NAME* *NEW-NAME*
:   Rename/Move a project within *PROJECT_ROOT*.

delete *PROJECT-NAME*
:   Delete existing project.
    There is no un-delete option, so use this command
    **very** carefully.

info *PROJECT-NAME*
:   Print information about project

update *PROJECT-NAME*
:   Update permissions on project.
    This is especially useful if someone manually changes
    some file permissions, or if a project's configuration
    file is manually modified.

adduser *PROJECT-NAME* *ROLE* *USERNAME*...
:   Add user to project, where *USERNAME* must be a valid
    username on the system, and role is one of:
        owner, member, collaborator

moduser *PROJECT-NAME* *ROLE* *USERNAME*...
:   Modify user permissions, where *USERNAME* must be a valid
    username on the system, and role is one of:
        owner, member, collaborator

deluser *PROJECT-NAME* *USERNAME*...
:   Remove user from project.

help [*COMMAND*]
:   Print help info for command

# Environment

**PROJECT_ROOT** - Parent directory of projects (defaults to */fmrif/projects*)

# Examples

Create a project:

    project create demo

use the *--public* flag to make the project world-readable.

List available projects:

    project list

Add a user to a project:

    project adduser demo-project member john mary
    project adduser demo-project collaborator jack

Change a user's role:

    project moduser demo-project collaborator john

Remove a user from a project:

    project deluser demo-project mary

Print information about a project:

    project info demo-project

Fix permissions for a project:

    project update demo-project

Fix permissions for all projects having broken permissions:

    project check | xargs -n 1 project update

Delete a project (use **very** carefully):

    project delete demo-project

# Bugs

- Project config files are created with rwx (0770) permissions.
  The should be created with rw- (0660) permissions.

# Security Issues

This tool has its setuid bit set and is owned by root
(like ``top``, ``ps``, ``traceroute``, etc.). This allows the tool
to effectively run as root, even when a regular user executes it.
This, in general, is dangerous if not handled correctly. The tool is
designed to not run arbitrary code, however it is capable of deleting
any directory if a *valid* configuration file can be found.

# See Also
`chown(1)`, `getfacl(1)`, `setfacl(1)`

repository: nih-fmrif/project-tool

repo_name: nih-fmrif/project-tool


text:
django-jsonschema-form
====================

This package renders a [jsonschema](http://json-schema.org/) as part of one django admin form.

# Instalation

Just run ```pip install django-jsonschema-form``` and then add an entry on your django project's settings.

``` python

INSTALLED_APPS = [
    ...,
    jsonschemaform,
]

```

# How it works
The core component is basicaly a django widget that receives a jsonschema and renders a form fragment.
It uses the [JSON Editor](https://github.com/jdorn/json-editor) js library to actually render this fragment.

In practice you only have to override the admin widget like the snipet bellow.

``` python

# Imporing Widget
from jsonschemaform.admin.widgets.jsonschema_widget import JSONSchemaWidget

# Here it is used postgres JSONField field implementation. Other implementation can be used depending on your DB
from django.contrib.postgres.fields import JSONField

# JSONSchema definition
schema = {
    "title": "Config Schema",
    "description": "My configutation schema",
    "type": "object",
    "properties": {
        "columns": {
            "description": "List of columns size",
            "type": "array"
        },
        "class": {
            "description": "A reference css class",
            "type": "string"
        },
        "container": {
            "default": "container",
            "description": "Default page container",
            "type": "string"
        }
    },
    "required": [
        "columns",
    ],
}

# Overriding widgets for all instances of JSONField on PageAdmin form
class PageAdmin(admin.ModelAdmin):
    formfield_overrides = {
        JSONField: {'widget': JSONSchemaWidget(schema)}
    }

```
This form will looks like

![rendered Jsonschema](/images/rendered.png)

# Tweaking the editor
It is possible to configure the editor through django settings using the key JSONSCHEMAFORM.

``` python
JSONSCHEMAFORM = {
    'css': {
        'all': (
            'https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css',
        )
    },
    'options': {
        'theme': 'bootstrap3',
        'iconlib': 'bootstrap3',
        'no_additional_properties': True,
        'disable_collapse': True,
    }
}

```
The settings above is also the default configuration.

But you can override or add any options described on [JSON Editor options](https://github.com/jdorn/json-editor#options).

repository: collabo-br/django-jsonschema-form

repo_name: collabo-br/django-jsonschema-form


text:
# Workday-Scheduler[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

  ## Description
Using HTML/CSS/JS I was able to create a workday scheduler. Additionlly, using jQuery and moment.js libraries allows you to save upcoming events. Also I was able to color the table based on the events that have passed,current or upcoming. Where the  events are saved in local storage and this way it will always be avaible to
user everytime they return to the site.

## Live Site
  https://thetodd7.github.io/Workday-Scheduler/

  ## Table of Contents
  * [Description](#Description)
  * [Usage](#Usage)
  * [Installation](#Installation)
  * [Tests](#Tests)
  * [License](#License)
  * [Contributions](#Contributions/Questions)

  ## Usage

![Screen Shot 2021-07-01 at 11 53 18 PM](https://user-images.githubusercontent.com/85806673/124218570-7a979180-dac8-11eb-9d18-2a36adac10bc.png)

  ## Installation

  Clone this repository from my GitHub page.

  ## License

[MIT License](https://opensource.org/licenses/MIT)

  ## Contributions/Questions

  Contributors should read the installation section.

  If you have any questions, please contact me on GitHub [thetodd7](https://github.com/thetodd7) or email me at<EMAIL_ADDRESS>

branch_name: refs/heads/main


text:
# Collection Model Admin

## Installation

```shell script
pip install wagtail-collectionmodeladmin
```

## Development

Checkout this repo, create a local virtual environment and install dependencies:
```shell script
pip install -e .
```

Create a new `demo` wagtail project:
```shell script
wagtail start demo
```

We will use the `home` app as the base for our demo. Add a new `Model` in `demo/home/models.py`:
```python
from django.db import models

from wagtail.core.models import CollectionMember

class Demo(CollectionMember, models.Model):
    demo_field = models.CharField()
```

Add the `wagtail.contrib.modeladmin` to the demo `INSTALLED_APPS` at `demo/demo/settings/base.py`:
```python
INSTALLED_APPS = [
   ...
   'wagtail.contrib.modeladmin',
]
```

Create the wagtail hooks that will inject the model admin in `demo/home/wagtail_hooks.py`:
```python
from wagtail.contrib.modeladmin.options import modeladmin_register

from collectionmodeladmin.base import CollectionModelAdmin
from home.models import Demo

class DemoModelAdmin(CollectionModelAdmin):
    model = Demo

modeladmin_register(DemoModelAdmin)
```

Then as usual make migrations, apply them, create a superuser and start the Django server.
```shell script
cd demo
python manage.py makemigrations
python manage.py migrate
python manage.py createsuperuser

python manage.py runserver
```

repository: BabisK/wagtail-collectionmodeladmin

repo_name: BabisK/wagtail-collectionmodeladmin


text:
---
id: 075e9806-0367-40a2-8154-2e84d5a020e2
title: 2020-08-09 Release Notes
desc: ''
updated:<PHONE_NUMBER>110
created:<PHONE_NUMBER>110
stub: false
---

# 2020-08-09 Release Notes (version 0.6)

Another week, another minor release. The much asked for `Rename Note` command is here, as well as a bunch of enhancements to notes and schemas. Enjoy 🌱

This release is also a reminder to fill out the [Dendron user survey](https://forms.gle/PPqe2axvwEmpXj4v5) if you haven't done so 🙏. This is a super short 3min survey that will help me plan the future growth of Dendron.

These release notes are summary of the more notable changes, for the full list, please look at our [CHANGELOG](https://github.com/dendronhq/dendron/blob/master/CHANGELOG.md)

## Commands

### Add Rename Note Command ([docs](https://www.dendron.so/notes/eea2b078-1acc-4071-a14e-18299fc28f47.html#rename-note))

Do you have regrets? While there are some things that you can't take back, misnaming a note should never be one of them. Dendron now lets you rename files and will update all links in all files that link to it!

![rename](https://foundation-prod-assetspublic53c57cce-8cpvgjldwysl.s3-us-west-2.amazonaws.com/assets/images/command-rename.gif)

### Add Copy Note Link Command ([docs](https://www.dendron.so/notes/eea2b078-1acc-4071-a14e-18299fc28f47.html#copy-note-link))

School's out so it's okay to copy notes. Use this to get the wiki-link (with title) of the current open note.

![copy note link](https://foundation-prod-assetspublic53c57cce-8cpvgjldwysl.s3-us-west-2.amazonaws.com/assets/images/command.copy-link.gif)

### Enhancements
- Show feedback on copy note link

### Fixes
- Issue with renamed notes not being indexed
- Issue where `doctor` doesn't backfill newly created notes'

## Notes

### Flexible Configuration for Notes ([docs](https://www.dendron.so/notes/5c213aa6-e4ba-49e8-85c5-1bdcb33ce202.html#configuration))

Notes are now as flexible as your yoga teacher. You can now customize every aspect of your `Journal` and `Scratch` notes - how they are added, their time format and even what they're called

### Add Built in Snippets ([docs](https://www.dendron.so/notes/9eca1992-7540-4d9d-97fb-328b27748b2c.html))

All the one-liners and bad jokes that you have saved for that special someone? Type them out faster than ever with built-in snippets. This updates the default settings to allow tab-based snippet completion and also initialize new vaults with some default snippets.

![snippets](https://foundation-prod-assetspublic53c57cce-8cpvgjldwysl.s3-us-west-2.amazonaws.com/assets/images/tab-autocomplete.gif)

### Enhancements
- Copy on Create: Journal and Scratch notes will automatically copy their links to the clipboard after creation

### Fixes
- Scratch note title note being set properly
- Not all notes indexed in sparse vaults: There was an issue where certain notes without a full hierarchy would not be indexed by Dendron. That issue has now been eliminated.

- Notes created via link not being indexed properly: Issue where sometimes new notes created using link navigation wasn't being indexed.

## Pods
### Custom Blogging Layout ([docs](https://www.dendron.so/notes/4c0ef322-3006-405c-9a66-3134dd9649a5.html#blogging))

Sometimes you have something you just need to shout out from the rooftops. Because its likely people think that you are a crazy person if you did this, Dendron now has dedicated blogging layouts so you can blog instead!

### Fixes
- Issue with buildpod logging

## Schemas

### Apply Schema Description to New Notes ([docs](https://www.dendron.so/notes/c5e5adde-5459-409b-b34d-a0d75cbb1052.html#desc))

Schemas now automatically apply their description to newly created notes that match said schema. Because life is too short to annotate all your notes all the time.

### Enhancements
- Remove data field from new schemas: Schema notes only show you fields that are required on creation.

## Workspace
### Enhancements
- Update index when notes are deleted outside of dendron: We know that sometimes, it can't be helped and you'll need to work with your notes outside of Dendron. If that work is deleting notes, Dendron will now keep track of it and remove it from its lookup index as well!

## Other
### Make Dendron available on [Open VSX Registry](https://open-vsx.org/) ([docs](https://dendron.so/notes/9134f160-31a6-4ab0-a640-1fce466f9526.html#open-vsx))

Maybe you just don't like Microsoft. Maybe you want to see other people. Whatever the reason, Dendron is now available on all VSCode compatible editors like [VSCodium](https://vscodium.com/) and [Gitpod](https://www.gitpod.io/).

## Thank You

Last and most of all, a big **thanks** to all these people that contributed issues and suggestions during this release.

- [Josh Finken](https://github.com/jfinken)
- [denisdifazio](https://github.com/denisdifazio)
- Annegrim
- [Chris Na](https://github.com/buxel)

repository: tsnieman/dendron-template

repo_name: tsnieman/dendron-template


text:
Description
===========
A space condition with dataset parsing was not handled which caused rules like
```
alert http any any -> any any (http.user_agent; dataset:set  ,ua-seen,type string,save datasets.csv; sid:1;)
```
Note the spaces after `dataset:set`.
Corresponding redmine ticket: https://redmine.openinfosecfoundation.org/issues/5019

PCAP
====
PCAP is irrelevant to the test but comes from the test [datasets-01](https://github.com/OISF/suricata-verify/blob/master/tests/datasets-01/input.pcap)

repository: jasonish/suricata-verify

repo_name: jasonish/suricata-verify


text:
> ## 🛠 Status: In Development
> django-cpss-vimeo currently in development.

# Python Vimeo API - Django  [<img src="https://github.com/xgdfalcon/django-cpss-vimeo/blob/master/django_cpss_vimeo/static/cpss/logo.png?raw=true" alt="CPSS by XGDFalcon®" height="20px" />](https://controlpointsw.com)

[![Build Status](https://travis-ci.org/xgdfalcon/django-cpss-vimeo.svg?branch=master)](https://travis-ci.org/xgdfalcon/django-cpss-vimeo)
[![PyPI version](https://badge.fury.io/py/django-cpss-vimeo.svg)](https://badge.fury.io/py/django-cpss-vimeo)

## Description

This is the [Django](https://www.djangoproject.com/) component of the
[PyVimeo project](https://github.com/vimeo/vimeo.py),
it implements the needed functionality to integrate
[PyVimeo](https://github.com/vimeo/vimeo.py)
in a Django based project.

## Django version

This project will focus on the currently supported Django releases as
stated on the [Django Project Supported Versions table](https://www.djangoproject.com/download/#supported-versions).

Backward compatibility with unsupported versions won't be enforced.

## Documentation

Project documentation is available at TBP.

## Setup

1. Add "django-cpss-vimeo" to your INSTALLED_APPS setting like this::
```
    INSTALLED_APPS = [
        ...
        'cpss_vimeo.apps.CPSSVimeoConfig',
    ]
```
2. Include the django-cpss-vimeo URLconf in your project urls.py like this::
```
    path('vimeo/', include('django-cpss-vimeo.urls')),
```
3. Run `python manage.py migrate` to create the django-cpss-vimeo models.

4. Start the development server and visit http://<IP_ADDRESS>:8000/admin/
   to create a poll (you'll need the Admin app enabled).

5. Visit http://<IP_ADDRESS>:8000/vimeo/

## Contributing
See the [CONTRIBUTING.md](CONTRIBUTING.md) document for details.

## Versioning
This project follows [Semantic Versioning 2.0.0](http://semver.org/spec/v2.0.0.html).

## License
This project follows the Apache license. See the [LICENSE](LICENSE.md) for details.

repository: xgdfalcon/django-cpss-vimeo

repo_name: xgdfalcon/django-cpss-vimeo


text:
# Baloghia neocaledonica (S.Moore) McPherson SPECIES

#### Status
ACCEPTED

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

#### Published in
null

#### Original name
Ricinocarpos neocaledonicus S.Moore

### Remarks
null