text:
---
layout: default
title: Hello Search
parent: Modules
nav_order: 4
---

# Hello Search

*Hello Search* is the simplest kind of Search-Based Application you can build with the SBA Framework. It is made of a single module and a single Angular component, which shows a search form and a list of results:

![Hello Search]({{site.baseurl}}assets/tutorial/hello-search.png)

## App module

Hello Search has one Angular module (`AppModule`) in [`src/app/app.module.ts`](https://github.com/sinequa/sba-angular/blob/master/projects/hello-search/src/app/app.module.ts). It looks very much like the default `app.module.ts` you would get from creating a new Angular app with `ng new`, with some specific points:

- We import required modules from [`@sinequa/core`]({{site.baseurl}}core) and pass them configuration via their `forRoot()` methods.
- In particular we must pass the [`StartConfig`]({{site.baseurl}}core/interfaces/StartConfig.html) object to the [`WebServicesModule`]({{site.baseurl}}core/modules/WebServicesModule.html). This object contains the **URL of the sinequa server** (which can be omitted when the app is hosted on the server) and the **name of the App** configured in the Sinequa administration.
- We use `{provide: LocationStrategy, useClass: HashLocationStrategy},` to manage routes (which is not specific to Hello Search).

## App component

Hello Search has one Angular component (`AppComponent`). It is made of:

- A template: [`src/app/app.component.html`](https://github.com/sinequa/sba-angular/blob/master/projects/hello-search/src/app/app.component.html)
- A controller: [`src/app/app.component.ts`](https://github.com/sinequa/sba-angular/blob/master/projects/hello-search/src/app/app.component.ts)
- A stylesheet: [`src/app/app.component.scss`](https://github.com/sinequa/sba-angular/blob/master/projects/hello-search/src/app/app.component.scss)

### Template

The template ([`src/app/app.component.html`](https://github.com/sinequa/sba-angular/blob/master/projects/hello-search/src/app/app.component.html)) is divided in four parts:

**Search Form**:

The search form has a search field `<input>`, and two buttons ("Search" and "Clear"). When submitting the form, the `search()` method from the controller is called. Note that the form is deactivated if the user is not logged in.

```html
<form novalidate [formGroup]="form">
    <input type="text" placeholder="Enter search terms..." formControlName="search" spellcheck="false" autocomplete="off" [attr.disabled]="!loginService.complete? '' : null">
    <button type="submit" (click)="search()" [attr.disabled]="!loginService.complete? '' : null">Search</button>
    <button *ngIf="results$ | async" type="button" (click)="clear()">Clear</button>
</form>
```

**Results**:

The results list displays the list of [`Record`]({{site.baseurl}}core/interfaces/Record.html) objects from a [`Results`]({{site.baseurl}}core/interfaces/Results.html) object provided by the controller. The first `*ngIf` and `| async` allow to display the results only when they become available (it is *asynchronous*, since the server cannot respond instantaneously). Then, the `*ngFor` iterates through the list of results. Inside this `<div>`, when then display the title, source and relevant extracts of each document.

```html
{% raw %}<div *ngIf="results$ | async; let results">
    <hr>
    <div *ngFor="let record of results.records" class="record">
        <a href="{{record.url1}}">
            <h3 [innerHtml]="record.displayTitle || record.title"></h3>
        </a>
        <div class="source">{{record.url1}}</div>
        <p *ngIf="record.relevantExtracts" [innerHTML]="record.relevantExtracts"></p>
    </div>
</div>{% endraw %}
```

**Login/Logout buttons**:

These buttons call the `login()` and `logout()` methods of the controller.

```html
<button *ngIf="loginService.complete" type="button" (click)="logout()">Logout</button>
<button *ngIf="!loginService.complete" type="button" (click)="login()">Login</button>
```

**Notifications**:

Notifications are typically some error messages coming from the Sinequa services and managed by the [`NotificationModule`]({{site.baseurl}}core/modules/NotificationModule.html) from [`@sinequa/core`]({{site.baseurl}}core). If you fail to log in or to get data from the Sinequa indexes, you will likely see a message displayed at the bottom of the app.

```html
{% raw %}<ng-container *ngIf="notificationsService.notificationsStream | async as notification">
    <hr>
    <div *ngIf="deleteNotification(notification)" class="notification">
        <div *ngIf="notification.title" class="title">
            <span>{{notification.title | sqMessage}}</span>
            <hr>
        </div>
        <div>{{notification.text | sqMessage:{values: notification.params} }}</div>
    </div>
</ng-container>{% endraw %}
```

### Controller

The controller ([`src/app/app.component.ts`](https://github.com/sinequa/sba-angular/blob/master/projects/hello-search/src/app/app.component.ts)) consists of the class `AppComponent`, which is made of the main following parts:

**Fields**:

The `AppComponent` class has the following fields:
- `form`: An Angular [`FormGroup`](https://angular.io/api/forms/FormGroup) object needed to interact with the content of a `<form>`.
- `results$`: An [rxjs Observable](https://angular.io/guide/observables) of [`Results`]({{site.baseurl}}core/interfaces/Results.html) (since results are retrieved asynchronously).

```ts
form: FormGroup;
results$: Observable<Results>;
```

**Constructor**:

In the constructor, we inject the following services from [`@sinequa/core`]({{site.baseurl}}core) (and initialize our `form`):
- [`LoginService`]({{site.baseurl}}core/injectables/LoginService.html): Service in charge of authentication and initialization of other services.
- [`AppService`]({{site.baseurl}}core/injectables/AppService.html): Service in charge of retrieving the configuration of your application from the Sinequa server.
- [`QueryWebService`]({{site.baseurl}}core/injectables/QueryWebService.html): Service in charge of sending *queries* and retrieving *results* from the Sinequa server.
- [`NotificationsService`]({{site.baseurl}}core/injectables/NotificationsService.html): Service in charge of centralizing errors and warnings from other services.

```ts
constructor(
    protected formBuilder: FormBuilder,
    public loginService: LoginService,
    public appService: AppService,
    public queryWebService: QueryWebService,
    public notificationsService: NotificationsService) {

    this.form = this.formBuilder.group({
        "search": []
    });
}
```

**Search method**:

The `search()` method is called when the user clicks on the "search" button. It performs the following tasks:
- Create a new [`Query`]({{site.baseurl}}core/classes/Query.html) object (with the right name, retrieved from the app configuration.
- Set the `query.text` to the value typed by the user in the search form (`this.form.get("search").value`).
- Send the query to the [`QueryWebService`]({{site.baseurl}}core/injectables/QueryWebService.html) and get the results observable (`results$`). When results are available (asynchronously), the template will display them.

```ts
search() {
    let ccquery = this.appService.ccquery;
    let query = new Query(ccquery ? ccquery.name : "_unknown");
    query.text = this.form.get("search").value || "";
    this.results$ = this.queryWebService.getResults(query);
}
```

**Login and Logout method**:

The `login()` and `logout()` methods are essentially proxies to the corresponding methods in the [`LoginService`]({{site.baseurl}}core/injectables/LoginService.html) which manages the authentication. Note that the [`LoginService`]({{site.baseurl}}core/injectables/LoginService.html) also takes care of retrieving data from the server via three services:

- The [`AppWebService`]({{site.baseurl}}core/injectables/AppWebService.html), which retrieves the configuration of the applications.
- The [`PrincipalWebService`]({{site.baseurl}}core/injectables/PrincipalWebService.html), which retrieves the user data from its domain (it includes the name, email, id, and other data).
- The [`UserSettingsWebService`]({{site.baseurl}}core/injectables/UserSettingsWebService.html), which retrieves the *User Settings* (more information in the [Tutorial]({{site.baseurl}}tutorial/user-settings.html) and the [Tips & Tricks]({{site.baseurl}}tipstricks/user-settings.html))

Additionally, we clear the results on log out, by removing the `results$` and emptying the search form.

```ts
login() {
    this.loginService.login();
}

logout() {
    this.clear();
    this.loginService.logout();
}

clear() {
    this.results$ = null;
    this.form.get("search").setValue("");
}
```

### Stylesheet

The component's stylesheet ([`src/app/app.component.scss`](https://github.com/sinequa/sba-angular/blob/master/projects/hello-search/src/app/app.component.scss)) contains CSS rules applied only within the component. In particular:

- Page layout rules, making our search results more readable:

    ```scss
    .search {
        max-width: 800px;
        margin-left: 100px;
    }
    ```

- Text sizing, coloring and spacing for the title (`h1`), document title (`h3`), document source (`.source`) and relevant extracts (`p`).

- Styling of the *notifications*:

    ```scss
    .notification {
        border: solid;
        padding: 8px;

        .title {
            font-weight: bold;
        }
    }
    ```

In addition to the component's stylesheet, a global stylesheet ([`src/styles/app.scss`](https://github.com/sinequa/sba-angular/blob/master/projects/hello-search/src/styles/app.scss)) contains styles that apply to the whole app. This is where you would import (globally) third party styling libraries such as Bootstrap (see the [tutorial]({{site.baseurl}}tutorial/search-module#importing-bootstrap)).

```scss
@import "~@angular/cdk/overlay-prebuilt";

body {
    font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
}

a {
    text-decoration: none;
    color: #3434d6;
}

.record .match-highlight {
    font-weight: bold;
    font-style: italic;
}
```


text:
---
title: Install UCP offline
description: Learn how to install Docker Universal Control Plane. on a machine with
  no internet access.
keywords: UCP, install, offline, Docker EE
---

The procedure to install Docker Universal Control Plane on a host is the same,
whether the host has access to the internet or not.

The only difference when installing on an offline host is that instead of
pulling the UCP images from Docker Hub, you use a computer that's connected
to the internet to download a single package with all the images. Then you
copy this package to the host where you install UCP. The offline installation
process works only if one of the following is true:

-  All of the cluster nodes, managers and workers alike, have internet access
   to Docker Hub, and
-  None of the nodes, managers and workers alike, have internet access to
   Docker Hub.

If the managers have access to Docker Hub while the workers don't,
installation will fail.

## Versions available

Use a computer with internet access to download the UCP package from the
following links.

{% include components/ddc_url_list_2.html product="ucp" version="3.1" %}

## Download the offline package

You can also use these links to get the UCP package from the command
line:

```bash
$ wget <ucp-package-url> -O ucp.tar.gz
```

Now that you have the package in your local machine, you can transfer it to
the machines where you want to install UCP.

For each machine that you want to manage with UCP:

1.  Copy the UCP package to the machine.

    ```bash
    $ scp ucp.tar.gz <user>@<host>
    ```

2.  Use ssh to log in to the hosts where you transferred the package.

3.  Load the UCP images.

    Once the package is transferred to the hosts, you can use the
    `docker load` command, to load the Docker images from the tar archive:

    ```bash
    $ docker load < ucp.tar.gz
    ```

Follow the same steps for the DTR binaries.

## Install UCP

Now that the offline hosts have all the images needed to install UCP,
you can [install Docker UCP on one of the manager nodes](index.md).

## Where to go next

- [System requirements](system-requirements.md)
- [Install UCP](index.md)

branch_name: refs/heads/master

extension: md

license_type: permissive


text:
# MSPMotorControl
This is an implementation of a closed loop DC motor velocity control system using the MSP430 and a Motor Driver.

## Requirements

1. MSP430F5529LP board
2. Code Composer Studio (CCS) or some way to compile and flash to the MSP
3. A TI DRV8871 motor driver
4. A DC Motor with some digital rotary encoder
5. Some external Power Supply to power the DC Motor
6. P1.2 available for PWM motor output
7. P1.3 available for encoder signal

## Usage

1. Clone the repo
2. Put it in CCS (or whatever development environment you use)
3. Connect the MSP, Motor driver, Motor all together. (You should test things separately first)
4. Flash the program to the MSP
5. Connect a serial Terminal, set it to 19200bps, start bit, stop bit, no parity.
6. Enjoy

license: MIT

repository: danieldaquino/MSPMotorControl

repo_name: danieldaquino/MSPMotorControl


text:
# pull-offset-limit
[![npm version][2]][3] [![build status][4]][5] [![test coverage][6]][7]
[![downloads][8]][9] [![js-standard-style][10]][11]

 A pull-stream that filters until X elements, and stops streaming after Y elements. Useful for pagination purposes.

## Usage
```js
const pull = require('pull-stream')
const split = require('pull-split')
const offsetLimit = require('pull-offset-limit')

pull(
  textStream, // some text stream
  split(), // split on new lines
  offsetLimit(5, 20), // after 5 lines, take 20
  output
)

```

## API
###

### `offsetLimit = require('pull-offset-limit')(offset, limit, onLimit)`
Create a new offsetLimit through stream.
- __offset:__ if set, filters stream until offset is reached
- __limit:__ if set, stops stream when limit is reached
- __onLimit:__ if set, runs when limit is reached

## Installation
```sh
$ npm install pull-offset-limit
```

## License
[MIT](https://tldrlegal.com/license/mit-license)

[1]: https://nodejs.org/api/documentation.html#documentation_stability_index
[2]: https://img.shields.io/npm/v/pull-offset-limit.svg?style=flat-square
[3]: https://npmjs.org/package/pull-offset-limit
[4]: https://img.shields.io/travis/JDvorak/pull-offset-limit/master.svg?style=flat-square
[5]: https://travis-ci.org/JDvorak/pull-offset-limit
[6]: https://img.shields.io/codecov/c/github/JDvorak/pull-offset-limit/master.svg?style=flat-square
[7]: https://codecov.io/github/JDvorak/pull-offset-limit
[8]: http://img.shields.io/npm/dm/pull-offset-limit.svg?style=flat-square
[9]: https://npmjs.org/package/pull-offset-limit
[10]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square
[11]: https://github.com/feross/standard

repository: JDvorak/pull-offset-limit

repo_name: JDvorak/pull-offset-limit


text:
+++
# Accomplishments widget.
widget = "accomplishments"  # Do not modify this line!
active = true  # Activate this widget? true/false

title = "Accomplishments"
subtitle = ""

# Order that this section will appear in.
weight = 15

# Date format
#   Refer to https://sourcethemes.com/academic/docs/customization/#date-format
date_format = "Jan 2006"

# Accomplishments.
#   Add/remove as many `[[item]]` blocks below as you like.
#   `title`, `organization` and `date_start` are the required parameters.
#   Leave other parameters empty if not required.
#   Begin/end multi-line descriptions with 3 quotes `"""`.

[[item]]
  title = "Angular 7"
  organization = "udemy"
  certificate_url = "https://www.udemy.com/certificate/UC-IOW7GML2/"
  date_start = "2018-10-01"
  date_end = ""
  description = "This course will clears all the fundamentals about modules, directives, components, databinding, routing, HTTP access and much more! each section is learned with a real project. All examples showcase the features Angular offers and how to apply them correctly."

[[item]]
  title = "Oracle Certified Professional, Java SE 7 Programmer"
  organization = "Oracle"
  certificate_url = "https://www.youracclaim.com/badges/439cbd61-c05c-41c9-b3fb-4891a9d43625/linked_in_profile"
  date_start = "2014-04-29"
  date_end = ""
  description = "An Oracle Certified Professional, Java SE 7 Programmer has validated his or her Java development skills by answering challenging, real-world, scenario-based questions that measure problem solving skills using java code."

[[item]]
  title = "Oracle Certified Associate, Java SE 7 Programmer"
  organization = "Oracle"
  certificate_url = "https://www.youracclaim.com/badges/4e64036c-a431-4f15-8011-362c235bcb19/linked_in_profile"
  date_start = "2013-12-26"
  date_end = ""
  description = "A Java SE 7 Oracle Certified Associate (OCA) has built a foundational understanding of Java, while acquiring knowledge of general programming."

+++


text:
---
layout: post
status: publish
published: true
title: Bookmarks for November 11th through November 14th
author: Michael Brunton-Spall
author_login: bruntonspall
author_email<EMAIL_ADDRESS>author_url: http://www.brunton-spall.co.uk
wordpress_id: 4664
wordpress_url: http://www.brunton-spall.co.uk/post/2012/11/15/bookmarks-for-november-11th/
date: '2012-11-15 07:00:01 +0000'
date_gmt: '2012-11-15 07:00:01 +0000'
categories:
- bookmarks
tags:
- programming
- tutorial
- python
- javascript
- html5
- deployment
- scala
- blog
- blogging
- bookmarked
- bootstrap
- prototyping
- book
- dependencies
- advice
- medium
- status
- quality
- process
- passion
comments: true
---

Things from around the web, as seen on November 11th through November 14th:

Doing what you can Vs. Doing what you must - What do you work on in the evenings and at weekends? What do you worry about at strange hours?  Some of us work because we must, because there's a driving force inside that just wont stop.

Velocity vs. Quality — Tech Talk - Code Quality versus product quality.  Just writing code fast, and cutting corners has compound costs, which I agree with.  But what is even more expensive is doing that at a product level.

Status Blog — Founders’ Stories - The status blog is an important way of communicating with your users.  It's helpful to have one that is external to your system, and as this story exemplifies, sometimes your status can really matter to some people

What we’re trying to do with Medium - Medium is a pretty new startup from Obvious.  It's aiming to be a slightly longer form twitter / blog style mashup, with recommended collectons and entertaining anecdotes.  It's beautifully clean and crisp, and currently in very limited beta

Pruning: Making room for something new - Do you treat your software and product lists like an overgrown hedge or a carefully cultured Topiary? Pruning old ideas can be important to let new things grow and reduce the maintenance burden.

7 Python Libraries you should know about - Exactly as it says, these are some great libraries. Dateutil in particular I consider a requirement for all my python projects now.

Freeze your requirements - A nice simple intro to why you need to understand your dependencies for your app.  This blog post is aimed at Python and pip users, but the moral is true for Maven, Ivy, C# and any other language with dependencies

Divshot - An Interface Builder for Bootstrap - Everything looks like Bootstrap at the moment, and there's a reason, it's easy to put something together that looks pretty good.  But it's also easy to break the layout and make things look bad.  A GUI for bootstrap webapps that works as well as this does is pretty damn amazing.

DOM Enlightenment - Exploring the relationship between JavaScript and the modern HTML DOM - A free version of a rather excellent looking book that talks about web development as it is today rather than what it was like in 1995.

Scala Second Impressions - Scala is an awesome language, but Rod says, it doesn't always make a great first impression because it merges OO and FP in such a unique way.

repository: bruntonspall/bruntonspall-site

extension: markdown

gha_language: JavaScript

repo_name: bruntonspall/bruntonspall-site


text:
# Puppet Labs SSH Keys #

Puppet Labs engineers and technical people should add their SSH public keys to
the templates directory of this project.

These keys are periodically copied to the Jenkins CI systems which are not
managed by Puppet.

# Usage #

If a host is not being managed by Puppet, then SSH access can be granted using
this process.

If the host has a cron that uses /etc/cron.hourly/ then simply copy the script into /etc/cron.hourly/ like this:

    cd /etc/cron.hourly/
    curl -O https://raw.github.com/puppetlabs/puppetlabs-sshkeys/master/templates/scripts/manage_root_authorized_keys
    chmod +x manage_root_authorized_keys

If the cron on the system does not support cron.hourly, the following crontab
entry may be used.

    mkdir -p /usr/local/bin
    cd /usr/local/bin
    curl -O https://raw.github.com/puppetlabs/puppetlabs-sshkeys/master/templates/scripts/manage_root_authorized_keys
    chmod +x manage_root_authorized_keys
    crontab -e

The entry should look like:

    # min hour dom month dow command
    59 * * * * /usr/local/bin/manage_root_authorized_keys

# Adding Keys #

Ideally, keys should be registered in the [User Account
Registry](https://docs.google.com/a/puppetlabs.com/spreadsheet/viewform?hl=en_US&formkey=dGl5YVFEX3R6a3p2Vm5wMlRkNDZaVWc6MQ#gid=2)
and then added to the templates/ssh/ directory of this repository, as username.pub and added to the authorized\_keys file too.
Once merged into the master branch, the keys will automatically be
copied to all of the hosts using this script.

EOF


text:
Written by Connor Freitas
Last Modified: 5/3/2017

Listen to the most recent stories coming out of Western Washington University's Western Today. This skill delivers a brief description from the 10 most recent news stories published on https://westerntoday.wwu.edu/news. This is achieved by scrapping the website for specific articles and stories to display to the listener. The skill uses the alexa-sdk along with request and cheerio to provide up to date, accurate, and robust results to the listener.

We hope that you enjoy!

This lambda function is written in Node.js
4.3

Note:

index.js must be in root directory

node_modules must be included in the root
directory

Zip all files in root directory for submission

Use https://developer.amazon.com for Alexa
Skill configuration and testing.

Use https://console.aws.amazon.com/lambda for
uploading and testing lambda function.


text:
---
title: Til
date: 2016-03-01 00:00:00 Z
---

Unless you want to install [hub](https://github.com/github/hub), transferring commits from one similar repo to another is a pain.

1. Add `.patch` to your github url for the commit, to download it as a formatted patch.
2. Save to the folder of the other repo (and maybe rename it, too).
3. In that folder run `git am your_patch_name.patch`

repository: sheck/til

branch_name: refs/heads/gh-pages

gha_language: SCSS

gha_license_id: MIT

repo_name: sheck/til


text:
---
assignees:
- derekwaynecarr
- janetkuo

---

This example demonstrates a typical setup to control for resource usage in a namespace.

It demonstrates using the following resources:

* [Namespace](/docs/admin/namespaces)
* [Resource Quota](/docs/admin/resourcequota/)
* [Limit Range](/docs/admin/limitrange/)

This example assumes you have a functional Kubernetes setup.

## Scenario

The cluster-admin is operating a cluster on behalf of a user population and the cluster-admin
wants to control the amount of resources that can be consumed in a particular namespace to promote
fair sharing of the cluster and control cost.

The cluster-admin has the following goals:

* Limit the amount of compute resource for running pods
* Limit the number of persistent volume claims to control access to storage
* Limit the number of load balancers to control cost
* Prevent the use of node ports to preserve scarce resources
* Provide default compute resource requests to enable better scheduling decisions

## Step 1: Create a namespace

This example will work in a custom namespace to demonstrate the concepts involved.

Let's create a new namespace called quota-example:

```shell
$ kubectl create -f docs/admin/resourcequota/namespace.yaml
namespace "quota-example" created
$ kubectl get namespaces
NAME            STATUS    AGE
default         Active    2m
kube-system     Active    2m
quota-example   Active    39s
```

## Step 2: Apply an object-count quota to the namespace

The cluster-admin wants to control the following resources:

* persistent volume claims
* load balancers
* node ports

Let's create a simple quota that controls object counts for those resource types in this namespace.

```shell
$ kubectl create -f docs/admin/resourcequota/object-counts.yaml --namespace=quota-example
resourcequota "object-counts" created
```

The quota system will observe that a quota has been created, and will calculate consumption
in the namespace in response.  This should happen quickly.

Let's describe the quota to see what is currently being consumed in this namespace:

```shell
$ kubectl describe quota object-counts --namespace=quota-example
Name:                  object-counts
Namespace:             quota-example
Resource               Used	Hard
--------               ----	----
persistentvolumeclaims 0    2
services.loadbalancers 0    2
services.nodeports     0    0
```

The quota system will now prevent users from creating more than the specified amount for each resource.

## Step 3: Apply a compute-resource quota to the namespace

To limit the amount of compute resource that can be consumed in this namespace,
let's create a quota that tracks compute resources.

```shell
$ kubectl create -f docs/admin/resourcequota/compute-resources.yaml --namespace=quota-example
resourcequota "compute-resources" created
```

Let's describe the quota to see what is currently being consumed in this namespace:

```shell
$ kubectl describe quota compute-resources --namespace=quota-example
Name:                  compute-resources
Namespace:             quota-example
Resource               Used Hard
--------               ---- ----
limits.cpu             0    2
limits.memory          0    2Gi
pods                   0    4
requests.cpu           0    1
requests.memory        0    1Gi
```

The quota system will now prevent the namespace from having more than 4 non-terminal pods.  In
addition, it will enforce that each container in a pod makes a `request` and defines a `limit` for
`cpu` and `memory`.

## Step 4: Applying default resource requests and limits

Pod authors rarely specify resource requests and limits for their pods.

Since we applied a quota to our project, let's see what happens when an end-user creates a pod that has unbounded
cpu and memory by creating an nginx container.

To demonstrate, lets create a deployment that runs nginx:

```shell
$ kubectl run nginx --image=nginx --replicas=1 --namespace=quota-example
deployment "nginx" created
```

Now let's look at the pods that were created.

```shell
$ kubectl get pods --namespace=quota-example
```

What happened?  I have no pods!  Let's describe the deployment to get a view of what is happening.

```shell
$ kubectl describe deployment nginx --namespace=quota-example
Name:                   nginx
Namespace:              quota-example
CreationTimestamp:      Mon, 06 Jun 2016 16:11:37 -0400
Labels:                 run=nginx
Selector:               run=nginx
Replicas:               0 updated | 1 total | 0 available | 1 unavailable
StrategyType:           RollingUpdate
MinReadySeconds:        0
RollingUpdateStrategy:  1 max unavailable, 1 max surge
OldReplicaSets:         <none>
NewReplicaSet:          nginx-3137573019 (0/1 replicas created)
...
```

A deployment created a corresponding replica set and attempted to size it to create a single pod.

Let's look at the replica set to get more detail.

```shell
$ kubectl describe rs nginx-3137573019 --namespace=quota-example
Name:                   nginx-3137573019
Namespace:              quota-example
Image(s):               nginx
Selector:               pod-template-hash=3137573019,run=nginx
Labels:                 pod-template-hash=3137573019
                        run=nginx
Replicas:               0 current / 1 desired
Pods Status:            0 Running / 0 Waiting / 0 Succeeded / 0 Failed
No volumes.
Events:
  FirstSeen	LastSeen	Count From                    SubobjectPath Type      Reason        Message
  ---------	--------  ----- ----                    -------------	--------  ------        -------
  4m        7s        11    {replicaset-controller }              Warning   FailedCreate  Error creating: pods "nginx-3137573019-" is forbidden: Failed quota: compute-resources: must specify limits.cpu,limits.memory,requests.cpu,requests.memory
```

The Kubernetes API server is rejecting the replica set requests to create a pod because our pods
do not specify `requests` or `limits` for `cpu` and `memory`.

So let's set some default values for the amount of `cpu` and `memory` a pod can consume:

```shell
$ kubectl create -f docs/admin/resourcequota/limits.yaml --namespace=quota-example
limitrange "limits" created
$ kubectl describe limits limits --namespace=quota-example
Name:           limits
Namespace:      quota-example
Type      Resource  Min  Max  Default Request   Default Limit   Max Limit/Request Ratio
----      --------  ---  ---  ---------------   -------------   -----------------------
Container memory    -    -    256Mi             512Mi           -
Container cpu       -    -    100m              200m            -
```

If the Kubernetes API server observes a request to create a pod in this namespace, and the containers
in that pod do not make any compute resource requests, a default request and default limit will be applied
as part of admission control.

In this example, each pod created will have compute resources equivalent to the following:

```shell
$ kubectl run nginx \
  --image=nginx \
  --replicas=1 \
  --requests=cpu=100m,memory=256Mi \
  --limits=cpu=200m,memory=512Mi \
  --namespace=quota-example
```

Now that we have applied default compute resources for our namespace, our replica set should be able to create
its pods.

```shell
$ kubectl get pods --namespace=quota-example
NAME                     READY     STATUS    RESTARTS   AGE
nginx-3137573019-fvrig   1/1       Running   0          6m
```

And if we print out our quota usage in the namespace:

```shell
$ kubectl describe quota --namespace=quota-example
Name:           compute-resources
Namespace:      quota-example
Resource        Used    Hard
--------        ----    ----
limits.cpu      200m    2
limits.memory   512Mi   2Gi
pods            1       4
requests.cpu    100m    1
requests.memory 256Mi   1Gi

Name:                 object-counts
Namespace:            quota-example
Resource              Used    Hard
--------              ----    ----
persistentvolumeclaims 0      2
services.loadbalancers 0      2
services.nodeports     0      0
```

As you can see, the pod that was created is consuming explict amounts of compute resources, and the usage is being
tracked by Kubernetes properly.

## Step 5: Advanced quota scopes

Let's imagine you did not want to specify default compute resource consumption in your namespace.

Instead, you want to let users run a specific number of `BestEffort` pods in their namespace to take
advantage of slack compute resources, and then require that users make an explicit resource request for
pods that require a higher quality of service.

Let's create a new namespace with two quotas to demonstrate this behavior:

```shell
$ kubectl create namespace quota-scopes
namespace "quota-scopes" created
$ kubectl create -f docs/admin/resourcequota/best-effort.yaml --namespace=quota-scopes
resourcequota "best-effort" created
$ kubectl create -f docs/admin/resourcequota/not-best-effort.yaml --namespace=quota-scopes
resourcequota "not-best-effort" created
$ kubectl describe quota --namespace=quota-scopes
Name:       best-effort
Namespace:  quota-scopes
Scopes:     BestEffort
 * Matches all pods that have best effort quality of service.
Resource    Used	Hard
--------    ----  ----
pods        0     10

Name:             not-best-effort
Namespace:        quota-scopes
Scopes:           NotBestEffort
 * Matches all pods that do not have best effort quality of service.
Resource          Used  Hard
--------          ----  ----
limits.cpu        0     2
limits.memory     0     2Gi
pods              0     4
requests.cpu      0     1
requests.memory   0     1Gi
```

In this scenario, a pod that makes no compute resource requests will be tracked by the `best-effort` quota.

A pod that does make compute resource requests will be tracked by the `not-best-effort` quota.

Let's demonstrate this by creating two deployments:

```shell
$ kubectl run best-effort-nginx --image=nginx --replicas=8 --namespace=quota-scopes
deployment "best-effort-nginx" created
$ kubectl run not-best-effort-nginx \
  --image=nginx \
  --replicas=2 \
  --requests=cpu=100m,memory=256Mi \
  --limits=cpu=200m,memory=512Mi \
  --namespace=quota-scopes
deployment "not-best-effort-nginx" created
```

Even though no default limits were specified, the `best-effort-nginx` deployment will create
all 8 pods.  This is because it is tracked by the `best-effort` quota, and the `not-best-effort`
quota will just ignore it.  The `not-best-effort` quota will track the `not-best-effort-nginx`
deployment since it creates pods with `Burstable` quality of service.

Let's list the pods in the namespace:

```shell
$ kubectl get pods --namespace=quota-scopes
NAME                                     READY     STATUS    RESTARTS   AGE
best-effort-nginx-3488455095-2qb41       1/1       Running   0          51s
best-effort-nginx-3488455095-3go7n       1/1       Running   0          51s
best-effort-nginx-3488455095-9o2xg       1/1       Running   0          51s
best-effort-nginx-3488455095-eyg40       1/1       Running   0          51s
best-effort-nginx-3488455095-gcs3v       1/1       Running   0          51s
best-effort-nginx-3488455095-rq8p1       1/1       Running   0          51s
best-effort-nginx-3488455095-udhhd       1/1       Running   0          51s
best-effort-nginx-3488455095-zmk12       1/1       Running   0          51s
not-best-effort-nginx-2204666826-7sl61   1/1       Running   0          23s
not-best-effort-nginx-2204666826-ke746   1/1       Running   0          23s
```

As you can see, all 10 pods have been allowed to be created.

Let's describe current quota usage in the namespace:

```shell
$ kubectl describe quota --namespace=quota-scopes
Name:            best-effort
Namespace:       quota-scopes
Scopes:          BestEffort
 * Matches all pods that have best effort quality of service.
Resource         Used  Hard
--------         ----  ----
pods             8     10

Name:               not-best-effort
Namespace:          quota-scopes
Scopes:             NotBestEffort
 * Matches all pods that do not have best effort quality of service.
Resource            Used  Hard
--------            ----  ----
limits.cpu          400m  2
limits.memory       1Gi   2Gi
pods                2     4
requests.cpu        200m  1
requests.memory     512Mi 1Gi
```

As you can see, the `best-effort` quota has tracked the usage for the 8 pods we created in
the `best-effort-nginx` deployment, and the `not-best-effort` quota has tracked the usage for
the 2 pods we created in the `not-best-effort-nginx` quota.

Scopes provide a mechanism to subdivide the set of resources that are tracked by
any quota document to allow greater flexibility in how operators deploy and track resource
consumption.

In addition to `BestEffort` and `NotBestEffort` scopes, there are scopes to restrict
long-running versus time-bound pods.  The `Terminating` scope will match any pod
where `spec.activeDeadlineSeconds is not nil`.  The `NotTerminating` scope will match any pod
where `spec.activeDeadlineSeconds is nil`.  These scopes allow you to quota pods based on their
anticipated permanence on a node in your cluster.

## Summary

Actions that consume node resources for cpu and memory can be subject to hard quota limits defined by the namespace quota.

Any action that consumes those resources can be tweaked, or can pick up namespace level defaults to meet your end goal.

Quota can be apportioned based on quality of service and anticipated permanence on a node in your cluster.

gha_language: HTML


text:
---
layout: page
title: About
---

I am a software engineer focused on providing solutions.  I believe that software and technology allows me to have a wider impact on the world.

Beginning in January 2018, I joined the merchant team at [Postmates](http://www.postmates.com).  I'm excited about the problem space that we work on and interested in seeing how teams work when total engineers > 100.

Prio to Postmates, I worked at [FiveStars](http://www.fivestars.com).  The culture, environment, and people are just what I was looking for as I made my career change away from non-profits.

I graduated from Hack Reactor Cohort 23 in March, 2015.  I have a Computer Science and Computer Engineering BS from [UC Davis](http://ucdavis.edu) in 2004.

In this blog I enjoy writing about tech, algorithms, and other things that interest me.

Previously, I spent the last 10 years working in the affordable housing industry, specifically in property management.  This work allowed me to give directly back to my community.  I am so grateful for the opportunity and for the many wonderful colleagues that I had the pleasure of working with.

Here are the companies that I have worked for:

* [Postmates](http://www.postmates.com)
* [FiveStars](http://www.fivestars.com)
* [SAHA](http://www.sahahomes.org)
* [TNDC](http://www.tndc.org)
* [Eden Housing](http://www.edenhousing.org)

Here are links to my various profiles:

* [LinkedIn](https://www.linkedin.com/in/zacharylopez)
* [GitHub](https://github.com/zdlopez)
* [Twitter](https://twitter.com/zdlopez)


text:
# Graphein - a Python Library for Geometric Deep Learning and Network Analysis on Biomolecular Structures and Interaction Networks

```
@incollection{graphein_neurips22,
author = {Rokkum Jamasb, Arian and Vi{\~n}as Torn{\'e}, Ramon and J Ma, Eric and Du, Yuanqi and Harris, Charles and Huang, Kexin and Hall, Dominic and Lio, Pietro and Leon Blundell, Tom},
title = {Graphein - a Python Library for Geometric Deep Learning and Network Analysis on Biomolecular Structures and Interaction Networks},
booktitle = {Advances in Neural Information Processing Systems (NeurIPS) 35},
pages = {27153--27167},
year = {2022},
publisher = {Curran Associates, Inc.}
}
```

links
- [neurips](https://nips.cc/Conferences/2022/Schedule?showEvent=52852)
- [openreview](https://openreview.net/forum?id=9xRZlV6GfOX)
- [biorxiv](https://www.biorxiv.org/content/10.1101/2<IP_ADDRESS>701v2)
- [proceedings](https://papers.nips.cc//paper_files/paper/2022/hash/ade039c1db0391106a3375bd2feb310a-Abstract-Conference.html)

gha_language: Jupyter Notebook


text:
#### Which issue(s) does this change fix?
<!-- Use the format #<issue-number>, e.g. #42 -->

#### Why is this change necessary?

#### How does it address the issue?

#### What side effects does this change have?

#### Mandatory Checklist
**PRs will only be reviewed after checklist is complete**

- [ ] Add input/output [type hints](https://docs.python.org/3/library/typing.html) to new functions/methods
- [ ] Write design document if needed ([Do I need to write a design document?](https://github.com/aws/aws-sam-cli/blob/develop/DEVELOPMENT_GUIDE.md#design-document))
- [ ] Write/update unit tests
- [ ] Write/update integration tests
- [ ] Write/update functional tests if needed
- [ ] `make pr` passes
- [ ] `make update-reproducible-reqs` if dependencies were changed
- [ ] Write documentation

By submitting this pull request, I confirm that my contribution is made under the terms of the [Apache 2.0 license](https://www.apache.org/licenses/LICENSE-2.0).

repository: aws/aws-sam-cli

branch_name: refs/heads/develop

gha_language: Python

repo_name: aws/aws-sam-cli


text:
---
title: "Sixty years a Queen, with unflinching grace and steadfast devotion to duty"
categories: ["Sundry"]
tags: [UK, Commonwealth, "HM The Queen", Jubilee]
seoTitle: "Donald Jenkins: Sixty years a Queen, with unflinching grace and steadfast devotion to duty"
date: 2012-02-06T08:35:24+00:00
type: articles
notable: true
layout: "single"
slug: "sixty-years-a-queen-with-unflinching-grace-and-steadfast-devotion-to-duty"
draft: false
description: "HM The Queen's Diamond Jubilee offers us an opportunity to reflect on a life devoted entirely to the service of her peoples both in the United Kingdom and in the Commonwealth."
summary: "HM The Queen's Diamond Jubilee offers us an opportunity to reflect on a life devoted entirely to the service of her peoples both in the United Kingdom and in the Commonwealth.  It is surely it appropriate today to reflect on what we owe Her Majesty as a nation, as does the vibrant community of countries whose unity she has symbolised for all these years."
featured_image: "4dca6186-bc55-4254-028f-11e8d090ca00"
author: "Donald Jenkins"
showthedate: false
tableofcontents: false
noindex: false
---

We celebrate today the sixtieth anniversary of Her Majesty The Queen’s accession. Those of my fellow citizens who, like I, throughout the Commonwealth, have had the privilege of being her subjects for our entire lives must often — out of habit and, perhaps, a very English need for understatement in all things, especially the more important ones — have taken our Sovereign for granted. Yet I think it appropriate today to reflect on what we owe Her Majesty as a nation, as does the vibrant community of countries whose unity she has symbolised for all these years.

{{% img src="34e69122-87a2-454d-074e-43ff2d59ce00" caption="Note written to her parents by HRH The Princess Elizabeth, then aged eleven, on the occasion of their coronation (1937)." %}}

This is because anyone with even a summary knowledge of our history, with all its vicissitudes, will know in his or her heart how deeply fortunate we have been in our Queen, in the midst of the unprecedented change that has unfolded in these islands since that cold winter morning in 1952 when the world learned that George VI, that brave, shy yet unstintingly dutiful monarch, had passed peacefully away in his sleep.

{{% video-new src="ff8d43af75ff6bb5defc97456ca3f44a" thumb-time="10" %}}
Her Majesty The Queen was [proclaimed](https://en.wikipedia.org/wiki/Proclamation_of_accession_of_Elizabeth_II) throughout the Commonwealth after her father, King George VI, died in the early hours of 6th February, 1952, while Her Majesty, traveling as HRH The Princess Elizabeth, was visiting Kenya.
{{% /video-new %}}

The beautiful young woman who succeeded him inherited every bit of her father’s sense of duty and simplicity and has made good the vow she made, before God, to the Commonwealth, on her twenty-first birthday: more, perhaps, than any of her glorious predecessors, she has acted devotedly and modestly, for six decades, towards the common good of her subjects throughout the world. Her Majesty has never let us down, even in the most trying of situations. Indeed on countless occasions — including last year on her state visit to Ireland — she has found the words to express what was right and honourable for us as a nation, without regard for her own personal circumstances.

{{% video-new src="dabd54f02ed744b61f97557f68b7e6de" %}}
{{% quote %}}I declare before you all that my whole life whether it be long or short shall be devoted to your service and the service of our great imperial family to which we all belong.{{% /quote %}} On her twenty-first birthday, 21st April, 1947, Princess Elizabeth was with her parents and younger sister on a tour of South Africa. In a speech broadcast on the radio from Cape Town, the Princess dedicated her life to the service of the Commonwealth.
{{% /video-new %}}

I am certain all will wish to join me in paying tribute to our beloved Sovereign in the prayer composed, with Her Majesty’s participation, and [published]({{% assets documents %}}diamond-jubilee-liturgical-resources.pdf) by the Church of England on the occasion of the sixtieth anniversary of her accession:

> God of time and eternity,
>  whose Son reigns as servant, not master;
>  we give you thanks and praise
>  that you have blessed this Nation, the Realms and Territories with Elizabeth
>  our beloved and glorious Queen.
>  In this year of Jubilee,
>  grant her your gifts of love and joy and peace
>  as she continues in faithful obedience to you, her Lord and God and in devoted service to her lands and peoples,
>  and those of the Commonwealth,
>  now and all the days of her life;
>  through Jesus Christ our Lord.
>  Amen.

repository: donaldjenkins/donaldjenkins

branch_name: refs/heads/main

repo_name: donaldjenkins/donaldjenkins


text:
# `targets` package minimal example

[![Launch RStudio
Cloud](https://img.shields.io/badge/RStudio-Cloud-blue)](https://rstudio.cloud/project/1430691)

This repository is an example data analysis workflow with
[`targets`](https://github.com/wlandau/targets). The pipeline reads the
data from a file, preprocesses it, visualizes it, and fits a regression
model.

## The `targets` pipeline

The [`targets`](https://github.com/wlandau/targets) R package manages
the workflow. It automatically skips steps of the pipeline when the
results are already up to date, which is critical for larger projects.
[`targets`](https://github.com/wlandau/targets) also helps users
understand their workflows with interactive dependency graphs
(screenshot below).

``` r
library(targets)
tar_visnetwork()
```

![](./images/graph.png)

## File structure

The files in this example are organized as follows.

``` r
├── _targets.R
├── R/
├──── functions.R
├── data/
└──── raw_data.csv
```

| File                                                                                | Purpose                                                                                |
| --------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [`_targets.R`](https://github.com/wlandau/targets-minimal/blob/main/_targets.R)               | The special R script that declares the [`targets`](https://github.com/wlandau/targets) pipeline. See `tar_script()` for details.                                                                                |
| [`R/functions.R`](https://github.com/wlandau/targets-minimal/blob/main/R/functions.R)         | An R script with user-defined functions. Unlike [`_targets.R`](https://github.com/wlandau/targets-minimal/blob/main/_targets.R), there is nothing special about the name or location of this script. In fact, for larger projects, it is good practice to partition functions into multiple files. |
| [`data/raw_data.csv`](https://github.com/wlandau/targets-minimal/blob/main/data/raw_data.csv) | The raw `airquality` dataset.                                                                                |

## How to access

You can try out the example as long as you have a browser and an
internet connection. [Click here](https://rstudio.cloud/project/1430691)
to navigate your browser to an RStudio Cloud instance. No downloads or
installations required.

## How to run

1.  If you are running locally instead of [this RStudio cloud
    workspace](https://rstudio.cloud/project/1430691)
    1.  Install the [`targets`](https://github.com/wlandau/targets)
        package, as well as the packages listed in the
        `tar_option_set()` call in
        [`_targets.R`](https://github.com/wlandau/targets-minimal/blob/main/_targets.R).
    2.  Download the files in [this
        repository](https://github.com/wlandau/targets-minimal), either
        [through
        Git](https://happygitwithr.com/existing-github-first.html#new-rstudio-project-via-git-clone)
        or through [this
        link](https://github.com/wlandau/targets-minimal/archive/main.zip).
2.  Run the `targets` pipeline by typing
    [`tar_make()`](https://wlandau.github.io/targets/reference/tar_make.html)
    in the R console.
3.  View the results with
    [`tar_load()`](https://wlandau.github.io/targets/reference/tar_load.html)
    or
    [`tar_read()`](https://wlandau.github.io/targets/reference/tar_read.html),
    e.g. `tar_read(hist)`.

repository: robitalec/targets-minimal

gha_license_id: NOASSERTION

repo_name: robitalec/targets-minimal


text:
---
path:	"/blog/they-just-want-to-code-or-design-all-day"
date:	"2018-05-30"
title:	"“They Just Want To Code (or Design) All Day”"
image<EMAIL_ADDRESS>---

<EMAIL_ADDRESS>
Quick post…

One of the biggest mistakes you can make as a product manager is to assume that the developers (and designers) you work with do not care about impact and outcomes. I have heard PMs say things like:

> Well, you know, developers just like to put their headphones on and code.Or

> Designers just like to make things pretty, and use the latest tricks“When have you shared actual outcomes with the team?” I’ll ask. Crickets. It is somehow difficult for them to process that individuals can really enjoy going super deep in their craft AND be interested in whether any of it mattered. And maybe a bit of jealously — “I’m in meetings all day, and my neck is on the line, and they’re just making stuff and playing foosball! We’ve got a deadline!”

Part of this, I think, is that when outcomes/impacts are not readily visible there *is* a tendency to fall back into craft.

> I’m not holding my breath on the product. But for right now — while I vest — I’m enjoying learning about these technologies.Or

> Well, the design is something that I can control. We never iterate on our MVPs, so I have to work super hard to get it as right as possible off the batt.So what these product managers might be seeing is the *result of *not engaging the team. They’re *right*, but *not for the right reasons*. This is common when there’s a lot of accumulated career cynicism…the team may have never experienced real wins, so they don’t even go there.

So…PMs. This is something you can control. Don’t assume people are disinterested or overly craft-obsessed (some are, and that’s OK). Share wins. Share misses (yours especially). Share data. Invite customers into the process. Your team likely cares more than they feel comfortable letting on AND they enjoying doing their thing all day.

repository: johnpcutler/cutlefishblog

repo_name: johnpcutler/cutlefishblog


text:
SingleViewApp template
=
This template can be used for simple application that has just one view, this template can be used for creating applications similar to __Flash light__ app or __Calculator app__.

→ [__Demo__](http://htmlpreview.github.io/?https://raw.github.com/krisrak/appframework-templates/master/template-SingleViewApp.html) → [Code](https://github.com/krisrak/appframework-templates/blob/master/template-SingleViewApp.html)

![SingleViewApp](https://raw.github.com/krisrak/appframework-templates/master/screenshots/SingleViewApp.png)

SingleView with header and footer
-
The HTML code for creating the above UI looks like this:
```
<div id="afui">
    <div id="content">
        <div class="panel" title="Title" id="page1" selected="true">
            <p>This is a Single View App template</p>
        </div>
    </div>
</div>
```
The `#content` DIV contains all the pages for app, the `.panel` DIV with `title` attribute will create a header on top with the `title`. A blank footer (also refered to as `#navbar`) is also created by default with this HTML code.

SingleView with no footer
-
If you want to create a page with just header and no footer, then you can set attribute `data-footer="none"` in the `.panel` DIV:
```
        <div class="panel" title="Title" id="page1" data-footer="none" selected="true">
        </div>
```

SingleView with header buttons
-
You will have to add a `<header>` element within the `.panel` to create a header with button on left and right. This `<header>` should also contain a `<h1>` element that will become the title for the page. The code for SingleView app with header buttons will look like this:
```
        <div class="panel" title="Title" id="page1" selected="true">
            <header>
                <h1>New Title</h1>
                <a href="#" class="button icon location" onclick="foo()"></a>
                <a href="#settings" class="button icon settings" style="float:right">Setup</a>
            </header>
            <p>This is a Single View App template</p>
        </div>
```
Things to note:
- `<h1>` element for title should be the first element, this text will override the `title` attribute in the `.panel`
- button can be specified like any other `afui` button
- button on the right should have a `style="float:right"`

![SingleViewApp](https://raw.github.com/krisrak/appframework-templates/master/screenshots/SingleViewApp-header.png)

→ [__Demo__](http://htmlpreview.github.io/?https://raw.github.com/krisrak/appframework-templates/master/template-SingleViewApp-header.html) → [Code](https://github.com/krisrak/appframework-templates/blob/master/template-SingleViewApp-header.html)

If you plan to use this same header in a different page then you can and a `id` move the `<header>` outside the `#content` DIV and reference the header `id` in the `.panel`'s `data-header` attribute. The code will look like this:
```
<div id="afui">

    <header id="header1">
        <h1>New Title</h1>
        <a href="#" class="button icon location" onclick="foo()"></a>
        <a href="#settings" class="button icon settings" onclick="foo()" style="float:right">Setup</a>
    </header>

    <div id="content">
        <div class="panel" title="Title" id="page1" data-header="header1" selected="true">
            <p>This is a Single View App template</p>
        </div>
    </div>

</div>
```
Documentation
-
Full documentation for AFUI are below, it explains all the attributes for `.panel` and also javascript properties and methods for manupilating UI:
- [Page Layout](http://app-framework-software.intel.com/documentation.php#afui/afui_layout)
- [Panel properties](http://app-framework-software.intel.com/documentation.php#afui/afui_panels)
- [Full Documentation](http://app-framework-software.intel.com/documentation.php#afui/afui_about)


text:
# webui

## Development

To set up a development environment

1. Install `go` v1.16
2. Install Node.js version 14.15.1
3. Install `reflex` for automated server builds: `go get github.com/cespare/reflex`
4. [Install `kubebuilder`](https://book.kubebuilder.io/quick-start.html#installation)
5. `npm install --silent` to install UI dependencies
6. `make dev` to compile and run the app
7. `npm start` to start the frontend dev server (with hot-reloading)

To generate protobuf files natively on your OS, install [protoc](https://grpc.io/docs/protoc-installation/), then install these packages:

```shell
go get -u github.com/golang/protobuf/protoc-gen-go
go get -u github.com/twitchtv/twirp/protoc-gen-twirp
go get -u go.larrymyers.com/protoc-gen-twirp_typescript
```

Then run:

```shell
make proto
```

repository: dan-slinky-ckpd/webui

repo_name: dan-slinky-ckpd/webui


text:
---
layout: post
title: SQL References
categories: [database]
tags: [sql]
description: the collection of SQL relate articles.
---

## Basic

* Database Normalization
  * [normalization](https://en.wikipedia.org/wiki/Database_normalization)
    > Database normalization, or simply normalization, is the process of organizing the columns (attributes) and tables (relations) of a relational database to minimize data redundancy.
  * [An Introduction to Database Normalization](http://mikehillyer.com/articles/an-introduction-to-database-normalization/)
  * [Database normalization in MySQL: Four quick and easy steps](http://www.computerweekly.com/tutorial/Database-normalization-in-MySQL-Four-quick-and-easy-steps)

## Syntax

* SQL joins
  * [A Visual Explanation of SQL Joins](https://blog.codinghorror.com/a-visual-explanation-of-sql-joins/)


text:
# NativeScript Tappy

{N} plugin for integrating with the iOS sdk for [https://github.com/TapTrack/TCMPTappy-iOS]()

## Demo

The demo app scans for TapTrack devices, connects, and performs read and write actions.
To run the demo:

cd demo

npm install

tns platform add ios

tns run ios

## License

Apache License Version 2.0, January 2004

repository: fhackenb/nativescript-tappy

gha_language: TypeScript

repo_name: fhackenb/nativescript-tappy


text:
---
layout: default
---

# 1994-08-19 - No Subject

## Header Data

From<EMAIL_ADDRESS>To<EMAIL_ADDRESS>Message Hash: abd29ec8ab309c060febed698349ae46d69097610501915dbe13479b91331a69

Message ID<EMAIL_ADDRESS>Reply To: _N/A_

UTC Datetime: 1994-08-19 14:24:33 UTC

Raw Date: Fri, 19 Aug 94 07:24:33 PDT

## Raw message

```
{% raw  %}From<EMAIL_ADDRESS>Date: Fri, 19 Aug 94 07:24:33 PDT
To<EMAIL_ADDRESS>Subject: No Subject
Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

Hi, guys|

I just received my T-shirt as a birthday-gift from my brother|

Or is this just a fraud...?

-mogsie-  finger <erikmo at oslonett.no> for PGP key

{% endraw %}
```

## Thread

+ Return to [August 1994](/archive/1994/08)

+ Return to "[mogsie@VNET.IBM.COM](/authors/mogsie_at_vnet_ibm_com)"
+ Return to "[NetSurfer <jdwilson@gold.chem.hawaii.edu>](/authors/netsurfer_jdwilson_at_gold_chem_hawaii_edu_)"

+ 1994-08-19 (Fri, 19 Aug 94 07:24:33 PDT) - No Subject -<EMAIL_ADDRESS>  + 1994-08-23 (Mon, 22 Aug 94 18:58:37 PDT) - [Re: your mail](/archive/1994/08/a1959e23590248df9d34a55bd6d24e004490582707047acfbd52730b33d6d83d) - _NetSurfer<EMAIL_ADDRESS>


text:
# CDK ECR Sync

An CDK Construct to synchronizes Docker images from Docker Hub to ECR.

![](https://github.com/pgarbe/cdk-ecr-sync/workflows/Build/badge.svg)

Why should you use it?

1. Avoid [DockerHub throttling](https://www.docker.com/increase-rate-limits)
2. Better availability (ECR: [99.9%](https://aws.amazon.com/ecr/sla/), DockerHub: ["as is"](https://www.docker.com/sites/default/files/d8/2019-04/docker-master-subscription-and-services-agreement-april-2019.pdf))
3. Possible less data transfer costs (ECS pulls from ECR in same region are [free](https://aws.amazon.com/ecr/pricing/))

See also my blog post: https://garbe.io/blog/2020/04/22/cdk-ecr-sync/

## How to use it

In your CDK application, run `npm install @pgarbe/cdk-ecr-sync` and add the following construct:

```typescript
const ecrSync = new EcrSync(this, 'ecrSync', {
  repoPrefix: 'dockerhub-mirror', // optional prefix
  dockerImages: [
    {
      imageName: 'datadog/agent',
      excludeTags: [  // Use RegEx expressions to exclude specific tags
        'latest',
        '^1.0'
      ],
    }
  ],
  lifcecyleRule: {...} // Optional lifecycle rule for ECR repos
});

// Allow all accounts in your organization to pull
ecrSync.grantPull(new iam.OrganizationalPrincipal('o-123456'));
```

See also `examples` folder.

### Trigger the sync manually

Look up for a lambda called `*ecrSync*%*`, add an empty test event, and execute it. The lambda will check which images needs to be synced and trigger a CodePipeline.

repository: pgarbe/cdk-ecr-sync

repo_name: pgarbe/cdk-ecr-sync


text:
# Invoke-RoboCopy

PowerShell cmdlet wrapper for RoboCopy.

By default all output is suppressed and RoboCopy will log to a random file.
Specify a log location if you desire logs.

You can, of course, also specify the switches (but don't add "/LOG" yourself!), the default switches are "/NP /MIR /R:3 /W:5".

With -Verbose it shows you the src/dst, logfile and result of every RoboCopy invocation.

repository: jootuom/posh-robocopy

repo_name: jootuom/posh-robocopy


text:
[![Build Status](https://travis-ci.org/mkftrivadis/sort.svg?branch=master)](https://travis-ci.org/mkftrivadis/sort)
# sort - **another AngularJS sorting plugin**

This plugin allows you to sort tabular data in a simple way. Sorting can be done automatically for the primitives types and dates. You can also provide a custom (provide) sort function.

### Dependencies
AngularJS 1.3.1+

### Installation
Include **sort.js** and **sort.css** in your scripts. Feel free to customize sort.css as the classes are actually very simple.

### Usage
Been here already? then [jump to the summary table](#summary-of-usage)

Although the most common usage would be to used a *ng-repeat* to display tabular data, this plugin doesn't require a *ng-repeat*. In fact, the data are not copied by the plugin but rather sorted directly at the source.
#### Simplest Form
Assuming you have the following configuration:

**Model**
```javascript
$scope.persons = [{ name: 'Maurice', age: '10' }, { name: 'Your name', age: 0 }, ...];
```

**View**

```html
<div sort="persons">
  <div sort-property="name">Name</div>
  <div sort-property="age" sort-default="true">Age</div>
<div>
```
As you probably figured out:
- you have two headers which allows you to sort persons by name or age.
- **sort** defines the data to be sorted- **sort-property** declares the property to be used to sort the data upon click
- with **sort-default**, you can set the default initial sorting property. If it is not defined then the data will be initially displayed as they are in the model.

Note that in the example above, you'll basically have to take care of displaying the data. Using the plugin in a table with a *ng-repeat* should be something like:
```html
<table sort="persons">
  <tr>
    <th sort-property="name">Name</th>
    <th sort-property="age" sort-default="true">Age</th>  </tr>
  <tr ng-repeat="person in persons">
    <td>{{person.name}}</td>
    <td>{{person.age}}</td>
  </tr>
</table>
```
Notice that despite the *ng-repeat* directive, you still need to define the model the plugins should work on with `sort="persons"`. In the remainder of this readme, `<div>...</div>` will be used.

#### Sort Order
Order is achieved through *sort-order*. Allowed values are `asc` and `desc`. By default, the sort order is ascending if not specified otherwise.

Clicking on a header always reverses the sorting. For instance, if the data are not sorted, clicking on a header will sort it ascending; clicking again on the same header will sort the data descending and so on. A css class (`sort-asc` or `sort-desc`) is always appended to the header to reflect the current sort order.

Note that you can combine *sort-order* and *sort-default*.
```html
<div sort-property="name" sort-default="true" sort-order="desc"></div>
```
#### Sorting Date
Out of the box, the plugin provides sorting for simple types like `int`, `string` and `bool`. The type `Date` is also suppported but needs to be enabled with `| date` through *sort-property*. Assuming that the property is called *myDateProperty* and that it is a date object or an international formatted date string like `2016-03-19T04:22:14` for instance, you shoud activate sorting with the following code:
```html
sort-property="myDateProperty | date"
```
Although the syntax above looks like a filter is being applied, it really isn't. Back in the code, the value of *sort-property* is parsed to and attempt to convert the string to a Date object is made.

#### Custom Sorting Function
You can bypass the out of the box sorting function by providing your own function through the **sort-refresh** attribute. The function provided there should expect 4 parameters:

1. The property to be sorted upon as a string
2. The sorting order as a string i.e. `asc` or `desc`
3. 'date' or null depending on whether date sorting is enabled as described in [Sorting Date](#sorting-date)
4. The preset array (see later in (#setting-a-preset-for-sorting) or null

The custom function is not given per property but rather global for all properties and should therefore be configured on the same level as the model. Assuming the following definitions in your model:

```javascript
$scope.persons = [...];
$scope.myCustomSort =  function(prop, order, date, preset) {
  ...
};
```
your view should be similar to the following:

```html
<div sort="persons" sort-refresh="myCustomSort">
  <div sort-property="name"></div>
  <div sort-property="age"></div>
</div>```
So clicking on the name header for instance shall trigger a call of your custom function `myCustomSort` with the 4 parameters set as follow
```javascript
myCustomSort('name', 'asc', null, null)
```

#### Custom Asynchronous Sort Function
If you use an asynchronous custom sorting function, you'll want to return a promise. Internally, the returned promise is required in order to set the css classes accordingly when the promise is resolved or do nothing if it's rejected. For instance your custom sorting function should look like:
```javascript
$scope.myCustomSort = function(prop, order, date, preset) {
  return $http.get(url).then(..., ...);
};
```

#### Setting a Preset for Sorting
As explained previously, the custom sorting function is global for all properties and receives the property name as the first parameter. Anyway, the plugin allows you to customize sorting on the property level only for a very special case.

Assume that you have an array of persons with *name*, *age* and *status* which should signal their marital status through a `string` e.g. *married*, *divorced*, *single*, *widowed* just to name a few. Out of the box, you could only order people alphabetically according to their marital status. But if you needed the marital status to be sorted logically i.e. from *single* to *widowed* in the ascending case and reversely in the descending case, you could write a custom function. Good news: you actually don't need to :)

Through the **sort-preset**, you could predefine an ascending order with which a property could be sorted. For instance doing this:
```javascript
$scope.myPresetForStatus = ['single', 'married', 'divorced', 'widowed'];
```

```html
...
<div sort-property="status" sort-preset="myPresetForStatus"></div>
...
```
will sort people by marital status according to the order given in the model *$scope.myPresetForStatus*.

### Summary of Usage
The html and table below show an extreme short summary of what has be explained earlier in this readme.

```html
<div sort="persons" sort-refresh="myCustomSortFunction"> <!-- parent -->
  <div sort-property="name">Name</div> <!-- header -->
  <div sort-property="age" sort-default="true">Age</div> <!-- header -->
  <div sort-property="born | date">Day of Birth</div> <!-- header -->
  <div sort-property="status" sort-preset="myPresetForStatusArray">Marital Status</div> <!-- header -->
<div>
```

Attribute | Usage | Level
------------------- | ------ | ---
  **sort** | model to be sorted | parent
  | *type:* array on the scope
  **sort-refresh** | custom sort function | parent
  | *type:* function(prop, order, date, preset) |
  | *info:* can be asynchronous, in which case the function should return a promise |
  **sort-property** | property to sort upon. Out of box sorting is only for simple type (int, string, bool) | header
  | *type:* string |
  | *info:* use " \| date" to enable sorting on type Date |
  **sort-order** | define the sorting order | header
  | *type:* string |
  | *info:* possible values are 'asc', 'desc'. 'asc' is set by default. Clicking on a header reverses the sorting order. Predefined css classes can be used to customize the view |
  **sort-default** | default sorting until a header is clicked | header
  | *type:* bool |
  **sort-preset** | predefine values upon sorting should be performed | header
  | *type:* array with values of the same type as the property |

## Future work
1. Implement the plugin for angularJS 2.x.
See [here](https://github.com/mkftrivadis/sort-2/blob/master/README.md)

## License

Licensed under MIT.

repository: mkftrivadis/sort

repo_name: mkftrivadis/sort


text:
# Python FT5406 Multitouch Driver

Multi-touch pure Python driver for the official 7" touchscreen display.

# Beta

This is a work in progress, but lets you use all 10 points of multitouch on the official 7" Pi Touchscreen in Python.

Note: It will only work with any sort of sanity in fullscreen mode currently

Hit ESC to exit the examples.

# Installing

Navigate into the library folder, and run setup like so:

```bash
cd library
sudo python3 setup.py install
```

See the examples folder for usage!

# Using The Library

```python
import ft5406
ts = ft5406.Touchscreen()

while True:
    for touch in ts.poll():
        print(touch.slot, touch.id, touch.valid, touch.x, touch.y)
```

The `slot` is a number from 0 to 9, denoting which index the touch is at.

The touch `id` is a unique ID given to the touch by evdev.

Touch `valid` indicates whether the touch is active- ie: is synonymous to `pressed`.

Both `x` and `y` should be self explanatory!

# Using Events

Three different kinds of event are generated by ft5406:

* Press `TS_PRESS`
* Release `TS_RELEASE`
* Move `TS_MOVE`

You can assign handlers to individual touches and events or just use the same handler for all of them.

The example below shows the base minimum you need to set up and handle events. This doesn't even include a GUI- Python will monitor the touchscreen directly.

```python
from ft5406 import Touchscreen, TS_PRESS, TS_RELEASE, TS_MOVE

ts = Touchscreen()

def touch_handler(event, touch):
    if event == TS_PRESS:
        print("Got Press", touch)
    if event == TS_RELEASE:
        print("Got release", touch)
    if event == TS_MOVE:
        print("Got move", touch)

for touch in ts.touches:
    touch.on_press = touch_handler
    touch.on_release = touch_handler
    touch.on_move = touch_handler

ts.run()

while True:
    # Redraw Code etc
    try:
        pass
    except KeyboardInterrupt:
        ts.stop()
        exit()
```

repository: jwayneroth/python-multitouch

repo_name: jwayneroth/python-multitouch


text:
---
title: Weekly Overview
module: 9
jotted: false
---

# Weeks 9 Overview

Active: {{ site.data.dates[page.module][0] }}

Homework Due: {{ site.data.dates[page.module][1] }}

This week we will look at another way to use jQuery by leveraging AJAX.  We will also look at jQuery plugins that will help expand how your websites look and feel as well as its functionality.  I think this week will be a lot of fun as we asynchronously gather new data and then do something visual with that data.

gha_language: CSS


text:
Az AI

# Todo
Ms learn labs
more AI labs
data science labs
La labs
Portal play for bot
Portal play for cog services

https://docs.microsoft.com/en-us/learn/certifications/azure-ai-engineer
https://docs.microsoft.com/en-us/learn/certifications/exams/ai-100
https://techcommunity.microsoft.com/t5/microsoft-ignite-the-tour-2019/start-building-machine-learning-models-faster-than-you-think/m-p/907390
https://aischool.microsoft.com/en-us/home

https://linuxacademy.com/cp/modules/view/id/433
https://linuxacademy.com/cp/modules/view/id/434
https://linuxacademy.com/cp/modules/view/id/435
https://linuxacademy.com/cp/modules/view/id/436
https://linuxacademy.com/cp/modules/view/id/464

https://dev.botframework.com/
https://github.com/microsoft/botbuilder-tools#bot-framework-tools
https://docs.microsoft.com/en-us/azure/bot-service/bot-service-concept-templates?view=azure-bot-service-3.0#basic-bot

# IOT
https://docs.microsoft.com/en-us/azure/iot-edge/about-iot-edge
https://azure.microsoft.com/en-us/services/iot-edge/

# ML
https://docs.microsoft.com/en-us/azure/machine-learning/how-to-enable-app-insights

# todo
la labs
la cards
la test
postman
Bing Search
Text Analytics
Moderator
Not

# tools
Logic Apps
Azure Automation Account
Azure functions
Azure Machine Learning Services
Azure Machine Learning Studio
mlops = azure devops extension to compute
Azure Cognitize Services
SQL Server ML Services
Microsoft Machine Learning Services
Azure Databricks
ML.NET
MMLSpark
Azure Data Science VM
Windows ML
Azure Compliance manager
Azure Policy
Azure Security Center
Azure Information Protection
workflow piplelines
bot framework
azure pieplines
azure iot endge
bing statistics
Luis.ai
cog api console
azureml sdk

# App vs Bot
REST vs CLI vs SDK
lang: C#, python, java, node.js, go, golang
os: winds, mac, linux
how: enpoint, subscription key
Data Analytics Data Science vs ML vs AI
workflow: train, package, validate, deploy, monitor
run: app services with ap insights.,, on device in a container
Compute CPU:
Compute GPU: prrallel processing.
Compute Field Programmable Gate Arrays (FPGA): AIML
Compute: ASIC: not reporogramable

Horovod???
Hyperparameters???

Aka.ms/aiml10 ...
Aka.ms/aiml50

Cli
Az extension add -n azure-cli-ml
Pip install —upgrade azureml-sdk

# Algorithms
Aspect based sentiment analysis
Per word sentiment
# Misc
Custom vision .ai
Onnx files
Github netron
Aka.ms/CD-docs

Azure ml algorithm cheat sheet

# Tools
Ml.azure.com
Automated ml
Ml workflow pipelines
Azure notebooks
Azure machine learning studio

bot Dispatch???
bot proactive
cognitive apis = rest based apis
some api's have gui = luis.ai
# Vision
Form Recongnizer
Ink Recognizer
Face - https://westus.dev.cognitive.microsoft.com/docs/services/563879b61984550e40cbbe8d/
Video Indexer
Compuer Vision =
Categories, Description, Color, Faces, adult, brands, objects
categories, tags, captions, metadata
models: celebrities, landmarks, printed, handwritten
Custom Vision Search - CustumVision.ai
eastus.api.cognitive.microsoft.com/vision/v2.0/ocr
# Speach
S2T, T2S (wav and mp3)
Speech Services
Speaker Recongnition (Verification vs Identification)
# Language
Text Analytics
Spell check
Translator Text
Batch Transcription
QnA Maker
LUIS (language Understanding)
domains = prebuilt domains
intent =
utterance =
entities =
Video Indexer
Decision
Content Moderator
Anomaly Detector
Personalizer
#Search
Search Service, Index, Indexer
Autosuggest
Entity
Image
Business
News
Spell Check
bing Video Search
Visual Search
bing Web Search
Custom Search
## Knowledge
Academic Knowledge
# Bot Framework /SDK
Bot Templates
Channels: Teams, Skype, Slack, Kik, Messenger, twilio, email, cortana
Cards: Animation, Audio, Image, Hero, Receipt, SignIn, Thumbnail, Video,
main cards: form, adaptive
Bot Emulator
Basic - Echo
Form
LUIS (luis.ai)
authoring api
prediction api
QnA
Proactive
# Content Moderation - delete on locate, human delete on review
Text
Image
Video
custom Terms
custum images

# Model building
Prepare data
Train model
Test model
Deploy model

# Features (seasonality)
Fourier features - seasonality
Lag features

# Ports
http/https = 80/443
kafka = 9093
amqp: 5671, 5672

repository: questsin/cheats

repo_name: questsin/cheats


text:
# Contributing to Checkup

The Checkup project is run by community members who want to build tools that provide insights to improve projects. We welcome any contributions to this effort.

The Open Source Guides website has a collection of resources for individuals, communities, and companies who want to learn how to run and contribute to an open source project. Contributors and people new to open source alike will find the following guides especially useful:

- [How to Contribute to Open Source](https://opensource.guide/how-to-contribute/)
- [Building Welcoming Communities](https://opensource.guide/building-community/)

## Bugs

We use [GitHub Issues](https://github.com/checkupjs/checkup/issues) for bugs. If you would like to report a problem, take a look around and see if someone already opened an issue about it. If you a are certain this is a new, unreported bug, you can submit a bug report.

## Pull Requests

### Your First Pull Request

Working on your first Pull Request? You can learn how from this free video series:

[**How to Contribute to an Open Source Project on GitHub**](https://egghead.io/courses/how-to-contribute-to-an-open-source-project-on-github)

### Sending a Pull Request

Small pull requests are much easier to review and more likely to get merged. Make sure the PR does only one thing, otherwise please split it.

Please make sure the following is done when submitting a pull request:

1. Fork [the repository](https://github.com/checkupjs/checkup) and create your branch from `master`.
1. Make sure to [test your changes](#running-tests)!
1. Make sure your Jest tests pass (`yarn test`).

All pull requests should be opened against the `master` branch.

#### Breaking Changes

When adding a new breaking change, follow this template in your pull request:

```md
### New breaking change here

- **Who does this affect**:
- **How to migrate**:
- **Why make this breaking change**:
- **Severity (number of people affected x effort)**:
```

## Installation

1. Clone the repository:

   ```
   git clone https://github.com/checkupjs/checkup.git
   ```

1. Change into that directory, and install dependencies by running `yarn install` (this will install all dependencies for all packages via yarn workspaces):

1. Build the project by running `yarn build`

## To run Checkup in a project

1. Add required dependencies to package.json:

   ```
     "devDependencies": {
       "@checkup/cli": "0.0.0",
       ...
     }
   ```

1. Run Checkup's config generator to generate a checkup config:

   ```shell
   checkup generate config
   ```

1. Execute Checkup in your project

   ```shell
   checkup .
   ```

### Running a specific Checkup task in your project

To run a specific task:

```
checkup --task TASK_NAME
```

## Running tests

To run tests in the checkup repository:

```
yarn test
```

## Using the DEBUG environment variable

Checkup using the debug package to provide useful information for debugging. You can enable it by running:

```shell
DEBUG='*' checkup
```

## Debugging tests

cd into the specific package you want to debug, then run:

```
node --inspect-brk ../../node_modules/.bin/jest --runInBand
```

repository: checkupjs/checkup

repo_name: checkupjs/checkup


text:
# python-qbo
[![Build Status](https://travis-ci.com/SebRut/python-qbo.svg?branch=master)](https://travis-ci.com/SebRut/python-qbo)
[![PyPI](https://img.shields.io/pypi/v/python-qbo.svg)](https://pypi.org/project/python-qbo/)
[![Coverage Status](https://coveralls.io/repos/github/SebRut/python-qbo/badge.svg?branch=master)](https://coveralls.io/github/SebRut/python-qbo?branch=master)
[![CodeFactor](https://www.codefactor.io/repository/github/sebrut/python-qbo/badge)](https://www.codefactor.io/repository/github/sebrut/python-qbo)
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2FSebRut%2Fpython-qbo.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2FSebRut%2Fpython-qbo?ref=badge_shield)

## This project is not being developed atm due to me not having access to a Qbo machine anymore

## Installation

`pip install python-qbo`

## Usage
Import the package:
```python
from qbo import Qbo
```

Obtain a qbo instance:
```python
qbo = Qbo("https://{QBO_URL}/")
```

Get the name of the machine:
```python
print(qbo.name())
```

Get maintenance status:

```python
print(qbo.maintenance_status())
```

## License
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2FSebRut%2Fpython-qbo.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2FSebRut%2Fpython-qbo?ref=badge_large)

repository: SebRut/python-qbo

repo_name: SebRut/python-qbo


text:
This is the development repository for galaxy tools developed in the [ARTbio platform](http://artbio.fr/) at the [IBPS](http://www.ibps.upmc.fr/en) [CNRS](http://www.cnrs.fr/en/research/Institutes.htm) & [UPMC](http://www.upmc.fr/en/index.html).

Tools are installed on https://mississippi.snv.jussieu.fr and downloadable through the [galaxy toolshed](https://toolshed.g2.bx.psu.edu).

This repository is tested by Travis CI.

CI      | Test                            |  Status
------- |-------------------------------- | -------
Travis  | Planemo test (error only)       | [![Lint Status](https://travis-ci.org/ARTbio/tools-artbio.svg?branch=master)](https://travis-ci.org/ARTbio/tools-artbio)

Changes should be proposed via Pull Requests.

Contact artbio.ibps at gmail com if you have questions.

repository: chamaelj/tools-artbio

repo_name: chamaelj/tools-artbio


text:
# Creating extractor

Extractor is responsible for converting json to Mill structures. The main design idea is that the extractor for a whole json is created by composing (sub-)extractors while reflecting the JSON structure. This composability is achieved by the **commitment** of each extractor returning a subtype of `Mill.AbstractDataNode`. Extractor can be any function, but to ensure a composability, it is should be a subtype of `AbstractExtractor`, which means all of them are implemented as functors (also because they contain parameters).

# Manual creation of extractors
The simplest way to create a custom extractor is the compose it from provided extractor functions. Imagine for example json file as follows.
```json
{"name": "Karl",
 "siblings": ["Gertruda", "Heike", "Fritz"],
 "hobby": ["running", "pingpong"],
 "age": 21
}
```

A corresponding extractor might look like

```@example 1
using JsonGrinder, Mill, JSON #hide
ex = ExtractDict(Dict(
	:name => ExtractString(),
	:siblings => ExtractArray(ExtractString()),
	:hobby => ExtractArray(ExtractCategorical(["running", "swimming","yoga"])),
	:age => ExtractScalar(),
	))
```
Notice, how the composability of extractors simplifies the desing and allow to reflect the same feature of JSON documents.

Applying the extractor `ex` on the above json yield the corresponding `Mill` structure.

```@example 1
s = JSON.parse("{\"name\" : \"Karl\",
 \"siblings\" : [\"Gertruda\", \"Heike\", \"Fritz\"],
 \"hobby\" : [\"running\", \"pingpong\"],
 \"age\" : 21
}")
ex(s)
```

The list of composable extractor function that we have found handy during our experiments are listed in *Extractor functions* section of the doc.

# Semi-automatic creation of extractors
Manually creating extractors is boring and error-prone process. Function `suggestextractor(schema)` tries to simplify this, since creation of most of the extractors is straightforward, once the the schema is known. This is especially true for `Dict` and `Arrays`, while extractors for leafs can be tricky, as one needs to decide, if the leaf should be represented as a  `Float` and `String` are represented as `Categorical` variables. `suggestextractor(schema)` uses a simple heuristic (described below) choosing reasonable extractors, but it can make errors. It is therefore highly recommended to check the proposed extractor manually, if it makes sense. A typical error, especially if schema is created from a small number of samples, is that some variable is treated as a categorical, while it should be `String` / `Float`.

```julia
JsonGrinder.suggestextractor(schema, settings::NamedTuple)
```

allows to pass your own heuristic and rules for handling scalars. By default,
`settings = (scalar_extractors = default_scalar_extractor()).`
Extractors for `Dict` and `Array`s are not configurable, as we do not feel the pressure to so, as there does not seems to be much to do, but of course there is some *dark magic* described below.

## Scalars

`scalar_extractors` is a list of tuples, where the first is a condition and the second is a function creating the extractor in case of a true. The default heuristic is following and
you can adjust according to your liking.
```julia
function default_scalar_extractor()
	[
	# all floatable keys are also intable AFAIK
	(e -> length(keys(e)) <= 100 && is_floatable(e),
		e -> ExtractCategorical(keys(e))),
	# it's important that condition here would be lower than maxkeys
	(e -> (keys_len = length(keys(e)); keys_len / e.updated < 0.1 && keys_len < 10000),
		e -> ExtractCategorical(keys(e))),
	(e -> is_intable(e),
		e -> extractscalar(Int32, e)),
	(e -> is_floatable(e),
	 	e -> extractscalar(FloatType, e)),
	(e -> true,
		e -> extractscalar(unify_types(e), e)),]
end
```

## Arrays
Extractor suggested for `ArrayEntry` is most of the time `ExtractArray` converting `Array`s to `Mill.BagNode`s. The exception is the case, when vectors are of the same length and their items are numbers. In this case, the suggestextractor returns `ExtractVector`, which treats convert the array to a `Mill.ArrayNode`, as we believe the array to represent a feature vector.

## Dict
Extractor suggested for `DictEntry` is most of the time `ExtractDict` converting `Dict`s to `ProductNode`s. Again, there is an excetion. Sometimes, people use `Dict`s with names of keys being values.
For example consider following two jsons
```json
{"a.dll": ["f", "g", "h"],
 "b.dll": ["a", "b", "c"]}
{"c.dll": ["x", "y", "z"]}
```
in the case, keys `["a.dll","b.dll","c.dll"]` are actually values (names of libraries), and arrays are values as well. The dictionary therefore contain an array. If this case is detected, it is suggested to use `ExtractKeyAsField`, which interprests the above JSON as
```
[{key = "a.dll",
  field = ["f", "g", "h"]},
 {key = "b.dll",
 field = ["a", "b", "c"]}
]
[{key = "c.dll",
field = ["x", "y", "z"]}]
```
`ExtractKeyAsField` extractor convert it to `Mill.BagNode(Mill.ProductNode((key=..., field=...)))`

<!-- todo: add example of setting categorical+string extractor on single specified place. And example for setting it everywhere instead of string -->


text:
# SAML to AWS STS Keys Conversion
Google Chrome Extension which converts a SAML 2.0 assertion to AWS STS Keys (temporary credentials). Just log in to the AWS Web Management Console using your SAML IDP and the Chrome Extension will fetch the SAML Assertion from the HTTP request. The SAML Assertion is then used to call the assumeRoleWithSAML API to create the temporary credentials. (AccessKeyId, SecretAccessKey and SessionToken).

# Table of Contents
* [Why this Chrome Extension?](#why)
* [Getting Started](#gettingstarted)
* [Create a symlink to your .aws directory (for Windows users)](#symlink)
* [Frequently Asked Question](#faq)

## Why this Chrome Extension?
If you don't have any user administration setup within AWS Identity & Access Management (IAM) but instead rely on your corporate user directory, i.e. Microsoft Active Directory. Your company uses a SAML 2.0 Identity Provider (IDP) to log in to the AWS Web Management Console (Single Sign On). Then this Chrome Extension if for you!

You run into trouble as soon as you would like to execute some fancy scripts from your computer which calls the AWS API's. When sending a request to the AWS API's you need credentials, meaning an AccessKey and SecretKey. You can easily generate these keys for each user in AWS IAM. However, since you don't have any users in AWS IAM and don't want to create users just for the sake of having an AccessKey and SecretKey you are screwed. But there is a way to get temporary credentials specifically for your corporate identity.

The Security Token Service (STS) from AWS provides an API action assumeRoleWithSAML. Using the SAML Assertion given by your IDP the Chrome Extension will call this API action to fetch temporary credentials. (AccessKeyId, SecretAccessKey and SessionToken). This way there is no need to create some sort of anonymous user in AWS IAM used for executing scripts. This would be a real security nightmare, since it won't be possible to audit who did what. This Chrome Extension however will make it super easy for you to just use your corporate identity for executing scripts calling AWS API's.

## Getting Started
Once you install the app, it will download a credentials file into your downloads folder each time you assume an AWS role.

You will need to load it into Chrome as an "unpacked extension" from the Chrome Extensions menu.
1. Pull the repo down locally
2. In Chrome, go to More Tools > Extensions
3. Make sure Developer mode is enabled. It is a toggle button at top right corner. Then click on Load Unpacked.
3. Select the samltoawsstskeys folder (ie this repo)

Additionally, you may need to manually pin the extension in your Chrome address bar's extension section - this will allow you to enable/ disable the extension if required

## Create a symlink to your .aws directory
We use our own version of a Chrome Extension which will automatically download a set of credentials for you when you assume the AWS role via GSuite - this will add temporary credentials into your downloads folder, which you can reference with a symlink from your .aws folder.

### Windows
In a command prompt run:
```powershell
C:\Users\user_name\.aws> mklink credentials C:\Users\user_name\Downloads\credentials
```

### Mac & Linux
Run the following command in a terminal:
```sh
ln -s ~/Downloads/credentials ~/.aws/credentials
```

If you are using multiple AWS profiles and already set AWS_PROFILE environment variable, then run the following command to set it back to default:
```sh
export AWS_PROFILE=default
```

To ensure your settings are fine, you can try the following command and should be able to see your credentials:
```sh
aws sts get-caller-identity
```

## FAQ: Frequently Asked Question
1. Why can I not save file somewhere else?
TODO
2. How long are the credentials valid?

repository: EducationPerfect/samltoawsstskeys

repo_name: EducationPerfect/samltoawsstskeys


text:
# OAuth-2.0-with-Google
Demonstrate the usage of OAuth 2.0 framework to access the resources made available by the Google Authorization Server. The Resource Server is developed using Node JS with the help of middleware library called 'Passport JS'. Frontend web application is developed using React JS. MongoDB is used as the database.

# How to deploy the project

1. Install Node JS and MongoDB, if you do not have them in your machine.
2. Clone this repository to your machine.(git clone <repository url>)
3. Copy the **'credentials.json'** file inside the **'IT16169036_IT16167506'** zip file uploaded to Courseweb by us.
4. Paste it inside **'OAuth-2.0-with-Google/Services/config'** folder.
5. Open command prompt and go inside 'Services' folder of cloned repository.
6. Run **'npm install'** command.
7. After that run **'npm run server'** command.
8. Open another command prompt and go inside 'Client' folder.
9. Run **'npm install'** command.
10. After that run **'npm run dev'** command and go to the link displayed in the command prompt after running the command.
11. Click the 'Google' button to initiate OAuth flow in the application.


text:
# led-websocket-server
Experimental websocket server to drive LED connected esp32 arduinos

## Requirements
- Node.js (at least LTS version)
- npm 6.x
- Docker (optional)

## Getting started
Clone the repo
```sh
git clone https://github.com/r3dcrosse/led-websocket-server.git && cd led-websocket-server
```

Install all the dependencies
```sh
npm install
```

## Starting the server
How to start the server without using Docker:
```sh
npm start
```

How to start the server using Docker:
```sh
npm run docker:build -- <your username here>/led-websocket-server 8000
```
The last argument is the port to expose as your server. If you
do not pass the port number, it will default to 3000

### Useful Docker commands
List what containers are running:
```sh
docker ps
```

How to stop a container:
- Get the container ID from `docker ps`
```sh
docker stop CONTAINER_ID
```

branch_name: refs/heads/latest


text:
Linear Regression
=================

Linear regression implementation in R (for university course).

##### The initial data
|X (key)|Y (value)|
|-------|-------|
|1|2
|2|2
|3|5
|4|4
|5|5
|6|6
|7|6|

We'll first enter the given data in R and create a scatter plot for it. Then we'll craft for our plot the "line of best fit", or the "least squares regression line".

![plot](./img/plot.png)

After that, we'll define the "Pearson's correlation coefficient", commonly called "the correlation coefficient".

![correlation](./img/correlation.png)

The correlation coefficient 0.9053 satisfies the condition -1 <= Rxy <= 1, and indicates a quite strong degree of linear dependence between the given variables.

Finally, we'll predict the value for key = 8.

![plot1](./img/plot1.png)

repository: denissimon/linear-regression

repo_name: denissimon/linear-regression


text:
# USE CASE: 16 The top N populated cities in a district where N is provided by the user.

## CHARACTERISTIC INFORMATION

### Goal in Context

As a Developer I want to produce a report of top N populated cities in a district where N is provided by the user.
So that I can see which countries are in the top N of the most populated cities in a district.

---

### Scope </h3> Organisation

---

### Level </h3> Primary task

---

### Preconditions </h3> Database contains all of the city data.

---

### Success End Condition </h3> A report is available for the organisation.

---

### Failed End Condition </h3> No report is produced.

---

### Primary Actor </h3> Organisation.

---

### Trigger </h3> A request for the top N cities of a district to be sent to organisation.

---

## MAIN SUCCESS SCENARIO

1. Organisation requests top N cities by population information of a district.
2. Developer extracts current top N cities of a district information.
3. Developer provides report to organisation.

---

## EXTENSIONS

None.

## SUB-VARIATIONS

None.

## SCHEDULE

**DUE DATE**: Release 1.0


text:
# Installing Gazebo and ArduPilot Plugin

### Video Tutorial at https://youtu.be/m7hPyJJmWmU

## Overview

Robot simulation is an essential tool in every roboticist's toolbox. A well-designed simulator makes it possible to rapidly test algorithms, design robots, perform regression testing, and train AI system using realistic scenarios. Gazebo offers the ability to accurately and efficiently simulate populations of robots in complex indoor and outdoor environments. At your fingertips is a robust physics engine, high-quality graphics, and convenient programmatic and graphical interfaces. Best of all, Gazebo is free with a vibrant community.

for more infromation on gazebo checkout http://gazebosim.org/

## Install Gazebo [***18.04-20.04***]

Setup your computer to accept software from http://packages.osrfoundation.org:
```
sudo sh -c 'echo "deb http://packages.osrfoundation.org/gazebo/ubuntu-stable `lsb_release -cs` main" > /etc/apt/sources.list.d/gazebo-stable.list'
```

Setup keys:
```
wget http://packages.osrfoundation.org/gazebo.key -O - | sudo apt-key add -
```

Reload software list:
```
sudo apt update
```

Install Gazebo:
### Ubuntu [***18.04***]
```
sudo apt install gazebo9 libgazebo9-dev
```
### Ubuntu [***20.04***]
```
sudo apt-get install gazebo11 libgazebo11-dev
```

for more detailed instructions for installing gazebo checkout http://gazebosim.org/tutorials?tut=install_ubuntu

## Install Gazebo plugin for APM (ArduPilot Master) :
```
cd ~
git clone https://github.com/khancyr/ardupilot_gazebo.git
cd ardupilot_gazebo
```
***Ubuntu 18.04 only*** checkout dev
```
git checkout dev
```
build and install plugin
```
mkdir build
cd build
cmake ..
make -j4
sudo make install
```
```
echo 'source /usr/share/gazebo/setup.sh' >> ~/.bashrc
```
Set paths for models:
```
echo 'export GAZEBO_MODEL_PATH=~/ardupilot_gazebo/models' >> ~/.bashrc
. ~/.bashrc
```

## Run Simulator

**NOTE the iris_arducopter_runway is not currently working in gazebo11. The iq_sim worlds DO work**

In one Terminal (Terminal 1), run Gazebo:
```
gazebo --verbose ~/ardupilot_gazebo/worlds/iris_arducopter_runway.world
```

In another Terminal (Terminal 2), run SITL:
```
cd ~/ardupilot/ArduCopter/
sim_vehicle.py -v ArduCopter -f gazebo-iris --console
```


text:
# P2P FTP/HTTP
A simple Peer to Peer file transfer tool over HTTP.

There comes a problem when sharing a file either small or big between to computers in the same network or a company where the file cannot be shared simply in an email or through common shared drive due to file type restriction or file size limitation or unavailability of space for sharing through shared memory spaces.

This tool allows the user to generate a simple URI that automatically fetches the required files, how big the file may be, over the local network direcly from the user's disk.

After generating the file download link, simply send it to the recipients who can open the link in their browser to download the file.

Download the latest exe: P2PFTPHTTP.exe


text:
 itertab: pretty printed table

- [Description](#description)
- [Usage](#usage)
- [Installation](#installation)

## Description

**itertab** is a pretty printed table with cell highlighting and automatic relative difference calculation.

The main purpose of this package is a basic understanding of the learning process (or any other iterative processes), without leaving the terminal and not relying on more advanced metric loggers (such as [Tensorboard](https://www.tensorflow.org/guide/summaries_and_tensorboard))

## Usage

Suppose you have a python script `example.py` with the following content:

```python
import time
import numpy as np
from itertab import PrettyTable

table = PrettyTable()
for epoch in range(15):
    metrics = {
        'epoch': epoch,
        'train': {
            'Train_Accuracy': np.random.uniform(),
            'Train_LogLoss': np.random.uniform(),
        },
    }
    table.add_row(metrics)
    table.clear_screen_and_print()

    time.sleep(0.3)
```

If you run `example.py` in the terminal you will get output similar to the one above.

## Installation

```bash
pip install<EMAIL_ADDRESS>```


text:
# Sing a song kata (refactoring)
The full details of the kata can be found [here:](https://github.com/sleepyfox/code-dojo-39)

Run the (super lightweight) tests with:

	npm test

If the tests pass, you'll get no output; if a test fails, it will generate an exception.

repository: sleepyfox/code-kata-solutions

repo_name: sleepyfox/code-kata-solutions


text:
# Employee-Tracker
> This application helps to organize and plan a business!

## Table of contents
* [General info](#general-info)
* [Screenshot](#screenshots)
* [Video Walkthrough](#video_walkthrough)
* [Licenses](#licenses)
* [Code](#code)
* [Setup](#setup)
* [Inspiration](#inspiration)
* [Contact](#contact)

## General info
The user can add, view, and modify department, role, and employee data. The user can select these options from a menu. The user will be led through prompts that help to add, view, or modify the business data.

## Screenshot
![Employee Tracker Screenshot](./images/employee_tracker.png)

## Video Walkthrough
[Employee Tracker Walkthrough](https://drive.google.com/file/d/16-gK36OUQ-6hmO4JCoRIyVN1byS4lcGP/view)

## Setup
* Clone GitHub repository
* run npm install
* run npm i inquirer
* run npm i console.table
* run npm i mysql2

Run 'npm start' to enter the application.

## Code
* JavaScript
* Node.js
* mySQL

* inquirer - question and menu prompts to help the user navigate
* console.table - dispalys SQL data in a table form
* mysql2 - connects to database and allows for application structure

## Licenses
* MIT license
* ISC

## Inspiration
UCLA week 12 Challenge.

## Contact
Application created by Alex Chigas.

license: MIT,ISC

repository: Achigas/employee-tracker

detected_licenses: MIT ISC

repo_name: Achigas/employee-tracker